예제 #1
0
파일: Server.cs 프로젝트: Carterj3/Caesura
        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();

            }

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