Files
integration/Plugins/UEWingman/Source/UEWingman/Private/WingCommandlet.cpp

32 lines
787 B
C++
Raw Normal View History

2026-03-18 10:25:21 -04:00
#include "WingCommandlet.h"
2026-04-08 03:14:08 -04:00
#include "CoreMinimal.h"
2026-03-18 10:17:58 -04:00
#include "WingServer.h"
#include "Containers/Ticker.h"
2026-04-08 19:39:39 -04:00
UWingmanCommandlet::UWingmanCommandlet()
{
IsClient = false;
IsEditor = true;
IsServer = false;
LogToConsole = true;
}
2026-04-08 19:39:39 -04:00
int32 UWingmanCommandlet::Main(const FString& Params)
{
2026-03-18 10:17:58 -04:00
// The UWingServer editor subsystem starts the server automatically.
2026-03-09 03:44:35 -04:00
// We just need to tick it, since FTickableEditorObject doesn't tick in commandlet mode.
double LastTime = FPlatformTime::Seconds();
2026-03-09 03:44:35 -04:00
while (!IsEngineExitRequested())
{
double CurrentTime = FPlatformTime::Seconds();
double DeltaTime = CurrentTime - LastTime;
LastTime = CurrentTime;
FTSTicker::GetCoreTicker().Tick(DeltaTime);
2026-03-18 10:17:58 -04:00
UWingServer::TickServer(DeltaTime);
FPlatformProcess::Sleep(0.01f);
}
return 0;
}