コード例 #1
0
        public void Update()
        {
            this._dbCallbackQueue.Switch();
            while (!this._dbCallbackQueue.isEmpty)
            {
                GBuffer gBuffer = this._dbCallbackQueue.Pop();
                if (gBuffer.data == 1)
                {
                    uint          gcNetID       = gBuffer.ReadUInt();
                    uint          platform      = gBuffer.ReadUInt();
                    string        uid           = gBuffer.ReadUTF8();
                    string        uin           = gBuffer.ReadUTF8();
                    string        sessionID     = gBuffer.ReadUTF8E();
                    LoginUserInfo loginUserInfo = new LoginUserInfo
                    {
                        sessionid = sessionID,
                        uin       = uin,
                        plat      = platform
                    };
                    this._allLoginUserInfo[sessionID] = loginUserInfo;
                    Logger.Log($"add uid:{uid}, sessionID:{sessionID}");

                    this.PostMsgToGC_NotifyServerList(gcNetID);
                }
                else if (gBuffer.data == 2)
                {
                    uint gcNetID   = gBuffer.ReadUInt();
                    int  errorCode = gBuffer.ReadInt();
                    Logger.Log($"user login fail with netID:{gcNetID}, errorCode:{errorCode}.");
                    this.PostMsgToGC_NotifyLoginFail(errorCode, gcNetID);
                }
                gBuffer.Clear();
                this._dbCallbackQueuePool.Push(gBuffer);
            }
        }