private ErrorCode OnMsgToGstoCsfromGcAskReconnectGame(CSGSInfo csgsInfo, uint gcNetID, byte[] data, int offset, int size)
        {
            GCToCS.ReconnectToGame pReconnectToGame = new GCToCS.ReconnectToGame();
            pReconnectToGame.MergeFrom(data, offset, size);

            ErrorCode errorCode = this.UserAskReconnectGame(csgsInfo, gcNetID, pReconnectToGame.Name, pReconnectToGame.Passwd);

            if (ErrorCode.Success != errorCode)
            {
                this.PostMsgToGCAskReturn(csgsInfo, gcNetID, ( int )GCToCS.MsgNum.EMsgToGstoCsfromGcAskReconnectGame, errorCode);
            }
            return(errorCode);
        }
Esempio n. 2
0
        /// <summary>
        /// 客户端请求重新登录
        /// </summary>
        private ErrorCode OnMsgToGstoCsfromGcAskReconnectGame(byte[] data, int offset, int size, int msgID)
        {
            if (!this._logicInited)
            {
                this.SetInited(true, true);
            }

            GCToCS.ReconnectToGame reconnectToGame = new GCToCS.ReconnectToGame();
            reconnectToGame.MergeFrom(data, offset, size);
            //验证token
            if (!GS.instance.gsStorage.IsUserCanLogin(reconnectToGame.Name, reconnectToGame.Passwd, this.id))
            {
                Logger.Error($"user {reconnectToGame.Name} can't login with token {reconnectToGame.Passwd}");
                GSToGC.NetClash msg = new GSToGC.NetClash();
                GS.instance.PostToGameClient(this.id, msg, ( int )GSToGC.MsgID.EMsgToGcfromGsNotifyNetClash);
                GS.instance.PostGameClientDisconnect(this.id);
            }
            return(ErrorCode.Success);
        }