Esempio n. 1
0
        public void ReceivedPacketHandler(INetworkImplementation source, ConnectionInfo connectioninfo, byte[] data, int offset, int length)
        {
            object connection = connectioninfo.Connection;

            //LogFile.WriteLine("Connection: "  + connection);
            if (IsServer)
            {
                if (!connections.ContainsKey(connection))
                {
                    NetworkLevel2Connection networklevel2connection = new NetworkLevel2Connection(this, connectioninfo, IsServer);
                    connections.Add(connection, networklevel2connection);
                }
                connections[connection].ReceivedPacketHandler(connectioninfo, data, offset, length);
            }
            else
            {
                connectiontoserver.ReceivedPacketHandler(connectioninfo, data, offset, length);
            }
        }