Ejemplo n.º 1
0
 def unlock_save(self, lock_holder, send_event=True):
     if lock_holder in self._save_locks:
         self._save_locks.remove(lock_holder)
     if send_event:
         if not self.is_save_locked():
             msg = UI_pb2.GameSaveLockUnlock()
             msg.is_locked = False
             distributor = Distributor.instance()
             distributor.add_event(MSG_GAME_SAVE_LOCK_UNLOCK, msg)
         else:
             new_lock_holder = self._save_locks[-1]
             msg = UI_pb2.GameSaveLockUnlock()
             msg.is_locked = True
             msg.lock_reason = new_lock_holder.get_lock_save_reason()
             distributor = Distributor.instance()
             distributor.add_event(MSG_GAME_SAVE_LOCK_UNLOCK, msg)
Ejemplo n.º 2
0
 def lock_save(self, lock_holder):
     self._save_locks.append(lock_holder)
     msg = UI_pb2.GameSaveLockUnlock()
     msg.is_locked = True
     msg.lock_reason = lock_holder.get_lock_save_reason()
     distributor = Distributor.instance()
     distributor.add_event(MSG_GAME_SAVE_LOCK_UNLOCK, msg)
Ejemplo n.º 3
0
 def _send_lock_save_message(self, reason_provider):
     distributor = Distributor.instance()
     if distributor is not None and distributor.client is not None:
         msg = UI_pb2.GameSaveLockUnlock()
         msg.is_locked = True
         msg.lock_reason = reason_provider()
         distributor.add_event(MSG_GAME_SAVE_LOCK_UNLOCK, msg)
Ejemplo n.º 4
0
 def _send_unlock_save_message(self):
     distributor = Distributor.instance()
     if distributor is not None and distributor.client is not None:
         msg = UI_pb2.GameSaveLockUnlock()
         msg.is_locked = False
         distributor.add_event(MSG_GAME_SAVE_LOCK_UNLOCK, msg)