DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
missionServer.c
См. документацию.
1
2//: string uid of the player
4
5class MissionServer extends MissionBase
6{
15
16 // -----------------------
17 // ARTILLERY SOUNDS SETUP
18 // -----------------------
19 private float m_ArtyBarrageTimer = 0; // This is not to be edited in Init.c this is just to increment time
20
21 // Variables to be modified in Init.c
22 protected bool m_PlayArty = false; // Toggle if Off map artillery sounds are played
23 protected float m_ArtyDelay = 0; // Set how much time there is between two barrages (in seconds)
24 protected int m_MinSimultaneousStrikes = 0; // The MIN of simultaneous shots on the map (Will be clamped between 1 and max shots)
25 protected int m_MaxSimultaneousStrikes = 0; // The MAX of simultaneous shots on the map (Will be clamped between 1 and max amount of coords)
26 protected ref array<vector> m_FiringPos; // Where we should fire from. On Init set the relevant data
27
28 //All Chernarus firing coordinates
29 protected const ref array<vector> CHERNARUS_STRIKE_POS =
30 {
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"
36 };
37
38 //All livonia firing coordinates
39 protected const ref array<vector> LIVONIA_STRIKE_POS =
40 {
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"
49 };
50 // -----------------------
51 // END OF ARTILLERY SETUP
52 // -----------------------
53
56
70
75
76 override void OnInit()
77 {
78 super.OnInit();
83 //Either pass consts in Init.c or insert all desired coords (or do both ;))
85 }
86
87 override void OnMissionStart()
88 {
89 super.OnMissionStart();
90
91 // We will load the Effect areas on Default mission start
93 }
94
95 override void OnUpdate(float timeslice)
96 {
97 UpdateDummyScheduler();
98 TickScheduler(timeslice);
100 m_WorldData.UpdateBaseEnvTemperature(timeslice); // re-calculate base enviro temperature
101 m_RainProcHandler.Update(timeslice);
102
103 RandomArtillery(timeslice);
104
105 super.OnUpdate(timeslice);
106 }
107
109 {
111 GetGame().SetDebugMonitorEnabled(GetGame().ServerConfigGetInt("enableDebugMonitor"));
112
113 InitialiseWorldData();
114 }
115
116
117 void RandomArtillery(float deltaTime)
118 {
119 // ARTY barrage
120 if (m_PlayArty)
121 {
122 // We only perform timer checks and increments if we enabled the artillery barrage
124 {
125 //We clamp to guarantee 1 and never have multiple shots on same pos, even in case of entry error
128
129 // Variables to be used in this scope
130 int randPos; // Select random position
131 Param1<vector> pos; // The value to be sent through RPC
132 array<ref Param> params; // The RPC params
133
135 {
136 // We only have one set of coordinates to send
137 randPos = Math.RandomIntInclusive(0, m_FiringPos.Count() - 1);
138 pos = new Param1<vector>(m_FiringPos[randPos]);
139 params = new array<ref Param>;
140 params.Insert(pos);
141 GetGame().RPC(null, ERPCs.RPC_SOUND_ARTILLERY, params, true);
142 }
143 else
144 {
145 //We will do some extra steps to
146 /*
147 1. Send multiple coords (Send one RPC per coord set)
148 2. Ensure we don't have duplicates
149 */
150 array<int> usedIndices = new array<int>; // Will store all previusly fired upon indices
151
152 // We determine how many positions fire between MIN and MAX
154 for (int i = 0; i < randFireNb; i++)
155 {
156 randPos = Math.RandomIntInclusive(0, m_FiringPos.Count() - 1);
157
158 if (usedIndices.Count() <= 0 || usedIndices.Find(randPos) < 0) //We do not find the index or array is empty
159 {
160 // We prepare to send the message
161 pos = new Param1<vector>(m_FiringPos[randPos]);
162 params = new array<ref Param>;
163
164 // We send the message with this set of coords
165 params.Insert(pos);
166 GetGame().RPC(null, ERPCs.RPC_SOUND_ARTILLERY, params, true);
167
168 // We store the last used value
169 usedIndices.Insert(randPos);
170 }
171 }
172 }
173
174 // Reset timer for new loop
175 m_ArtyBarrageTimer = 0.0;
176 }
177
178 m_ArtyBarrageTimer += deltaTime;
179 }
180 }
181
182 override bool IsServer()
183 {
184 return true;
185 }
186
187 override bool IsPlayerDisconnecting(Man player)
188 {
189 return (m_LogoutPlayers && m_LogoutPlayers.Contains(PlayerBase.Cast(player))) || (m_NewLogoutPlayers && m_NewLogoutPlayers.Contains(PlayerBase.Cast(player)));
190 }
191
193 {
194 PluginLifespan moduleLifespan;
195 Class.CastTo(moduleLifespan, GetPlugin(PluginLifespan));
196 array<Man> players = new array<Man>();
197 GetGame().GetPlayers(players);
198
199 foreach (Man man : players)
200 {
201 PlayerBase player;
202 if (Class.CastTo(player, man))
203 {
204 player.StatUpdateByTime(AnalyticsManagerServer.STAT_PLAYTIME);
205 player.StatUpdateByPosition(AnalyticsManagerServer.STAT_DISTANCE);
206
207 moduleLifespan.UpdateLifespan(player);
208 }
209 }
210
212 }
213
214 protected void AddNewPlayerLogout(PlayerBase player, notnull LogoutInfo info)
215 {
216 m_LogoutPlayers.Insert(player, info);
217 m_NewLogoutPlayers.Remove(player);
218 }
219
220 // check if logout finished for some players
222 {
223 for (int i = 0; i < m_LogoutPlayers.Count();)
224 {
225 LogoutInfo info = m_LogoutPlayers.GetElement(i);
226
227 if (GetGame().GetTime() >= info.param1)
228 {
229 PlayerIdentity identity;
230 PlayerBase player = m_LogoutPlayers.GetKey(i);
231 if (player)
232 {
233 identity = player.GetIdentity();
234 m_LogoutPlayers.Remove(player);
235 }
236 else
237 {
238 m_LogoutPlayers.RemoveElement(i);
239 }
240
241 // disable reconnecting to old char
242 // GetGame().RemoveFromReconnectCache(info.param2);
243
244 PlayerDisconnected(player, identity, info.param2);
245 }
246 else
247 {
248 ++i;
249 }
250 }
251 }
252
253 override void OnEvent(EventType eventTypeId, Param params)
254 {
255 PlayerIdentity identity;
256 PlayerBase player;
257 int counter = 0;
258
259 switch (eventTypeId)
260 {
262 ClientPrepareEventParams clientPrepareParams;
263 Class.CastTo(clientPrepareParams, params);
264 CfgGameplayHandler.SyncDataSendEx(clientPrepareParams.param1);
265 UndergroundAreaLoader.SyncDataSend(clientPrepareParams.param1);
266 CfgPlayerRestrictedAreaHandler.SyncDataSend(clientPrepareParams.param1);
267 OnClientPrepareEvent(clientPrepareParams.param1, clientPrepareParams.param2, clientPrepareParams.param3, clientPrepareParams.param4, clientPrepareParams.param5);
268 break;
269
271 ClientNewEventParams newParams;
272 Class.CastTo(newParams, params);
273 player = OnClientNewEvent(newParams.param1, newParams.param2, newParams.param3);
274 if (!player)
275 {
276 Debug.Log("ClientNewEvent: Player is empty");
277 return;
278 }
279 identity = newParams.param1;
280 InvokeOnConnect(player,identity);
282
283 ControlPersonalLight(player);
284 SyncGlobalLighting(player);
285
286 break;
287
289 ClientReadyEventParams readyParams;
290 Class.CastTo(readyParams, params);
291 identity = readyParams.param1;
292 Class.CastTo(player, readyParams.param2);
293 if (!player)
294 {
295 Debug.Log("ClientReadyEvent: Player is empty");
296 return;
297 }
298
299 OnClientReadyEvent(identity, player);
300 InvokeOnConnect(player, identity);
301 // Send list of players at all clients
303 ControlPersonalLight(player);
304 SyncGlobalLighting(player);
305 break;
306
308 ClientRespawnEventParams respawnParams;
309 Class.CastTo(respawnParams, params);
310 identity = respawnParams.param1;
311 Class.CastTo(player, respawnParams.param2);
312 if (!player)
313 {
314 Debug.Log("ClientRespawnEvent: Player is empty");
315 return;
316 }
317
318 OnClientRespawnEvent(identity, player);
319 break;
320
322 ClientReconnectEventParams reconnectParams;
323 Class.CastTo(reconnectParams, params);
324
325 identity = reconnectParams.param1;
326 Class.CastTo(player, reconnectParams.param2);
327 if (!player)
328 {
329 Debug.Log("ClientReconnectEvent: Player is empty");
330 return;
331 }
332
333 OnClientReconnectEvent(identity, player);
334 break;
335
338 Class.CastTo(discoParams, params);
339
340 identity = discoParams.param1;
341 Class.CastTo(player, discoParams.param2);
342 int logoutTime = discoParams.param3;
343 bool authFailed = discoParams.param4;
344
345 if (!player)
346 {
347 Debug.Log("ClientDisconnectenEvent: Player is empty");
348 return;
349 }
350
351 OnClientDisconnectedEvent(identity, player, logoutTime, authFailed);
352 break;
353
355 LogoutCancelEventParams logoutCancelParams;
356
357 Class.CastTo(logoutCancelParams, params);
358 Class.CastTo(player, logoutCancelParams.param1);
359 identity = player.GetIdentity();
360 if (identity)
361 {
362 // disable reconnecting to old char
363 // GetGame().RemoveFromReconnectCache(identity.GetId());
364 Print("[Logout]: Player " + identity.GetId() + " cancelled");
365 }
366 else
367 {
368 Print("[Logout]: Player cancelled");
369 }
370 m_LogoutPlayers.Remove(player);
371 m_NewLogoutPlayers.Remove(player);
372 break;
373 }
374 }
375
377 {
378 Debug.Log("InvokeOnConnect:"+this.ToString(),"Connect");
379 if (player)
380 player.OnConnect();
381 }
382
384 {
385 Debug.Log("InvokeOnDisconnect:"+this.ToString(),"Connect");
386 if (player)
387 player.OnDisconnect();
388 }
389
390 void OnClientPrepareEvent(PlayerIdentity identity, out bool useDB, out vector pos, out float yaw, out int preloadTimeout)
391 {
392 if (GetHive())
393 {
394 // use character from database
395 useDB = true;
396 }
397 else
398 {
399 // use following data without database
400 useDB = false;
401 pos = "1189.3 0.0 5392.48";
402 yaw = 0;
403 }
404 }
405
406 // Enables/Disables personal light on the given player.
408 {
409 if (player)
410 {
411 bool is_personal_light = ! GetGame().ServerConfigGetInt("disablePersonalLight");
412 Param1<bool> personal_light_toggle = new Param1<bool>(is_personal_light);
413 GetGame().RPCSingleParam(player, ERPCs.RPC_TOGGLE_PERSONAL_LIGHT, personal_light_toggle, true, player.GetIdentity());
414 }
415 else
416 {
417 Error("Error! Player was not initialized at the right time. Thus cannot send RPC command to enable or disable personal light!");
418 }
419 }
420
421 // syncs global lighting setup from the server (lightingConfig server config parameter)
423 {
424 if (player)
425 {
426 int lightingID = GetGame().ServerConfigGetInt("lightingConfig");
427 Param1<int> lightID = new Param1<int>(lightingID);
428 GetGame().RPCSingleParam(player, ERPCs.RPC_SEND_LIGHTING_SETUP, lightID, true, player.GetIdentity());
429 }
430 }
431
434 {
435 //creates temporary server-side structure for handling default character spawn
437 }
438
439 //
440 PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
441 {
442 Entity playerEnt;
443 playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
444 Class.CastTo(m_player, playerEnt);
445
446 GetGame().SelectPlayer(identity, m_player);
447
448 return m_player;
449 }
450
453 {
454 int slot_ID;
455 string attachment_type;
456 for (int i = 0; i < DefaultCharacterCreationMethods.GetAttachmentSlotsArray().Count(); i++)
457 {
458 slot_ID = DefaultCharacterCreationMethods.GetAttachmentSlotsArray().Get(i);
459 attachment_type = "";
460 if (m_RespawnMode != GameConstants.RESPAWN_MODE_CUSTOM || !char_data.GetAttachmentMap().Find(slot_ID,attachment_type) || !VerifyAttachmentType(slot_ID,attachment_type)) //todo insert verification fn here
461 {
462 //randomize
463 if (DefaultCharacterCreationMethods.GetConfigArrayCountFromSlotID(slot_ID) > 0)
464 {
465 attachment_type = DefaultCharacterCreationMethods.GetConfigAttachmentTypes(slot_ID).GetRandomElement();
466 }
467 else //undefined, moving on
468 continue;
469 }
470
471 if (attachment_type != "")
472 {
473 m_player.GetInventory().CreateAttachmentEx(attachment_type,slot_ID);
474 }
475 }
476
478 }
479
481 void StartingEquipSetup(PlayerBase player, bool clothesChosen)
482 {
483 }
484
485 bool VerifyAttachmentType(int slot_ID, string attachment_type)
486 {
487 return DefaultCharacterCreationMethods.GetConfigAttachmentTypes(slot_ID).Find(attachment_type) > -1;
488 }
489
491 {
492 string characterType = GetGame().CreateRandomPlayer();
493 bool generateRandomEquip = false;
494
495 // get login data for new character
496 if (ProcessLoginData(ctx) && (m_RespawnMode == GameConstants.RESPAWN_MODE_CUSTOM) && !GetGame().GetMenuDefaultCharacterData(false).IsRandomCharacterForced())
497 {
498 if (GetGame().ListAvailableCharacters().Find(GetGame().GetMenuDefaultCharacterData().GetCharacterType()) > -1)
500 }
501 else
502 {
503 generateRandomEquip = true;
504 }
505
507 {
509 if (presetData && presetData.IsValid())
510 {
511 string presetCharType = presetData.GetRandomCharacterType();
512 if (presetCharType == string.Empty)
513 presetCharType = characterType;
514 if (CreateCharacter(identity, pos, ctx, presetCharType) != null)
515 {
517 return m_player;
518 }
519 else
520 {
521 ErrorEx("Failed to create character from type: " + presetCharType + ", using default spawning method");
522 }
523 }
524 else
525 {
526 ErrorEx("Failed to load PlayerSpawnPreset data properly, using default spawning method");
527 }
528 }
529
530 if (CreateCharacter(identity, pos, ctx, characterType))
531 {
532 if (generateRandomEquip)
534 EquipCharacter(GetGame().GetMenuDefaultCharacterData());
535 }
536
537 return m_player;
538 }
539
541 {
542 GetGame().SelectPlayer(identity, player);
543
544 #ifdef DIAG_DEVELOPER
545 if (FeatureTimeAccel.m_CurrentTimeAccel)
546 {
547 GetGame().RPCSingleParam(player, ERPCs.DIAG_TIMEACCEL_CLIENT_SYNC, FeatureTimeAccel.m_CurrentTimeAccel, true, identity);
548 }
549 #endif
550 }
551
553 {
554 if (player)
555 {
556 if (player.IsUnconscious() || player.IsRestrained())
557 {
558 PluginAdminLog adm = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
559 adm.PlayerKilledByRespawn(player);
560
561 // kill character
562 player.SetHealth("", "", 0.0);
563 }
564 }
565
566 #ifdef DIAG_DEVELOPER
567 if (FeatureTimeAccel.m_CurrentTimeAccel)
568 {
569 GetGame().RPCSingleParam(player, ERPCs.DIAG_TIMEACCEL_CLIENT_SYNC, FeatureTimeAccel.m_CurrentTimeAccel, true, identity);
570 }
571 #endif
572 }
573
575 {
576 if (player)
577 {
578 player.OnReconnect();
579 }
580 }
581
582 void OnClientDisconnectedEvent(PlayerIdentity identity, PlayerBase player, int logoutTime, bool authFailed)
583 {
584 bool disconnectNow = true;
585
586 // TODO: get out of vehicle
587 // using database and no saving if authorization failed
588 if (GetHive() && !authFailed)
589 {
590 if (player.IsAlive())
591 {
592 if (!m_LogoutPlayers.Contains(player) && !m_NewLogoutPlayers.Contains(player))
593 {
594 Print("[Logout]: New player " + identity.GetId() + " with logout time " + logoutTime.ToString());
595
596 // send statistics to client
597 player.StatSyncToClient();
598
599 // inform client about logout time
600 GetGame().SendLogoutTime(player, logoutTime);
601
602 // wait for some time before logout and save
603 LogoutInfo params = new LogoutInfo(GetGame().GetTime() + logoutTime * 1000, identity.GetId());
604
605 m_NewLogoutPlayers.Insert(player, params);
607
608 // allow reconnecting to old char only if not in cars, od ladders etc. as they cannot be properly synchronized for reconnect
609 //if (!player.GetCommand_Vehicle() && !player.GetCommand_Ladder())
610 //{
611 // GetGame().AddToReconnectCache(identity);
612 //}
613 // wait until logout timer runs out
614 disconnectNow = false;
615 }
616 return;
617 }
618 }
619
620 if (disconnectNow)
621 {
622 Print("[Logout]: New player " + identity.GetId() + " with instant logout");
623
624 // inform client about instant logout
625 GetGame().SendLogoutTime(player, 0);
626
627 PlayerDisconnected(player, identity, identity.GetId());
628 }
629 }
630
631 void PlayerDisconnected(PlayerBase player, PlayerIdentity identity, string uid)
632 {
633 // Note: At this point, identity can be already deleted
634 if (!player)
635 {
636 Print("[Logout]: Skipping player " + uid + ", already removed");
637 return;
638 }
639
640 // disable reconnecting to old char
641 //GetGame().RemoveFromReconnectCache(uid);
642
643 // now player can't cancel logout anymore, so call everything needed upon disconnect
644 InvokeOnDisconnect(player);
645
646 Print("[Logout]: Player " + uid + " finished");
647
648 if (GetHive())
649 {
650 // save player
651 player.Save();
652
653 // unlock player in DB
654 GetHive().CharacterExit(player);
655 }
656
657 // handle player's existing char in the world
658 player.ReleaseNetworkControls();
659 HandleBody(player);
660
661 // remove player from server
662 GetGame().DisconnectPlayer(identity, uid);
663 // Send list of players at all clients
665 }
666
668 {
669 if (player.IsUnconscious() || player.IsRestrained())
670 {
671 switch (player.GetKickOffReason())
672 {
673 case EClientKicked.SERVER_EXIT:
674 return false;
675 case EClientKicked.KICK_ALL_ADMIN:
676 return false;
677 case EClientKicked.KICK_ALL_SERVER:
678 return false;
679 case EClientKicked.SERVER_SHUTDOWN:
680 return false;
681 default:
682 return true;
683 }
684 }
685
686 return false;
687 }
688
690 {
691 if (player.IsAlive())
692 {
693 if (ShouldPlayerBeKilled(player))
694 {
695 PluginAdminLog adm = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
696 adm.PlayerKilledByDisconnect(player);
697
698 player.SetHealth("", "", 0.0);//kill
699 }
700 else
701 {
702 player.Delete();// remove the body
703 }
704 }
705 }
706
707 void TickScheduler(float timeslice)
708 {
710 int players_count = m_Players.Count();
711 int tick_count_max = Math.Min(players_count, SCHEDULER_PLAYERS_PER_TICK);
712
713 for (int i = 0; i < tick_count_max; i++)
714 {
715 if (m_currentPlayer >= players_count)
716 {
717 m_currentPlayer = 0;
718 }
719
720 PlayerBase currentPlayer = PlayerBase.Cast(m_Players.Get(m_currentPlayer));
721
722 if (currentPlayer)
723 currentPlayer.OnTick();
725 }
726 }
727
728 //--------------------------------------------------
729 override bool InsertCorpse(Man player)
730 {
731 CorpseData corpse_data = new CorpseData(PlayerBase.Cast(player),GetGame().GetTime());
732 return m_DeadPlayersArray.Insert(corpse_data) >= 0;
733 }
734
736 {
737 if (m_DeadPlayersArray.Count() == 0)//nothing to process, abort
738 return;
739 int current_time = GetGame().GetTime();
740 array<int> invalid_corpses = new array<int>;
741 CorpseData corpse_data;
742
743 for (int i = 0; i < m_DeadPlayersArray.Count(); i++)
744 {
745 corpse_data = m_DeadPlayersArray.Get(i);
746 if (!corpse_data || (corpse_data && (!corpse_data.m_Player || !corpse_data.m_bUpdate)))
747 {
748 invalid_corpses.Insert(i);
749 }
750 else if (corpse_data.m_bUpdate && current_time - corpse_data.m_iLastUpdateTime >= 30000)
751 {
752 corpse_data.UpdateCorpseState();
753 corpse_data.m_iLastUpdateTime = current_time;
754 }
755 }
756
757 //cleanup
758 if (invalid_corpses.Count() > 0)
759 {
760 for (i = invalid_corpses.Count() - 1; i > -1; i--)
761 {
762 m_DeadPlayersArray.Remove(invalid_corpses.Get(i));
763 }
764 }
765 }
766 //--------------------------------------------------
767
768 override void SyncRespawnModeInfo(PlayerIdentity identity)
769 {
770 ScriptRPC rpc = new ScriptRPC();
771 rpc.Write(m_RespawnMode);
772 rpc.Send(null, ERPCs.RPC_SERVER_RESPAWN_MODE, true, identity);
773 }
774
779
781 {
782 return m_ActiveRefresherLocations;
783 }
784
786 PluginAdditionalInfo m_moduleDefaultCharacter;
787}
788
EClientKicked
Определения ClientKickedModule.c:2
map
Определения ControlsXboxNew.c:4
ERPCs
Определения ERPCs.c:2
proto string ToString()
Empty
Определения Hand_States.c:14
proto native Hive GetHive()
float GetTime()
Определения NotificationSystem.c:35
void PluginLifespan()
Определения PluginLifespan.c:45
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
@ Count
Определения RandomGeneratorSyncManager.c:8
const string STAT_PLAYTIME
Определения AnalyticsManagerServer.c:4
const string STAT_DISTANCE
Определения AnalyticsManagerServer.c:3
override string CreateRandomPlayer()
Определения DayZGame.c:3384
proto native void GetPlayers(out array< Man > players)
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
proto native void SelectPlayer(PlayerIdentity identity, Object player)
Selects player's controlled object.
proto native World GetWorld()
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native Entity CreatePlayer(PlayerIdentity identity, string name, vector pos, float radius, string spec)
Assign player entity to client (in multiplayer)
void SetDebugMonitorEnabled(int value)
Определения Game.c:1082
proto native void DisconnectPlayer(PlayerIdentity identity, string uid="")
Destroy player info and disconnect.
proto native void RPC(Object target, int rpcType, notnull array< ref Param > params, bool guaranteed, PlayerIdentity recipient=null)
Initiate remote procedure call. When called on client, RPC is evaluated on server; When called on ser...
proto native void SendLogoutTime(Object player, int time)
Inform client about logout time (creates logout screen on specified client)
proto int GetTime()
returns mission time in milliseconds
proto native int ServerConfigGetInt(string name)
Server config parsing. Returns 0 if not found.
MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data=true)
Определения Game.c:1493
static bool LoadData()
Определения CfgGameplayHandler.c:44
static bool GetDisableRespawnDialog()
Определения CfgGameplayHandler.c:173
static void SyncDataSendEx(notnull PlayerIdentity identity)
Определения CfgGameplayHandler.c:94
static void SyncDataSend(notnull PlayerIdentity identity)
Super root of all classes in Enforce script.
Определения EnScript.c:11
PlayerBase m_Player
Определения CorpseData.c:14
int m_iLastUpdateTime
Определения CorpseData.c:6
bool m_bUpdate
Определения CorpseData.c:5
void UpdateCorpseState(bool force_check=false)
Определения CorpseData.c:27
Определения CorpseData.c:2
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.
Определения Debug.c:122
Определения Debug.c:2
static void CreateZones()
Определения ContaminatedAreaLoader.c:6
Определения Camera.c:2
Определения constants.c:659
proto native void CharacterExit(Man player)
Определения EnMath.c:7
string GetCharacterType()
Определения gameplay.c:1110
void GenerateRandomEquip()
Определения gameplay.c:1017
map< int, string > GetAttachmentMap()
Определения gameplay.c:1125
bool DeserializeCharacterData(ParamsReadContext ctx)
Определения gameplay.c:1080
int m_RespawnMode
Определения missionServer.c:14
void RandomArtillery(float deltaTime)
Определения missionServer.c:117
void ~MissionServer()
Определения missionServer.c:71
ref array< vector > m_FiringPos
Определения missionServer.c:26
void EquipCharacter(MenuDefaultCharacterData char_data)
Spawns character equip from received data. Checks validity against config, randomizes if invalid valu...
Определения missionServer.c:452
int m_currentPlayer
Определения missionServer.c:13
override void OnUpdate(float timeslice)
Определения missionServer.c:95
float m_ArtyBarrageTimer
Определения missionServer.c:19
override void OnInit()
Определения missionServer.c:76
int m_MaxSimultaneousStrikes
Определения missionServer.c:25
PluginAdditionalInfo m_moduleDefaultCharacter
DEPRECATED.
Определения missionServer.c:786
ref array< Man > m_Players
Определения missionServer.c:7
bool m_PlayArty
Определения missionServer.c:22
void AddNewPlayerLogout(PlayerBase player, notnull LogoutInfo info)
Определения missionServer.c:214
void SyncGlobalLighting(PlayerBase player)
Определения missionServer.c:422
override bool InsertCorpse(Man player)
Определения missionServer.c:729
void UpdateCorpseStatesServer()
Определения missionServer.c:735
override RainProcurementHandler GetRainProcurementHandler()
Определения missionServer.c:775
override void OnGameplayDataHandlerLoad()
Определения missionServer.c:108
void HandleBody(PlayerBase player)
Определения missionServer.c:689
const int SCHEDULER_PLAYERS_PER_TICK
Определения missionServer.c:12
void MissionServer()
Определения missionServer.c:57
override bool IsServer()
Определения missionServer.c:182
void TickScheduler(float timeslice)
Определения missionGameplay.c:204
const ref array< vector > CHERNARUS_STRIKE_POS
Определения missionServer.c:29
override void OnEvent(EventType eventTypeId, Param params)
Определения missionServer.c:253
MissionBase m_mission
Определения missionServer.c:55
void UpdatePlayersStats()
Определения missionServer.c:192
bool ProcessLoginData(ParamsReadContext ctx)
returns whether received data is valid, ctx can be filled on client in StoreLoginData()
Определения missionServer.c:433
ref RainProcurementHandler m_RainProcHandler
Определения missionServer.c:11
void InvokeOnConnect(PlayerBase player, PlayerIdentity identity)
Определения missionServer.c:376
PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
Определения missionServer.c:440
void PlayerDisconnected(PlayerBase player, PlayerIdentity identity, string uid)
Определения missionServer.c:631
bool ShouldPlayerBeKilled(PlayerBase player)
Определения missionServer.c:667
float m_ArtyDelay
Определения missionServer.c:23
void InvokeOnDisconnect(PlayerBase player)
Определения missionServer.c:383
void ControlPersonalLight(PlayerBase player)
Определения missionServer.c:407
bool VerifyAttachmentType(int slot_ID, string attachment_type)
Определения missionServer.c:485
ref map< PlayerBase, ref LogoutInfo > m_NewLogoutPlayers
Определения missionServer.c:10
const ref array< vector > LIVONIA_STRIKE_POS
Определения missionServer.c:39
void StartingEquipSetup(PlayerBase player, bool clothesChosen)
can be overriden to manually set up starting equip. 'clothesChosen' is legacy parameter,...
Определения missionServer.c:481
PlayerBase m_player
Определения missionServer.c:54
void OnClientReadyEvent(PlayerIdentity identity, PlayerBase player)
Определения missionServer.c:540
void OnClientPrepareEvent(PlayerIdentity identity, out bool useDB, out vector pos, out float yaw, out int preloadTimeout)
Определения missionServer.c:390
override void SyncRespawnModeInfo(PlayerIdentity identity)
Определения missionServer.c:768
void OnClientDisconnectedEvent(PlayerIdentity identity, PlayerBase player, int logoutTime, bool authFailed)
Определения missionServer.c:582
ref map< PlayerBase, ref LogoutInfo > m_LogoutPlayers
Определения missionServer.c:9
void UpdateLogoutPlayers()
Определения missionServer.c:221
override void OnMissionStart()
Определения missionServer.c:87
void OnClientReconnectEvent(PlayerIdentity identity, PlayerBase player)
Определения missionServer.c:574
PlayerBase OnClientNewEvent(PlayerIdentity identity, vector pos, ParamsReadContext ctx)
Определения missionServer.c:490
override array< vector > GetActiveRefresherLocations()
Определения missionServer.c:780
void OnClientRespawnEvent(PlayerIdentity identity, PlayerBase player)
Определения missionServer.c:552
ref array< ref CorpseData > m_DeadPlayersArray
Определения missionServer.c:8
int m_MinSimultaneousStrikes
Определения missionServer.c:24
override bool IsPlayerDisconnecting(Man player)
Определения missionServer.c:187
Определения missionGameplay.c:2
Определения PPEConstants.c:68
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
Определения PlayerBaseClient.c:2
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)
Определения gameplay.c:389
static bool IsInitialized()
Определения CfgPlayerSpawnHandler.c:35
static bool ProcessEquipmentData(PlayerBase player, PlayerSpawnPreset data)
equips character with the chosen preset
Определения CfgPlayerSpawnHandler.c:61
static bool LoadData()
Определения CfgPlayerSpawnHandler.c:6
static PlayerSpawnPreset GetRandomCharacterPreset()
Определения CfgPlayerSpawnHandler.c:40
override bool IsValid()
Определения CfgPlayerSpawnDataJson.c:33
string GetRandomCharacterType()
Определения CfgPlayerSpawnDataJson.c:24
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
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...
Определения gameplay.c:105
proto bool Write(void value_out)
static void SendPlayerList()
Определения SyncEvents.c:47
Определения SyncEvents.c:2
static void SyncDataSend(PlayerIdentity identity)
Определения UndergroundAreaLoader.c:115
static void SpawnAllTriggerCarriers()
Определения UndergroundAreaLoader.c:84
proto native void GetPlayerList(out array< Man > players)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения EnConvert.c:106
const EventType LogoutCancelEventTypeID
params: LogoutCancelEventParams
Определения gameplay.c:529
Param1< Man > LogoutCancelEventParams
Player.
Определения gameplay.c:435
const EventType ClientNewEventTypeID
params: ClientNewEventParams
Определения gameplay.c:509
Param5< PlayerIdentity, bool, vector, float, int > ClientPrepareEventParams
PlayerIdentity, useDB, pos, yaw, preloadTimeout (= additional time in seconds to how long server wait...
Определения gameplay.c:414
Serializer ParamsReadContext
Определения gameplay.c:15
Param2< PlayerIdentity, Man > ClientRespawnEventParams
PlayerIdentity, Man.
Определения gameplay.c:420
const EventType ClientReconnectEventTypeID
params: ClientReconnectEventParams
Определения gameplay.c:515
Param4< PlayerIdentity, Man, int, bool > ClientDisconnectedEventParams
PlayerIdentity, Man, LogoutTime, AuthFailed.
Определения gameplay.c:426
const EventType ClientRespawnEventTypeID
params: ClientRespawnEventParams
Определения gameplay.c:513
Param2< PlayerIdentity, Man > ClientReconnectEventParams
PlayerIdentity, Man.
Определения gameplay.c:424
Param2< PlayerIdentity, Man > ClientReadyEventParams
PlayerIdentity, Man.
Определения gameplay.c:422
Param3< PlayerIdentity, vector, Serializer > ClientNewEventParams
PlayerIdentity, PlayerPos, Top, Bottom, Shoe, Skin.
Определения gameplay.c:416
const EventType ClientDisconnectedEventTypeID
params: ClientDisconnectedEventParams
Определения gameplay.c:519
proto native CGame GetGame()
const EventType ClientReadyEventTypeID
params: ClientReadyEventParams
Определения gameplay.c:517
const EventType ClientPrepareEventTypeID
params: ClientPrepareEventParams
Определения gameplay.c:507
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90
proto void Print(void var)
Prints content of variable to console/log.
enum ShapeType ErrorEx
const int RESPAWN_MODE_CUSTOM
Определения constants.c:1045
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].
Определения EnMath.c:54
const int CALL_CATEGORY_GAMEPLAY
Определения tools.c:10
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8
TypeID EventType
Определения EnWidgets.c:55
Param2< int, string > LogoutInfo
int time of the logout end
Определения missionServer.c:3