12 const int SCHEDULER_PLAYERS_PER_TICK = 5;
19 private float m_ArtyBarrageTimer = 0;
22 protected bool m_PlayArty =
false;
23 protected float m_ArtyDelay = 0;
24 protected int m_MinSimultaneousStrikes = 0;
25 protected int m_MaxSimultaneousStrikes = 0;
30 "-500.00 165.00 5231.69",
31 "-500.00 300.00 9934.41",
32 "10406.86 192.00 15860.00",
33 "4811.75 370.00 15860.00",
34 "-500.00 453.00 15860.00"
39 "7440.00 417.00 -500.00",
40 "-500.00 276.00 5473.00",
41 "-500.00 265.00 9852.00",
42 "4953.00 240.00 13300.00",
43 "9620.00 188.00 13300.00",
44 "13300.00 204.00 10322.00",
45 "13300.00 288.00 6204.00",
46 "13300.00 296.00 -500.00"
86 super.OnMissionStart();
94 UpdateDummyScheduler();
97 m_WorldData.UpdateBaseEnvTemperature(
timeslice);
108 GetGame().SetDebugMonitorEnabled(
GetGame().ServerConfigGetInt(
"enableDebugMonitor"));
110 InitialiseWorldData();
120 if (m_ArtyBarrageTimer > m_ArtyDelay)
123 m_MaxSimultaneousStrikes =
Math.
Clamp(m_MaxSimultaneousStrikes, 1, m_FiringPos.Count());
124 m_MinSimultaneousStrikes =
Math.
Clamp(m_MinSimultaneousStrikes, 1, m_MaxSimultaneousStrikes);
131 if (m_MaxSimultaneousStrikes == 1)
172 m_ArtyBarrageTimer = 0.0;
186 return (m_LogoutPlayers && m_LogoutPlayers.Contains(
PlayerBase.Cast(
player))) || (m_NewLogoutPlayers && m_NewLogoutPlayers.Contains(
PlayerBase.Cast(
player)));
214 m_NewLogoutPlayers.Remove(
player);
220 for (
int i = 0;
i < m_LogoutPlayers.Count();)
231 m_LogoutPlayers.Remove(
player);
234 m_LogoutPlayers.RemoveElement(
i);
268 Debug.
Log(
"ClientNewEvent: Player is empty");
287 Debug.
Log(
"ClientReadyEvent: Player is empty");
306 Debug.
Log(
"ClientRespawnEvent: Player is empty");
321 Debug.
Log(
"ClientReconnectEvent: Player is empty");
339 Debug.
Log(
"ClientDisconnectenEvent: Player is empty");
356 Print(
"[Logout]: Player " +
identity.GetId() +
" cancelled");
359 Print(
"[Logout]: Player cancelled");
360 m_LogoutPlayers.Remove(
player);
361 m_NewLogoutPlayers.Remove(
player);
391 pos =
"1189.3 0.0 5392.48";
406 Error(
"Error! Player was not initialized at the right time. Thus cannot send RPC command to enable or disable personal light!");
424 return GetGame().GetMenuDefaultCharacterData(
false).DeserializeCharacterData(
ctx);
482 if (
GetGame().ListAvailableCharacters().Find(
GetGame().GetMenuDefaultCharacterData().GetCharacterType()) > -1)
502 ErrorEx(
"Failed to create character from type: " +
presetCharType +
", using default spawning method");
505 ErrorEx(
"Failed to load PlayerSpawnPreset data properly, using default spawning method");
511 GetGame().GetMenuDefaultCharacterData().GenerateRandomEquip();
535 player.SetHealth(
"",
"", 0.0);
561 if (!m_LogoutPlayers.Contains(
player) && !m_NewLogoutPlayers.Contains(
player))
566 player.StatSyncToClient();
591 Print(
"[Logout]: New player " +
identity.GetId() +
" with instant logout");
605 Print(
"[Logout]: Skipping player " +
uid +
", already removed");
615 Print(
"[Logout]: Player " +
uid +
" finished");
627 player.ReleaseNetworkControls();
640 switch (
player.GetKickOffReason())
664 player.SetHealth(
"",
"", 0.0);
675 GetGame().GetWorld().GetPlayerList(m_Players);
696 return m_DeadPlayersArray.Insert(
corpse_data) >= 0;
701 if (m_DeadPlayersArray.Count() == 0)
707 for (
int i = 0;
i < m_DeadPlayersArray.Count();
i++)
731 rpc.Write(m_RespawnMode);
proto native Hive GetHive()
PluginBase GetPlugin(typename plugin_type)
const string STAT_PLAYTIME
const string STAT_DISTANCE
static bool GetDisableRespawnDialog()
static void SyncDataSendEx(notnull PlayerIdentity identity)
Super root of all classes in Enforce script.
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
static void CreateZones()
void RandomArtillery(float deltaTime)
ref array< vector > m_FiringPos
void EquipCharacter(MenuDefaultCharacterData char_data)
Spawns character equip from received data. Checks validity against config, randomizes if invalid valu...
override void OnUpdate(float timeslice)
PluginAdditionalInfo m_moduleDefaultCharacter
ref array< Man > m_Players
void AddNewPlayerLogout(PlayerBase player, notnull LogoutInfo info)
void SyncGlobalLighting(PlayerBase player)
override bool InsertCorpse(Man player)
void UpdateCorpseStatesServer()
override RainProcurementHandler GetRainProcurementHandler()
override void OnGameplayDataHandlerLoad()
void HandleBody(PlayerBase player)
void TickScheduler(float timeslice)
override void OnEvent(EventType eventTypeId, Param params)
void UpdatePlayersStats()
bool ProcessLoginData(ParamsReadContext ctx)
returns whether received data is valid, ctx can be filled on client in StoreLoginData()
ref RainProcurementHandler m_RainProcHandler
void InvokeOnConnect(PlayerBase player, PlayerIdentity identity)
PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
void PlayerDisconnected(PlayerBase player, PlayerIdentity identity, string uid)
bool ShouldPlayerBeKilled(PlayerBase player)
void InvokeOnDisconnect(PlayerBase player)
void ControlPersonalLight(PlayerBase player)
bool VerifyAttachmentType(int slot_ID, string attachment_type)
ref map< PlayerBase, ref LogoutInfo > m_NewLogoutPlayers
void StartingEquipSetup(PlayerBase player, bool clothesChosen)
can be overriden to manually set up starting equip. 'clothesChosen' is legacy parameter,...
void OnClientReadyEvent(PlayerIdentity identity, PlayerBase player)
void OnClientPrepareEvent(PlayerIdentity identity, out bool useDB, out vector pos, out float yaw, out int preloadTimeout)
override void SyncRespawnModeInfo(PlayerIdentity identity)
void OnClientDisconnectedEvent(PlayerIdentity identity, PlayerBase player, int logoutTime, bool authFailed)
ref map< PlayerBase, ref LogoutInfo > m_LogoutPlayers
void UpdateLogoutPlayers()
override void OnMissionStart()
void OnClientReconnectEvent(PlayerIdentity identity, PlayerBase player)
PlayerBase OnClientNewEvent(PlayerIdentity identity, vector pos, ParamsReadContext ctx)
void OnClientRespawnEvent(PlayerIdentity identity, PlayerBase player)
ref array< ref CorpseData > m_DeadPlayersArray
override bool IsPlayerDisconnecting(Man player)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
The class that will be instanced (moddable)
static bool IsInitialized()
static bool ProcessEquipmentData(PlayerBase player, PlayerSpawnPreset data)
equips character with the chosen preset
static PlayerSpawnPreset GetRandomCharacterPreset()
Serialization general interface. Serializer API works with:
static void SendPlayerList()
static void SyncDataSend(PlayerIdentity identity)
static void SpawnAllTriggerCarriers()
const EventType LogoutCancelEventTypeID
params: LogoutCancelEventParams
const EventType ClientNewEventTypeID
params: ClientNewEventParams
const EventType ClientReconnectEventTypeID
params: ClientReconnectEventParams
const EventType ClientRespawnEventTypeID
params: ClientRespawnEventParams
const EventType ClientDisconnectedEventTypeID
params: ClientDisconnectedEventParams
proto native CGame GetGame()
const EventType ClientReadyEventTypeID
params: ClientReadyEventParams
const EventType ClientPrepareEventTypeID
params: ClientPrepareEventParams
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
const int RESPAWN_MODE_CUSTOM
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Min(float x, float y)
Returns smaller of two given values.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Param2< int, string > LogoutInfo
int time of the logout end