33 "-500.00 165.00 5231.69",
34 "-500.00 300.00 9934.41",
35 "10406.86 192.00 15860.00",
36 "4811.75 370.00 15860.00",
37 "-500.00 453.00 15860.00"
43 "7440.00 417.00 -500.00",
44 "-500.00 276.00 5473.00",
45 "-500.00 265.00 9852.00",
46 "4953.00 240.00 13300.00",
47 "9620.00 188.00 13300.00",
48 "13300.00 204.00 10322.00",
49 "13300.00 288.00 6204.00",
50 "13300.00 296.00 -500.00"
101 super.OnMissionStart();
112 if (GetTimeStamp() == 0)
115 g_Game.GetUIManager().ShowUICursor(
false);
120 UpdateDummyScheduler();
123 m_WorldData.UpdateBaseEnvTemperature(timeslice);
129 super.OnUpdate(timeslice);
139 for (i = 0; i < 5; i++)
146 for (i = 0; i < 6; i++)
164 g_Game.SetDebugMonitorEnabled(
g_Game.ServerConfigGetInt(
"enableDebugMonitor"));
166 InitialiseWorldData();
194 g_Game.RPC(null,
ERPCs.RPC_SOUND_ARTILLERY, params,
true);
207 for (
int i = 0; i < randFireNb; i++)
211 if (usedIndices.Count() <= 0 || usedIndices.Find(randPos) < 0)
219 g_Game.RPC(null,
ERPCs.RPC_SOUND_ARTILLERY, params,
true);
222 usedIndices.Insert(randPos);
250 g_Game.GetPlayers(players);
252 foreach (Man man : players)
260 moduleLifespan.UpdateLifespan(player);
283 if (
g_Game.GetTime() >= info.param1)
289 identity = player.GetIdentity();
323 OnClientPrepareEvent(clientPrepareParams.param1, clientPrepareParams.param2, clientPrepareParams.param3, clientPrepareParams.param4, clientPrepareParams.param5);
329 player =
OnClientNewEvent(newParams.param1, newParams.param2, newParams.param3);
332 Debug.
Log(
"ClientNewEvent: Player is empty");
335 identity = newParams.param1;
348 identity = readyParams.param1;
352 Debug.
Log(
"ClientReadyEvent: Player is empty");
369 identity = respawnParams.param1;
373 Debug.
Log(
"ClientRespawnEvent: Player is empty");
384 identity = reconnectParams.param1;
388 Debug.
Log(
"ClientReconnectEvent: Player is empty");
399 identity = discoParams.param1;
401 int logoutTime = discoParams.param3;
402 bool authFailed = discoParams.param4;
406 Debug.
Log(
"ClientDisconnectenEvent: Player is empty");
418 identity = player.GetIdentity();
423 Print(
"[Logout]: Player " + identity.
GetId() +
" cancelled");
427 Print(
"[Logout]: Player cancelled");
446 player.OnDisconnect();
460 pos =
"1189.3 0.0 5392.48";
470 bool is_personal_light = !
g_Game.ServerConfigGetInt(
"disablePersonalLight");
471 Param1<bool> personal_light_toggle =
new Param1<bool>(is_personal_light);
472 g_Game.RPCSingleParam(player,
ERPCs.RPC_TOGGLE_PERSONAL_LIGHT, personal_light_toggle,
true, player.GetIdentity());
476 Error(
"Error! Player was not initialized at the right time. Thus cannot send RPC command to enable or disable personal light!");
485 int lightingID =
g_Game.ServerConfigGetInt(
"lightingConfig");
486 Param1<int> lightID =
new Param1<int>(lightingID);
487 g_Game.RPCSingleParam(player,
ERPCs.RPC_SEND_LIGHTING_SETUP, lightID,
true, player.GetIdentity());
495 return g_Game.GetMenuDefaultCharacterData(
false).DeserializeCharacterData(ctx);
502 playerEnt =
g_Game.CreatePlayer(identity, characterName, pos, 0,
"NONE");
514 string attachment_type;
515 for (
int i = 0; i < DefaultCharacterCreationMethods.GetAttachmentSlotsArray().
Count(); i++)
517 slot_ID = DefaultCharacterCreationMethods.GetAttachmentSlotsArray().Get(i);
518 attachment_type =
"";
522 if (DefaultCharacterCreationMethods.GetConfigArrayCountFromSlotID(slot_ID) > 0)
524 attachment_type = DefaultCharacterCreationMethods.GetConfigAttachmentTypes(slot_ID).GetRandomElement();
530 if (attachment_type !=
"")
532 m_player.GetInventory().CreateAttachmentEx(attachment_type,slot_ID);
546 return DefaultCharacterCreationMethods.GetConfigAttachmentTypes(slot_ID).Find(attachment_type) > -1;
551 string characterType =
g_Game.CreateRandomPlayer();
552 bool generateRandomEquip =
false;
557 if (
g_Game.ListAvailableCharacters().Find(
g_Game.GetMenuDefaultCharacterData().GetCharacterType()) > -1)
558 characterType =
g_Game.GetMenuDefaultCharacterData().GetCharacterType();
562 generateRandomEquip =
true;
568 if (presetData && presetData.
IsValid())
571 if (presetCharType ==
string.
Empty)
572 presetCharType = characterType;
580 ErrorEx(
"Failed to create character from type: " + presetCharType +
", using default spawning method");
585 ErrorEx(
"Failed to load PlayerSpawnPreset data properly, using default spawning method");
591 if (generateRandomEquip)
592 g_Game.GetMenuDefaultCharacterData().GenerateRandomEquip();
601 g_Game.SelectPlayer(identity, player);
603 #ifdef DIAG_DEVELOPER
604 if (FeatureTimeAccel.m_CurrentTimeAccel)
606 g_Game.RPCSingleParam(player,
ERPCs.DIAG_TIMEACCEL_CLIENT_SYNC, FeatureTimeAccel.m_CurrentTimeAccel,
true, identity);
615 if (player.IsUnconscious() || player.IsRestrained())
617 PluginAdminLog adm = PluginAdminLog.Cast(
GetPlugin(PluginAdminLog));
618 adm.PlayerKilledByRespawn(player);
621 player.SetHealth(
"",
"", 0.0);
625 #ifdef DIAG_DEVELOPER
626 if (FeatureTimeAccel.m_CurrentTimeAccel)
628 g_Game.RPCSingleParam(player,
ERPCs.DIAG_TIMEACCEL_CLIENT_SYNC, FeatureTimeAccel.m_CurrentTimeAccel,
true, identity);
637 player.OnReconnect();
643 bool disconnectNow =
true;
649 if (player.IsAlive())
653 Print(
"[Logout]: New player " + identity.
GetId() +
" with logout time " + logoutTime.
ToString());
656 player.StatSyncToClient();
659 g_Game.SendLogoutTime(player, logoutTime);
673 disconnectNow =
false;
681 Print(
"[Logout]: New player " + identity.
GetId() +
" with instant logout");
684 g_Game.SendLogoutTime(player, 0);
695 Print(
"[Logout]: Skipping player " + uid +
", already removed");
705 Print(
"[Logout]: Player " + uid +
" finished");
717 player.ReleaseNetworkControls();
721 g_Game.DisconnectPlayer(identity, uid);
728 if (player.IsUnconscious() || player.IsRestrained())
730 switch (player.GetKickOffReason())
750 if (player.IsAlive())
754 PluginAdminLog adm = PluginAdminLog.Cast(
GetPlugin(PluginAdminLog));
755 adm.PlayerKilledByDisconnect(player);
757 player.SetHealth(
"",
"", 0.0);
772 for (
int i = 0; i < tick_count_max; ++i)
781 currentPlayer.OnTick();
796 if (nDeadPlayers == 0)
798 int current_time =
g_Game.GetTime();
802 for (
int i = 0; i < nDeadPlayers; ++i)
805 if (!corpse_data || (corpse_data && (!corpse_data.
m_Player || !corpse_data.
m_bUpdate)))
807 invalid_corpses.Insert(i);
817 int nInvalidCorpses = invalid_corpses.Count();
818 if (nInvalidCorpses > 0)
820 for (i = nInvalidCorpses - 1; i >= 0; --i)
832 rpc.
Send(null,
ERPCs.RPC_SERVER_RESPAWN_MODE,
true, identity);
842 return m_ActiveRefresherLocations;
849 super.RemoveActiveInputExcludes(excludes,bForceSupress);
851 if (excludes.Count() != 0)
853 bool changed =
false;
857 foreach (
string excl : excludes)
885 case EInputRestrictors.INVENTORY:
890 case EInputRestrictors.MAP:
895 case EInputRestrictors.SURRENDER_TRANSITION:
912 super.AddActiveInputExcludes(excludes);
914 if (excludes.Count() != 0)
916 bool changed =
false;
922 foreach (
string excl : excludes)
949 case EInputRestrictors.INVENTORY:
955 ItemBase item = player.GetItemInHands();
956 if (item && item.IsWeapon())
957 player.RequestResetADSSync();
961 case EInputRestrictors.MAP:
966 case EInputRestrictors.SURRENDER_TRANSITION:
1012 for (
int i = 0; i < count; i++)
1030 bool active =
false;
proto native Hive GetHive()
PluginBase GetPlugin(typename plugin_type)
const string STAT_PLAYTIME
const string STAT_DISTANCE
static BunkerBroadcastHandler GetInstance()
static void SyncDataSend(PlayerIdentity identity)
static bool GetDisableRespawnDialog()
static void SyncDataSendEx(notnull PlayerIdentity identity)
static void SyncDataSend(notnull PlayerIdentity identity)
Super root of all classes in Enforce script.
void UpdateCorpseState(bool force_check=false)
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()
proto native void CharacterExit(Man player)
override void EnableAllInputs(bool bForceSupress=false)
Removes all active input excludes and restrictions.
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 AddActiveInputExcludes(array< string > excludes)
Adds one or more exclude groups to disable and refreshes excludes.
int m_ControlDisabledMode
override void OnUpdate(float timeslice)
override void RemoveActiveInputExcludes(array< string > excludes, bool bForceSupress=false)
Removes one or more exclude groups and refreshes excludes.
int m_MaxSimultaneousStrikes
PluginAdditionalInfo m_moduleDefaultCharacter
DEPRECATED.
ref array< Man > m_Players
void AddNewPlayerLogout(PlayerBase player, notnull LogoutInfo info)
void SyncGlobalLighting(PlayerBase player)
override bool IsInputExcludeActive(string exclude)
Returns true if the particular input exclude group had been activated via script and is active.
ref array< string > m_ActiveInputExcludeGroups
override bool InsertCorpse(Man player)
override bool IsControlDisabled()
returns if ANY exclude groups, restriction (or deprecated disable, if applicable) is active
void UpdateCorpseStatesServer()
override RainProcurementHandler GetRainProcurementHandler()
override void OnGameplayDataHandlerLoad()
void HandleBody(PlayerBase player)
const int SCHEDULER_PLAYERS_PER_TICK
void TickScheduler(float timeslice)
const ref array< vector > CHERNARUS_STRIKE_POS
override bool IsInputRestrictionActive(int restriction)
Returns true if the particular 'restriction' (those govern special behaviour outside regular input ex...
override void OnEvent(EventType eventTypeId, Param params)
BunkerBroadcastHandler m_BunkerBroadcastHandler
ref array< int > m_ActiveInputRestrictions
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)
override void RefreshExcludes()
queues refresh of input excludes
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)
override void AddActiveInputRestriction(int restrictor)
Adds one input restriction (specific behaviour oudside regular excludes, defined below)
ref map< PlayerBase, ref LogoutInfo > m_NewLogoutPlayers
const ref array< vector > LIVONIA_STRIKE_POS
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()
bool m_ProcessInputExcludes
void PerformRefreshExcludes()
applies queued excludes (0 == clear excludes)
override void RemoveActiveInputRestriction(int restrictor)
Removes one restriction (specific behaviour oudside regular excludes, defined below)
override void OnMissionStart()
void OnClientReconnectEvent(PlayerIdentity identity, PlayerBase player)
PlayerBase OnClientNewEvent(PlayerIdentity identity, vector pos, ParamsReadContext ctx)
override array< vector > GetActiveRefresherLocations()
void OnClientRespawnEvent(PlayerIdentity identity, PlayerBase player)
ref array< ref CorpseData > m_DeadPlayersArray
int m_MinSimultaneousStrikes
override bool IsPlayerDisconnecting(Man player)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
proto string GetId()
unique id of player (hashed steamID, database Xbox id...) can be used in database or logs
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()
string GetRandomCharacterType()
proto native void Send(Object target, int rpc_type, bool guaranteed, PlayerIdentity recipient=NULL)
Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on ser...
proto bool Write(void value_out)
static void SendPlayerList()
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
static void SyncDataSend(PlayerIdentity identity)
static void SpawnAllTriggerCarriers()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
const EventType LogoutCancelEventTypeID
params: LogoutCancelEventParams
Param1< Man > LogoutCancelEventParams
Player.
const EventType ClientNewEventTypeID
params: ClientNewEventParams
Param5< PlayerIdentity, bool, vector, float, int > ClientPrepareEventParams
PlayerIdentity, useDB, pos, yaw, preloadTimeout (= additional time in seconds to how long server wait...
Serializer ParamsReadContext
Param2< PlayerIdentity, Man > ClientRespawnEventParams
PlayerIdentity, Man.
const EventType ClientReconnectEventTypeID
params: ClientReconnectEventParams
Param4< PlayerIdentity, Man, int, bool > ClientDisconnectedEventParams
PlayerIdentity, Man, LogoutTime, AuthFailed.
const EventType ClientRespawnEventTypeID
params: ClientRespawnEventParams
Param2< PlayerIdentity, Man > ClientReconnectEventParams
PlayerIdentity, Man.
Param2< PlayerIdentity, Man > ClientReadyEventParams
PlayerIdentity, Man.
Param3< PlayerIdentity, vector, Serializer > ClientNewEventParams
PlayerIdentity, PlayerPos, Top, Bottom, Shoe, Skin.
const EventType ClientDisconnectedEventTypeID
params: ClientDisconnectedEventParams
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 INPUT_EXCLUDE_ALL
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].
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
Param2< int, string > LogoutInfo
int time of the logout end