public void Send(byte flag, IMessage message) { ushort opcode = Game.Scene.GetComponent <OpcodeTypeComponent>().GetOpcode(message.GetType()); byte[] bytes = ProtobufHelper.ToBytes(message); session.Send(flag, opcode, bytes); }
public void Send(ushort opcode, IMessage message) { if (OpcodeHelper.IsNeedDebugLogMessage(opcode)) { Log.Msg(message); } session.Send(opcode, message); }
public void Send(byte flag, ushort opcode, IMessage message) { session.Send(flag, opcode, message); if (OpcodeHelper.IsNeedDebugLogMessage(opcode)) { ETModel.Log.Msg(message); } }
protected override void Run(ETModel.Session session, C2S_Exit msg) { Log.Info($"C2S_ExitHandler message: {msg.Name} RpcId= {msg.RpcId} "); session.Send(new S2C_Exit() { Name = "Server TestNetwork" }); }
public async void Broadcast2Kad(int kIndex, IMessage message) { List <NodeData> result = GetkList(kIndex); for (int i = 0; i < result.Count; i++) { NodeData node = result[i]; Session session = await networkInner.Get(NetworkHelper.ToIPEndPoint(node.ipEndPoint)); if (session != null && session.IsConnect()) { session.Send(message); } } }
private async void SendMessage() { for (int i = 0; i < 100; i++) { await Game.Scene.GetComponent <TimerComponent>().WaitAsync(500); if (this.GateSession != null) { GateSession.Send(new G2C_TestHotfixMessage() { Info = "recv hotfix message success" + i }); } } }
public async void Broadcast(P2P_NewBlock p2p_Block, Block block) { var myNodeId = GetMyNodeId(); for (int i = 0; i < nodes.Count; i++) { NodeData node = nodes[i]; if (node.nodeId != myNodeId) { Session session = await networkInner.Get(NetworkHelper.ToIPEndPoint(node.ipEndPoint)); if (session != null && session.IsConnect()) { session.Send(p2p_Block); } } } }
public void Send(byte flag, IMessage message) { ushort opcode = Game.Scene.GetComponent <OpcodeTypeComponent>().GetOpcode(message.GetType()); session.Send(flag, opcode, message); }
public void Send(byte flag, ushort opcode, IMessage message) { session.Send(flag, opcode, message); }