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); } }
private void OnTimer(object state) { this._sdkCallbackQueue.Switch(); while (!this._sdkCallbackQueue.isEmpty) { GBuffer buffer = this._sdkCallbackQueue.Pop(); if (buffer.data == ( int )GCToLS.MsgID.EMsgToLsfromGcAskLogin) { uint gcnetID = buffer.ReadUInt(); UserPlatform eplat = ( UserPlatform )buffer.ReadInt(); if (IfTestPlatform(eplat)) { this.AsynHandleLoiginCheckMsg_PC(gcnetID); } // 其他渠道暂不实现 todo //else //{ //bool bState = IfPostVisit( platform ); //string str = gBuffer.ReadUTF8E(); //new_conn( gcNetID, gBuffer.data, str, this.gGlobalInfoInstance, platform, bState ); //} } buffer.position = 0; this._sdkCallbackQueuePool.Push(buffer); } }