Пример #1
0
        public static void HandleEnterServerReq(CharacterSession session, ClientEnterServerReq enterServerReq)
        {
            void SendError(byte result)
            {
                session.SendMessage(new ServerEnterServerRes
                {
                    Result = result
                });
            }

            AccountModel account = DatabaseManager.Instance.AuthDatabase.GetAccount(enterServerReq.AccountId, enterServerReq.SessionKey);

            if (account == null)
            {
                SendError(1);
                return;
            }

            session.Authenticate(account);
            session.SendMessage(new ServerEnterServerRes
            {
                Result    = 0,
                AccountId = account.Id
            });
        }