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"
|
2026-03-05 19:26:46 -05:00
|
|
|
#include "Containers/Ticker.h"
|
|
|
|
|
|
2026-04-08 19:39:39 -04:00
|
|
|
UWingmanCommandlet::UWingmanCommandlet()
|
2026-03-05 19:26:46 -05:00
|
|
|
{
|
|
|
|
|
IsClient = false;
|
|
|
|
|
IsEditor = true;
|
|
|
|
|
IsServer = false;
|
|
|
|
|
LogToConsole = true;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-08 19:39:39 -04:00
|
|
|
int32 UWingmanCommandlet::Main(const FString& Params)
|
2026-03-05 19:26:46 -05:00
|
|
|
{
|
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.
|
2026-03-05 19:26:46 -05:00
|
|
|
double LastTime = FPlatformTime::Seconds();
|
|
|
|
|
|
2026-03-09 03:44:35 -04:00
|
|
|
while (!IsEngineExitRequested())
|
2026-03-05 19:26:46 -05:00
|
|
|
{
|
|
|
|
|
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);
|
2026-03-05 19:26:46 -05:00
|
|
|
FPlatformProcess::Sleep(0.01f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|