DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл PPERequesterBank.c

См. исходные тексты.

Структуры данных

class  Managed
 TODO doc. Подробнее...
 

Функции

class PPERequesterBank extends Managed PPERequesterRegistrations ()
 Mod this, if you wish to register custom requesters.
 
static void Init ()
 
static void Cleanup ()
 
static PPERequesterBase GetRequester (typename type)
 Returns an instance (singleton) of a requester based on typename.
 
static PPERequesterBase GetRequester (int index)
 Returns an instance (singleton) of a requester based on index.
 
static int GetRequesterID (typename type)
 Returns an ID of a requester type.
 
static GetRequesterTypename (int index)
 Returns a typename from a requester ID.
 
static int RegisterRequester (typename type)
 Registers new requester type.
 
static bool VerifyRequester (PPERequesterBase req)
 Verifies the instance.
 

Переменные

static ref map< int, ref PPERequesterBasem_Instances
 
static bool m_Initialized = false
 
static int m_lastID = -1
 
static const int INVALID = -1
 
static const int REQ_INVENTORYBLUR = RegisterRequester(PPERequester_InventoryBlur)
 
static const int REQ_CONTROLLERDISCONNECT = RegisterRequester(PPERequester_ControllerDisconnectBlur)
 
static const int REQ_GLASSESSPORTBLACK = RegisterRequester(PPERequester_GlassesSportBlack)
 
static const int REQ_GLASSESSPORTBLUE = RegisterRequester(PPERequester_GlassesSportBlue)
 
static const int REQ_GLASSESSPORTGREEN = RegisterRequester(PPERequester_GlassesSportGreen)
 
static const int REQ_GLASSESSPORTORANGE = RegisterRequester(PPERequester_GlassesSportOrange)
 
static const int REQ_GLASSESAVIATOR = RegisterRequester(PPERequester_GlassesAviator)
 
static const int REQ_GLASSESDESIGNER = RegisterRequester(PPERequester_GlassesDesignerBlack)
 
static const int REQ_GLASSESTACTICAL = RegisterRequester(PPERequester_TacticalGoggles)
 
static const int REQ_MOTOHELMETBLACK = RegisterRequester(PPERequester_MotoHelmetBlack)
 
static const int REQ_GLASSESWELDING = RegisterRequester(PPERequester_WeldingMask)
 
static const int REQ_CAMERANV = RegisterRequester(PPERequester_CameraNV)
 
static const int REQ_CAMERAADS = RegisterRequester(PPERequester_CameraADS)
 
static const int REQ_BLOODLOSS = RegisterRequester(PPERequester_BloodLoss)
 
static const int REQ_DEATHEFFECTS = RegisterRequester(PPERequester_DeathDarkening)
 
static const int REQ_UNCONEFFECTS = RegisterRequester(PPERequester_UnconEffects)
 
static const int REQ_TUNELVISSION = RegisterRequester(PPERequester_TunnelVisionEffects)
 
static const int REQ_BURLAPSACK = RegisterRequester(PPERequester_BurlapSackEffects)
 
static const int REQ_INTROCHROMABB = RegisterRequester(PPERequester_IntroChromAbb)
 
static const int REQ_FEVEREFFECTS = RegisterRequester(PPERequester_FeverEffects)
 
static const int REQ_FLASHBANGEFFECTS = RegisterRequester(PPERequester_FlashbangEffects)
 
static const int REQ_SHOCKHITEFFECTS = RegisterRequester(PPERequester_ShockHitReaction)
 
static const int REQ_HEALTHHITEFFECTS = RegisterRequester(PPERequester_HealthHitReaction)
 
static const int REQ_MENUEFFECTS = RegisterRequester(PPERequester_MenuEffects)
 
static const int REQ_CONTROLLERBLUR = RegisterRequester(PPERequester_ControlsBlur)
 
static const int REQ_SERVERBROWSEREFFECTS = RegisterRequester(PPERequester_ServerBrowserBlur)
 
static const int REQ_TUTORIALEFFECTS = RegisterRequester(PPERequester_TutorialMenu)
 
static const int REQ_CONTAMINATEDAREA = RegisterRequester(PPERequester_ContaminatedAreaTint)
 
static const int REQ_SPOOKYAREA = RegisterRequester(PPERequester_SpookyAreaTint)
 
static const int REQ_PAINBLUR = RegisterRequester(PPERequester_PainBlur)
 
static const int REQ_UNDERGROUND = RegisterRequester(PPERUndergroundAcco)
 
static const int REQ_DROWNING = RegisterRequester(PPERequester_Drowning)
 
static const int REQ_HMP_GHOST = RegisterRequester(PPERequester_HMPGhosts)
 
static ref PPERequesterRegistrations m_Registrations
 

Функции

◆ Cleanup()

static void Cleanup ( )
staticprivate

◆ GetRequester() [1/2]

static PPERequesterBase GetRequester ( int index)
staticprivate

Returns an instance (singleton) of a requester based on index.

Аргументы
indexint Index of the registered requester.
Возвращает
PPERequesterBase Requester singleton.
Заметки
Returns only already registered instances, does not register anything.
335{
337 private static bool m_Initialized = false;
338
339 static int m_lastID = -1;
340
341 static const int INVALID = -1;
374 //static const int REQ_HMP_LVL3 = RegisterRequester(PPERequester_HeavyMetalPoisoning_3);
376
377 private static ref PPERequesterRegistrations m_Registrations; //more registrations to be placed here
378
379 static void Init()
380 {
382
383 if (!m_Instances)
385
386 m_Initialized = true;
387 }
388
389 static void Cleanup()
390 {
391 if (m_Initialized)
392 {
393 delete m_Registrations;
394 m_Instances.Clear();
395 }
396 }
397
403
404 static PPERequesterBase GetRequester(typename type)
405 {
406 if (!type)
407 {
408 Error("Requested type is NULL!");
409 return null;
410 }
411
414 for (int i = 0; i < m_Instances.Count(); i++)
415 {
416 temp = m_Instances.GetElement(i);
417 if (temp.Type() == type)
418 {
420 break;
421 }
422 }
423
424 if (!ret)
425 {
426 Debug.Log("'" + type.ToString() + "' not found in bank! Register first in 'RegisterRequester' method.");
427 }
428 return ret;
429 }
430
436
438 {
440
441 if (!ret)
442 {
443 Debug.Log("Requester idx '" + index + "' not found in bank! Register first in 'RegisterRequester' method.");
444 }
445 return ret;
446 }
447
453
454 static int GetRequesterID(typename type)
455 {
456 int ret = -1;
458
459 for (int i = 0; i < m_Instances.Count(); i++)
460 {
461 temp = m_Instances.GetElement(i);
462 if (temp.Type() == type)
463 {
464 ret = m_Instances.GetKey(i);
465 }
466 }
467
468 if ( ret == -1 )
469 {
470 Debug.Log("Requester instance of the '" + type.ToString() + "' type not found in bank! Register first in 'RegisterRequester' method.");
471 }
472 return ret;
473 }
474
479
480 static typename GetRequesterTypename(int index)
481 {
482 typename ret;
484 if ( !temp )
485 {
486 Debug.Log("No requester exists under idx '" + index + "' in bank! Register first in 'RegisterRequester' method.");
487 }
488 else
489 {
490 ret = temp.Type();
491 }
492
493 return ret;
494 }
495
499
500 static int RegisterRequester(typename type)
501 {
502 if (!m_Instances)
504
505 if ( GetRequester(type) != null )
506 {
507 //Error("Trying to register an already existing requester type: " + type);
508 Debug.Log("Trying to register an already existing requester type: " + type);
509 return -1;
510 }
511
512 m_lastID++;
513
515 req = PPERequesterBase.Cast(type.Spawn());
516 req.SetRequesterIDX(m_lastID);
518
519 return m_lastID;
520 }
521
524 {
525 if (!m_Initialized) //initial registrations are fair game
526 {
527 return true;
528 }
529
531 for (int i = 0; i < m_Instances.Count(); i++)
532 {
533 temp = m_Instances.GetElement(i);
534 if (temp == req)
535 {
536 return true;
537 }
538 }
539
540 //Error("Requester instance " + req + " not valid! Please use registered instances from PPERequesterBank.");
541 Debug.Log("Requester instance '" + req + "' not valid! Please use registered instances from PPERequesterBank.");
542 return false;
543 }
544
545 /*static void DumpInstances()
546 {
547 Print("DumpInstances");
548 for (int i = 0; i < m_Instances.Count(); i++)
549 {
550 Print(m_Instances.GetKey(i));
551 Print(m_Instances.GetElement(i));
552 }
553 }*/
554}
555
558{
560 {
561 //PPERequesterBank.RegisterRequester(TestReq);
562 }
563}
564
565/*modded class PPERequesterRegistrations extends Managed
566{
567 void PPERequesterRegistrations()
568 {
569 PPERequesterBank.RegisterRequester(TestReq2);
570 }
571}
static const int REQ_HEALTHHITEFFECTS
Definition PPERequesterBank.c:258
static const int REQ_GLASSESTACTICAL
Definition PPERequesterBank.c:244
static const int REQ_CONTROLLERDISCONNECT
Definition PPERequesterBank.c:237
static void Init()
Definition PPERequesterBank.c:273
static const int REQ_GLASSESSPORTBLACK
Definition PPERequesterBank.c:238
static void Cleanup()
Definition PPERequesterBank.c:283
static ref map< int, ref PPERequesterBase > m_Instances
Definition PPERequesterBank.c:230
static const int REQ_INTROCHROMABB
Definition PPERequesterBank.c:254
static const int REQ_CONTROLLERBLUR
Definition PPERequesterBank.c:260
static const int REQ_GLASSESDESIGNER
Definition PPERequesterBank.c:243
class PPERequesterBank extends Managed PPERequesterRegistrations()
Mod this, if you wish to register custom requesters.
Definition PPERequesterBank.c:229
static const int REQ_BURLAPSACK
Definition PPERequesterBank.c:253
static bool VerifyRequester(PPERequesterBase req)
Verifies the instance.
Definition PPERequesterBank.c:417
static int RegisterRequester(typename type)
Registers new requester type.
Definition PPERequesterBank.c:394
static const int REQ_INVENTORYBLUR
Definition PPERequesterBank.c:236
static const int REQ_CONTAMINATEDAREA
Definition PPERequesterBank.c:263
static const int REQ_GLASSESAVIATOR
Definition PPERequesterBank.c:242
static const int REQ_MOTOHELMETBLACK
Definition PPERequesterBank.c:245
static bool m_Initialized
Definition PPERequesterBank.c:231
static int m_lastID
Definition PPERequesterBank.c:233
static const int REQ_GLASSESSPORTORANGE
Definition PPERequesterBank.c:241
static const int REQ_CAMERANV
Definition PPERequesterBank.c:247
static const int REQ_SHOCKHITEFFECTS
Definition PPERequesterBank.c:257
static const int REQ_FEVEREFFECTS
Definition PPERequesterBank.c:255
static const int REQ_DROWNING
Definition PPERequesterBank.c:267
static const int INVALID
Definition PPERequesterBank.c:235
static const int REQ_TUTORIALEFFECTS
Definition PPERequesterBank.c:262
static ref PPERequesterRegistrations m_Registrations
Definition PPERequesterBank.c:271
static const int REQ_DEATHEFFECTS
Definition PPERequesterBank.c:250
static const int REQ_UNCONEFFECTS
Definition PPERequesterBank.c:251
static int GetRequesterID(typename type)
Returns an ID of a requester type.
Definition PPERequesterBank.c:348
static const int REQ_TUNELVISSION
Definition PPERequesterBank.c:252
static const int REQ_BLOODLOSS
Definition PPERequesterBank.c:249
static const int REQ_HMP_GHOST
Definition PPERequesterBank.c:269
static const int REQ_GLASSESWELDING
Definition PPERequesterBank.c:246
static const int REQ_PAINBLUR
Definition PPERequesterBank.c:265
static const int REQ_FLASHBANGEFFECTS
Definition PPERequesterBank.c:256
static const int REQ_CAMERAADS
Definition PPERequesterBank.c:248
static GetRequesterTypename(int index)
Returns a typename from a requester ID.
Definition PPERequesterBank.c:374
static const int REQ_MENUEFFECTS
Definition PPERequesterBank.c:259
static const int REQ_UNDERGROUND
Definition PPERequesterBank.c:266
static const int REQ_GLASSESSPORTBLUE
Definition PPERequesterBank.c:239
static const int REQ_SERVERBROWSEREFFECTS
Definition PPERequesterBank.c:261
static const int REQ_GLASSESSPORTGREEN
Definition PPERequesterBank.c:240
static const int REQ_SPOOKYAREA
Definition PPERequesterBank.c:264
PPERUndergroundAcco GetRequester()
Definition UndergroundHandlerClient.c:54
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition Debug.c:14
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.
Definition Debug.c:136
TODO doc.
Definition EnScript.c:118
Definition PPERequestPlatformsBase.c:3
Definition EntityAI.c:95
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

◆ GetRequester() [2/2]

static PPERequesterBase GetRequester ( typename type )
staticprivate

Returns an instance (singleton) of a requester based on typename.

Аргументы
typetypename Typename of the requester.
Возвращает
PPERequesterBase Requester singleton.
Заметки
Returns only already registered instances, does not register anything.
302{
304 private static bool m_Initialized = false;
305
306 static int m_lastID = -1;
307
308 static const int INVALID = -1;
341 //static const int REQ_HMP_LVL3 = RegisterRequester(PPERequester_HeavyMetalPoisoning_3);
343
344 private static ref PPERequesterRegistrations m_Registrations; //more registrations to be placed here
345
346 static void Init()
347 {
349
350 if (!m_Instances)
352
353 m_Initialized = true;
354 }
355
356 static void Cleanup()
357 {
358 if (m_Initialized)
359 {
360 delete m_Registrations;
361 m_Instances.Clear();
362 }
363 }
364
370
371 static PPERequesterBase GetRequester(typename type)
372 {
373 if (!type)
374 {
375 Error("Requested type is NULL!");
376 return null;
377 }
378
381 for (int i = 0; i < m_Instances.Count(); i++)
382 {
383 temp = m_Instances.GetElement(i);
384 if (temp.Type() == type)
385 {
387 break;
388 }
389 }
390
391 if (!ret)
392 {
393 Debug.Log("'" + type.ToString() + "' not found in bank! Register first in 'RegisterRequester' method.");
394 }
395 return ret;
396 }
397
403
405 {
407
408 if (!ret)
409 {
410 Debug.Log("Requester idx '" + index + "' not found in bank! Register first in 'RegisterRequester' method.");
411 }
412 return ret;
413 }
414
420
421 static int GetRequesterID(typename type)
422 {
423 int ret = -1;
425
426 for (int i = 0; i < m_Instances.Count(); i++)
427 {
428 temp = m_Instances.GetElement(i);
429 if (temp.Type() == type)
430 {
431 ret = m_Instances.GetKey(i);
432 }
433 }
434
435 if ( ret == -1 )
436 {
437 Debug.Log("Requester instance of the '" + type.ToString() + "' type not found in bank! Register first in 'RegisterRequester' method.");
438 }
439 return ret;
440 }
441
446
447 static typename GetRequesterTypename(int index)
448 {
449 typename ret;
451 if ( !temp )
452 {
453 Debug.Log("No requester exists under idx '" + index + "' in bank! Register first in 'RegisterRequester' method.");
454 }
455 else
456 {
457 ret = temp.Type();
458 }
459
460 return ret;
461 }
462
466
467 static int RegisterRequester(typename type)
468 {
469 if (!m_Instances)
471
472 if ( GetRequester(type) != null )
473 {
474 //Error("Trying to register an already existing requester type: " + type);
475 Debug.Log("Trying to register an already existing requester type: " + type);
476 return -1;
477 }
478
479 m_lastID++;
480
482 req = PPERequesterBase.Cast(type.Spawn());
483 req.SetRequesterIDX(m_lastID);
485
486 return m_lastID;
487 }
488
491 {
492 if (!m_Initialized) //initial registrations are fair game
493 {
494 return true;
495 }
496
498 for (int i = 0; i < m_Instances.Count(); i++)
499 {
500 temp = m_Instances.GetElement(i);
501 if (temp == req)
502 {
503 return true;
504 }
505 }
506
507 //Error("Requester instance " + req + " not valid! Please use registered instances from PPERequesterBank.");
508 Debug.Log("Requester instance '" + req + "' not valid! Please use registered instances from PPERequesterBank.");
509 return false;
510 }
511
512 /*static void DumpInstances()
513 {
514 Print("DumpInstances");
515 for (int i = 0; i < m_Instances.Count(); i++)
516 {
517 Print(m_Instances.GetKey(i));
518 Print(m_Instances.GetElement(i));
519 }
520 }*/
521}
522
525{
527 {
528 //PPERequesterBank.RegisterRequester(TestReq);
529 }
530}
531
532/*modded class PPERequesterRegistrations extends Managed
533{
534 void PPERequesterRegistrations()
535 {
536 PPERequesterBank.RegisterRequester(TestReq2);
537 }
538}

◆ GetRequesterID()

static int GetRequesterID ( typename type )
staticprivate

Returns an ID of a requester type.

Аргументы
typetypename Typename of the requester.
Возвращает
int Requester ID.
Заметки
Returns '-1' if not found.
352{
354 private static bool m_Initialized = false;
355
356 static int m_lastID = -1;
357
358 static const int INVALID = -1;
391 //static const int REQ_HMP_LVL3 = RegisterRequester(PPERequester_HeavyMetalPoisoning_3);
393
394 private static ref PPERequesterRegistrations m_Registrations; //more registrations to be placed here
395
396 static void Init()
397 {
399
400 if (!m_Instances)
402
403 m_Initialized = true;
404 }
405
406 static void Cleanup()
407 {
408 if (m_Initialized)
409 {
410 delete m_Registrations;
411 m_Instances.Clear();
412 }
413 }
414
420
421 static PPERequesterBase GetRequester(typename type)
422 {
423 if (!type)
424 {
425 Error("Requested type is NULL!");
426 return null;
427 }
428
431 for (int i = 0; i < m_Instances.Count(); i++)
432 {
433 temp = m_Instances.GetElement(i);
434 if (temp.Type() == type)
435 {
437 break;
438 }
439 }
440
441 if (!ret)
442 {
443 Debug.Log("'" + type.ToString() + "' not found in bank! Register first in 'RegisterRequester' method.");
444 }
445 return ret;
446 }
447
453
455 {
457
458 if (!ret)
459 {
460 Debug.Log("Requester idx '" + index + "' not found in bank! Register first in 'RegisterRequester' method.");
461 }
462 return ret;
463 }
464
470
471 static int GetRequesterID(typename type)
472 {
473 int ret = -1;
475
476 for (int i = 0; i < m_Instances.Count(); i++)
477 {
478 temp = m_Instances.GetElement(i);
479 if (temp.Type() == type)
480 {
481 ret = m_Instances.GetKey(i);
482 }
483 }
484
485 if ( ret == -1 )
486 {
487 Debug.Log("Requester instance of the '" + type.ToString() + "' type not found in bank! Register first in 'RegisterRequester' method.");
488 }
489 return ret;
490 }
491
496
497 static typename GetRequesterTypename(int index)
498 {
499 typename ret;
501 if ( !temp )
502 {
503 Debug.Log("No requester exists under idx '" + index + "' in bank! Register first in 'RegisterRequester' method.");
504 }
505 else
506 {
507 ret = temp.Type();
508 }
509
510 return ret;
511 }
512
516
517 static int RegisterRequester(typename type)
518 {
519 if (!m_Instances)
521
522 if ( GetRequester(type) != null )
523 {
524 //Error("Trying to register an already existing requester type: " + type);
525 Debug.Log("Trying to register an already existing requester type: " + type);
526 return -1;
527 }
528
529 m_lastID++;
530
532 req = PPERequesterBase.Cast(type.Spawn());
533 req.SetRequesterIDX(m_lastID);
535
536 return m_lastID;
537 }
538
541 {
542 if (!m_Initialized) //initial registrations are fair game
543 {
544 return true;
545 }
546
548 for (int i = 0; i < m_Instances.Count(); i++)
549 {
550 temp = m_Instances.GetElement(i);
551 if (temp == req)
552 {
553 return true;
554 }
555 }
556
557 //Error("Requester instance " + req + " not valid! Please use registered instances from PPERequesterBank.");
558 Debug.Log("Requester instance '" + req + "' not valid! Please use registered instances from PPERequesterBank.");
559 return false;
560 }
561
562 /*static void DumpInstances()
563 {
564 Print("DumpInstances");
565 for (int i = 0; i < m_Instances.Count(); i++)
566 {
567 Print(m_Instances.GetKey(i));
568 Print(m_Instances.GetElement(i));
569 }
570 }*/
571}
572
575{
577 {
578 //PPERequesterBank.RegisterRequester(TestReq);
579 }
580}
581
582/*modded class PPERequesterRegistrations extends Managed
583{
584 void PPERequesterRegistrations()
585 {
586 PPERequesterBank.RegisterRequester(TestReq2);
587 }
588}

◆ GetRequesterTypename()

static GetRequesterTypename ( int index)
staticprivate

Returns a typename from a requester ID.

Аргументы
indexint ID of the requester.
Возвращает
typename Requester typename.
378{
380 private static bool m_Initialized = false;
381
382 static int m_lastID = -1;
383
384 static const int INVALID = -1;
417 //static const int REQ_HMP_LVL3 = RegisterRequester(PPERequester_HeavyMetalPoisoning_3);
419
420 private static ref PPERequesterRegistrations m_Registrations; //more registrations to be placed here
421
422 static void Init()
423 {
425
426 if (!m_Instances)
428
429 m_Initialized = true;
430 }
431
432 static void Cleanup()
433 {
434 if (m_Initialized)
435 {
436 delete m_Registrations;
437 m_Instances.Clear();
438 }
439 }
440
446
447 static PPERequesterBase GetRequester(typename type)
448 {
449 if (!type)
450 {
451 Error("Requested type is NULL!");
452 return null;
453 }
454
457 for (int i = 0; i < m_Instances.Count(); i++)
458 {
459 temp = m_Instances.GetElement(i);
460 if (temp.Type() == type)
461 {
463 break;
464 }
465 }
466
467 if (!ret)
468 {
469 Debug.Log("'" + type.ToString() + "' not found in bank! Register first in 'RegisterRequester' method.");
470 }
471 return ret;
472 }
473
479
481 {
483
484 if (!ret)
485 {
486 Debug.Log("Requester idx '" + index + "' not found in bank! Register first in 'RegisterRequester' method.");
487 }
488 return ret;
489 }
490
496
497 static int GetRequesterID(typename type)
498 {
499 int ret = -1;
501
502 for (int i = 0; i < m_Instances.Count(); i++)
503 {
504 temp = m_Instances.GetElement(i);
505 if (temp.Type() == type)
506 {
507 ret = m_Instances.GetKey(i);
508 }
509 }
510
511 if ( ret == -1 )
512 {
513 Debug.Log("Requester instance of the '" + type.ToString() + "' type not found in bank! Register first in 'RegisterRequester' method.");
514 }
515 return ret;
516 }
517
522
523 static typename GetRequesterTypename(int index)
524 {
525 typename ret;
527 if ( !temp )
528 {
529 Debug.Log("No requester exists under idx '" + index + "' in bank! Register first in 'RegisterRequester' method.");
530 }
531 else
532 {
533 ret = temp.Type();
534 }
535
536 return ret;
537 }
538
542
543 static int RegisterRequester(typename type)
544 {
545 if (!m_Instances)
547
548 if ( GetRequester(type) != null )
549 {
550 //Error("Trying to register an already existing requester type: " + type);
551 Debug.Log("Trying to register an already existing requester type: " + type);
552 return -1;
553 }
554
555 m_lastID++;
556
558 req = PPERequesterBase.Cast(type.Spawn());
559 req.SetRequesterIDX(m_lastID);
561
562 return m_lastID;
563 }
564
567 {
568 if (!m_Initialized) //initial registrations are fair game
569 {
570 return true;
571 }
572
574 for (int i = 0; i < m_Instances.Count(); i++)
575 {
576 temp = m_Instances.GetElement(i);
577 if (temp == req)
578 {
579 return true;
580 }
581 }
582
583 //Error("Requester instance " + req + " not valid! Please use registered instances from PPERequesterBank.");
584 Debug.Log("Requester instance '" + req + "' not valid! Please use registered instances from PPERequesterBank.");
585 return false;
586 }
587
588 /*static void DumpInstances()
589 {
590 Print("DumpInstances");
591 for (int i = 0; i < m_Instances.Count(); i++)
592 {
593 Print(m_Instances.GetKey(i));
594 Print(m_Instances.GetElement(i));
595 }
596 }*/
597}
598
601{
603 {
604 //PPERequesterBank.RegisterRequester(TestReq);
605 }
606}
607
608/*modded class PPERequesterRegistrations extends Managed
609{
610 void PPERequesterRegistrations()
611 {
612 PPERequesterBank.RegisterRequester(TestReq2);
613 }
614}

◆ Init()

static void Init ( )
staticprivate
277{
279 private static bool m_Initialized = false;
280
281 static int m_lastID = -1;
282
283 static const int INVALID = -1;
316 //static const int REQ_HMP_LVL3 = RegisterRequester(PPERequester_HeavyMetalPoisoning_3);
318
319 private static ref PPERequesterRegistrations m_Registrations; //more registrations to be placed here
320
321 static void Init()
322 {
324
325 if (!m_Instances)
327
328 m_Initialized = true;
329 }
330
331 static void Cleanup()
332 {
333 if (m_Initialized)
334 {
335 delete m_Registrations;
336 m_Instances.Clear();
337 }
338 }
339
345
346 static PPERequesterBase GetRequester(typename type)
347 {
348 if (!type)
349 {
350 Error("Requested type is NULL!");
351 return null;
352 }
353
356 for (int i = 0; i < m_Instances.Count(); i++)
357 {
358 temp = m_Instances.GetElement(i);
359 if (temp.Type() == type)
360 {
362 break;
363 }
364 }
365
366 if (!ret)
367 {
368 Debug.Log("'" + type.ToString() + "' not found in bank! Register first in 'RegisterRequester' method.");
369 }
370 return ret;
371 }
372
378
380 {
382
383 if (!ret)
384 {
385 Debug.Log("Requester idx '" + index + "' not found in bank! Register first in 'RegisterRequester' method.");
386 }
387 return ret;
388 }
389
395
396 static int GetRequesterID(typename type)
397 {
398 int ret = -1;
400
401 for (int i = 0; i < m_Instances.Count(); i++)
402 {
403 temp = m_Instances.GetElement(i);
404 if (temp.Type() == type)
405 {
406 ret = m_Instances.GetKey(i);
407 }
408 }
409
410 if ( ret == -1 )
411 {
412 Debug.Log("Requester instance of the '" + type.ToString() + "' type not found in bank! Register first in 'RegisterRequester' method.");
413 }
414 return ret;
415 }
416
421
422 static typename GetRequesterTypename(int index)
423 {
424 typename ret;
426 if ( !temp )
427 {
428 Debug.Log("No requester exists under idx '" + index + "' in bank! Register first in 'RegisterRequester' method.");
429 }
430 else
431 {
432 ret = temp.Type();
433 }
434
435 return ret;
436 }
437
441
442 static int RegisterRequester(typename type)
443 {
444 if (!m_Instances)
446
447 if ( GetRequester(type) != null )
448 {
449 //Error("Trying to register an already existing requester type: " + type);
450 Debug.Log("Trying to register an already existing requester type: " + type);
451 return -1;
452 }
453
454 m_lastID++;
455
457 req = PPERequesterBase.Cast(type.Spawn());
458 req.SetRequesterIDX(m_lastID);
460
461 return m_lastID;
462 }
463
466 {
467 if (!m_Initialized) //initial registrations are fair game
468 {
469 return true;
470 }
471
473 for (int i = 0; i < m_Instances.Count(); i++)
474 {
475 temp = m_Instances.GetElement(i);
476 if (temp == req)
477 {
478 return true;
479 }
480 }
481
482 //Error("Requester instance " + req + " not valid! Please use registered instances from PPERequesterBank.");
483 Debug.Log("Requester instance '" + req + "' not valid! Please use registered instances from PPERequesterBank.");
484 return false;
485 }
486
487 /*static void DumpInstances()
488 {
489 Print("DumpInstances");
490 for (int i = 0; i < m_Instances.Count(); i++)
491 {
492 Print(m_Instances.GetKey(i));
493 Print(m_Instances.GetElement(i));
494 }
495 }*/
496}
497
500{
502 {
503 //PPERequesterBank.RegisterRequester(TestReq);
504 }
505}
506
507/*modded class PPERequesterRegistrations extends Managed
508{
509 void PPERequesterRegistrations()
510 {
511 PPERequesterBank.RegisterRequester(TestReq2);
512 }
513}

◆ PPERequesterRegistrations()

class PPERequesterBank extends Managed PPERequesterRegistrations ( )

Mod this, if you wish to register custom requesters.

230 {
231 //PPERequesterBank.RegisterRequester(TestReq);
232 }

Используется в Managed::Init().

◆ RegisterRequester()

static int RegisterRequester ( typename type )
staticprivate

Registers new requester type.

Заметки
Performed only on game start. New requesters can be registered in 'PPERequesterRegistrations'
398{
400 private static bool m_Initialized = false;
401
402 static int m_lastID = -1;
403
404 static const int INVALID = -1;
437 //static const int REQ_HMP_LVL3 = RegisterRequester(PPERequester_HeavyMetalPoisoning_3);
439
440 private static ref PPERequesterRegistrations m_Registrations; //more registrations to be placed here
441
442 static void Init()
443 {
445
446 if (!m_Instances)
448
449 m_Initialized = true;
450 }
451
452 static void Cleanup()
453 {
454 if (m_Initialized)
455 {
456 delete m_Registrations;
457 m_Instances.Clear();
458 }
459 }
460
466
467 static PPERequesterBase GetRequester(typename type)
468 {
469 if (!type)
470 {
471 Error("Requested type is NULL!");
472 return null;
473 }
474
477 for (int i = 0; i < m_Instances.Count(); i++)
478 {
479 temp = m_Instances.GetElement(i);
480 if (temp.Type() == type)
481 {
483 break;
484 }
485 }
486
487 if (!ret)
488 {
489 Debug.Log("'" + type.ToString() + "' not found in bank! Register first in 'RegisterRequester' method.");
490 }
491 return ret;
492 }
493
499
501 {
503
504 if (!ret)
505 {
506 Debug.Log("Requester idx '" + index + "' not found in bank! Register first in 'RegisterRequester' method.");
507 }
508 return ret;
509 }
510
516
517 static int GetRequesterID(typename type)
518 {
519 int ret = -1;
521
522 for (int i = 0; i < m_Instances.Count(); i++)
523 {
524 temp = m_Instances.GetElement(i);
525 if (temp.Type() == type)
526 {
527 ret = m_Instances.GetKey(i);
528 }
529 }
530
531 if ( ret == -1 )
532 {
533 Debug.Log("Requester instance of the '" + type.ToString() + "' type not found in bank! Register first in 'RegisterRequester' method.");
534 }
535 return ret;
536 }
537
542
543 static typename GetRequesterTypename(int index)
544 {
545 typename ret;
547 if ( !temp )
548 {
549 Debug.Log("No requester exists under idx '" + index + "' in bank! Register first in 'RegisterRequester' method.");
550 }
551 else
552 {
553 ret = temp.Type();
554 }
555
556 return ret;
557 }
558
562
563 static int RegisterRequester(typename type)
564 {
565 if (!m_Instances)
567
568 if ( GetRequester(type) != null )
569 {
570 //Error("Trying to register an already existing requester type: " + type);
571 Debug.Log("Trying to register an already existing requester type: " + type);
572 return -1;
573 }
574
575 m_lastID++;
576
578 req = PPERequesterBase.Cast(type.Spawn());
579 req.SetRequesterIDX(m_lastID);
581
582 return m_lastID;
583 }
584
587 {
588 if (!m_Initialized) //initial registrations are fair game
589 {
590 return true;
591 }
592
594 for (int i = 0; i < m_Instances.Count(); i++)
595 {
596 temp = m_Instances.GetElement(i);
597 if (temp == req)
598 {
599 return true;
600 }
601 }
602
603 //Error("Requester instance " + req + " not valid! Please use registered instances from PPERequesterBank.");
604 Debug.Log("Requester instance '" + req + "' not valid! Please use registered instances from PPERequesterBank.");
605 return false;
606 }
607
608 /*static void DumpInstances()
609 {
610 Print("DumpInstances");
611 for (int i = 0; i < m_Instances.Count(); i++)
612 {
613 Print(m_Instances.GetKey(i));
614 Print(m_Instances.GetElement(i));
615 }
616 }*/
617}
618
621{
623 {
624 //PPERequesterBank.RegisterRequester(TestReq);
625 }
626}
627
628/*modded class PPERequesterRegistrations extends Managed
629{
630 void PPERequesterRegistrations()
631 {
632 PPERequesterBank.RegisterRequester(TestReq2);
633 }
634}

◆ VerifyRequester()

static bool VerifyRequester ( PPERequesterBase req)
staticprivate

Verifies the instance.

421{
423 private static bool m_Initialized = false;
424
425 static int m_lastID = -1;
426
427 static const int INVALID = -1;
460 //static const int REQ_HMP_LVL3 = RegisterRequester(PPERequester_HeavyMetalPoisoning_3);
462
463 private static ref PPERequesterRegistrations m_Registrations; //more registrations to be placed here
464
465 static void Init()
466 {
468
469 if (!m_Instances)
471
472 m_Initialized = true;
473 }
474
475 static void Cleanup()
476 {
477 if (m_Initialized)
478 {
479 delete m_Registrations;
480 m_Instances.Clear();
481 }
482 }
483
489
490 static PPERequesterBase GetRequester(typename type)
491 {
492 if (!type)
493 {
494 Error("Requested type is NULL!");
495 return null;
496 }
497
500 for (int i = 0; i < m_Instances.Count(); i++)
501 {
502 temp = m_Instances.GetElement(i);
503 if (temp.Type() == type)
504 {
506 break;
507 }
508 }
509
510 if (!ret)
511 {
512 Debug.Log("'" + type.ToString() + "' not found in bank! Register first in 'RegisterRequester' method.");
513 }
514 return ret;
515 }
516
522
524 {
526
527 if (!ret)
528 {
529 Debug.Log("Requester idx '" + index + "' not found in bank! Register first in 'RegisterRequester' method.");
530 }
531 return ret;
532 }
533
539
540 static int GetRequesterID(typename type)
541 {
542 int ret = -1;
544
545 for (int i = 0; i < m_Instances.Count(); i++)
546 {
547 temp = m_Instances.GetElement(i);
548 if (temp.Type() == type)
549 {
550 ret = m_Instances.GetKey(i);
551 }
552 }
553
554 if ( ret == -1 )
555 {
556 Debug.Log("Requester instance of the '" + type.ToString() + "' type not found in bank! Register first in 'RegisterRequester' method.");
557 }
558 return ret;
559 }
560
565
566 static typename GetRequesterTypename(int index)
567 {
568 typename ret;
570 if ( !temp )
571 {
572 Debug.Log("No requester exists under idx '" + index + "' in bank! Register first in 'RegisterRequester' method.");
573 }
574 else
575 {
576 ret = temp.Type();
577 }
578
579 return ret;
580 }
581
585
586 static int RegisterRequester(typename type)
587 {
588 if (!m_Instances)
590
591 if ( GetRequester(type) != null )
592 {
593 //Error("Trying to register an already existing requester type: " + type);
594 Debug.Log("Trying to register an already existing requester type: " + type);
595 return -1;
596 }
597
598 m_lastID++;
599
601 req = PPERequesterBase.Cast(type.Spawn());
602 req.SetRequesterIDX(m_lastID);
604
605 return m_lastID;
606 }
607
610 {
611 if (!m_Initialized) //initial registrations are fair game
612 {
613 return true;
614 }
615
617 for (int i = 0; i < m_Instances.Count(); i++)
618 {
619 temp = m_Instances.GetElement(i);
620 if (temp == req)
621 {
622 return true;
623 }
624 }
625
626 //Error("Requester instance " + req + " not valid! Please use registered instances from PPERequesterBank.");
627 Debug.Log("Requester instance '" + req + "' not valid! Please use registered instances from PPERequesterBank.");
628 return false;
629 }
630
631 /*static void DumpInstances()
632 {
633 Print("DumpInstances");
634 for (int i = 0; i < m_Instances.Count(); i++)
635 {
636 Print(m_Instances.GetKey(i));
637 Print(m_Instances.GetElement(i));
638 }
639 }*/
640}
641
644{
646 {
647 //PPERequesterBank.RegisterRequester(TestReq);
648 }
649}
650
651/*modded class PPERequesterRegistrations extends Managed
652{
653 void PPERequesterRegistrations()
654 {
655 PPERequesterBank.RegisterRequester(TestReq2);
656 }
657}

Переменные

◆ INVALID

const int INVALID = -1
staticprivate

◆ m_Initialized

bool m_Initialized = false
staticprivate

◆ m_Instances

◆ m_lastID

int m_lastID = -1
staticprivate

Используется в Managed::RegisterRequester().

◆ m_Registrations

ref PPERequesterRegistrations m_Registrations
staticprivate

Используется в Managed::Cleanup() и Managed::Init().

◆ REQ_BLOODLOSS

const int REQ_BLOODLOSS = RegisterRequester(PPERequester_BloodLoss)
staticprivate

◆ REQ_BURLAPSACK

const int REQ_BURLAPSACK = RegisterRequester(PPERequester_BurlapSackEffects)
staticprivate

◆ REQ_CAMERAADS

const int REQ_CAMERAADS = RegisterRequester(PPERequester_CameraADS)
staticprivate

◆ REQ_CAMERANV

const int REQ_CAMERANV = RegisterRequester(PPERequester_CameraNV)
staticprivate

◆ REQ_CONTAMINATEDAREA

const int REQ_CONTAMINATEDAREA = RegisterRequester(PPERequester_ContaminatedAreaTint)
staticprivate

◆ REQ_CONTROLLERBLUR

const int REQ_CONTROLLERBLUR = RegisterRequester(PPERequester_ControlsBlur)
staticprivate

◆ REQ_CONTROLLERDISCONNECT

const int REQ_CONTROLLERDISCONNECT = RegisterRequester(PPERequester_ControllerDisconnectBlur)
staticprivate

◆ REQ_DEATHEFFECTS

const int REQ_DEATHEFFECTS = RegisterRequester(PPERequester_DeathDarkening)
staticprivate

◆ REQ_DROWNING

const int REQ_DROWNING = RegisterRequester(PPERequester_Drowning)
staticprivate

◆ REQ_FEVEREFFECTS

const int REQ_FEVEREFFECTS = RegisterRequester(PPERequester_FeverEffects)
staticprivate

◆ REQ_FLASHBANGEFFECTS

const int REQ_FLASHBANGEFFECTS = RegisterRequester(PPERequester_FlashbangEffects)
staticprivate

◆ REQ_GLASSESAVIATOR

const int REQ_GLASSESAVIATOR = RegisterRequester(PPERequester_GlassesAviator)
staticprivate

◆ REQ_GLASSESDESIGNER

const int REQ_GLASSESDESIGNER = RegisterRequester(PPERequester_GlassesDesignerBlack)
staticprivate

◆ REQ_GLASSESSPORTBLACK

const int REQ_GLASSESSPORTBLACK = RegisterRequester(PPERequester_GlassesSportBlack)
staticprivate

◆ REQ_GLASSESSPORTBLUE

const int REQ_GLASSESSPORTBLUE = RegisterRequester(PPERequester_GlassesSportBlue)
staticprivate

◆ REQ_GLASSESSPORTGREEN

const int REQ_GLASSESSPORTGREEN = RegisterRequester(PPERequester_GlassesSportGreen)
staticprivate

◆ REQ_GLASSESSPORTORANGE

const int REQ_GLASSESSPORTORANGE = RegisterRequester(PPERequester_GlassesSportOrange)
staticprivate

◆ REQ_GLASSESTACTICAL

const int REQ_GLASSESTACTICAL = RegisterRequester(PPERequester_TacticalGoggles)
staticprivate

◆ REQ_GLASSESWELDING

const int REQ_GLASSESWELDING = RegisterRequester(PPERequester_WeldingMask)
staticprivate

◆ REQ_HEALTHHITEFFECTS

const int REQ_HEALTHHITEFFECTS = RegisterRequester(PPERequester_HealthHitReaction)
staticprivate

◆ REQ_HMP_GHOST

const int REQ_HMP_GHOST = RegisterRequester(PPERequester_HMPGhosts)
staticprivate

◆ REQ_INTROCHROMABB

const int REQ_INTROCHROMABB = RegisterRequester(PPERequester_IntroChromAbb)
staticprivate

◆ REQ_INVENTORYBLUR

const int REQ_INVENTORYBLUR = RegisterRequester(PPERequester_InventoryBlur)
staticprivate

◆ REQ_MENUEFFECTS

const int REQ_MENUEFFECTS = RegisterRequester(PPERequester_MenuEffects)
staticprivate

◆ REQ_MOTOHELMETBLACK

const int REQ_MOTOHELMETBLACK = RegisterRequester(PPERequester_MotoHelmetBlack)
staticprivate

◆ REQ_PAINBLUR

const int REQ_PAINBLUR = RegisterRequester(PPERequester_PainBlur)
staticprivate

◆ REQ_SERVERBROWSEREFFECTS

const int REQ_SERVERBROWSEREFFECTS = RegisterRequester(PPERequester_ServerBrowserBlur)
staticprivate

◆ REQ_SHOCKHITEFFECTS

const int REQ_SHOCKHITEFFECTS = RegisterRequester(PPERequester_ShockHitReaction)
staticprivate

◆ REQ_SPOOKYAREA

const int REQ_SPOOKYAREA = RegisterRequester(PPERequester_SpookyAreaTint)
staticprivate

◆ REQ_TUNELVISSION

const int REQ_TUNELVISSION = RegisterRequester(PPERequester_TunnelVisionEffects)
staticprivate

◆ REQ_TUTORIALEFFECTS

const int REQ_TUTORIALEFFECTS = RegisterRequester(PPERequester_TutorialMenu)
staticprivate

◆ REQ_UNCONEFFECTS

const int REQ_UNCONEFFECTS = RegisterRequester(PPERequester_UnconEffects)
staticprivate

◆ REQ_UNDERGROUND

const int REQ_UNDERGROUND = RegisterRequester(PPERUndergroundAcco)
staticprivate