mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Beginnings of the "pass everything using a native type wrapper" console code.
- ConsoleValue class is now the base value class. - ConsoleValueRef is now used to supply function parameters. Values are disposable. - Script functions return values instead of just strings where possible. - Variables can be disposable strings - Bytecode changed Fix the issues with console method parameters and fields which prevented missions from loading.
This commit is contained in:
parent
394d87cd54
commit
38c8e52c1d
68 changed files with 1511 additions and 529 deletions
|
|
@ -269,7 +269,8 @@ ConsoleMethod(GameConnection, setConnectArgs, void, 3, 17,
|
|||
|
||||
"@see GameConnection::onConnect()\n\n")
|
||||
{
|
||||
object->setConnectArgs(argc - 2, argv + 2);
|
||||
StringStackWrapper args(argc - 2, argv + 2);
|
||||
object->setConnectArgs(args.count(), args);
|
||||
}
|
||||
|
||||
void GameConnection::onTimedOut()
|
||||
|
|
@ -430,7 +431,7 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr
|
|||
*errorString = "CR_INVALID_ARGS";
|
||||
return false;
|
||||
}
|
||||
const char *connectArgv[MaxConnectArgs + 3];
|
||||
ConsoleValueRef connectArgv[MaxConnectArgs + 3];
|
||||
for(U32 i = 0; i < mConnectArgc; i++)
|
||||
{
|
||||
char argString[256];
|
||||
|
|
@ -439,6 +440,7 @@ bool GameConnection::readConnectRequest(BitStream *stream, const char **errorStr
|
|||
connectArgv[i + 3] = mConnectArgv[i];
|
||||
}
|
||||
connectArgv[0] = "onConnectRequest";
|
||||
connectArgv[1] = NULL;
|
||||
char buffer[256];
|
||||
Net::addressToString(getNetAddress(), buffer);
|
||||
connectArgv[2] = buffer;
|
||||
|
|
@ -944,7 +946,7 @@ bool GameConnection::readDemoStartBlock(BitStream *stream)
|
|||
|
||||
void GameConnection::demoPlaybackComplete()
|
||||
{
|
||||
static const char *demoPlaybackArgv[1] = { "demoPlaybackComplete" };
|
||||
static ConsoleValueRef demoPlaybackArgv[1] = { "demoPlaybackComplete" };
|
||||
Sim::postCurrentEvent(Sim::getRootGroup(), new SimConsoleEvent(1, demoPlaybackArgv, false));
|
||||
Parent::demoPlaybackComplete();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue