TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

Functions
Network
Function Categories

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

## Detailed Description

## Function Documentation

String addTaggedString | ( | string |  | ) |

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

Parameters

  string | The 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

void allowConnections | ( | enable |  | ) |

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

Parameters

  enable | A boolean value enabling, or disabling connections to the local server.

Returns
  No return value

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

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

Parameters

  enable | A boolean value. If set to true, network packet logging is enabled, otherwise it is disabled.

Returns
  No return value

void closeNetPort | ( |  | ) |

Closes the current network port.

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

  client | The numeric ID of a client gameConnection.
  func | The 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.

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

  func | The 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.

void DNetSetLogging | ( | bool | enabled | ) |

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.

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

  tag | A numeric tag ID.

Returns
  Returns the string corresponding to the tag ID

void removeTaggedString | ( | tag |  | ) |

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

Parameters

  tag | A number tag ID.

Returns
  No return value

Boolean setNetPort | ( | int | port | ) |

Set the network port for the game to use.

Parameters

  The | requested port as an integer

Returns
  Returns true on success, false on fail