Ejemplo n.º 1
0
 def on_entity_equipment(self, slot, slotdata, eid):
     entity = self.entities.get(eid, None)
     if entity is None:
         msg = "Equipment for unkown entity %s, slot %s:  %s"
         log.msg((msg % eid, slot, Item(slotdata)))
         return
     entity.equipment[slot] = Item.from_slotdata(slotdata)
Ejemplo n.º 2
0
 def window_slot(self, slot, wid, slotdata):
     try:
         window = self[wid]
     except KeyError:
         msg = "Could not find window for window ID " + str(wid)
         log.msg("ERROR: " + msg)
         return
     window[slot] = Item.from_slotdata(slotdata)
     log.msg("Updated %s slot %s with %s" % (window.name, slot,
                                             str(window[slot])))
Ejemplo n.º 3
0
 def set_window_items(self, length, slotdata, window_id):
     try:
         window = self[window_id]
     except KeyError:
         msg = "Could not find window for window ID " + str(window_id)
         log.msg("ERROR: " + msg)
         return
     assert len(window) == length == len(slotdata)
     window[:] = [Item.from_slotdata(slot) for slot in slotdata]
     log.msg("set_window_items: " + str(window))