Exemple #1
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
                });
            }
Exemple #2
0
        public static int ZhengBaKuaFuLogin(AutoCSer.Net.TcpInternalServer.ServerSocketSender socket, int zhanDuiID, int gameId, int srcServerID, out ZhanDuiZhengBaFuBenData copyData)
        {
            copyData = null;
            lock (ZhanDuiZhengBa_K.Mutex)
            {
                ZhanDuiZhengBa_K.JoinRolePkData roleData = ZhanDuiZhengBa_K.TodayJoinRoleDatas.Find((ZhanDuiZhengBa_K.JoinRolePkData _r) => _r.ZhanDuiID == zhanDuiID && _r.CurrGameID == gameId);
                ZhanDuiZhengBaPkLogData         logData  = null;
                ZhanDuiZhengBa_K.ThisLoopPkLogs.TryGetValue(gameId, out logData);
                if (roleData == null || logData == null)
                {
                    return(-12);
                }
                if (!roleData.WaitReqEnter)
                {
                    return(-12);
                }
                copyData = roleData.CopyData;
            }
            KuaFuServerInfo serverInfo = KuaFuServerManager.GetKuaFuServerInfo(srcServerID);
            int             result;

            if (null != serverInfo)
            {
                copyData.IPs = new string[]
                {
                    serverInfo.DbIp,
                    serverInfo.DbIp
                };
                copyData.Ports = new int[]
                {
                    serverInfo.DbPort,
                    serverInfo.LogDbPort
                };
                result = 0;
            }
            else
            {
                result = -11000;
            }
            return(result);
        }
Exemple #3
0
 public static int _M17(AutoCSer.Net.TcpInternalServer.ServerSocketSender _sender_, int zhanDuiID, int gameId, int srcServerID, out ZhanDuiZhengBaFuBenData copyData)
 {
     return(ZhanDuiZhengBa_K.ZhengBaKuaFuLogin(_sender_, zhanDuiID, gameId, srcServerID, out copyData));
 }
Exemple #4
0
        private static bool CreateGameFuBen(DateTime now, ZhanDuiZhengBaMatchConfig matchConfig, ZhanDuiZhengBa_K.JoinRolePkData joinRole1, ZhanDuiZhengBa_K.JoinRolePkData joinRole2)
        {
            bool result;

            if (joinRole1.CurrGameID > 0)
            {
                result = true;
            }
            else
            {
                int betterZhanDuiID = (joinRole1.Rank < joinRole2.Rank) ? joinRole1.ZhanDuiID : joinRole2.ZhanDuiID;
                int toServerId      = 0;
                int gameId          = TianTiPersistence.Instance.GetNextGameId();
                if (ClientAgentManager.Instance().AssginKfFuben(ZhanDuiZhengBa_K.GameType, (long)gameId, 10, out toServerId))
                {
                    ZhanDuiZhengBaFuBenData copyData = new ZhanDuiZhengBaFuBenData();
                    copyData.GameID = (long)gameId;
                    copyData.SideDict[(long)joinRole1.ZhanDuiID] = 1;
                    copyData.SideDict[(long)joinRole2.ZhanDuiID] = 2;
                    copyData.BetterZhanDuiID = betterZhanDuiID;
                    copyData.ConfigID        = matchConfig.ID;
                    copyData.JoinGrade       = (int)matchConfig.JoinGrade;
                    copyData.NewGrade        = (int)matchConfig.WillUpGrade;
                    copyData.ServerID        = toServerId;
                    copyData.RoleDict.AddRange(TianTi5v5Service.GetZhanDuiMemberIDs(joinRole1.ZhanDuiID));
                    if (joinRole1.ZhanDuiID != joinRole2.ZhanDuiID)
                    {
                        copyData.RoleDict.AddRange(TianTi5v5Service.GetZhanDuiMemberIDs(joinRole2.ZhanDuiID));
                    }
                    joinRole1.ToServerID   = (joinRole2.ToServerID = toServerId);
                    joinRole1.CurrGameID   = (joinRole2.CurrGameID = gameId);
                    joinRole1.CopyData     = (joinRole2.CopyData = copyData);
                    joinRole1.WaitReqEnter = (joinRole2.WaitReqEnter = true);
                    ZhanDuiZhengBaNtfEnterData data = new ZhanDuiZhengBaNtfEnterData();
                    data.ZhanDuiID1 = joinRole1.ZhanDuiID;
                    data.ZhanDuiID2 = joinRole2.ZhanDuiID;
                    data.ToServerId = toServerId;
                    data.GameId     = gameId;
                    data.Day        = ZhanDuiZhengBa_K.SyncData.RealActID;
                    ZhanDuiZhengBa_K.AsyncEvQ.Enqueue(KFCallMsg.New <ZhanDuiZhengBaNtfEnterData>(KuaFuEventTypes.ZhanDuiZhengBa_NotifyEnter, data));
                    LogManager.WriteLog(LogTypes.Info, string.Format("战队争霸第{0}轮战队成员通知入场,zhanduiID1={1},zhanduiID2={2}", ZhanDuiZhengBa_K.SyncData.RealActID, joinRole1.ZhanDuiID, joinRole2.ZhanDuiID), null, true);
                    ZhanDuiZhengBaPkLogData log = new ZhanDuiZhengBaPkLogData();
                    log.Month           = ZhanDuiZhengBa_K.SyncData.Month;
                    log.ID              = ZhanDuiZhengBa_K.SyncData.RealActID;
                    log.ZhanDuiID1      = joinRole1.ZhanDuiID;
                    log.ZoneID1         = joinRole1.ZoneId;
                    log.ZhanDuiName1    = joinRole1.RoleName;
                    log.ZhanDuiID2      = joinRole2.ZhanDuiID;
                    log.ZoneID2         = joinRole2.ZoneId;
                    log.ZhanDuiName2    = joinRole2.RoleName;
                    log.StartTime       = now;
                    log.BetterZhanDuiID = betterZhanDuiID;
                    log.GameID          = (long)gameId;
                    ZhanDuiZhengBa_K.ThisLoopPkLogs[gameId] = log;
                    result = true;
                }
                else
                {
                    LogManager.WriteLog(LogTypes.Error, string.Format("战队争霸第{0}轮分配游戏服务器失败,zhanduiID1={1},zhanduiID2={2}", ZhanDuiZhengBa_K.SyncData.RealActID, joinRole1.ZhanDuiID, joinRole2.ZhanDuiID), null, true);
                    result = false;
                }
            }
            return(result);
        }