Changeset 115
Legend:
- Unmodified
- Added
- Removed
-
adventure/adventuremuc.py
r114 r115 10 10 self.Namespace = NS_COMPONENT_ACCEPT 11 11 self.DBG = 'component' 12 self.jid = JID(jid) 12 13 Component.__init__(self, server=server, port=port, debug=[]) 13 14 self.worlds = {} … … 30 31 print ' ' + world.name 31 32 32 def s end(self, worldnode, worldresource, stanza):33 stanza.setFrom(JID(node=worldnode, domain=self.jid. domain, resource=worldresource))34 Component.send(self,stanza)33 def snd(self, worldnode, worldresource, stanza): 34 stanza.setFrom(JID(node=worldnode, domain=self.jid.getDomain(), resource=worldresource)) 35 self.send(stanza) 35 36 36 37 def handle_iq(self, _, iq): -
adventure/player.py
r114 r115 16 16 17 17 for line in place.description.split('\n'): 18 se nd_message(None, line.strip())18 self.send_message(None, line.strip()) 19 19 20 20 self.send_message(None, ' ') … … 31 31 if thing != self: 32 32 if from_: 33 se nd_message(None, '%s enters %s coming from %s' % (thing.name, place, from_))33 self.send_message(None, '%s enters %s coming from %s' % (thing.name, place, from_)) 34 34 else: 35 se nd_message(None, '%s spawns' % thing.name)35 self.send_message(None, '%s spawns' % thing.name) 36 36 37 37 def on_leave(self, thing, to): 38 38 if thing != self: 39 39 if to: 40 se nd_message(None, '%s leaves %s going to %s' % (thing.name, place, to))40 self.send_message(None, '%s leaves %s going to %s' % (thing.name, place, to)) 41 41 else: 42 se nd_message(None, '%s disintegrates' % thing.name)42 self.send_message(None, '%s disintegrates' % thing.name) 43 43 -
adventure/world.py
r114 r115 36 36 # Avoid sending to things without JID 37 37 if stanza.getTo() != None: 38 self.muc.s end(self.node, resource, stanza)38 self.muc.snd(self.node, resource, stanza) 39 39 40 40 def place(self, placename): … … 93 93 thing.send_message(None, 'Entering %s' % newplace, subject) 94 94 thing.send_message(None, ' ') 95 thing.see( place(newplace))95 thing.see(self.place(newplace)) 96 96 97 97 for t in self.each_thing_by_place(thing.place):
