Example #1
0
        void c_ClientUnitConnectionInfo(object sender, ClientUnitConnectionInfoEventArgs e)
        {
            if (ClientUnitConnection != null)
            {
                ClientUnitConnection(sender, e);
            }

            Client    c = (Client)sender;
            UnitLogin u = e.UnitLoginDetails;

            int accountId = u.AccountID;

            if (accountManager.ConnectVerification(accountId))
            {
                byte[] bufferUniLoginState = PacketManager.SendUnitLoginState(LoginState.Success, u.CharacterID);
                c.Send(bufferUniLoginState);
            }
            else
            {
                Client[] otherPlayer = clients.Where(x => (x.AccountID == u.AccountID) && (x != c)).ToArray();
                for (int i = 0; i < otherPlayer.Length; i++)
                {
                    otherPlayer[i].Send(PacketManager.SendUnitLoginState(LoginState.OtherConnecting, 0));
                    otherPlayer[i].Dispose();
                }

                byte[] bufferUniLoginState = PacketManager.SendUnitLoginState(LoginState.Success, u.CharacterID);
                c.Send(bufferUniLoginState);
            }
        }
Example #2
0
        void c_ClientUnitConnectionInfo(object sender, ClientUnitConnectionInfoEventArgs e)
        {
            if (ClientUnitConnection != null)
            {
                ClientUnitConnection(sender, e);
            }

            Client    c = (Client)sender;
            UnitLogin u = e.UnitLoginDetails;

            int accountId = u.AccountID;

            byte[] bufferUniLoginState = PacketManager.SendUnitLoginState(LoginState.Success, u.CharacterID);
            c.Send(bufferUniLoginState);

            Character[] charList = characterManager.GetAllCharactersByAccountId(accountId);

            byte[] bufferCharacterList = PacketManager.SendCharacterList(charList);
            c.Send(bufferCharacterList);
        }
Example #3
0
        void c_ClientUnitConnectionInfo(object sender, ClientUnitConnectionInfoEventArgs e)
        {
            if (ClientUnitConnection != null)
                ClientUnitConnection(sender, e);

            Client c = (Client)sender;
            UnitLogin u = e.UnitLoginDetails;

            int accountId = u.AccountID;

            if (accountManager.ConnectVerification(accountId))
            {
                byte[] bufferUniLoginState = PacketManager.SendUnitLoginState(LoginState.Success, u.CharacterID);
                c.Send(bufferUniLoginState);
            }
            else
            {
                Client[] otherPlayer = clients.Where(x => (x.AccountID == u.AccountID) && (x != c)).ToArray();
                for (int i = 0; i < otherPlayer.Length; i++)
                {
                    otherPlayer[i].Send(PacketManager.SendUnitLoginState(LoginState.OtherConnecting, 0));
                    otherPlayer[i].Dispose();
                }

                byte[] bufferUniLoginState = PacketManager.SendUnitLoginState(LoginState.Success, u.CharacterID);
                c.Send(bufferUniLoginState);
            }
        }
Example #4
0
        void c_ClientUnitConnectionInfo(object sender, ClientUnitConnectionInfoEventArgs e)
        {
            if (ClientUnitConnection != null)
                ClientUnitConnection(sender, e);

            Client c = (Client)sender;
            UnitLogin u = e.UnitLoginDetails;

            int accountId = u.AccountID;

            byte[] bufferUniLoginState = PacketManager.SendUnitLoginState(LoginState.Success, u.CharacterID);
            c.Send(bufferUniLoginState);

            Character[] charList = characterManager.GetAllCharactersByAccountId(accountId);

            byte[] bufferCharacterList = PacketManager.SendCharacterList(charList);
            c.Send(bufferCharacterList);
        }