コード例 #1
0
    private void HandleLogonCompleteRequest(RPCContext context)
    {
        LogonResult     result    = LogonResult.ParseFrom(context.Payload);
        BattleNetErrors errorCode = (BattleNetErrors)result.ErrorCode;

        if (errorCode != BattleNetErrors.ERROR_OK)
        {
            base.m_battleNet.EnqueueErrorInfo(BnetFeature.Auth, BnetFeatureEvent.Auth_OnFinish, errorCode, context.Context);
        }
        else
        {
            this.m_accountEntity = result.Account;
            base.m_battleNet.Presence.PresenceSubscribe(this.m_accountEntity);
            this.m_gameAccounts = new List <EntityId>();
            foreach (EntityId id in result.GameAccountList)
            {
                this.m_gameAccounts.Add(id);
                base.m_battleNet.Presence.PresenceSubscribe(id);
            }
            if (this.m_gameAccounts.Count > 0)
            {
                this.m_gameAccount = result.GameAccountList[0];
            }
            base.m_battleNet.IssueSelectGameAccountRequest();
            base.m_battleNet.SetConnectedRegion(result.ConnectedRegion);
            object[] args = new object[] { result };
            base.ApiLog.LogDebug("LogonComplete {0}", args);
            object[] objArray2 = new object[] { result.ConnectedRegion };
            base.ApiLog.LogDebug("Region (connected): {0}", objArray2);
            BIReport.Get().Report_Telemetry(Telemetry.Level.LEVEL_INFO, BIReport.TelemetryEvent.EVENT_LOGIN_SUCCESS);
        }
    }
コード例 #2
0
        private void HandleLogonCompleteRequest(RPCContext context)
        {
            LogonResult     logonResult = LogonResult.ParseFrom(context.Payload);
            BattleNetErrors errorCode   = (BattleNetErrors)logonResult.ErrorCode;

            if (errorCode != BattleNetErrors.ERROR_OK)
            {
                this.m_battleNet.EnqueueErrorInfo(BnetFeature.Auth, BnetFeatureEvent.Auth_OnFinish, errorCode, 0);
                return;
            }
            this.m_accountEntity = logonResult.Account;
            this.m_battleNet.Presence.PresenceSubscribe(this.m_accountEntity);
            this.m_gameAccounts = new List <bnet.protocol.EntityId>();
            foreach (bnet.protocol.EntityId gameAccountList in logonResult.GameAccountList)
            {
                this.m_gameAccounts.Add(gameAccountList);
                this.m_battleNet.Presence.PresenceSubscribe(gameAccountList);
            }
            if (logonResult.HasBattleTag)
            {
                this.m_battleTag = logonResult.BattleTag;
            }
            if (this.m_gameAccounts.Count > 0)
            {
                this.m_gameAccount = logonResult.GameAccountList[0];
            }
            this.m_sessionKey = logonResult.SessionKey;
            this.m_battleNet.IssueSelectGameAccountRequest();
            this.m_battleNet.SetConnectedRegion(logonResult.ConnectedRegion);
            base.ApiLog.LogDebug("LogonComplete {0}", new object[] { logonResult });
            base.ApiLog.LogDebug("Region (connected): {0}", new object[] { logonResult.ConnectedRegion });
        }
コード例 #3
0
        private void HandleLogonCompleteRequest(RPCContext context)
        {
            byte[]          payload     = context.Payload;
            LogonResult     logonResult = LogonResult.ParseFrom(payload);
            BattleNetErrors errorCode   = (BattleNetErrors)logonResult.ErrorCode;

            if (errorCode != BattleNetErrors.ERROR_OK)
            {
                this.m_battleNet.EnqueueErrorInfo(BnetFeature.Auth, BnetFeatureEvent.Auth_OnFinish, errorCode, 0);
                return;
            }
            this.m_accountEntity = logonResult.Account;
            this.m_battleNet.Presence.PresenceSubscribe(this.m_accountEntity);
            this.m_gameAccounts = new List <bnet.protocol.EntityId>();
            using (List <bnet.protocol.EntityId> .Enumerator enumerator = logonResult.GameAccountList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    bnet.protocol.EntityId current = enumerator.get_Current();
                    this.m_gameAccounts.Add(current);
                    this.m_battleNet.Presence.PresenceSubscribe(current);
                }
            }
            if (this.m_gameAccounts.get_Count() > 0)
            {
                this.m_gameAccount = logonResult.GameAccountList.get_Item(0);
            }
            this.m_sessionKey = logonResult.SessionKey;
            this.m_battleNet.IssueSelectGameAccountRequest();
            this.m_battleNet.SetConnectedRegion(logonResult.ConnectedRegion);
            base.ApiLog.LogDebug("LogonComplete {0}", new object[]
            {
                logonResult
            });
            base.ApiLog.LogDebug("Region (connected): {0}", new object[]
            {
                logonResult.ConnectedRegion
            });
        }