Files
integration/Plugins/UEWingman/Source/UEWingman/Private/WingCommandlet.cpp
2026-03-18 10:29:38 -04:00

31 lines
753 B
C++

#include "WingCommandlet.h"
#include "WingServer.h"
#include "Containers/Ticker.h"
UWingCommandlet::UWingCommandlet()
{
IsClient = false;
IsEditor = true;
IsServer = false;
LogToConsole = true;
}
int32 UWingCommandlet::Main(const FString& Params)
{
// The UWingServer editor subsystem starts the server automatically.
// We just need to tick it, since FTickableEditorObject doesn't tick in commandlet mode.
double LastTime = FPlatformTime::Seconds();
while (!IsEngineExitRequested())
{
double CurrentTime = FPlatformTime::Seconds();
double DeltaTime = CurrentTime - LastTime;
LastTime = CurrentTime;
FTSTicker::GetCoreTicker().Tick(DeltaTime);
UWingServer::TickServer(DeltaTime);
FPlatformProcess::Sleep(0.01f);
}
return 0;
}