EventConfig = EventConfig or {} --- Action Tick的频率 EventConfig.TickFrequency = 24. EventEnum = { -- DefaultEvent DSStartUp = 1001; -- 服务器启动 PlayerLogin = 1003; -- 玩家加入房间 PlayerKey PlayerExit = 1004; -- 玩家离开房间 PlayerKey -- GameState GameStateChange = 2001; -- 游戏模式改变 CustomEnum.EGameState WaitPlayerJoin = 2002; -- 等待玩家加入 GamePlay = 2003; -- 游戏开始 GameEnd = 2004; -- 游戏结束 RoundBegin = 2005; -- 回合开始 RoundEnd = 2006; -- 回合结束 RoundReadyFinish = 2007; -- 回合准备阶段结束 -- PlayerEvent PlayerDeathInfo = 3001; -- 死亡信息 VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue uint, uint, int, int, bool, float, float PlayerInjuryInfo = 3002; -- 受伤信息 VictimKey, CauserKey, WeaponID, DamageType, IsHeadShotDamage, Distance, DamageValue uint, uint, int, int, bool, float, float PlayerPossessed = 3003; -- 玩家受控 PlayerKey PlayerBeginPlay = 3004; -- 玩家受控 PlayerPawn -- PlayerPawn同步参数更新 更新传入Pawn及其同步变量值 UpdateCanObtainIncreaseCount = 4001; UpdateNowCanSelectIncrease = 4002; UpdateOwnedIncrease = 4003; UpdateToGodSchedule = 4004; -- PlayerEvent End UpdatePlayerStartList = 5001, -- 通知出生点控制器进行更新出生点指针 AchievementSettlement = 5002, -- 成就事件游戏结算 UpdateTeamScore = 5003, -- 队伍得分信息更新 UpdatePlayerScoreData = 5004, -- 玩家得分信息更新 通过UGCGameSystem.GameState.PlayerScoreDatas 获取玩家得分信息 AddTip = 5005, -- 添加提提示 TipStr TipType GameWillBegin = 5006, -- 游戏即将开始 PlayerIsAliveIsChange = 5007, -- 玩家存活列表改变 -- 地图选择 LoadMap = 6001, -- 关卡加载 MapConifg.MapType SelectMapCallBack = 6002, -- 地图选择服务器的回调 bSucceed, MapType SelectDefaultWeaponCallBack = 6003, -- 默认武器选择回调 bSucceed, WeaponID RandomSelectVoteMap = 6004, UpdateMapKey = 6005, -- 随机出的地图索引 MapKey -- 武器选择 PlayerWeaponCombinationUpdate = 7001, -- 玩家可选的武器配置列表更新 [PlayerKey] = CombinationType PlayerSelectedWeaponIndexUpdate = 7002, -- 玩家选择的武器配置索引更新 [PlayerKey] = Index -- 工程事件,根据工程的不同而修改删除 --PlayerEnterLineOfDefense = 10001; -- 玩家突破防线 PlayerKey --UpdateAttackers = 10002; -- 进攻方玩家更新 Attackers {PlayerKey, ... } --UpdateTeamBreakThroughTime = 10003; -- 队伍突围成功的时间 --UpdateCanBreakThrough = 10004; -- 更新是否可突围 bCanBreakThrough OverlapCheckPoint = 10005; -- 玩家进入检查点 PlayerKey } --- 模式编辑器的默认事件映射 EventConfig.GameModeEditEventMap = { ["DSStartUp"] = EventEnum.DSStartUp, ["PlayerLogin"] = EventEnum.PlayerLogin, ["PlayerExit"] = EventEnum.PlayerExit, } --- 事件包含的的参数名 EventConfig.EventParam = { --[[ Template [EventEnum.] = {"PlayerKey",}, ]] [EventEnum.DSStartUp] = {}, [EventEnum.PlayerLogin] = {"PlayerPawn", "PlayerKey"}, [EventEnum.PlayerExit] = {"PlayerPawn", "PlayerKey"}, [EventEnum.GameStateChange] = {"GameState"}, [EventEnum.WaitPlayerJoin] = {}, [EventEnum.GamePlay] = {}, [EventEnum.GameEnd] = {}, [EventEnum.RoundBegin] = {}, [EventEnum.RoundEnd] = {}, [EventEnum.PlayerDeathInfo] = {"VictimKey", "CauserKey", "WeaponID", "DamageType", "IsHeadShotDamage", "Distance", "DamageValue"}, [EventEnum.PlayerInjuryInfo] = {"VictimKey", "CauserKey", "WeaponID", "DamageType", "IsHeadShotDamage", "Distance", "DamageValue"}, [EventEnum.PlayerPossessed] = {"PlayerKey",}, } EventConfig.ActionType = { ---Player PlayerLogin = 1001, PlayerExit = 1002, PlayerDeadUpdateInfo = 1003, PlayerRespawn = 1004, PlayerAddEnergy = 1005, PlayerPossessed = 1006, EnableInfBullets = 1007, ---GameState WaitPlayerJoin = 2001, GamePlay = 2002, GameEnd = 2003, RoundBegin = 2004, RoundEnd = 2005, CountdownMode = 2101, -- 倒计时模式 TargetTeamScoringMode = 2102, -- 队伍目标得分模式 RespiratoryRegurgitation= 3001, -- 呼吸回血 TestPlaceMap = 10001, } --- Action 配置游戏模式的默认参数,该参数会被传入参数可被覆盖(传入参数有效才会覆盖),不填则使用Action中的默认参数或被传入参数覆盖 EventConfig.ActionInfo = { -- Player [EventConfig.ActionType.PlayerLogin] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerLogin", ActionParam = { PlayerKey = -1, }, }, [EventConfig.ActionType.PlayerExit] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerExit", ActionParam = { PlayerKey = -1, -- 玩家不足以支持游戏时触发的游戏结束事件 EndEvent = EventEnum.GameEnd, }, }, [EventConfig.ActionType.PlayerRespawn] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerRespawn", ActionParam = { PlayerKey = -1, -- 复活等待的时间 DelayTime = GlobalConfigs.GameSetting.RespawnTime, }, }, [EventConfig.ActionType.PlayerDeadUpdateInfo] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerDeadUpdateInfo", ActionParam = { DeadPlayerKey = -1, KillerPlayerKey = -1, WeaponID = -1, }, }, [EventConfig.ActionType.PlayerPossessed] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_PlayerPossessed", ActionParam = { }, }, [EventConfig.ActionType.EnableInfBullets] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_EnableInfBullets", ActionParam = { }, }, -- GameState [EventConfig.ActionType.WaitPlayerJoin] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_WaitingPlayer", ActionParam = { -- 等待玩家加入的时长 WaitTime = GlobalConfigs.GameSetting.WaitTime, -- 等待结束触发的事件 WaitFinishEvent = EventEnum.GamePlay, -- 等待结束玩家不足时触发的事件 WaitFailureEvent = EventEnum.GameEnd, -- 至少等待时长 AtLeastWaitingTime = 5, -- 游戏即将开始提示的时间 GameWillBeginWaitTime = 5, }, }, [EventConfig.ActionType.GamePlay] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_Play", ActionParam = { -- 游戏游玩时长 GameTime = GlobalConfigs.GameSetting.GameTime, -- 游戏结束事件 GameEndEvent = EventEnum.GameEnd, }, }, [EventConfig.ActionType.GameEnd] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_GameEnd", ActionParam = { -- 延迟关闭DS时间 DelayOffDS = 30.; }, }, [EventConfig.ActionType.RoundBegin] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_RoundBegin", ActionParam = { GameTime = GlobalConfigs.GameSetting.RoundTime; PreparationTime = GlobalConfigs.GameSetting.RoundReadyTime; GameEndEvent = EventEnum.RoundEnd; }, }, [EventConfig.ActionType.RoundEnd] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_RoundEnd", ActionParam = { GameTime = 8; GameEndEvent = EventEnum.GameEnd; NewRoundEvent = EventEnum.RoundBegin; }, }, [EventConfig.ActionType.CountdownMode] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_CountdownMode", ActionParam = { -- 游戏游玩时长 GameTime = GlobalConfigs.GameSetting.GameTime, GameEndEvent = EventEnum.GameEnd; }, }, [EventConfig.ActionType.TargetTeamScoringMode] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_TargetTeamScoringMode", ActionParam = { -- 游戏游玩时长 GameTime = GlobalConfigs.GameSetting.GameTime, GameEndEvent = EventEnum.GameEnd; }, }, [EventConfig.ActionType.RespiratoryRegurgitation] = { ActionPath = "Script.Global.EventManager.EventAction.EventAction_RespiratoryRegurgitation", ActionParam = { }, }, } --- 事件绑定Action 参数映射 [EventParamName] = "ActionParamName" EventConfig.EventAttach = { [EventEnum.DSStartUp] = { [EventConfig.ActionType.WaitPlayerJoin] = {}, [EventConfig.ActionType.EnableInfBullets] = {}, -- [EventConfig.ActionType.RespiratoryRegurgitation] = {}, }, [EventEnum.GamePlay] = { -- [EventConfig.ActionType.CountdownMode] = {}, [EventConfig.ActionType.CountdownMode] = {}, }, [EventEnum.GameEnd] = { [EventConfig.ActionType.GameEnd] = {}, }, [EventEnum.PlayerLogin] = { [EventConfig.ActionType.PlayerLogin] = { ["PlayerKey"] = "PlayerKey" } }, [EventEnum.PlayerExit] = { [EventConfig.ActionType.PlayerExit] = { ["PlayerKey"] = "PlayerKey" } }, [EventEnum.PlayerDeathInfo] = { [EventConfig.ActionType.PlayerRespawn] = { ["VictimKey"] = "PlayerKey" }, [EventConfig.ActionType.PlayerDeadUpdateInfo] = { ["VictimKey"] = "DeadPlayerKey", ["CauserKey"] = "KillerPlayerKey", ["WeaponID"] = "WeaponID", } }, [EventEnum.PlayerPossessed] = { [EventConfig.ActionType.PlayerPossessed] = { ["PlayerKey"] = "PlayerKey" } }, [EventEnum.RoundBegin] = { [EventConfig.ActionType.RoundBegin] = {}; }, [EventEnum.RoundEnd] = { [EventConfig.ActionType.RoundEnd] = {}; }, } function EventConfig.CheckEventAttach(EventType) return ( EventConfig.EventParam[EventType] ~= nil and table.getCount(EventConfig.EventAttach[EventType]) > 0 ) end