31 "-500.00 165.00 5231.69",
32 "-500.00 300.00 9934.41",
33 "10406.86 192.00 15860.00",
34 "4811.75 370.00 15860.00",
35 "-500.00 453.00 15860.00"
41 "7440.00 417.00 -500.00",
42 "-500.00 276.00 5473.00",
43 "-500.00 265.00 9852.00",
44 "4953.00 240.00 13300.00",
45 "9620.00 188.00 13300.00",
46 "13300.00 204.00 10322.00",
47 "13300.00 288.00 6204.00",
48 "13300.00 296.00 -500.00"
96 super.OnMissionStart();
106 if (GetTimeStamp() == 0)
109 g_Game.GetUIManager().ShowUICursor(
false);
114 UpdateDummyScheduler();
122 super.OnUpdate(timeslice);
132 for (i = 0; i < 5; i++)
139 for (i = 0; i < 6; i++)
157 g_Game.SetDebugMonitorEnabled(
g_Game.ServerConfigGetInt(
"enableDebugMonitor"));
159 InitialiseWorldData();
187 g_Game.RPC(null,
ERPCs.RPC_SOUND_ARTILLERY, params,
true);
200 for (
int i = 0; i < randFireNb; i++)
204 if (usedIndices.Count() <= 0 || usedIndices.Find(randPos) < 0)
212 g_Game.RPC(null,
ERPCs.RPC_SOUND_ARTILLERY, params,
true);
215 usedIndices.Insert(randPos);
243 g_Game.GetPlayers(players);
245 foreach (Man man : players)
253 moduleLifespan.UpdateLifespan(player);
273 if (
g_Game.GetTime() >= info.param1)
279 identity = player.GetIdentity();
313 OnClientPrepareEvent(clientPrepareParams.param1, clientPrepareParams.param2, clientPrepareParams.param3, clientPrepareParams.param4, clientPrepareParams.param5);
319 player =
OnClientNewEvent(newParams.param1, newParams.param2, newParams.param3);
322 Debug.
Log(
"ClientNewEvent: Player is empty");
325 identity = newParams.param1;
337 identity = readyParams.param1;
341 Debug.
Log(
"ClientReadyEvent: Player is empty");
356 identity = respawnParams.param1;
360 Debug.
Log(
"ClientRespawnEvent: Player is empty");
371 identity = reconnectParams.param1;
375 Debug.
Log(
"ClientReconnectEvent: Player is empty");
386 identity = discoParams.param1;
388 int logoutTime = discoParams.param3;
389 bool authFailed = discoParams.param4;
393 Debug.
Log(
"ClientDisconnectenEvent: Player is empty");
405 identity = player.GetIdentity();
410 Print(
"[Logout]: Player " + identity.
GetId() +
" cancelled");
414 Print(
"[Logout]: Player cancelled");
433 player.OnDisconnect();
447 pos =
"1189.3 0.0 5392.48";
457 bool is_personal_light = !
g_Game.ServerConfigGetInt(
"disablePersonalLight");
458 Param1<bool> personal_light_toggle =
new Param1<bool>(is_personal_light);
459 g_Game.RPCSingleParam(player,
ERPCs.RPC_TOGGLE_PERSONAL_LIGHT, personal_light_toggle,
true, player.GetIdentity());
463 Error(
"Error! Player was not initialized at the right time. Thus cannot send RPC command to enable or disable personal light!");
472 int lightingID =
g_Game.ServerConfigGetInt(
"lightingConfig");
473 Param1<int> lightID =
new Param1<int>(lightingID);
474 g_Game.RPCSingleParam(player,
ERPCs.RPC_SEND_LIGHTING_SETUP, lightID,
true, player.GetIdentity());
482 return g_Game.GetMenuDefaultCharacterData(
false).DeserializeCharacterData(ctx);
489 playerEnt =
g_Game.CreatePlayer(identity, characterName, pos, 0,
"NONE");
501 string attachment_type;
502 for (
int i = 0; i < DefaultCharacterCreationMethods.GetAttachmentSlotsArray().
Count(); i++)
504 slot_ID = DefaultCharacterCreationMethods.GetAttachmentSlotsArray().Get(i);
505 attachment_type =
"";
509 if (DefaultCharacterCreationMethods.GetConfigArrayCountFromSlotID(slot_ID) > 0)
511 attachment_type = DefaultCharacterCreationMethods.GetConfigAttachmentTypes(slot_ID).GetRandomElement();
517 if (attachment_type !=
"")
519 m_player.GetInventory().CreateAttachmentEx(attachment_type,slot_ID);
533 return DefaultCharacterCreationMethods.GetConfigAttachmentTypes(slot_ID).Find(attachment_type) > -1;
538 string characterType =
g_Game.CreateRandomPlayer();
539 bool generateRandomEquip =
false;
544 if (
g_Game.ListAvailableCharacters().Find(
g_Game.GetMenuDefaultCharacterData().GetCharacterType()) > -1)
545 characterType =
g_Game.GetMenuDefaultCharacterData().GetCharacterType();
549 generateRandomEquip =
true;
555 if (presetData && presetData.
IsValid())
558 if (presetCharType ==
string.
Empty)
559 presetCharType = characterType;
567 ErrorEx(
"Failed to create character from type: " + presetCharType +
", using default spawning method");
572 ErrorEx(
"Failed to load PlayerSpawnPreset data properly, using default spawning method");
578 if (generateRandomEquip)
579 g_Game.GetMenuDefaultCharacterData().GenerateRandomEquip();
588 g_Game.SelectPlayer(identity, player);
590 #ifdef DIAG_DEVELOPER
591 if (FeatureTimeAccel.m_CurrentTimeAccel)
593 g_Game.RPCSingleParam(player,
ERPCs.DIAG_TIMEACCEL_CLIENT_SYNC, FeatureTimeAccel.m_CurrentTimeAccel,
true, identity);
602 if (player.IsUnconscious() || player.IsRestrained())
604 PluginAdminLog adm = PluginAdminLog.Cast(
GetPlugin(PluginAdminLog));
605 adm.PlayerKilledByRespawn(player);
608 player.SetHealth(
"",
"", 0.0);
612 #ifdef DIAG_DEVELOPER
613 if (FeatureTimeAccel.m_CurrentTimeAccel)
615 g_Game.RPCSingleParam(player,
ERPCs.DIAG_TIMEACCEL_CLIENT_SYNC, FeatureTimeAccel.m_CurrentTimeAccel,
true, identity);
624 player.OnReconnect();
630 bool disconnectNow =
true;
636 if (player.IsAlive())
640 Print(
"[Logout]: New player " + identity.
GetId() +
" with logout time " + logoutTime.ToString());
643 player.StatSyncToClient();
646 g_Game.SendLogoutTime(player, logoutTime);
660 disconnectNow =
false;
668 Print(
"[Logout]: New player " + identity.
GetId() +
" with instant logout");
671 g_Game.SendLogoutTime(player, 0);
682 Print(
"[Logout]: Skipping player " + uid +
", already removed");
692 Print(
"[Logout]: Player " + uid +
" finished");
704 player.ReleaseNetworkControls();
708 g_Game.DisconnectPlayer(identity, uid);
715 if (player.IsUnconscious() || player.IsRestrained())
717 switch (player.GetKickOffReason())
737 if (player.IsAlive())
741 PluginAdminLog adm = PluginAdminLog.Cast(
GetPlugin(PluginAdminLog));
742 adm.PlayerKilledByDisconnect(player);
744 player.SetHealth(
"",
"", 0.0);
759 for (
int i = 0; i < tick_count_max; ++i)
768 currentPlayer.OnTick();
783 if (nDeadPlayers == 0)
785 int current_time =
g_Game.GetTime();
789 for (
int i = 0; i < nDeadPlayers; ++i)
792 if (!corpse_data || (corpse_data && (!corpse_data.
m_Player || !corpse_data.
m_bUpdate)))
794 invalid_corpses.Insert(i);
804 int nInvalidCorpses = invalid_corpses.Count();
805 if (nInvalidCorpses > 0)
807 for (i = nInvalidCorpses - 1; i >= 0; --i)
819 rpc.
Send(null,
ERPCs.RPC_SERVER_RESPAWN_MODE,
true, identity);
829 return m_ActiveRefresherLocations;
836 super.RemoveActiveInputExcludes(excludes,bForceSupress);
838 if (excludes.Count() != 0)
840 bool changed =
false;
844 foreach (
string excl : excludes)
872 case EInputRestrictors.INVENTORY:
877 case EInputRestrictors.MAP:
894 super.AddActiveInputExcludes(excludes);
896 if (excludes.Count() != 0)
898 bool changed =
false;
904 foreach (
string excl : excludes)
931 case EInputRestrictors.INVENTORY:
937 ItemBase item = player.GetItemInHands();
938 if (item && item.IsWeapon())
939 player.RequestResetADSSync();
943 case EInputRestrictors.MAP:
989 for (
int i = 0; i < count; i++)
1007 bool active =
false;
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)
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)
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].
Param2< int, string > LogoutInfo
int time of the logout end