mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-26 13:51:35 +00:00
Implemented hard separation between playsim ConsoleEvent and networked ConsoleEvent (ConsoleProcess, NetworkProcess)
This commit is contained in:
parent
43d3e3e5c3
commit
a924564bf3
2 changed files with 39 additions and 14 deletions
|
@ -630,6 +630,7 @@ DEFINE_EMPTY_HANDLER(DStaticEventHandler, UiProcess);
|
|||
DEFINE_EMPTY_HANDLER(DStaticEventHandler, InputProcess);
|
||||
|
||||
DEFINE_EMPTY_HANDLER(DStaticEventHandler, ConsoleProcess);
|
||||
DEFINE_EMPTY_HANDLER(DStaticEventHandler, NetworkProcess);
|
||||
|
||||
// ===========================================
|
||||
//
|
||||
|
@ -1040,22 +1041,45 @@ static DConsoleEvent* E_SetupConsoleEvent()
|
|||
|
||||
void DStaticEventHandler::ConsoleProcess(int player, FString name, int arg1, int arg2, int arg3)
|
||||
{
|
||||
IFVIRTUAL(DStaticEventHandler, ConsoleProcess)
|
||||
if (player < 0)
|
||||
{
|
||||
// don't create excessive DObjects if not going to be processed anyway
|
||||
if (func == DStaticEventHandler_ConsoleProcess_VMPtr)
|
||||
return;
|
||||
DConsoleEvent* e = E_SetupConsoleEvent();
|
||||
IFVIRTUAL(DStaticEventHandler, ConsoleProcess)
|
||||
{
|
||||
// don't create excessive DObjects if not going to be processed anyway
|
||||
if (func == DStaticEventHandler_ConsoleProcess_VMPtr)
|
||||
return;
|
||||
DConsoleEvent* e = E_SetupConsoleEvent();
|
||||
|
||||
//
|
||||
e->Player = player;
|
||||
e->Name = name;
|
||||
e->Args[0] = arg1;
|
||||
e->Args[1] = arg2;
|
||||
e->Args[2] = arg3;
|
||||
//
|
||||
e->Player = player;
|
||||
e->Name = name;
|
||||
e->Args[0] = arg1;
|
||||
e->Args[1] = arg2;
|
||||
e->Args[2] = arg3;
|
||||
|
||||
VMValue params[2] = { (DStaticEventHandler*)this, e };
|
||||
GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr);
|
||||
VMValue params[2] = { (DStaticEventHandler*)this, e };
|
||||
GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IFVIRTUAL(DStaticEventHandler, NetworkProcess)
|
||||
{
|
||||
// don't create excessive DObjects if not going to be processed anyway
|
||||
if (func == DStaticEventHandler_NetworkProcess_VMPtr)
|
||||
return;
|
||||
DConsoleEvent* e = E_SetupConsoleEvent();
|
||||
|
||||
//
|
||||
e->Player = player;
|
||||
e->Name = name;
|
||||
e->Args[0] = arg1;
|
||||
e->Args[1] = arg2;
|
||||
e->Args[2] = arg3;
|
||||
|
||||
VMValue params[2] = { (DStaticEventHandler*)this, e };
|
||||
GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -321,7 +321,8 @@ class StaticEventHandler : Object native play
|
|||
virtual native bool InputProcess(InputEvent e);
|
||||
|
||||
//
|
||||
virtual native clearscope void ConsoleProcess(ConsoleEvent e);
|
||||
virtual native ui void ConsoleProcess(ConsoleEvent e);
|
||||
virtual native void NetworkProcess(ConsoleEvent e);
|
||||
|
||||
// this value will be queried on Register() to decide the relative order of this handler to every other.
|
||||
// this is most useful in UI systems.
|
||||
|
|
Loading…
Reference in a new issue