Torque2D Reference
Loading...
Searching...
No Matches
GameConnection Class Reference

#include <gameConnection.h>

Inheritance diagram for GameConnection:

Classes

struct  GamePacketNotify

Public Types

enum  Constants { GameConnectionBlockTypeCount , MaxConnectArgs = 16 }
 Configuration. More...
Public Types inherited from NetConnection
enum  Constants { HashTableSize = 127 }
enum  NetConnectionFlags { ConnectionToServer = BIT(0) , ConnectionToClient = BIT(1) , LocalClientConnection = BIT(2) , NetworkConnection = BIT(3) }
enum  NetConnectionState {
  NotConnected , AwaitingChallengeResponse , AwaitingConnectRequest , AwaitingConnectResponse ,
  Connected
}
enum  GhostConstants { GhostIdBitSize = 12 , MaxGhostCount = 1 << GhostIdBitSize , GhostLookupTableSize = 1 << GhostIdBitSize , GhostIndexBitSize = 4 }
 Some configuration values. More...
enum  DemoBlockTypes { BlockTypePacket , BlockTypeSendPacket , NetConnectionBlockTypeCount }
enum  DemoConstants { MaxNumBlockTypes = 16 , MaxBlockSize = 0x1000 }
typedef SimObjectList::iterator iterator
typedef SimObjectList::value_type value
Public Types inherited from SimObject
enum  WriteFlags { SelectedOnly = BIT(0) }
enum  CopyFieldsFlags { CopyFields_SkipName = BIT(0) , CopyFields_SkipParentGroup = BIT(1) , CopyFields_SkipScriptClass = BIT(2) }
 What copyFieldsFrom may be told to leave alone. More...

Public Member Functions

void setConnectArgs (U32 argc, const char **argv)
 Set connection arguments; these are passed to the server when we connect.
void setJoinPassword (const char *password)
 Set the server password to use when we join.
bool canRemoteCreate ()
 DECLARE_CONOBJECT (GameConnection)
void handleConnectionMessage (U32 message, U32 sequence, U32 ghostCount)
void setDisconnectReason (const char *reason)
 GameConnection ()
 ~GameConnection ()
bool onAdd ()
 Called when the object is added to the sim.
void onRemove ()
 Called when the object is removed from the sim.
void detectLag ()
Event Handling
virtual void onTimedOut ()
virtual void onConnectTimedOut ()
virtual void onDisconnect (const char *reason)
virtual void onConnectionRejected (const char *reason)
virtual void onConnectionEstablished (bool isInitiator)
virtual void handleStartupError (const char *errorString)
Authentication

This is remnant code from Tribes 2.

void setAuthInfo (const AuthInfo *info)
const AuthInfogetAuthInfo ()
Public Member Functions inherited from NetConnection
void sendDisconnectPacket (const char *reason)
void connect (const NetAddress *address)
U32 getNetClassGroup ()
void setSimulatedNetParams (F32 packetLoss, U32 ping)
bool isConnectionToServer ()
bool isLocalConnection ()
bool isNetworkConnection ()
void setIsConnectionToServer ()
void setIsLocalClientConnection ()
void setNetworkConnection (bool net)
virtual void setEstablished ()
void setRemoteConnectionObject (NetConnection *connection)
 Call this if the "connection" is local to this app. This short-circuits the protocol layer.
void setSequence (U32 connectSequence)
void setAddressDigest (U32 digest[4])
void getAddressDigest (U32 digest[4])
U32 getSequence ()
void setProtocolVersion (U32 protocolVersion)
U32 getProtocolVersion ()
F32 getRoundTripTime ()
F32 getPacketLoss ()
void checkMaxRate ()
void handlePacket (BitStream *stream)
void processRawPacket (BitStream *stream)
void handleNotify (bool recvd)
void handleConnectionEstablished ()
void keepAlive ()
const NetAddressgetNetAddress ()
void setNetAddress (const NetAddress *address)
Net::Error sendPacket (BitStream *stream)
bool checkTimeout (U32 time)
 returns true if the connection timed out
void checkPacketSend (bool force)
bool missionPathsSent () const
void setMissionPathsSent (const bool s)
void onRemove ()
 Called when the object is removed from the sim.
 NetConnection ()
 ~NetConnection ()
void setConnectionState (U32 state)
U32 getConnectionState ()
void setGhostFrom (bool ghostFrom)
 Sets whether ghosts transmit from this side of the connection.
void setGhostTo (bool ghostTo)
 Sets whether ghosts are allowed from the other side of the connection.
void setSendingEvents (bool sending)
 Sets whether this side actually sends the events that are posted to it.
void setTranslatesStrings (bool xl)
 Sets whether this connection is capable of translating strings.
void setNetClassGroup (U32 group)
 Sets the group of NetClasses this connection traffics in.
bool isEstablished ()
 Is the connection established?
 DECLARE_CONOBJECT (NetConnection)
U32 getGhostsActive ()
bool isGhostingTo ()
 Are we ghosting to someone?
bool isGhostingFrom ()
 Are we ghosting from someone?
void ghostOnRemove ()
 Called by onRemove, to shut down the ghost subsystem.
virtual void doneScopingScene ()
void setScopeObject (NetObject *object)
 Set the object around which we are currently scoping network traffic.
NetObjectgetScopeObject ()
 Get the object aorund which we are currently scoping network traffic.
void objectInScope (NetObject *object)
 Add an object to scope.
void objectLocalScopeAlways (NetObject *object)
 Add an object to scope, marking that it should always be scoped to this connection.
void objectLocalClearAlways (NetObject *object)
NetObjectresolveGhost (S32 id)
 Get a NetObject* from a ghost ID (on client side).
NetObjectresolveObjectFromGhostIndex (S32 id)
 Get a NetObject* from a ghost index (on the server side).
S32 getGhostIndex (NetObject *object)
void ghostPushNonZero (GhostInfo *gi)
 Move a GhostInfo into the nonzero portion of the list (so that we know to update it).
void ghostPushToZero (GhostInfo *gi)
 Move a GhostInfo into the zero portion of the list (so that we know not to update it).
void ghostPushZeroToFree (GhostInfo *gi)
 Move a GhostInfo from the zero portion of the list to the free portion.
void ghostPushFreeToZero (GhostInfo *info)
 Move a GhostInfo from the free portion of the list to the zero portion.
void resetGhosting ()
void activateGhosting ()
 Activate ghosting, once it's enabled.
bool isGhosting ()
 Are we ghosting?
void detachObject (GhostInfo *info)
 Begin to stop ghosting an object.
void setGhostAlwaysObject (NetObject *object, U32 index)
 Mark an object to be always ghosted. Index is the ghost index of the object.
void sendConnectionMessage (U32 message, U32 sequence=0, U32 ghostCount=0)
bool isRecording ()
bool isPlayingBack ()
U32 getNextBlockType ()
void recordBlock (U32 type, U32 size, void *data)
virtual void handleRecordedBlock (U32 type, U32 size, void *data)
bool processNextBlock ()
bool startDemoRecord (const char *fileName)
bool replayDemoRecord (const char *fileName)
void startDemoRead ()
void stopRecording ()
void stopDemoPlayback ()
virtual void writeDemoStartBlock (ResizeBitStream *stream)
virtual bool readDemoStartBlock (BitStream *stream)
virtual void demoPlaybackComplete ()
bool postNetEvent (NetEvent *event)
 Post an event to this connection.
NetConnectiongetNext ()
void mapString (U32 netId, NetStringHandle &string)
U32 checkString (NetStringHandle &string, bool *isOnOtherSide=NULL)
U32 getNetSendId (NetStringHandle &string)
void confirmStringReceived (NetStringHandle &string, U32 index)
NetStringHandle translateRemoteStringId (U32 id)
void validateSendString (const char *str)
void packString (BitStream *stream, const char *str)
void unpackString (BitStream *stream, char readBuffer[1024])
void packNetStringHandleU (BitStream *stream, NetStringHandle &h)
NetStringHandle unpackNetStringHandleU (BitStream *stream)
bool startSendingFile (const char *fileName)
 Start sending the specified file over the link.
void chunkReceived (U8 *chunkData, U32 chunkLen)
 Called when we receive a FileChunkEvent.
void sendNextFileDownloadRequest ()
 Get the next file...
void sendFileChunk ()
 Post the next FileChunkEvent.
virtual void fileDownloadSegmentComplete ()
 Called when we finish downloading file data.
void loadNextGhostAlwaysObject (bool hadNewFiles)
Public Member Functions inherited from ConnectionProtocol
 ConnectionProtocol ()
void buildSendPacketHeader (BitStream *bstream, S32 packetType=0)
void sendPingPacket ()
void sendAckPacket ()
void setConnectionEstablished ()
bool windowFull ()
bool connectionEstablished ()
void setConnectSequence (U32 connectSeq)
Public Member Functions inherited from SimGroup
 ~SimGroup ()
virtual void addObject (SimObject *)
 Add an object to the group.
void addObject (SimObject *, SimObjectId)
void addObject (SimObject *, const char *name)
virtual void removeObject (SimObject *)
 Remove an object from the group.
virtual void onChildRemoved (SimObject *)
virtual SimObjectfindObject (const char *name)
 Find an object in the group.
bool processArguments (S32 argc, const char **argv)
 Process constructor options. (ie, new SimObject(1,2,3)).
 DECLARE_CONOBJECT (SimGroup)
Public Member Functions inherited from SimSet
 SimSet ()
 ~SimSet ()
virtual void onDeleteNotify (SimObject *object)
virtual U32 getTamlChildCount (void) const
 Called when Taml attempts to compile a list of children.
virtual SimObjectgetTamlChild (const U32 childIndex) const
 Called when Taml attempts to compile a list of children.
virtual void addTamlChild (SimObject *pSimObject)
 Called when Taml attempts to populate an objects children during a read.
void callOnChildren (const char *method, S32 argc, const char *argv[], bool executeOnChildGroups=true)
virtual void write (Stream &stream, U32 tabStop, U32 flags=0)
SimObjectfindObjectByInternalName (const char *internalName, bool searchChildren=false)
virtual bool writeObject (Stream *stream)
virtual bool readObject (Stream *stream)
void lock ()
void unlock ()
 DECLARE_CONOBJECT (SimSet)
void _setVectorAssoc (const char *file, const U32 line)
virtual void pushObject (SimObject *)
virtual void popObject ()
 Remove an object from the end of the list.
void bringObjectToFront (SimObject *obj)
void pushObjectToBack (SimObject *obj)
SimObjectfront ()
SimObjectfirst ()
SimObjectlast ()
bool empty ()
S32 size () const
iterator begin ()
iterator end ()
value operator[] (S32 index)
iterator find (iterator first, iterator last, SimObject *obj)
iterator find (SimObject *obj)
template<typename T>
bool containsType (void)
bool isMember (SimObject *obj)
virtual bool reOrder (SimObject *obj, SimObject *target=0)
SimObjectat (S32 index) const
void deleteObjects (void)
void clear ()
Public Member Functions inherited from SimObject
StringTableEntry getClassNamespace () const
StringTableEntry getSuperClassNamespace () const
void setClassNamespace (const char *classNamespace)
void setSuperClassNamespace (const char *superClassNamespace)
void pushScriptCallbackGuard (void)
void popScriptCallbackGuard (void)
S32 getScriptCallbackGuard (void)
NamespacegetNamespace ()
 Return the object's namespace.
const char * tabComplete (const char *prevText, S32 baseLen, bool)
virtual void dump ()
virtual void dumpClassHierarchy ()
SimObjectclone (const bool copyDynamicFields)
virtual void copyTo (SimObject *object)
SimObjectdeepClone ()
template<typename T>
bool isType (void)
virtual bool handlesConsoleMethod (const char *fname, S32 *routingId)
 DECLARE_CONOBJECT (SimObject)
virtual bool writeField (StringTableEntry fieldname, const char *value)
virtual void writeFields (Stream &stream, U32 tabStop)
virtual void buildFilterList ()
void addFieldFilter (const char *fieldName)
void removeFieldFilter (const char *fieldName)
void clearFieldFilters ()
bool isFiltered (const char *fieldName)
void assignFieldsFrom (SimObject *obj)
void copyFieldsFrom (SimObject *obj, const U32 flags)
void assignDynamicFieldsFrom (SimObject *obj)
NotifyremoveNotify (void *ptr, Notify::Type)
 Remove a notification from the list.
void deleteNotify (SimObject *obj)
 Notify an object when we are deleted.
void clearNotify (SimObject *obj)
 Notify an object when we are cleared.
void clearAllNotifications ()
 Remove all notifications for this object.
void processDeleteNotifies ()
 Send out deletion notifications.
void registerReference (SimObject **obj)
void unregisterReference (SimObject **obj)
void addListener (std::string objID)
void removeListener (std::string objID)
void removeAllListeners ()
void postEvent (std::string eventName, std::string data)
const char * getDataField (StringTableEntry slotName, const char *array)
virtual void setDataField (StringTableEntry slotName, const char *array, const char *value)
const char * getPrefixedDataField (StringTableEntry fieldName, const char *array)
void setPrefixedDataField (StringTableEntry fieldName, const char *array, const char *value)
const char * getPrefixedDynamicDataField (StringTableEntry fieldName, const char *array, const S32 fieldType=-1)
void setPrefixedDynamicDataField (StringTableEntry fieldName, const char *array, const char *value, const S32 fieldType=-1)
StringTableEntry getDataFieldPrefix (StringTableEntry fieldName)
U32 getDataFieldType (StringTableEntry slotName, const char *array)
SimFieldDictionarygetFieldDictionary ()
void clearDynamicFields (void)
 Clear all dynamic fields.
void setCanSaveDynamicFields (bool bCanSave)
 Set whether fields created at runtime should be saved. Default is true.
bool getCanSaveDynamicFields (void) const
 Get whether fields created at runtime should be saved. Default is true.
void setInternalName (const char *newname)
StringTableEntry getInternalName ()
 Get the internal of of this control.
virtual bool save (const char *pcFilePath, bool bOnlySelected=false)
 Save object as a TorqueScript File.
virtual bool isMethod (const char *methodName)
 Check if a method exists in the objects current namespace.
SimObjectId getId (void) const
StringTableEntry getIdString (void) const
U32 getType () const
const StringTableEntry getName (void) const
void setId (SimObjectId id)
void assignName (const char *name)
SimGroupgetGroup () const
bool isChildOfGroup (SimGroup *pGroup)
bool isProperlyAdded () const
bool isDeleted () const
bool isRemoved () const
bool isLocked () const
void setLocked (bool b)
bool isHidden () const
void setHidden (bool b)
void setProgenitorFile (const char *pFile)
StringTableEntry getProgenitorFile (void) const
void setPeriodicTimerID (const S32 timerID)
S32 getPeriodicTimerID (void) const
bool isPeriodicTimerActive (void) const
bool isSelected () const
bool isExpanded () const
void setSelected (bool sel)
void setExpanded (bool exp)
void setModDynamicFields (bool dyn)
void setModStaticFields (bool sta)
 SimObject ()
virtual ~SimObject ()
virtual void onGroupAdd ()
 Called when the object is added to a SimGroup.
virtual void onGroupRemove ()
 Called when the object is removed from a SimGroup.
virtual void onNameChange (const char *name)
 Called when the object's name is changed.
virtual void onStaticModified (const char *slotName, const char *newValue=NULL)
virtual void inspectPreApply ()
virtual void inspectPostApply ()
virtual void onEditorEnable ()
 Called when the editor is activated.
virtual void onEditorDisable ()
 Called when the editor is deactivated.
bool registerObject ()
bool registerObject (U32 id)
bool registerObject (const char *name)
bool registerObject (const char *name, U32 id)
void unregisterObject ()
void deleteObject ()
bool addToSet (SimObjectId)
bool addToSet (const char *)
bool removeFromSet (SimObjectId)
bool removeFromSet (const char *)
Public Member Functions inherited from ConsoleObject
const AbstractClassRep::FieldfindField (StringTableEntry fieldName) const
 Get a reference to a field by name.
virtual AbstractClassRepgetClassRep () const
 Gets the ClassRep.
bool setField (const char *fieldName, const char *value)
 Set the value of a field.
virtual ~ConsoleObject ()
const AbstractClassRep::FieldListgetFieldList () const
 Get a list of all the fields. This information cannot be modified.
AbstractClassRep::FieldListgetModifiableFieldList ()
bool & getDynamicGroupExpand ()
S32 getClassId (U32 netClassGroup) const
const char * getClassName () const

Static Public Member Functions

static void consoleInit ()
static GameConnectiongetServerConnection ()
static GameConnectiongetLocalClientConnection ()
Static Public Member Functions inherited from NetConnection
static NetConnectiongetConnectionToServer ()
static NetConnectiongetLocalClientConnection ()
static void setLocalClientConnection (NetConnection *conn)
static bool filesWereDownloaded ()
static char * getErrorBuffer ()
static void setLastError (const char *fmt,...)
static NetConnectionlookup (const NetAddress *remoteAddress)
 Find a NetConnection, if any, with the specified address.
static void consoleInit ()
static NetConnectiongetConnectionList ()
Static Public Member Functions inherited from SimObject
static void initPersistFields ()
Static Public Member Functions inherited from ConsoleObject
static const char * lookupClassName (const U32 in_classTag)
 Get the classname from a class tag.
static void initPersistFields ()
static void consoleInit ()
static AbstractClassRepgetStaticClassRep ()
 Get the abstract class information for this class.
static AbstractClassRepgetParentStaticClassRep ()
 Get the abstract class information for this class's superclass.
static ConsoleObjectcreate (const char *in_pClassName)
static ConsoleObjectcreate (const U32 groupId, const U32 typeId, const U32 in_classId)

Static Public Attributes

Protocol Versions

Protocol versions are used to indicated changes in network traffic. These could be changes in how any object transmits or processes network information. You can specify backwards compatability by specifying a MinRequireProtocolVersion. If the client protocol is >= this min value, the connection is accepted.

Torque (V12) SDK 1.0 uses protocol = 1

Torque SDK 1.1 uses protocol = 2

static const U32 CurrentProtocolVersion = 12
static const U32 MinRequiredProtocolVersion = 12
Static Public Attributes inherited from NetConnection
static char mErrorBuffer [256]
static bool disableNameChanging = false

Protected Member Functions

PacketNotifyallocNotify ()
Protected Member Functions inherited from NetConnection
SimObjectPtr< NetConnectiongetRemoteConnection ()
void clearGhostInfo ()
bool validateGhostArray ()
void ghostPacketDropped (PacketNotify *notify)
void ghostPacketReceived (PacketNotify *notify)
void ghostWritePacket (BitStream *bstream, PacketNotify *notify)
void ghostReadPacket (BitStream *bstream)
void freeGhostInfo (GhostInfo *)
void ghostWriteStartBlock (ResizeBitStream *stream)
void ghostReadStartBlock (BitStream *stream)
Protected Member Functions inherited from SimGroup
virtual void deepCloneChildren (SimObject *clone)
Protected Member Functions inherited from SimObject
virtual void onTamlPreWrite (void)
 Taml callbacks.
virtual void onTamlPostWrite (void)
 Called after Taml has finished writing the object.
virtual void onTamlPreRead (void)
 Called prior to Taml reading the object.
virtual void onTamlPostRead (const TamlCustomNodes &customNodes)
virtual void onTamlAddParent (SimObject *pParentObject)
 Called after Taml has finished reading the object and has added the object to any parent.
virtual void onTamlCustomWrite (TamlCustomNodes &customNodes)
 Called during the writing of the object to allow custom properties to be written.
virtual void onTamlCustomRead (const TamlCustomNodes &customNodes)
 Called during the reading of the object to allow custom properties to be read.
void linkNamespaces ()
void unlinkNamespaces ()
virtual SimObjectallocClone ()
 A registered but empty object of this object's class.
void cloneInto (SimObject *clone)
Protected Member Functions inherited from ConsoleObject
 ConsoleObject ()
 ConsoleObject (const ConsoleObject &)

Protected Attributes

AuthInfomAuthInfo
S32 mLastPacketTime
bool mLagging
Protected Attributes inherited from NetConnection
U32 mConnectSendCount
U32 mConnectLastSendTime
GhostInfo ** mGhostArray
 Linked list of ghostInfos ghosted by this side of the connection.
U32 mGhostZeroUpdateIndex
 Index in mGhostArray of first ghost with 0 update mask.
U32 mGhostFreeIndex
 Index in mGhostArray of first free ghost.
U32 mGhostsActive
bool mGhosting
 Am I currently ghosting objects?
bool mScoping
 am I currently scoping objects?
U32 mGhostingSequence
 Sequence number describing this ghosting session.
NetObject ** mLocalGhosts
GhostInfomGhostRefs
 mLocalGhosts pointer is NULL if mGhostTo is false
GhostInfo ** mGhostLookupTable
 Table indexed by object id to GhostInfo. Null if ghostFrom is false.
SimObjectPtr< NetObjectmScopeObject
Vector< char * > mMissingFileList
StreammCurrentDownloadingFile
 Stream for currently uploading file (if any).
void * mCurrentFileBuffer
 Storage for currently downloading file.
U32 mCurrentFileBufferSize
 Size of currently downloading file in bytes.
U32 mCurrentFileBufferOffset
 Our position in the currently downloading file in bytes.
U32 mNumDownloadedFiles
 Number of files we have downloaded.
char mLastFileErrorBuffer [256]
 Error storage for file transfers.
Vector< GhostSavemGhostAlwaysSaveList
 List of objects to ghost-always.
Protected Attributes inherited from ConnectionProtocol
U32 mLastSeqRecvdAtSend [32]
U32 mLastSeqRecvd
U32 mHighestAckedSeq
U32 mLastSendSeq
U32 mAckMask
U32 mConnectSequence
U32 mLastRecvAckAck
bool mConnectionEstablished
Protected Attributes inherited from SimSet
SimObjectList objectList
void * mMutex
Protected Attributes inherited from SimObject
SimObjectId mId
 Id number for this object.
StringTableEntry mIdString
NamespacemNameSpace
U32 mTypeMask
S32 mScriptCallbackGuard
 Whether the object is executing a script callback.
bool mCanSaveFieldDictionary
 true if dynamic fields (added at runtime) should be saved, defaults to true
StringTableEntry mInternalName
 Stores object Internal Name.
StringTableEntry mClassName
 Stores the class name to link script class namespaces.
StringTableEntry mSuperClassName
 Stores super class name to link script class namespaces.

Static Protected Attributes

static S32 mLagThresholdMS = 0
Static Protected Attributes inherited from NetConnection
static SimObjectPtr< NetConnectionmServerConnection
static SimObjectPtr< NetConnectionmLocalClientConnection
static bool mFilesWereDownloaded = false
static SimObject::NotifymNotifyFreeList = NULL

Packet I/O

virtual void writeConnectRequest (BitStream *stream)
virtual bool readConnectRequest (BitStream *stream, const char **errorString)
virtual void writeConnectAccept (BitStream *stream)
virtual bool readConnectAccept (BitStream *stream, const char **errorString)
void readPacket (BitStream *bstream)
void writePacket (BitStream *bstream, PacketNotify *note)
void packetReceived (PacketNotify *note)
void packetDropped (PacketNotify *note)
void connectionError (const char *errorString)

Additional Inherited Members

Public Attributes inherited from NetConnection
U32 mConnectionSendCount
 number of connection messages we've sent.
U32 mConnectionState
 State of the connection, from NetConnectionState.
PacketNotifymNotifyQueueHead
 Head of packet notify list.
PacketNotifymNotifyQueueTail
 Tail of packet notify list.
Protected Types inherited from NetConnection
enum  GhostStates {
  GhostAlwaysDone , ReadyForNormalGhosts , EndGhosting , GhostAlwaysStarting ,
  SendNextDownloadRequest , FileDownloadSizeMessage , NumConnectionMessages
}
Static Protected Member Functions inherited from SimObject
static bool setClass (void *obj, const char *data)
static bool setSuperClass (void *obj, const char *data)
static bool writeObjectName (void *obj, StringTableEntry pFieldName)
static bool writeCanSaveDynamicFields (void *obj, StringTableEntry pFieldName)
static bool writeInternalName (void *obj, StringTableEntry pFieldName)
static bool setParentGroup (void *obj, const char *data)
static bool writeParentGroup (void *obj, StringTableEntry pFieldName)
static bool writeSuperclass (void *obj, StringTableEntry pFieldName)
static bool writeClass (void *obj, StringTableEntry pFieldName)
static bool setProtectedName (void *obj, const char *data)
static const char * getProtectedName (void *obj, const char *data)
static SimObject::NotifyallocNotify ()
 Get a free Notify structure.
static void freeNotify (SimObject::Notify *)
 Mark a Notify structure as free.
static void addGroup (const char *in_pGroupname, const char *in_pGroupDocs=NULL)
static void endGroup (const char *in_pGroupname)
static void addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL)
static void addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::WriteDataNotify in_writeDataFn, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL)
static void addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, const char *in_pFieldDocs)
static void addField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::WriteDataNotify in_writeDataFn, const char *in_pFieldDocs)
static void addFieldV (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, ConsoleTypeValidator *v, const char *in_pFieldDocs=NULL)
static void addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL)
static void addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, AbstractClassRep::WriteDataNotify in_writeDataFn=&defaultProtectedWriteFn, const U32 in_elementCount=1, EnumTable *in_table=NULL, const char *in_pFieldDocs=NULL)
static void addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, const char *in_pFieldDocs=NULL)
static void addProtectedField (const char *in_pFieldname, const U32 in_fieldType, const dsize_t in_fieldOffset, AbstractClassRep::SetDataNotify in_setDataFn, AbstractClassRep::GetDataNotify in_getDataFn=&defaultProtectedGetFn, AbstractClassRep::WriteDataNotify in_writeDataFn=&defaultProtectedWriteFn, const char *in_pFieldDocs=NULL)
static void addDepricatedField (const char *fieldName)
static bool removeField (const char *in_pFieldname)

Member Enumeration Documentation

◆ Constants

enum Constants

Configuration.

Enumerator
GameConnectionBlockTypeCount 
MaxConnectArgs 

Constructor & Destructor Documentation

◆ GameConnection()

◆ ~GameConnection()

Member Function Documentation

◆ allocNotify()

NetConnection::PacketNotify * allocNotify ( )
protectedvirtual

Reimplemented from NetConnection.

◆ canRemoteCreate()

bool canRemoteCreate ( )
virtual

Reimplemented from NetConnection.

◆ connectionError()

void connectionError ( const char * errorString)
protectedvirtual

Reimplemented from NetConnection.

◆ consoleInit()

void consoleInit ( )
static

◆ DECLARE_CONOBJECT()

DECLARE_CONOBJECT ( GameConnection )

◆ detectLag()

void detectLag ( )

◆ getAuthInfo()

const AuthInfo * getAuthInfo ( )

◆ getLocalClientConnection()

GameConnection * getLocalClientConnection ( )
inlinestatic

◆ getServerConnection()

GameConnection * getServerConnection ( )
inlinestatic

◆ handleConnectionMessage()

void handleConnectionMessage ( U32 message,
U32 sequence,
U32 ghostCount )
virtual

Handle message from sendConnectionMessage().

This is called to handle messages sent via sendConnectionMessage.

Parameters
messageOne of GhostStates
sequenceA sequence number, if any.
ghostCountA count of ghosts relating to this message.

Reimplemented from NetConnection.

◆ handleStartupError()

void handleStartupError ( const char * errorString)
virtual

Reimplemented from NetConnection.

◆ onAdd()

bool onAdd ( void )
virtual

Called when the object is added to the sim.

Reimplemented from SimObject.

◆ onConnectionEstablished()

void onConnectionEstablished ( bool isInitiator)
virtual

Reimplemented from NetConnection.

◆ onConnectionRejected()

void onConnectionRejected ( const char * reason)
virtual

Reimplemented from NetConnection.

◆ onConnectTimedOut()

void onConnectTimedOut ( )
virtual

Reimplemented from NetConnection.

◆ onDisconnect()

void onDisconnect ( const char * reason)
virtual

Reimplemented from NetConnection.

◆ onRemove()

void onRemove ( )
virtual

Called when the object is removed from the sim.

Reimplemented from SimGroup.

◆ onTimedOut()

void onTimedOut ( )
virtual

Reimplemented from NetConnection.

◆ packetDropped()

void packetDropped ( PacketNotify * note)
protectedvirtual

Reimplemented from NetConnection.

◆ packetReceived()

void packetReceived ( PacketNotify * note)
protectedvirtual

Reimplemented from NetConnection.

◆ readConnectAccept()

bool readConnectAccept ( BitStream * stream,
const char ** errorString )
virtual

Reimplemented from NetConnection.

◆ readConnectRequest()

bool readConnectRequest ( BitStream * stream,
const char ** errorString )
virtual

Reimplemented from NetConnection.

◆ readPacket()

void readPacket ( BitStream * bstream)
protectedvirtual

Reimplemented from NetConnection.

◆ setAuthInfo()

void setAuthInfo ( const AuthInfo * info)

◆ setConnectArgs()

void setConnectArgs ( U32 argc,
const char ** argv )

Set connection arguments; these are passed to the server when we connect.

◆ setDisconnectReason()

void setDisconnectReason ( const char * reason)

◆ setJoinPassword()

void setJoinPassword ( const char * password)

Set the server password to use when we join.

◆ writeConnectAccept()

void writeConnectAccept ( BitStream * stream)
virtual

Reimplemented from NetConnection.

◆ writeConnectRequest()

void writeConnectRequest ( BitStream * stream)
virtual

Reimplemented from NetConnection.

◆ writePacket()

void writePacket ( BitStream * bstream,
PacketNotify * note )
protectedvirtual

Reimplemented from NetConnection.

Member Data Documentation

◆ CurrentProtocolVersion

const U32 CurrentProtocolVersion = 12
static

◆ mAuthInfo

AuthInfo* mAuthInfo
protected

◆ MinRequiredProtocolVersion

const U32 MinRequiredProtocolVersion = 12
static

◆ mLagging

bool mLagging
protected

◆ mLagThresholdMS

S32 mLagThresholdMS = 0
staticprotected

◆ mLastPacketTime

S32 mLastPacketTime
protected

The documentation for this class was generated from the following files: