Example #1
0
        public void run()
        {
            iSocket.iSocket temp;
            Connection conn;

            while (true)
            {
                    temp = socket.listen(iSocket.constants.defaultPort);
                    // spawn a new connection
                    conn = new Connection(temp, this);

                    var conThread = new Thread(new ThreadStart(conn.run));
                    conThread.Start();

            }

            // }
        }
Example #2
0
 private void OnPacketRecieved(Connection connection, IPacket packet)
 {
     IPacketHandler handler = _packetHandlers[packet.OpCode];
     handler.Invoke(connection.Client, packet);
 }
Example #3
0
 private void OnDisconnected(Connection obj)
 {
     LoginHandler.Logout(obj.Client);
 }
Example #4
0
 private void OnConnection(Connection connection)
 {
     var client = new GameClient(connection);
     connection.Client = client;
 }
Example #5
0
 private void OnPacketRecieved(Connection connection, IPacket packet)
 {
     // The game couuld be in absolutely any state, we'll store these for later
     _packetTasks.Enqueue(new PacketTask(connection.Client, packet));
     Logger.Instance.Trace(connection + " sent " + packet.GetType().Name);
 }
Example #6
0
 private void OnDisconnected(Connection obj)
 {
     _logoutQueue.Enqueue(obj.Client);
 }