2019-08-29 05:22:33 +00:00
|
|
|
function ExampleModule::onCreate(%this)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ExampleModule::onDestroy(%this)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-31 05:26:20 +00:00
|
|
|
//This is called when the server is initially set up by the game application
|
2019-09-02 21:13:24 +00:00
|
|
|
function ExampleModule::initServer(%this)
|
2019-08-29 05:22:33 +00:00
|
|
|
{
|
2022-05-31 05:26:20 +00:00
|
|
|
%this.queueExec("./scripts/server/ExampleGameMode");
|
2019-08-29 05:22:33 +00:00
|
|
|
}
|
|
|
|
|
|
2022-05-31 05:26:20 +00:00
|
|
|
//This is called when the server is created for an actual game/map to be played
|
2019-08-29 05:22:33 +00:00
|
|
|
function ExampleModule::onCreateGameServer(%this)
|
|
|
|
|
{
|
2022-05-31 05:26:20 +00:00
|
|
|
//These are common managed data files. For any datablock-based stuff that gets generated by the editors
|
|
|
|
|
//(that doesn't have a specific associated file, like data for a player class) will go into these.
|
|
|
|
|
//So we'll register them now if they exist.
|
|
|
|
|
if(isFile("./scripts/managedData/managedDatablocks." @ $TorqueScriptFileExtension))
|
|
|
|
|
%this.registerDatablock("./scripts/managedData/managedDatablocks");
|
|
|
|
|
if(isFile("./scripts/managedData/managedForestItemData." @ $TorqueScriptFileExtension))
|
|
|
|
|
%this.registerDatablock("./scripts/managedData/managedForestItemData");
|
|
|
|
|
if(isFile("./scripts/managedData/managedForestBrushData." @ $TorqueScriptFileExtension))
|
|
|
|
|
%this.registerDatablock("./scripts/managedData/managedForestBrushData");
|
|
|
|
|
if(isFile("./scripts/managedData/managedParticleData." @ $TorqueScriptFileExtension))
|
|
|
|
|
%this.registerDatablock("./scripts/managedData/managedParticleData");
|
2023-07-20 13:54:52 +00:00
|
|
|
if(isFile("./scripts/managedData/managedParticleEmitterData." @ $TorqueScriptFileExtension))
|
|
|
|
|
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
|
2022-05-31 05:26:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//This is called when the server is shut down due to the game/map being exited
|
2019-08-29 05:22:33 +00:00
|
|
|
function ExampleModule::onDestroyGameServer(%this)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-31 05:26:20 +00:00
|
|
|
//This is called when the client is initially set up by the game application
|
2019-08-29 05:22:33 +00:00
|
|
|
function ExampleModule::initClient(%this)
|
|
|
|
|
{
|
2022-05-31 05:26:20 +00:00
|
|
|
%this.queueExec("./scripts/client/inputCommands");
|
|
|
|
|
|
|
|
|
|
//client scripts
|
|
|
|
|
exec("./scripts/client/defaultkeybinds");
|
2019-08-29 05:22:33 +00:00
|
|
|
|
|
|
|
|
%prefPath = getPrefpath();
|
2022-05-31 05:26:20 +00:00
|
|
|
if(isScriptFile(%prefPath @ "/keybinds"))
|
|
|
|
|
exec(%prefPath @ "/keybinds");
|
2019-08-29 05:22:33 +00:00
|
|
|
}
|
|
|
|
|
|
2022-05-31 05:26:20 +00:00
|
|
|
//This is called when a client connects to a server
|
2019-08-29 05:22:33 +00:00
|
|
|
function ExampleModule::onCreateClientConnection(%this)
|
|
|
|
|
{
|
2022-05-31 05:26:20 +00:00
|
|
|
ExampleMovemap.push();
|
2019-08-29 05:22:33 +00:00
|
|
|
}
|
|
|
|
|
|
2022-05-31 05:26:20 +00:00
|
|
|
//This is called when a client disconnects from a server
|
2019-08-29 05:22:33 +00:00
|
|
|
function ExampleModule::onDestroyClientConnection(%this)
|
|
|
|
|
{
|
2022-03-27 08:05:48 +00:00
|
|
|
}
|