Exemple #1
0
        /// <summary>
        /// 添加一个场景
        /// </summary>
        public bool AddCopyScene(GameClient client, CopyMap copyMap)
        {
            if (copyMap.MapCode == _runtimeData.MapID)
            {
                int fuBenSeqId = copyMap.FuBenSeqID;
                int mapCode    = copyMap.MapCode;
                lock (_mutex)
                {
                    CopyWolfSceneInfo newScene = null;
                    if (!_runtimeData.SceneDict.TryGetValue(fuBenSeqId, out newScene))
                    {
                        newScene             = new CopyWolfSceneInfo();
                        newScene.CopyMapInfo = copyMap;
                        newScene.CleanAllInfo();
                        newScene.GameId      = Global.GetClientKuaFuServerLoginData(client).GameId;
                        newScene.MapID       = mapCode;
                        newScene.CopyID      = copyMap.CopyMapID;
                        newScene.FuBenSeqId  = fuBenSeqId;
                        newScene.PlayerCount = 1;

                        _runtimeData.SceneDict[fuBenSeqId] = newScene;
                    }
                    else
                    {
                        newScene.PlayerCount++;
                    }

                    client.ClientData.BattleWhichSide = _runtimeData.CampID;
                    copyMap.IsKuaFuCopy = true;
                    copyMap.SetRemoveTicks(TimeUtil.NOW() + _runtimeData.TotalSecs * TimeUtil.SECOND);
                    GameManager.ClientMgr.BroadSpecialCopyMapMessage((int)TCPGameServerCmds.CMD_SPR_COPY_WOLF_SCORE_INFO, newScene.ScoreData, newScene.CopyMapInfo);
                }

                //更新状态
                // ElementWarClient.getInstance().GameFuBenRoleChangeState(client.ClientData.RoleID, (int)KuaFuRoleStates.StartGame);
                // 开始游戏统计
                GlobalNew.UpdateKuaFuRoleDayLogData(client.ServerId, client.ClientData.RoleID, TimeUtil.NowDateTime(), client.ClientData.ZoneID, 0, 1, 0, 0, (int)_gameType);

                return(true);
            }

            return(false);
        }
        public bool AddCopyScene(GameClient client, CopyMap copyMap)
        {
            bool result;

            if (copyMap.MapCode == this._runtimeData.MapID)
            {
                int fuBenSeqId = copyMap.FuBenSeqID;
                int mapCode    = copyMap.MapCode;
                lock (CopyWolfManager._mutex)
                {
                    CopyWolfSceneInfo newScene = null;
                    if (!this._runtimeData.SceneDict.TryGetValue(fuBenSeqId, out newScene))
                    {
                        newScene             = new CopyWolfSceneInfo();
                        newScene.CopyMapInfo = copyMap;
                        newScene.CleanAllInfo();
                        newScene.GameId      = Global.GetClientKuaFuServerLoginData(client).GameId;
                        newScene.MapID       = mapCode;
                        newScene.CopyID      = copyMap.CopyMapID;
                        newScene.FuBenSeqId  = fuBenSeqId;
                        newScene.PlayerCount = 1;
                        this._runtimeData.SceneDict[fuBenSeqId] = newScene;
                    }
                    else
                    {
                        newScene.PlayerCount++;
                    }
                    client.ClientData.BattleWhichSide = this._runtimeData.CampID;
                    copyMap.IsKuaFuCopy = true;
                    copyMap.SetRemoveTicks(TimeUtil.NOW() + (long)(this._runtimeData.TotalSecs * 1000));
                    GameManager.ClientMgr.BroadSpecialCopyMapMessage <CopyWolfScoreData>(1025, newScene.ScoreData, newScene.CopyMapInfo);
                }
                GlobalNew.UpdateKuaFuRoleDayLogData(client.ServerId, client.ClientData.RoleID, TimeUtil.NowDateTime(), client.ClientData.ZoneID, 0, 1, 0, 0, 11);
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }