Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
tools.c File Reference

Go to the source code of this file.

Data Structures

class  ScriptCallQueue
 ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but later during frame update (used mainly in UI)
usage: More...
 
class  ScriptInvoker
 ScriptInvoker Class provide list of callbacks
usage: More...
 

Enumerations

enum  EScriptInvokerInsertFlags
 

Functions

enum EScriptInvokerInsertFlags ScriptCaller ()
 Designed to hold 1 valid call. More...
 
proto void Init (func fn)
 Replaces the current registered func with the new one, throws errors if unsuccessful. More...
 
proto void Invoke (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)
 Invoke call on the registered func, throws errors if unsuccessful. More...
 
proto bool IsValid ()
 Checks if the ScriptCaller is valid. More...
 
proto bool Equals (notnull ScriptCaller other)
 Compares this script caller against another script caller. More...
 

Variables

enum EScriptInvokerInsertFlags NONE
 
enum EScriptInvokerInsertFlags ALL
 Default flag. More...
 
 IMMEDIATE
 It gets added in immediately, which means that when called while an invoker is running, it will call this newly added call in the same run. More...
 
 UNIQUE
 Only one call to this instance+method is ever expected. More...
 

Enumeration Type Documentation

◆ EScriptInvokerInsertFlags

Definition at line 129 of file tools.c.

Function Documentation

◆ Equals()

proto bool Equals ( notnull ScriptCaller  other)

Compares this script caller against another script caller.

Note
May return true even if either one is invalid
class SomeClass
{
void SomeMethod()
{
}
}
void Test()
{
SomeClass instanceA = new SomeClass();
SomeClass instanceB = new SomeClass();
ScriptCaller callerA;
ScriptCaller callerB;
callerA = ScriptCaller.Create(instanceA.SomeMethod);
callerB = ScriptCaller.Create(instanceA.SomeMethod);
Print(callerA.Equals(callerB));
Print(callerA == callerB);
Print(callerA);
Print(callerB);
callerA = ScriptCaller.Create(instanceA.SomeMethod);
callerB = ScriptCaller.Create(instanceB.SomeMethod);
Print(callerA.Equals(callerB));
Print(callerA == callerB);
Print(callerA);
Print(callerB);
}

◆ Init()

proto void Init ( func  fn)

Replaces the current registered func with the new one, throws errors if unsuccessful.

◆ Invoke()

proto void Invoke ( 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 
)

Invoke call on the registered func, throws errors if unsuccessful.

◆ IsValid()

override bool IsValid ( )

Checks if the ScriptCaller is valid.

Checks if the ScriptCaller is valid.

Definition at line 134 of file cfgplayerspawndatajson.c.

◆ ScriptCaller()

enum EScriptInvokerInsertFlags ScriptCaller ( )

Designed to hold 1 valid call.

ScriptCaller is meant to be created through Create

Variable Documentation

◆ ALL

Default flag.

Note
Don't use this if you want it to remove only the last insert instead of all of them

◆ IMMEDIATE

@ IMMEDIATE

It gets added in immediately, which means that when called while an invoker is running, it will call this newly added call in the same run.

Note
Default flag, as that is the original behaviour, although it might cause endless Insert chain now... (still better than undefined behaviour)
In case of "Possible endless Insert detected" VME, either create an exit, remove the IMMEDIATE flag or make the insert UNIQUE
The Endless Insert is detected by seeing if "amount of calls > initial size + 128"

Definition at line 9 of file tools.c.

◆ NONE

@ NONE

Definition at line 2 of file tools.c.

◆ UNIQUE

UNIQUE

Only one call to this instance+method is ever expected.

Note
Will throw a VME when a second one is attempted to be added
If it was already added without the flag, it will also throw a VME and keep the first of all previously inserted

Definition at line 15 of file tools.c.

ScriptCaller
DayZIntroScene ScriptCaller
Designed to hold 1 valid call.
Print
proto void Print(void var)
Prints content of variable to console/log.
Test
< h scale="0.8">< image set="dayz_gui" name="icon_pin"/> Welcome to the DayZ Stress Test Branch</h >< h scale="0.6"> This branch serves for time limited development tests that are open to the community Our goal in each of these tests is to gather performance and stability data from servers under heavy load</h ></br >< h scale="0.8">< image set="dayz_gui" name="icon_pin"/> Stress test Schedule</h >< h scale="0.6"> We ll only run the Stress Tests when our development team needs data and or specific feedback Stress Tests will be announced on our Twitter and and will usually run for a couple of hours</h ></br >< h scale="0.8">< image set="dayz_gui" name="icon_pin"/> Current Stress Test</h >< h scale="0.6"> In the first bunch of Stress we ll mostly focus on watching server performance under heavy PvP gameplay load For detailed information about an ongoing Stress Test(inlcuding known issues)