Changeset 115

Show
Ignore:
Timestamp:
10/14/07 18:11:42 (2 years ago)
Author:
elghinn
Message:
 
Location:
adventure
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • adventure/adventuremuc.py

    r114 r115  
    1010        self.Namespace = NS_COMPONENT_ACCEPT 
    1111        self.DBG = 'component' 
     12        self.jid = JID(jid) 
    1213        Component.__init__(self, server=server, port=port, debug=[]) 
    1314        self.worlds = {} 
     
    3031        print ' ' + world.name 
    3132 
    32     def send(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) 
    3536 
    3637    def handle_iq(self, _, iq): 
  • adventure/player.py

    r114 r115  
    1616 
    1717        for line in place.description.split('\n'): 
    18             send_message(None, line.strip()) 
     18            self.send_message(None, line.strip()) 
    1919 
    2020        self.send_message(None, ' ') 
     
    3131        if thing != self: 
    3232            if from_: 
    33                 send_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_)) 
    3434            else: 
    35                 send_message(None, '%s spawns' % thing.name) 
     35                self.send_message(None, '%s spawns' % thing.name) 
    3636 
    3737    def on_leave(self, thing, to): 
    3838        if thing != self: 
    3939            if to: 
    40                 send_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)) 
    4141            else: 
    42                 send_message(None, '%s disintegrates' % thing.name) 
     42                self.send_message(None, '%s disintegrates' % thing.name) 
    4343 
  • adventure/world.py

    r114 r115  
    3636        # Avoid sending to things without JID 
    3737        if stanza.getTo() != None: 
    38             self.muc.send(self.node, resource, stanza) 
     38            self.muc.snd(self.node, resource, stanza) 
    3939 
    4040    def place(self, placename): 
     
    9393        thing.send_message(None, 'Entering %s' % newplace, subject) 
    9494        thing.send_message(None, ' ') 
    95         thing.see(place(newplace)) 
     95        thing.see(self.place(newplace)) 
    9696 
    9797        for t in self.each_thing_by_place(thing.place):