TorqueScript Reference
|
#include <netConnection_ScriptBinding.h>
Inherits SimGroup.
Inherited by GameConnection.
Public Member Functions | |
void | checkMaxRate () |
void | connect (remoteAddress) |
String | connectLocal () |
String | getAddress () |
Integer | getGhostID (S32 realID) |
S32 | getGhostsActive () |
Integer | getPacketLoss () |
Integer | getPing () |
Integer | resolveGhostID (S32 ghostID) |
Integer | resolveObjectFromGhostIndex (S32 ghostIdx) |
void | setSimulatedNetParams (packetLoss, delay) |
void checkMaxRate | ( | ) |
Use the checkMaxRate method to retrieve the current maximum packet rate for this connection. The period may not neccesarily be one second. To adjust packet rates, see the preference variables above
void connect | ( | remoteAddress | ) |
Use the connect method to request a connection to a remote server at the address remoteAddress.
remoteAddress | A string containing an address of the form: A.B.C.D:Port, where A .. B are standard IP numbers between 0 and 255 and Port can be between 1000 and 65536. |
String connectLocal | ( | ) |
Use the connectLocal method to connect the current client-side connection to a local NetConnection, that is to create an internal connection from this client to the internal server. This is accomplished through the use of a back door mechanism and has an extremely high bandwidth.
String getAddress | ( | ) |
Use the getAddress method to get the address and port that this NetConnection is currently attached to.
Integer getGhostID | ( | S32 | realID | ) |
Convert a real id to the ghost id for this connection.
S32 getGhostsActive | ( | ) |
Use the getGhostsActive method to determine how many ghosts are active on a particular connection.
Integer getPacketLoss | ( | ) |
Use the getPacketLoss method to determine the current packetLoss count for this connection.
Integer getPing | ( | ) |
Use the getPing method to determine the round-trip travel time from this connection to the agent on the other end and back again.
Integer resolveGhostID | ( | S32 | ghostID | ) |
Convert a ghost id from this connection to a real id.
Integer resolveObjectFromGhostIndex | ( | S32 | ghostIdx | ) |
Convert a ghost index from this connection to a real id.
void setSimulatedNetParams | ( | packetLoss | , |
delay | |||
) |
Use the setSimulatedNetParams method to force a connection to experience a certain degree of packet-loss and/or latency. This is a debug feature to allow us to see how a distributed game will behave in the face of poor connection quality.
packetLoss | A floating-point value between 0.0 (0%) and 1.0 (100%) dictating the percentage of packets to be artificially lost. |
delay | An integer value specifying the number of milliseconds to insert into transmission latencies. |