DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ IsRequesterRunning() [2/2]

static bool PPERequesterRegistrations::IsRequesterRunning ( typename type )
staticprivate

Check if specific requester is active (started) based on type name.

См. определение в файле PPERequesterBank.c строка 480

484{
486 private static bool m_Initialized = false;
487
488 static int m_lastID = -1;
489
490 static const int INVALID = -1;
491 static const int REQ_INVENTORYBLUR = RegisterRequester(PPERequester_InventoryBlur);
492 static const int REQ_CONTROLLERDISCONNECT = RegisterRequester(PPERequester_ControllerDisconnectBlur);
493 static const int REQ_GLASSESSPORTBLACK = RegisterRequester(PPERequester_GlassesSportBlack);
494 static const int REQ_GLASSESSPORTBLUE = RegisterRequester(PPERequester_GlassesSportBlue);
495 static const int REQ_GLASSESSPORTGREEN = RegisterRequester(PPERequester_GlassesSportGreen);
496 static const int REQ_GLASSESSPORTORANGE = RegisterRequester(PPERequester_GlassesSportOrange);
497 static const int REQ_GLASSESAVIATOR = RegisterRequester(PPERequester_GlassesAviator);
498 static const int REQ_GLASSESDESIGNER = RegisterRequester(PPERequester_GlassesDesignerBlack);
499 static const int REQ_GLASSESTACTICAL = RegisterRequester(PPERequester_TacticalGoggles);
500 static const int REQ_MOTOHELMETBLACK = RegisterRequester(PPERequester_MotoHelmetBlack);
501 static const int REQ_GLASSESWELDING = RegisterRequester(PPERequester_WeldingMask);
502 static const int REQ_CAMERANV = RegisterRequester(PPERequester_CameraNV);
503 static const int REQ_CAMERAADS = RegisterRequester(PPERequester_CameraADS);
504 static const int REQ_BLOODLOSS = RegisterRequester(PPERequester_BloodLoss);
505 static const int REQ_DEATHEFFECTS = RegisterRequester(PPERequester_DeathDarkening);
506 static const int REQ_UNCONEFFECTS = RegisterRequester(PPERequester_UnconEffects);
507 static const int REQ_TUNELVISSION = RegisterRequester(PPERequester_TunnelVisionEffects);
508 static const int REQ_BURLAPSACK = RegisterRequester(PPERequester_BurlapSackEffects);
509 static const int REQ_INTROCHROMABB = RegisterRequester(PPERequester_IntroChromAbb);
510 static const int REQ_FEVEREFFECTS = RegisterRequester(PPERequester_FeverEffects);
511 static const int REQ_FLASHBANGEFFECTS = RegisterRequester(PPERequester_FlashbangEffects);
512 static const int REQ_SHOCKHITEFFECTS = RegisterRequester(PPERequester_ShockHitReaction);
513 static const int REQ_HEALTHHITEFFECTS = RegisterRequester(PPERequester_HealthHitReaction);
514 static const int REQ_MENUEFFECTS = RegisterRequester(PPERequester_MenuEffects);
515 static const int REQ_CONTROLLERBLUR = RegisterRequester(PPERequester_ControlsBlur);
516 static const int REQ_SERVERBROWSEREFFECTS = RegisterRequester(PPERequester_ServerBrowserBlur);
517 static const int REQ_TUTORIALEFFECTS = RegisterRequester(PPERequester_TutorialMenu);
518 static const int REQ_CONTAMINATEDAREA = RegisterRequester(PPERequester_ContaminatedAreaTint);
519 static const int REQ_SPOOKYAREA = RegisterRequester(PPERequester_SpookyAreaTint);
520 static const int REQ_PAINBLUR = RegisterRequester(PPERequester_PainBlur);
521 static const int REQ_UNDERGROUND = RegisterRequester(PPERUndergroundAcco);
522 static const int REQ_DROWNING = RegisterRequester(PPERequester_Drowning);
523 //static const int REQ_HMP_LVL3 = RegisterRequester(PPERequester_HeavyMetalPoisoning_3);
524 static const int REQ_HMP_GHOST = RegisterRequester(PPERequester_HMPGhosts);
525 static const int REQ_LATENCYBLUR = RegisterRequester(PPERequester_LatencyBlur);
526 static const int REQ_FEEDBACKBLUR = RegisterRequester(PPERequester_FeedbackBlur);
529
530 private static ref PPERequesterRegistrations m_Registrations; //more registrations to be placed here
531
532 static void Init()
533 {
535
536 if (!m_Instances)
538
539 m_Initialized = true;
540 }
541
542 static void Cleanup()
543 {
544 if (m_Initialized)
545 {
546 delete m_Registrations;
547 m_Instances.Clear();
548 }
549 }
550
557 static PPERequesterBase GetRequester(typename type)
558 {
559 if (!type)
560 {
561 Error("Requested type is NULL!");
562 return null;
563 }
564
565 PPERequesterBase temp;
567 for (int i = 0; i < m_Instances.Count(); i++)
568 {
569 temp = m_Instances.GetElement(i);
570 if (temp.Type() == type)
571 {
572 Class.CastTo(ret,temp);
573 break;
574 }
575 }
576
577 if (!ret)
578 {
579 Debug.Log("'" + type.ToString() + "' not found in bank! Register first in 'RegisterRequester' method.");
580 }
581 return ret;
582 }
583
590 static PPERequesterBase GetRequester(int index)
591 {
592 PPERequesterBase ret = m_Instances.Get(index);
593
594 if (!ret)
595 {
596 Debug.Log("Requester idx '" + index + "' not found in bank! Register first in 'RegisterRequester' method.");
597 }
598 return ret;
599 }
600
607 static int GetRequesterID(typename type)
608 {
609 int ret = -1;
610 PPERequesterBase temp;
611
612 for (int i = 0; i < m_Instances.Count(); i++)
613 {
614 temp = m_Instances.GetElement(i);
615 if (temp.Type() == type)
616 {
617 ret = m_Instances.GetKey(i);
618 }
619 }
620
621 if ( ret == -1 )
622 {
623 Debug.Log("Requester instance of the '" + type.ToString() + "' type not found in bank! Register first in 'RegisterRequester' method.");
624 }
625 return ret;
626 }
627
633 static typename GetRequesterTypename(int index)
634 {
635 typename ret;
636 PPERequesterBase temp = m_Instances.Get(index);
637 if ( !temp )
638 {
639 Debug.Log("No requester exists under idx '" + index + "' in bank! Register first in 'RegisterRequester' method.");
640 }
641 else
642 {
643 ret = temp.Type();
644 }
645
646 return ret;
647 }
648
653 static int RegisterRequester(typename type)
654 {
655 if (!m_Instances)
657
658 if ( GetRequester(type) != null )
659 {
660 //Error("Trying to register an already existing requester type: " + type);
661 Debug.Log("Trying to register an already existing requester type: " + type);
662 return -1;
663 }
664
665 m_lastID++;
666
668 req = PPERequesterBase.Cast(type.Spawn());
670 m_Instances.Set(m_lastID,req);
671
672 return m_lastID;
673 }
674
676 static bool VerifyRequester(PPERequesterBase req)
677 {
678 if (!m_Initialized) //initial registrations are fair game
679 {
680 return true;
681 }
682
683 PPERequesterBase temp;
684 for (int i = 0; i < m_Instances.Count(); i++)
685 {
686 temp = m_Instances.GetElement(i);
687 if (temp == req)
688 {
689 return true;
690 }
691 }
692
693 //Error("Requester instance " + req + " not valid! Please use registered instances from PPERequesterBank.");
694 Debug.Log("Requester instance '" + req + "' not valid! Please use registered instances from PPERequesterBank.");
695 return false;
696 }
697
699 static bool IsRequesterRunning(typename type)
700 {
701 PPERequesterBase req = GetRequester(type);
702 if (req)
703 {
704 return req.IsRequesterRunning();
705 }
706 else
707 {
708 Debug.Log("'" + type.ToString() + "' not found in bank! Register first in 'RegisterRequester' method.");
709 }
710
711 return false;
712 }
713
715 static bool IsRequesterRunning(int index)
716 {
717 PPERequesterBase req = GetRequester(index);
718 if (req)
719 {
720 return req.IsRequesterRunning();
721 }
722 else
723 {
724 Debug.Log("Requester idx '" + index + "' not found in bank! Register first in 'RegisterRequester' method.");
725 }
726
727 return false;
728 }
729
730 /*static void DumpInstances()
731 {
732 Print("DumpInstances");
733 for (int i = 0; i < m_Instances.Count(); i++)
734 {
735 Print(m_Instances.GetKey(i));
736 Print(m_Instances.GetElement(i));
737 }
738 }*/
739}
740
743{
745 {
747 }
748
749 protected void RegisterAdditionalRequesters()
750 {
751 //PPERequesterBank.RegisterRequester(TestReq);
752 }
753}
754
755/*modded class PPERequesterRegistrations extends Managed
756{
757 override protected void RegisterAdditionalRequesters()
758 {
759 PPERequesterBank.RegisterRequester(TestReq2);
760 }
761}
bool IsRequesterRunning()
Определения PPERequestPlatformsBase.c:486
static const int REQ_HEALTHHITEFFECTS
Определения PPERequesterBank.c:294
static const int REQ_GLASSESTACTICAL
Определения PPERequesterBank.c:280
static const int REQ_CONTROLLERDISCONNECT
Определения PPERequesterBank.c:273
static const int REQ_LATENCYBLUR
Определения PPERequesterBank.c:306
static const int REQ_GLASSESSPORTBLACK
Определения PPERequesterBank.c:274
void RegisterAdditionalRequesters()
Определения PPERequesterBank.c:270
static ref map< int, ref PPERequesterBase > m_Instances
Определения PPERequesterBank.c:266
static const int REQ_FEEDBACKBLUR
Определения PPERequesterBank.c:307
static const int REQ_INTROCHROMABB
Определения PPERequesterBank.c:290
static const int REQ_CONTROLLERBLUR
Определения PPERequesterBank.c:296
static const int REQ_GLASSESDESIGNER
Определения PPERequesterBank.c:279
class PPERequesterBank extends Managed PPERequesterRegistrations()
Mod this, if you wish to register custom requesters inside 'RegisterAdditionalRequesters' override.
Определения PPERequesterBank.c:265
static const int REQ_BURLAPSACK
Определения PPERequesterBank.c:289
static const int REQ_INVENTORYBLUR
Определения PPERequesterBank.c:272
static const int REQ_CONTAMINATEDAREA
Определения PPERequesterBank.c:299
static const int REQ_GLASSESAVIATOR
Определения PPERequesterBank.c:278
static const int REQ_MOTOHELMETBLACK
Определения PPERequesterBank.c:281
static bool VerifyRequester(PPERequesterBase req)
Verifies the instance.
Определения PPERequesterBank.c:457
static int m_lastID
Определения PPERequesterBank.c:269
static const int REQ_GLASSESSPORTORANGE
Определения PPERequesterBank.c:277
static const int REQ_CAMERANV
Определения PPERequesterBank.c:283
static const int REQ_SHOCKHITEFFECTS
Определения PPERequesterBank.c:293
static const int REQ_FEVEREFFECTS
Определения PPERequesterBank.c:291
static int RegisterRequester(typename type)
Registers new requester type.
Определения PPERequesterBank.c:434
static void Init()
Определения PPERequesterBank.c:313
static const int REQ_DROWNING
Определения PPERequesterBank.c:303
static int GetRequesterID(typename type)
Returns an ID of a requester type.
Определения PPERequesterBank.c:388
static const int REQ_TUTORIALEFFECTS
Определения PPERequesterBank.c:298
static ref PPERequesterRegistrations m_Registrations
Определения PPERequesterBank.c:311
static const int REQ_DEATHEFFECTS
Определения PPERequesterBank.c:286
static GetRequesterTypename(int index)
Returns a typename from a requester ID.
Определения PPERequesterBank.c:414
static const int REQ_SQUINT
Определения PPERequesterBank.c:308
static const int REQ_UNCONEFFECTS
Определения PPERequesterBank.c:287
static const int REQ_SANDSTORMEFFECT
Определения PPERequesterBank.c:309
static const int REQ_TUNELVISSION
Определения PPERequesterBank.c:288
static const int REQ_BLOODLOSS
Определения PPERequesterBank.c:285
static const int REQ_HMP_GHOST
Определения PPERequesterBank.c:305
static const int REQ_GLASSESWELDING
Определения PPERequesterBank.c:282
static const int REQ_PAINBLUR
Определения PPERequesterBank.c:301
static void Cleanup()
Определения PPERequesterBank.c:323
static const int REQ_FLASHBANGEFFECTS
Определения PPERequesterBank.c:292
static const int REQ_CAMERAADS
Определения PPERequesterBank.c:284
static const int REQ_MENUEFFECTS
Определения PPERequesterBank.c:295
static const int REQ_UNDERGROUND
Определения PPERequesterBank.c:302
static const int REQ_GLASSESSPORTBLUE
Определения PPERequesterBank.c:275
static const int REQ_SERVERBROWSEREFFECTS
Определения PPERequesterBank.c:297
static const int REQ_GLASSESSPORTGREEN
Определения PPERequesterBank.c:276
static const int REQ_SPOOKYAREA
Определения PPERequesterBank.c:300
bool m_Initialized
Определения UiHintPanel.c:317
PPERUndergroundAcco GetRequester()
Определения UndergroundHandlerClient.c:56
Super root of all classes in Enforce script.
Определения EnScript.c:11
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.
Определения 3_Game/DayZ/tools/Debug.c:183
Определения 3_Game/DayZ/tools/Debug.c:2
TODO doc.
Определения EnScript.c:118
bool IsRequesterRunning()
Определения PPERequestPlatformsBase.c:53
void SetRequesterIDX(int idx)
automatically assigned by PPERequesterBank
Определения PPERequestPlatformsBase.c:59
Определения Transport.c:70
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
@ INVALID
Invalid file.
Определения EnSystem.c:510