def send_to_coordinate(opcode, data): send_data = NetMessage() send_data.opcode = opcode send_data.data = data.SerializeToString() send_data.id = gl.get_v("uuid") gl.get_v("redis").publish("game-coordinate", send_data.SerializeToString())
def sendToGame(self, uuid, opcode, data): message = NetMessage() message.opcode = opcode if data is not None: message.data = data.SerializeToString() gl.get_v("serverlogger").logger.info("发送%d给游戏服" % opcode) gl.get_v("redis").publish(uuid, message.SerializeToString())
def send_to_gateway(self, opcode, data): send_data = NetMessage() send_data.opcode = opcode send_data.data = data.SerializeToString() s = GateWayMessage() s.userId = self.__userId s.data = send_data.SerializeToString() gl.get_v("redis").publish("server-gateway", s.SerializeToString()) gl.get_v("serverlogger").logger.info("发送%d给%s" % (opcode, self.__userId))