Changeset 109
- Timestamp:
- 10/14/07 15:41:33 (3 years ago)
- Location:
- adventure
- Files:
-
- 2 modified
-
adventuremuc.py (modified) (3 diffs)
-
thing.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
adventure/adventuremuc.py
r104 r109 2 2 # -*- coding: utf-8 -*- 3 3 4 from xmpp import Component, JID 4 from xmpp import Component, JID, NS_COMPONENT_1 5 5 from sys import argv 6 6 from world import World … … 8 8 class AdventureMUC(Component): 9 9 def __init__(self, jid, password, server, port=5347): 10 Component.__init__(server, port) 10 self.Namespace = NS_COMPONENT_1 11 self.DBG = '' 12 Component.__init__(self, server=server, port=port, debug=[]) 11 13 self.worlds = {} 12 14 … … 115 117 116 118 if __name__ == '__main__': 117 if len(argv) != 4:119 if len(argv) != 5: 118 120 print 'Syntax: ./adventuremuc.py <JID> <Password> <Host> <Port>' 119 121 print 'See README for further help' 120 muc = AdventureMUC( *argv)122 muc = AdventureMUC(argv[1], argv[2], argv[3], int(argv[4])) 121 123 muc.add_world('cave.xml') -
adventure/thing.py
r108 r109 1 1 # -*- coding: utf-8 -*- 2 2 3 from player import Player3 #from player import Player 4 4 from xmpp import Presence 5 5 … … 57 57 else: 58 58 text = '' 59 target = None 59 60 if command.action[2]: 60 target = .... # élément de nom command.action[2] avec le même place que self 61 else: 61 for object_ in self.place.objects: 62 if object_.place == self.place and object_.name == command.action[2]: 63 target = object_ 64 break 65 for participant in self.place.participants: 66 if participant.place == self.place and participant.name == command.action[2]: 67 target = participant 68 break 69 #else: 70 if not target: 62 71 target = self 63 72 text.replace('%self%', target.name)
