Beispiel #1
0
        /// <summary>
        /// 该方法为异步方法
        /// </summary>
        public void SendToFailData(ErrorCode errorCode, uint gcNetID)
        {
            GBuffer gBuffer = this._dbCallbackQueuePool.Pop();

            gBuffer.Write(gcNetID);
            gBuffer.Write(( int )errorCode);
            gBuffer.position = 0;
            gBuffer.data     = 2;
            Logger.Log($"user login fail with netID:{gcNetID}, errorCode:{errorCode}.");
            this._dbCallbackQueue.Push(gBuffer);
        }
        private void PostMsg(string msg, int msgID, uint gcnetID, UserPlatform eplat)
        {
            GBuffer buffer = this._sdkCallbackQueuePool.Pop();

            buffer.Write(gcnetID);
            buffer.Write(( int )eplat);
            buffer.WriteUTF8E(msg);
            buffer.position = 0;
            buffer.data     = msgID;
            this._sdkCallbackQueue.Push(buffer);
        }
Beispiel #3
0
        /// <summary>
        /// 该方法为异步方法
        /// </summary>
        public void SendToInsertData(string uid, LoginUserInfo loginInfo, uint gcNetID)
        {
            GBuffer gBuffer = this._dbCallbackQueuePool.Pop();

            gBuffer.Write(gcNetID);
            gBuffer.Write(loginInfo.plat);
            gBuffer.WriteUTF8(uid);
            gBuffer.WriteUTF8(loginInfo.uin);
            gBuffer.WriteUTF8E(loginInfo.sessionid);
            gBuffer.position = 0;
            gBuffer.data     = 1;
            this._dbCallbackQueue.Push(gBuffer);
        }
 /// <summary>
 /// 把消息编码到缓冲区
 /// </summary>
 public static ErrorCode EncodeProtoMsgToBuffer(IMessage msg, int msgID, GBuffer buffer)
 {
     buffer.Write(msg.ToByteArray());
     buffer.position = 0;
     buffer.data     = msgID;
     return(ErrorCode.Success);
 }