class PlayerCommands < MUDFramework::Commands
on "kill *" do |target|
if player.room == target.room
player.attack(target)
player.send "You attack #{target.name}!"
end
end
end
mud = MUDFramework::Server.new
mud.register_channel :main, PlayerCommands
mud.listen "localhost", 23
# lib/models/room.rb
class Room < RupeeMud::RecordModel
property :header, :string
property :description, :text, :limit => 400
has_many :exits
has_many :mobiles
end
# lib/controllers/room_controller.rb
class RoomController < RupeeMud::Controller
def enter
@room = Room.find[scope[:id]]
end
end
# lib/views/rooms/enter.rb
echo @room.header
echo " \n"
echo @room.description
echo "Obvious Exits:\n" unless @room.exits.nil?
@room.exits.each do |e|
echo e.name + " - " e.to_desc
end
@room.mobiles.each do |m|
echo m.short_desc
end
class WeaponController < RupeeMud::Controllers::GameObject
end
class QuestController < RupeeMud::Controllers::GameService
end
having a framework that could be used to accomplish heavy lifting for new developers.
I think it could even benefit from using a MVC design as far as game objects go. The goal would be
to ween new comers off of C / C++ and get them started in Ruby or Python. I imagine a properly designed
'gem' could accomplish this for Ruby. It could contain all the socket programming, data storage, olc etc built
in.
I'm sure this isn't the first time someone has thought of this or even mentioned it. I'm just curious whether or not
this is a practical idea. Any thoughts?