Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
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

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

Variables

enum EScriptInvokerInsertFlags ALL
 Default flag.
 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.
enum EScriptInvokerInsertFlags NONE = 0
 UNIQUE
 Only one call to this instance+method is ever expected.

Enumeration Type Documentation

◆ EScriptInvokerInsertFlags

Definition at line 129 of file tools.c.

Function Documentation

◆ Create()

proto ScriptCaller Create ( func fn)
static

Creates a ScriptCaller.

References ScriptCaller().

◆ 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);
}
enum EScriptInvokerInsertFlags ScriptCaller()
Designed to hold 1 valid call.
proto void Print(void var)
Prints content of variable to console/log.
< 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)

References ScriptCaller().

◆ 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.

Definition at line 134 of file cfgplayerspawndatajson.c.

References discreteItemSets, Debug::Log(), slotName, and spawnWeight.

◆ ScriptCaller()

enum EScriptInvokerInsertFlags ScriptCaller ( )

Designed to hold 1 valid call.

ScriptCaller is meant to be created through Create

Referenced by Create(), and Equals().

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 7 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 13 of file tools.c.