Пример #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)
                {
                    ElementWarScene newScene = null;
                    if (!_sceneDict.TryGetValue(fuBenSeqId, out newScene))
                    {
                        newScene             = new ElementWarScene();
                        newScene.CopyMapInfo = copyMap;
                        newScene.CleanAllInfo();
                        newScene.GameId      = Global.GetClientKuaFuServerLoginData(client).GameId;
                        newScene.MapID       = mapCode;
                        newScene.CopyID      = copyMap.CopyMapID;
                        newScene.FuBenSeqId  = fuBenSeqId;
                        newScene.PlayerCount = 1;

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

                    copyMap.IsKuaFuCopy = true;
                    copyMap.SetRemoveTicks(TimeUtil.NOW() + _runtimeData.TotalSecs * TimeUtil.SECOND);
                    GameManager.ClientMgr.BroadSpecialCopyMapMessage((int)TCPGameServerCmds.CMD_SPR_ELEMENT_WAR_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);
        }
Пример #2
0
        public bool AddCopyScene(GameClient client, CopyMap copyMap)
        {
            bool result;

            if (copyMap.MapCode == this._runtimeData.MapID)
            {
                int fuBenSeqId = copyMap.FuBenSeqID;
                int mapCode    = copyMap.MapCode;
                lock (ElementWarManager._mutex)
                {
                    ElementWarScene newScene = null;
                    if (!this._sceneDict.TryGetValue(fuBenSeqId, out newScene))
                    {
                        newScene             = new ElementWarScene();
                        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._sceneDict[fuBenSeqId] = newScene;
                    }
                    else
                    {
                        newScene.PlayerCount++;
                    }
                    copyMap.IsKuaFuCopy = true;
                    copyMap.SetRemoveTicks(TimeUtil.NOW() + (long)(this._runtimeData.TotalSecs * 1000));
                    GameManager.ClientMgr.BroadSpecialCopyMapMessage <ElementWarScoreData>(1014, newScene.ScoreData, newScene.CopyMapInfo);
                }
                GlobalNew.UpdateKuaFuRoleDayLogData(client.ServerId, client.ClientData.RoleID, TimeUtil.NowDateTime(), client.ClientData.ZoneID, 0, 1, 0, 0, 4);
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }