Example #1
0
            public static ReturnValue <List <ZhanDuiZhengBaNtfPkResultData> > ZhengBaPkResult(int gameId, int winner1)
            {
                AutoWaitReturnValue <KfCall._p28> _wait_ = AutoWaitReturnValue <KfCall._p28> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p27 _inputParameter_ = new KfCall._p27
                        {
                            p0 = gameId,
                            p1 = winner1
                        };
                        KfCall._p28 _outputParameter_ = default(KfCall._p28);
                        ReturnType  _returnType_      = _socket_.WaitGet <KfCall._p27, KfCall._p28>(TcpCall.ZhanDuiZhengBa_K._c18, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <List <ZhanDuiZhengBaNtfPkResultData> >
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p28> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <List <ZhanDuiZhengBaNtfPkResultData> >
                {
                    Type = ReturnType.ClientException
                });
            }
Example #2
0
            public static ReturnValue <bool> BoCaiBuyItem(KFBoCaiShopDB Item, int maxNum)
            {
                AutoWaitReturnValue <KfCall._p10> _wait_ = AutoWaitReturnValue <KfCall._p10> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p9 _inputParameter_ = new KfCall._p9
                        {
                            p0 = Item,
                            p1 = maxNum
                        };
                        KfCall._p10 _outputParameter_ = default(KfCall._p10);
                        ReturnType  _returnType_      = _socket_.WaitGet <KfCall._p9, KfCall._p10>(TcpCall.KFBoCaiManager._c5, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <bool>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p10> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <bool>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #3
0
            AutoCSer.Net.TcpServer.AwaiterBox <AutoCSer.DiskBlock.ClientBuffer> readAwaiter(AutoCSer.DiskBlock.ClientBuffer buffer, ulong index)
            {
                AutoCSer.Net.TcpServer.AwaiterBox <AutoCSer.DiskBlock.ClientBuffer> _awaiter_ = new AutoCSer.Net.TcpServer.AwaiterBox <AutoCSer.DiskBlock.ClientBuffer>();
                AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = _TcpClient_.Sender;
                if (_socket_ != null)
                {
                    TcpInternalServer._p5 _inputParameter_ = new TcpInternalServer._p5
                    {
                        p0 = buffer,

                        p1 = index,
                    };
                    AutoCSer.Net.TcpServer.ReturnType _returnType_;
                    AutoCSer.Net.TcpServer.AwaiterReturnValueBox <AutoCSer.DiskBlock.ClientBuffer> _outputParameter_ = default(AutoCSer.Net.TcpServer.AwaiterReturnValueBox <AutoCSer.DiskBlock.ClientBuffer>);
                    _returnType_ = _socket_.GetAwaiter <TcpInternalServer._p5, AutoCSer.Net.TcpServer.AwaiterReturnValueBox <AutoCSer.DiskBlock.ClientBuffer> >(_a2, _awaiter_, ref _inputParameter_, ref _outputParameter_);
                    if (_returnType_ != AutoCSer.Net.TcpServer.ReturnType.Success)
                    {
                        _awaiter_.Call(_returnType_);
                    }
                }
                else
                {
                    _awaiter_.Call(AutoCSer.Net.TcpServer.ReturnType.ClientException);
                }
                return(_awaiter_);
            }
Example #4
0
            public static ReturnValue <int> GetZhanDuiState(int zhanDuiID)
            {
                AutoWaitReturnValue <KfCall._p6> _wait_ = AutoWaitReturnValue <KfCall._p6> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p12 _inputParameter_ = new KfCall._p12
                        {
                            p0 = zhanDuiID
                        };
                        KfCall._p6 _outputParameter_ = default(KfCall._p6);
                        ReturnType _returnType_      = _socket_.WaitGet <KfCall._p12, KfCall._p6>(TcpCall.EscapeBattle_K._c22, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <int>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p6> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <int>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #5
0
            public static ReturnValue <string> SendData(int strLen, bool flag)
            {
                AutoWaitReturnValue <KfCall._p31> _wait_ = AutoWaitReturnValue <KfCall._p31> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p30 _inputParameter_ = new KfCall._p30
                        {
                            p1 = strLen,
                            p0 = flag
                        };
                        KfCall._p31 _outputParameter_ = default(KfCall._p31);
                        ReturnType  _returnType_      = _socket_.WaitGet <KfCall._p30, KfCall._p31>(TcpCall.TestS2KFCommunication._c23, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <string>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p31> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <string>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #6
0
            public static ReturnValue <ZhanDuiZhengBaSyncData> SyncZhengBaData(ZhanDuiZhengBaSyncData lastSyncData)
            {
                AutoWaitReturnValue <KfCall._p24> _wait_ = AutoWaitReturnValue <KfCall._p24> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p23 _inputParameter_ = new KfCall._p23
                        {
                            p0 = lastSyncData
                        };
                        KfCall._p24 _outputParameter_ = default(KfCall._p24);
                        ReturnType  _returnType_      = _socket_.WaitGet <KfCall._p23, KfCall._p24>(TcpCall.ZhanDuiZhengBa_K._c16, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <ZhanDuiZhengBaSyncData>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p24> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <ZhanDuiZhengBaSyncData>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #7
0
            public static ReturnValue <bool> InitializeClient(AutoCSer.Net.TcpInternalServer.ClientSocketSender _sender_, KuaFuClientContext clientInfo)
            {
                AutoWaitReturnValue <KfCall._p10> _wait_ = AutoWaitReturnValue <KfCall._p10> .Pop();

                try
                {
                    if (_sender_ != null)
                    {
                        KfCall._p20 _inputParameter_ = new KfCall._p20
                        {
                            p0 = clientInfo
                        };
                        KfCall._p10 _outputParameter_ = default(KfCall._p10);
                        ReturnType  _returnType_      = _sender_.WaitGet <KfCall._p20, KfCall._p10>(TcpCall.KFServiceBase._c13, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <bool>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p10> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <bool>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #8
0
            public static KeepCallback KeepGetMessage(Action <ReturnValue <KFCallMsg> > _onReturn_)
            {
                Callback <ReturnValue <KfCall._p21> > _onOutput_ = KfCall.TcpClient.GetCallback <KFCallMsg, KfCall._p21>(_onReturn_);

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        return(_socket_.GetKeep <KfCall._p21>(TcpCall.KFServiceBase._ac14, ref _onOutput_));
                    }
                }
                finally
                {
                    if (_onOutput_ != null)
                    {
                        ReturnValue <KfCall._p21> _outputParameter_ = new ReturnValue <KfCall._p21>
                        {
                            Type = ReturnType.ClientException
                        };
                        _onOutput_.Call(ref _outputParameter_);
                    }
                }
                return(null);
            }
Example #9
0
            public static ReturnValue <List <KFBoCaoHistoryData> > GetWinHistory(int type)
            {
                AutoWaitReturnValue <KfCall._p17> _wait_ = AutoWaitReturnValue <KfCall._p17> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p12 _inputParameter_ = new KfCall._p12
                        {
                            p0 = type
                        };
                        KfCall._p17 _outputParameter_ = default(KfCall._p17);
                        ReturnType  _returnType_      = _socket_.WaitGet <KfCall._p12, KfCall._p17>(TcpCall.KFBoCaiManager._c10, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <List <KFBoCaoHistoryData> >
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p17> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <List <KFBoCaoHistoryData> >
                {
                    Type = ReturnType.ClientException
                });
            }
Example #10
0
            public static ReturnValue <int> ExecuteCommand(string[] args)
            {
                AutoWaitReturnValue <KfCall._p6> _wait_ = AutoWaitReturnValue <KfCall._p6> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p19 _inputParameter_ = new KfCall._p19
                        {
                            p0 = args
                        };
                        KfCall._p6 _outputParameter_ = default(KfCall._p6);
                        ReturnType _returnType_      = _socket_.WaitGet <KfCall._p19, KfCall._p6>(TcpCall.KFServiceBase._c12, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <int>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p6> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <int>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #11
0
            AutoCSer.Net.TcpServer.ReturnValue <bool> appendLog(AutoCSer.Net.TcpRegister.ServerLog server)
            {
                AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p5> _wait_ = AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p5> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = _TcpClient_.Sender;
                    if (_socket_ != null)
                    {
                        TcpInternalServer._p4 _inputParameter_ = new TcpInternalServer._p4
                        {
                            p0 = server,
                        };
                        TcpInternalServer._p5 _outputParameter_ = new TcpInternalServer._p5
                        {
                        };
                        AutoCSer.Net.TcpServer.ReturnType _returnType_ = _socket_.WaitGet <TcpInternalServer._p4, TcpInternalServer._p5>(_c3, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new AutoCSer.Net.TcpServer.ReturnValue <bool> {
                            Type = _returnType_, Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p5> .PushNotNull(_wait_);
                    }
                }
                return(new AutoCSer.Net.TcpServer.ReturnValue <bool> {
                    Type = AutoCSer.Net.TcpServer.ReturnType.ClientException
                });
            }
Example #12
0
            public static ReturnValue <bool> BuyBoCai(KFBuyBocaiData data)
            {
                AutoWaitReturnValue <KfCall._p10> _wait_ = AutoWaitReturnValue <KfCall._p10> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p11 _inputParameter_ = new KfCall._p11
                        {
                            p0 = data
                        };
                        KfCall._p10 _outputParameter_ = default(KfCall._p10);
                        ReturnType  _returnType_      = _socket_.WaitGet <KfCall._p11, KfCall._p10>(TcpCall.KFBoCaiManager._c6, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <bool>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p10> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <bool>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #13
0
            AutoCSer.Net.TcpServer.ReturnValue <ulong> append(AutoCSer.DiskBlock.AppendBuffer buffer)
            {
                AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p2> _wait_ = AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p2> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = _TcpClient_.Sender;
                    if (_socket_ != null)
                    {
                        TcpInternalServer._p1 _inputParameter_ = new TcpInternalServer._p1
                        {
                            p0 = buffer,
                        };
                        TcpInternalServer._p2 _outputParameter_ = new TcpInternalServer._p2
                        {
                        };
                        AutoCSer.Net.TcpServer.ReturnType _returnType_ = _socket_.WaitGet <TcpInternalServer._p1, TcpInternalServer._p2>(_c0, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new AutoCSer.Net.TcpServer.ReturnValue <ulong> {
                            Type = _returnType_, Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p2> .PushNotNull(_wait_);
                    }
                }
                return(new AutoCSer.Net.TcpServer.ReturnValue <ulong> {
                    Type = AutoCSer.Net.TcpServer.ReturnType.ClientException
                });
            }
Example #14
0
            public static ReturnValue <int> GameResult(int gameId, List <int> zhanDuiScoreList)
            {
                AutoWaitReturnValue <KfCall._p6> _wait_ = AutoWaitReturnValue <KfCall._p6> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p5 _inputParameter_ = new KfCall._p5
                        {
                            p1 = gameId,
                            p0 = zhanDuiScoreList
                        };
                        KfCall._p6 _outputParameter_ = default(KfCall._p6);
                        ReturnType _returnType_      = _socket_.WaitGet <KfCall._p5, KfCall._p6>(TcpCall.EscapeBattle_K._c3, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <int>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p6> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <int>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #15
0
        public bool SendCustomData(SubArray <byte> data)
        {
            if (data.Length > maxCustomDataSize)
            {
                throw new ArgumentOutOfRangeException("data.Length" + data.Length.toString() + " > maxCustomDataSize[" + maxCustomDataSize.toString() + "]");
            }
            ClientSocketSender sender = Sender;

            return(sender.CustomData(ref data));
        }
Example #16
0
        /// <summary>
        /// 时间验证客户端验证
        /// </summary>
        /// <param name="verify">时间验证服务客户端委托</param>
        /// <param name="sender"></param>
        /// <param name="client"></param>
        /// <returns></returns>
        public unsafe static bool Verify(Verifier verify, ClientSocketSender sender, AutoCSer.Net.TcpInternalServer.Client client)
        {
            string verifyString = client.Attribute.VerifyString;

            if (verifyString == null)
            {
                long ticks = 0;
                return(verify(sender, null, 0, null, ref ticks).Value);
            }
            return(Verify(verify, sender, client, null, verifyString));
        }
Example #17
0
        private static bool verifyMethod(AutoCSer.Net.TcpInternalServer.ClientSocketSender sender)
        {
            ReturnValue <bool> returnValue = TcpCall.KFServiceBase.InitializeClient(sender, KFCallManager.ClientInfo);
            bool result;

            if (returnValue.Type == ReturnType.Success && returnValue.Value)
            {
                KFCallManager.ClientInfo.ClientId = TimeUtil.AgeByUnixTime(KFCallManager.ClientInfo.ClientId);
                LogManager.WriteLog(LogTypes.Running, string.Format("连接中心成功,host={0},port={1},error={2}", KFCallManager.Host, KFCallManager.Port, returnValue.Type.ToString()), null, true);
                result = (KFCallManager.IsLogin = true);
            }
            else
            {
                LogManager.WriteLog(LogTypes.Running, string.Format("连接中心失败,host={0},port={1},error={2}", KFCallManager.Host, KFCallManager.Port, returnValue.Type.ToString()), null, true);
                result = (KFCallManager.IsLogin = false);
            }
            return(result);
        }
Example #18
0
        /// <summary>
        /// 时间验证客户端验证
        /// </summary>
        /// <param name="verify">时间验证服务客户端委托</param>
        /// <param name="sender"></param>
        /// <param name="client"></param>
        /// <param name="userID">用户ID</param>
        /// <param name="verifyString">验证字符串</param>
        /// <returns></returns>
        public unsafe static bool Verify(Verifier verify, ClientSocketSender sender, AutoCSer.Net.TcpInternalServer.Client client, string userID, string verifyString)
        {
            TcpServer.ServerBaseAttribute attribute = client.Attribute;
            ulong markData = 0;

            if (attribute.IsMarkData)
            {
                markData = attribute.VerifyHashCode;
            }
            long ticks = GetTicks();

            TcpServer.ClientSocketBase socket = sender.ClientSocket;
            bool isError = false;

            do
            {
                ulong randomPrefix = Random.Default.SecureNextULongNotZero();
                while (randomPrefix == markData)
                {
                    randomPrefix = Random.Default.SecureNextULongNotZero();
                }
                socket.ReceiveMarkData = attribute.IsMarkData ? markData ^ randomPrefix : 0UL;
                sender.SendMarkData    = 0;
                long lastTicks = ticks;
                TcpServer.ReturnValue <bool> isVerify = verify(sender, userID, randomPrefix, TcpServer.TimeVerifyServer.Md5(verifyString, randomPrefix, ticks), ref ticks);
                if (isVerify.Value)
                {
                    sender.SendMarkData = socket.ReceiveMarkData;
                    if (isError)
                    {
                        socket.Log.Debug(sender.ClientSocket.IpAddress.ToString() + ":" + sender.ClientSocket.Port.toString() + " TCP客户端验证时间重试成功");
                    }
                    return(true);
                }
                if (isVerify.Type != TcpServer.ReturnType.Success || ticks <= lastTicks)
                {
                    socket.Log.Error(sender.ClientSocket.IpAddress.ToString() + ":" + sender.ClientSocket.Port.toString() + " TCP客户端验证失败 [" + isVerify.Type.ToString() + "] " + ticks.toString() + " <= " + lastTicks.toString());
                    return(false);
                }
                socket.Log.Error(sender.ClientSocket.IpAddress.ToString() + ":" + sender.ClientSocket.Port.toString() + " TCP客户端验证时间失败重试 " + ticks.toString() + " - " + lastTicks.toString());
                isError = true;
            }while (true);
        }
Example #19
0
            AutoCSer.Net.TcpServer.ReturnValue <bool> verify(AutoCSer.Net.TcpInternalServer.ClientSocketSender _sender_, string userID, ulong randomPrefix, byte[] md5Data, ref long ticks)
            {
                AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p4> _wait_ = AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p4> .Pop();

                AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = null;
                try
                {
                    _socket_ = _sender_;
                    if (_socket_ != null)
                    {
                        TcpInternalServer._p3 _inputParameter_ = new TcpInternalServer._p3
                        {
                            p2 = userID,

                            p3 = randomPrefix,

                            p0 = md5Data,

                            p1 = ticks,
                        };
                        TcpInternalServer._p4 _outputParameter_ = new TcpInternalServer._p4
                        {
                            p0 = ticks,
                        };
                        AutoCSer.Net.TcpServer.ReturnType _returnType_ = _socket_.WaitGet <TcpInternalServer._p3, TcpInternalServer._p4>(_c1, ref _wait_, ref _inputParameter_, ref _outputParameter_);

                        ticks = _outputParameter_.p0;
                        return(new AutoCSer.Net.TcpServer.ReturnValue <bool> {
                            Type = _returnType_, Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p4> .PushNotNull(_wait_);
                    }
                }
                return(new AutoCSer.Net.TcpServer.ReturnValue <bool> {
                    Type = _socket_ == null ? AutoCSer.Net.TcpServer.ReturnType.ClientSocketNull : AutoCSer.Net.TcpServer.ReturnType.ClientException
                });
            }
Example #20
0
        /// <summary>
        /// 时间验证客户端验证
        /// </summary>
        /// <param name="verify">时间验证服务客户端委托</param>
        /// <param name="sender"></param>
        /// <param name="client"></param>
        /// <returns></returns>
        public unsafe static bool Verify(Verifier verify, ClientSocketSender sender, AutoCSer.Net.TcpInternalServer.Client client)
        {
            long            ticks;
            ServerAttribute attribute    = client.Attribute;
            string          verifyString = attribute.VerifyString;

            if (verifyString == null)
            {
                ticks = 0;
                return(verify(sender, 0, null, ref ticks).Value);
            }
            ulong markData = 0;

            if (attribute.IsMarkData)
            {
                markData = attribute.VerifyHashCode;
            }
            ticks = Date.NowTime.SetUtc().Ticks;
            TcpServer.ClientSocketBase socket = sender.ClientSocket;
            do
            {
                ulong randomPrefix = Random.Default.SecureNextULongNotZero();
                while (randomPrefix == markData)
                {
                    randomPrefix = Random.Default.SecureNextULongNotZero();
                }
                socket.ReceiveMarkData = attribute.IsMarkData ? markData ^ randomPrefix : 0UL;
                sender.SendMarkData    = 0;
                long lastTicks = ticks;
                TcpServer.ReturnValue <bool> isVerify = verify(sender, randomPrefix, TcpServer.TimeVerifyServer.Md5(verifyString, randomPrefix, ticks), ref ticks);
                if (isVerify.Value)
                {
                    sender.SendMarkData = socket.ReceiveMarkData;
                    return(true);
                }
                if (isVerify.Type != TcpServer.ReturnType.Success || ticks <= lastTicks)
                {
                    socket.Log.Add(AutoCSer.Log.LogType.Error, "TCP客户端验证失败 [" + isVerify.Type.ToString() + "] " + ticks.toString() + " <= " + lastTicks.toString());
                    return(false);
                }
                socket.Log.Add(AutoCSer.Log.LogType.Error, "TCP客户端验证时间失败重试 " + ticks.toString() + " - " + lastTicks.toString());
            }while (true);
        }
Example #21
0
            public static ReturnValue <int> ZhengBaRequestEnter(int zhanDuiID, out int gameId, out int kuaFuServerID, out string[] ips, out int[] ports)
            {
                AutoWaitReturnValue <KfCall._p8> _wait_ = AutoWaitReturnValue <KfCall._p8> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p7 _inputParameter_ = new KfCall._p7
                        {
                            p0 = zhanDuiID
                        };
                        KfCall._p8 _outputParameter_ = default(KfCall._p8);
                        ReturnType _returnType_      = _socket_.WaitGet <KfCall._p7, KfCall._p8>(TcpCall.ZhanDuiZhengBa_K._c19, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        gameId        = _outputParameter_.p0;
                        kuaFuServerID = _outputParameter_.p1;
                        ips           = _outputParameter_.p3;
                        ports         = _outputParameter_.p2;
                        return(new ReturnValue <int>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p8> .PushNotNull(_wait_);
                    }
                }
                gameId        = 0;
                kuaFuServerID = 0;
                ips           = null;
                ports         = null;
                return(new ReturnValue <int>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #22
0
            public static ReturnValue <int> ZhengBaKuaFuLogin(int zhanDuiID, int gameId, int srcServerID, out ZhanDuiZhengBaFuBenData copyData)
            {
                AutoWaitReturnValue <KfCall._p26> _wait_ = AutoWaitReturnValue <KfCall._p26> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p25 _inputParameter_ = new KfCall._p25
                        {
                            p1 = zhanDuiID,
                            p2 = gameId,
                            p3 = srcServerID
                        };
                        KfCall._p26 _outputParameter_ = default(KfCall._p26);
                        ReturnType  _returnType_      = _socket_.WaitGet <KfCall._p25, KfCall._p26>(TcpCall.ZhanDuiZhengBa_K._c17, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        copyData = _outputParameter_.p0;
                        return(new ReturnValue <int>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p26> .PushNotNull(_wait_);
                    }
                }
                copyData = null;
                return(new ReturnValue <int>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #23
0
 AutoCSer.Net.TcpServer.KeepCallback getLog(Action <AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.Net.TcpRegister.ServerLog> > _onReturn_)
 {
     AutoCSer.Net.Callback <AutoCSer.Net.TcpServer.ReturnValue <TcpInternalServer._p3> > _onOutput_ = _TcpClient_.GetCallback <AutoCSer.Net.TcpRegister.ServerLog, TcpInternalServer._p3>(_onReturn_);
     try
     {
         AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = _TcpClient_.Sender;
         if (_socket_ != null)
         {
             return(_socket_.GetKeep <TcpInternalServer._p3>(_ac2, ref _onOutput_));
         }
     }
     finally
     {
         if (_onOutput_ != null)
         {
             AutoCSer.Net.TcpServer.ReturnValue <TcpInternalServer._p3> _outputParameter_ = new AutoCSer.Net.TcpServer.ReturnValue <TcpInternalServer._p3> {
                 Type = AutoCSer.Net.TcpServer.ReturnType.ClientException
             };
             _onOutput_.Call(ref _outputParameter_);
         }
     }
     return(null);
 }
Example #24
0
            public static ReturnValue <bool> IsCanBuy(int type, string buyValue, int buyNum, long DataPeriods)
            {
                AutoWaitReturnValue <KfCall._p10> _wait_ = AutoWaitReturnValue <KfCall._p10> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p18 _inputParameter_ = new KfCall._p18
                        {
                            p0 = type,
                            p3 = buyValue,
                            p1 = buyNum,
                            p2 = DataPeriods
                        };
                        KfCall._p10 _outputParameter_ = default(KfCall._p10);
                        ReturnType  _returnType_      = _socket_.WaitGet <KfCall._p18, KfCall._p10>(TcpCall.KFBoCaiManager._c11, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <bool>
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p10> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <bool>
                {
                    Type = ReturnType.ClientException
                });
            }
Example #25
0
            AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.DiskBlock.ClientBuffer> read(AutoCSer.DiskBlock.ClientBuffer buffer, ulong index)
            {
                AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p6> _wait_ = AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p6> .Pop();

                AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = null;
                try
                {
                    _socket_ = _TcpClient_.Sender;
                    if (_socket_ != null)
                    {
                        TcpInternalServer._p5 _inputParameter_ = new TcpInternalServer._p5
                        {
                            p0 = buffer,

                            p1 = index,
                        };
                        TcpInternalServer._p6 _outputParameter_ = new TcpInternalServer._p6
                        {
                            Ret = buffer
                        };
                        AutoCSer.Net.TcpServer.ReturnType _returnType_ = _socket_.WaitGet <TcpInternalServer._p5, TcpInternalServer._p6>(_c2, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.DiskBlock.ClientBuffer> {
                            Type = _returnType_, Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoCSer.Net.TcpServer.AutoWaitReturnValue <TcpInternalServer._p6> .PushNotNull(_wait_);
                    }
                }
                return(new AutoCSer.Net.TcpServer.ReturnValue <AutoCSer.DiskBlock.ClientBuffer> {
                    Type = _socket_ == null ? AutoCSer.Net.TcpServer.ReturnType.ClientSocketNull : AutoCSer.Net.TcpServer.ReturnType.ClientException
                });
            }
Example #26
0
 AutoCSer.Net.TcpServer.AwaiterBox <bool> appendLogAwaiter(AutoCSer.Net.TcpRegister.ServerLog server)
 {
     AutoCSer.Net.TcpServer.AwaiterBox <bool>          _awaiter_ = new AutoCSer.Net.TcpServer.AwaiterBox <bool>();
     AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_  = _TcpClient_.Sender;
     if (_socket_ != null)
     {
         TcpInternalServer._p4 _inputParameter_ = new TcpInternalServer._p4
         {
             p0 = server,
         };
         AutoCSer.Net.TcpServer.ReturnType _returnType_;
         AutoCSer.Net.TcpServer.AwaiterReturnValueBox <bool> _outputParameter_ = default(AutoCSer.Net.TcpServer.AwaiterReturnValueBox <bool>);
         _returnType_ = _socket_.GetAwaiter <TcpInternalServer._p4, AutoCSer.Net.TcpServer.AwaiterReturnValueBox <bool> >(_a3, _awaiter_, ref _inputParameter_, ref _outputParameter_);
         if (_returnType_ != AutoCSer.Net.TcpServer.ReturnType.Success)
         {
             _awaiter_.Call(_returnType_);
         }
     }
     else
     {
         _awaiter_.Call(AutoCSer.Net.TcpServer.ReturnType.ClientException);
     }
     return(_awaiter_);
 }
Example #27
0
            public static ReturnValue <List <OpenLottery> > GetOpenLottery(int type, long DataPeriods, bool getOne)
            {
                AutoWaitReturnValue <KfCall._p16> _wait_ = AutoWaitReturnValue <KfCall._p16> .Pop();

                try
                {
                    AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_ = KfCall.TcpClient.Sender;
                    if (_socket_ != null)
                    {
                        KfCall._p15 _inputParameter_ = new KfCall._p15
                        {
                            p1 = type,
                            p2 = DataPeriods,
                            p0 = getOne
                        };
                        KfCall._p16 _outputParameter_ = default(KfCall._p16);
                        ReturnType  _returnType_      = _socket_.WaitGet <KfCall._p15, KfCall._p16>(TcpCall.KFBoCaiManager._c9, ref _wait_, ref _inputParameter_, ref _outputParameter_);
                        return(new ReturnValue <List <OpenLottery> >
                        {
                            Type = _returnType_,
                            Value = _outputParameter_.Return
                        });
                    }
                }
                finally
                {
                    if (_wait_ != null)
                    {
                        AutoWaitReturnValue <KfCall._p16> .PushNotNull(_wait_);
                    }
                }
                return(new ReturnValue <List <OpenLottery> >
                {
                    Type = ReturnType.ClientException
                });
            }
Example #28
0
 AutoCSer.Net.TcpServer.AwaiterBox <ulong> appendAwaiter(AutoCSer.DiskBlock.AppendBuffer buffer)
 {
     AutoCSer.Net.TcpServer.AwaiterBox <ulong>         _awaiter_ = new AutoCSer.Net.TcpServer.AwaiterBox <ulong>();
     AutoCSer.Net.TcpInternalServer.ClientSocketSender _socket_  = _TcpClient_.Sender;
     if (_socket_ != null)
     {
         TcpInternalServer._p1 _inputParameter_ = new TcpInternalServer._p1
         {
             p0 = buffer,
         };
         AutoCSer.Net.TcpServer.ReturnType _returnType_;
         AutoCSer.Net.TcpServer.AwaiterReturnValueBox <ulong> _outputParameter_ = default(AutoCSer.Net.TcpServer.AwaiterReturnValueBox <ulong>);
         _returnType_ = _socket_.GetAwaiter <TcpInternalServer._p1, AutoCSer.Net.TcpServer.AwaiterReturnValueBox <ulong> >(_a0, _awaiter_, ref _inputParameter_, ref _outputParameter_);
         if (_returnType_ != AutoCSer.Net.TcpServer.ReturnType.Success)
         {
             _awaiter_.Call(_returnType_);
         }
     }
     else
     {
         _awaiter_.Call(AutoCSer.Net.TcpServer.ReturnType.ClientException);
     }
     return(_awaiter_);
 }
Example #29
0
 private bool _timerVerify_(TcpInternalClient client, AutoCSer.Net.TcpInternalServer.ClientSocketSender sender)
 {
     return(AutoCSer.Net.TcpInternalServer.TimeVerifyClient.Verify(verify, sender, _TcpClient_));
 }