def handleJoinRoomPayload(self, data): payload = protocol_pb2.Room() if (payload.ParseFromString(data) == False): #TODO: ERROR return self.handleJoinRoomRequest(payload.userName, payload.room, payload.nickname, payload.password)
def handleRoomNicknameChanged(self, user, r, nickname): room = protocol_pb2.Room() room.userName = user room.nickname = nickname room.room = r room.password = "" message = WRAP(room.SerializeToString(), protocol_pb2.WrapperMessage.TYPE_ROOM_NICKNAME_CHANGED) self.send(message);
def handleLeaveRoomPayload(self, data): payload = protocol_pb2.Room() if (payload.ParseFromString(data) == False): #TODO: ERROR return self.handleLeaveRoomRequest(payload.userName, payload.room)