gameconnection::onconnect()
by kcpdad · in Torque 3D Professional · 08/15/2012 (8:04 am) · 1 replies
I'm a bit confused by GameConnection::OnConnect() which appears in 2 files
What is the intent of the clientConnection.cs version of the function if it never gets called or when does it get called?
It wasn't apparent where this function gets called from but it is in T3D/gamebase/gameConnection.cpp
around line 339
Any insight is appreciated.
Thanks!
- core/scripts/server/clientConnection.cs
- scripts/server/gameCore.cs
What is the intent of the clientConnection.cs version of the function if it never gets called or when does it get called?
It wasn't apparent where this function gets called from but it is in T3D/gamebase/gameConnection.cpp
around line 339
argv[0] = "onConnect";
for(U32 i = 0; i < mConnectArgc; i++)
argv[i + 2] = mConnectArgv[i];
// NOTE: Need to fallback to Con::execute() as IMPLEMENT_CALLBACK does not
// support variadic functions.
Con::execute(this, mConnectArgc + 2, argv);
}I ran into this when I modified the clientConnection version of the function and found it had no effect. A bit confusing. Any insight is appreciated.
Thanks!
About the author
Hobbyist working on a tank game when time allows. Play the prototype at => http://www.sytrept.com/60tons/
Associate Michael Hall
Distracted...
Why didn't I just change the existing function? Because at the time GarageGames treated the 'core' directory as an external directory within their SVN repository and any changes within it would have been reflected across all projects. The override was specific to the FPS Genre Kit -- which eventually got reduced to the Full Template and FPS Example -- and wasn't necessary or useful for other projects.
Any function that exists within a package can be overridden or extended (parent calls) from a later package or child/inherited namespaces. This is useful but not always obvious behavior unless you know about it.