Ejemplo n.º 1
0
        public static bool HandlePacket( ServerBase sender, Stream stream )
        {
            UInt16 id = BitConverter.ToUInt16( stream.ReadBytes( 2 ), 0 );

            if ( stTypeIDs.Count <= id )
                throw new Exception( "Unknown packet type recieved" );

            ServerPacketType type = stTypeIDs[ id ];

            if ( type == null )
                throw new Exception( "Unknown packet type recieved" );

            return type.PacketHandler( sender, type, stream );
        }
Ejemplo n.º 2
0
 public bool ConnectLocal()
 {
     Server = new LocalServer();
     return Server.Connect();
 }