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(); } // } }
private void OnPacketRecieved(Connection connection, IPacket packet) { IPacketHandler handler = _packetHandlers[packet.OpCode]; handler.Invoke(connection.Client, packet); }
private void OnDisconnected(Connection obj) { LoginHandler.Logout(obj.Client); }
private void OnConnection(Connection connection) { var client = new GameClient(connection); connection.Client = client; }
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); }
private void OnDisconnected(Connection obj) { _logoutQueue.Enqueue(obj.Client); }