TorqueScript Reference
Functions

Functions

String addTaggedString (string)
 
void allowConnections (enable)
 
String buildTaggedString (format, [arg1,...arg9]?)
 
void closeNetPort ()
 Closes the current network port.
 
void commandToClient (client, func, [arg1,..., argn]?)
 
void commandToNamedServer (...)
 
void commandToServer (func, [arg1,..., argn]?)
 
void DNetSetLogging (bool enabled)
 
void dumpNetStringTable ()
 
String getTaggedString (tag)
 
Boolean isAddressTypeAvailable (int addressType)
 
void removeTaggedString (tag)
 
Boolean setNetPort (int port, bind)
 

Detailed Description

Function Documentation

◆ addTaggedString()

String addTaggedString ( string  )

Use the addTaggedString function to tag a new string and add it to the NetStringTable.

Parameters
stringThe string to tagged and placed in the NetStringTable. Tagging ignores case, so tagging the same string (excluding case differences) will be ignored as a duplicated tag.
Returns
Returns a string (containing a numeric value) equivalent to the string ID for the newly tagged string

◆ allowConnections()

void allowConnections ( enable  )

Use the allowConnections to enable (or disable) remote connections to the local game server.

Parameters
enableA boolean value enabling, or disabling connections to the local server.
Returns
No return value

◆ buildTaggedString()

String buildTaggedString ( format  ,
[arg1, ...arg9] ?   
)

Use the buildTaggedString function to build a tagged string using the specified format.

Parameters
enableA boolean value. If set to true, network packet logging is enabled, otherwise it is disabled.
Returns
No return value

◆ closeNetPort()

void closeNetPort ( )

Closes the current network port.

◆ commandToClient()

void commandToClient ( client  ,
func  ,
[arg1, ... , argn] ?   
)

Use the commandToClient function to issue a remote procedure call on a client. All arguments (excluding client) may be in tagged or non-tagged format. See 'Remote Procedure Call Samples' below

Parameters
clientThe numeric ID of a client gameConnection.
funcThe suffix of the remote procedure name to be executed on the client.
arg1... argn - Optional arguments to be passed to the remote procedure.
Returns
No return value.

◆ commandToNamedServer()

void commandToNamedServer (   ...)

◆ commandToServer()

void commandToServer ( func  ,
[arg1, ... , argn] ?   
)

Use the commandToServer function to issue a remote procedure call the server. All arguments may be in tagged or non-tagged format. See 'Remote Procedure Call Samples' below

Parameters
funcThe suffix of the remote procedure name to be executed on the client.
arg1... argn - Optional arguments to be passed to the remote procedure.
Returns
No return value.

◆ DNetSetLogging()

void DNetSetLogging ( bool  enabled)

◆ dumpNetStringTable()

void dumpNetStringTable ( )

Use the dumpNetStringTable function to dump a list of all the currently registered NetStringTable entries, including the times each has been referenced, the total entry count, and the current 'highest' reference string. For this to work, the engine must have been compiled with TORQUE_DEBUG defined

Returns
No return value.

◆ getTaggedString()

String getTaggedString ( tag  )

Use the getTaggedString function to convert a tag to a string. This is not the same a detag() which can only be used within the context of a function that receives a tag. This function can be used any time and anywhere to convert a tag to a string.

Parameters
tagA numeric tag ID.
Returns
Returns the string corresponding to the tag ID

◆ isAddressTypeAvailable()

Boolean isAddressTypeAvailable ( int  addressType)

Determines if a specified address type can be reached.

Parameters
protocolid
Returns
Returns true on success, false on fail

◆ removeTaggedString()

void removeTaggedString ( tag  )

Use the removeTaggedSTring function to remove a previously tagged string from the NetStringTable.

Parameters
tagA number tag ID.
Returns
No return value

◆ setNetPort()

Boolean setNetPort ( int  port,
bind   
)

Set the network port for the game to use.

Parameters
Therequested port as an integer
Returns
Returns true on success, false on fail