Exemplo n.º 1
0
        private void AcceptConnection(GameSocketEventArgs eventArgs)
        {
            if (eventArgs.Socket.GameSocketManager != GameSocketManager)
                return;

            new MAcceptConnection().Send(eventArgs.Socket);
        }
Exemplo n.º 2
0
        private void RegisterLoginHandlers(GameSocketEventArgs eventArgs)
        {
            if (eventArgs.Socket.GameSocketManager != GameSocketManager)
                return;

            eventArgs.Socket.PacketHandlers[196, GameSocketMessageHandlerPriority.DefaultAction] += Handlers.ProcessPong;
            eventArgs.Socket.PacketHandlers[206, GameSocketMessageHandlerPriority.DefaultAction] += Handlers.ProcessEncryptionRequest;
            eventArgs.Socket.PacketHandlers[204, GameSocketMessageHandlerPriority.DefaultAction] += Handlers.ProcessSSOTicket;
            eventArgs.Socket.PacketHandlers[2002, GameSocketMessageHandlerPriority.DefaultAction] += Handlers.ProcessSessionRequest;

            eventArgs.Socket.PacketHandlers[7, GameSocketMessageHandlerPriority.DefaultAction] += Handlers.ProcessAccountDetailsRequest;
            eventArgs.Socket.PacketHandlers[8, GameSocketMessageHandlerPriority.DefaultAction] += Handlers.ProcessBalanceRequest;
            eventArgs.Socket.PacketHandlers[49, GameSocketMessageHandlerPriority.DefaultAction] += Handlers.ProcessCurrentDateRequest;
            eventArgs.Socket.PacketHandlers[157, GameSocketMessageHandlerPriority.DefaultAction] += Handlers.ProcessBadgeStatusRequest;
            eventArgs.Socket.PacketHandlers[228, GameSocketMessageHandlerPriority.DefaultAction] += Handlers.ProcessGroupStatusInit;
        }
Exemplo n.º 3
0
        private void IncomingConnectedAccepted(AsyncResultEventArgs<ServerChildTcpSocket> args)
        {
            if(args.Error != null)
            {
                string dumpPath = CoreManager.ServerCore.DumpException(args.Error);
                CoreManager.ServerCore.ConsoleManager.Error("Game Socket Manager", "Incoming connection failed!!");
                CoreManager.ServerCore.ConsoleManager.Error("Game Socket Manager", "    An exception dump has been saved to " + dumpPath);
                _listeningSocket.AcceptAsync();
                return;
            }

            ServerChildTcpSocket internalSocket = args.Result;
            GameSocket socket = new GameSocket(internalSocket, this);

            GameSocketEventArgs eventArgs = new GameSocketEventArgs(socket);

            CoreManager.ServerCore.OfficalEventFirer.Fire("incoming_game_connection:before", eventArgs);
            if (eventArgs.IsCancelled)
            {
                socket.Disconnect("Connection rejected from " + internalSocket.RemoteEndPoint + "(" + eventArgs.CancelReason + ")");
                return;
            }
            socket.Start();
            CoreManager.ServerCore.OfficalEventFirer.Fire("incoming_game_connection:after", eventArgs);
            CoreManager.ServerCore.ConsoleManager.Notice("Game Socket Manager", "Incoming connection accepted: " + internalSocket.RemoteEndPoint);

            _listeningSocket.AcceptAsync();
        }