Example #1
0
        //private object ServerConnectors_OnRequestPacket(ServerConnectorContext serverConnectorContext, int module, int command, object packet)
        //{

        //}

        private static void ServerConnectors_OnPacket(ServerConnectorContext serverConnectorContext, int module, int command, object packet)
        {
            Console.WriteLine($"ServerConnectors_OnPacket RemoteEndPoint:{serverConnectorContext.Socket.RemoteEndPoint.ToString()} \r\n module:{module}  command:{command} \r\n packet:{packet.GetType().Name + ": " + JsonConvert.SerializeObject(packet)}");

            //sends echo
            _serverConnectors.Send(serverConnectorContext.Id, 1, 1, "echo: " + packet.ToString());
        }
Example #2
0
 public void SendToAll(SendPacketsUtils.IServer2ClientPacket server2ClientPacket)
 {
     _serverConnectors.Send(x => true, server2ClientPacket);
 }