Changeset 156
- Timestamp:
- 04/27/08 13:35:42 (2 years ago)
- Location:
- adventure
- Files:
-
- 5 modified
-
adventuremuc.py (modified) (1 diff)
-
movable.py (modified) (2 diffs)
-
place.py (modified) (2 diffs)
-
thing.py (modified) (3 diffs)
-
world.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
adventure/adventuremuc.py
r131 r156 187 187 print 'Syntax: ./adventuremuc.py <JID> <Password> <Host> <Port>' 188 188 print 'See README for further help' 189 MUD = AdventureMUC(argv[1], argv[2], argv[3], int(argv[4])) 190 MUD.add_world('cave.xml') 191 MUD.add_world('tower/tower.xml') 192 while 1: 193 MUD.Process(10) 189 else: 190 MUD = AdventureMUC(argv[1], argv[2], argv[3], int(argv[4])) 191 MUD.add_world('cave.xml') 192 MUD.add_world('tower/tower.xml') 193 while 1: 194 MUD.Process(10) 195 -
adventure/movable.py
r142 r156 32 32 self.place = None 33 33 self.presence = None 34 self.image_path = None 34 35 35 36 self.vcard = None … … 40 41 if image: 41 42 if not isabs(image): 42 image = path_join(self.world.data_dir, image) 43 if isfile(image): 44 file = open(image, 'rb') 43 image_path = path_join(self.world.data_dir, image) 44 if isfile(image_path): 45 self.image_path = image 46 47 file = open(image_path, 'rb') 45 48 data = file.read() 46 49 encoded_data = encodestring(data) -
adventure/place.py
r143 r156 22 22 from thing import NonPlayableCharacter 23 23 24 class Place :24 class Place(object): 25 25 def __init__(self, world, name, description): 26 26 self.world = world … … 140 140 for visitor in self.visitors: 141 141 visitor.send_message(from_, message) 142 142 143 -
adventure/thing.py
r151 r156 20 20 from movable import Movable 21 21 22 class Thing :22 class Thing(object): 23 23 def __init__(self, world, name, place): 24 24 self.world = world … … 29 29 self.on_enters = list() 30 30 self.on_leaves = list() 31 self.uid = 0 # Useful?32 31 33 32 def add_aliases(self, aliases_obj, alias_str): … … 236 235 return False 237 236 237 238 238 class NonPlayableCharacter(Movable, Thing): 239 239 def __init__(self, world, name, jid, place): -
adventure/world.py
r147 r156 28 28 from thing import Thing, NonPlayableCharacter 29 29 30 class World :30 class World(object): 31 31 """ World class. 32 32 Worlds have their own JID and correspond to an xml file """ … … 417 417 return True 418 418 return False 419
