OpenSSL channels now working
This commit is contained in:
@@ -18,7 +18,7 @@ AIntegrationGameModeBase::AIntegrationGameModeBase()
|
||||
//PrimaryActorTick.bTickEvenWhenPaused = true; // Probably wrong
|
||||
//PrimaryActorTick.TickGroup = TG_PrePhysics; // Probably wrong
|
||||
SetActorTickEnabled(true);
|
||||
SetActorTickInterval(0.05f);
|
||||
SetActorTickInterval(0.0f);
|
||||
}
|
||||
|
||||
AIntegrationGameModeBase::~AIntegrationGameModeBase()
|
||||
@@ -40,11 +40,11 @@ uint32 AIntegrationGameModeBase::Run()
|
||||
engineutil::DPrint("Thread waiting a long time...");
|
||||
continue;
|
||||
}
|
||||
engineutil::DPrint("Thread triggered.");
|
||||
{
|
||||
FScopeLock lk(&LuprexMutex);
|
||||
Sockets->Update();
|
||||
Luprex.play_invoke_event_update(&Luprex, EngineSeconds);
|
||||
Sockets->Update();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -64,15 +64,15 @@ void AIntegrationGameModeBase::ResetToInitialState()
|
||||
}
|
||||
ThreadStopRequested = false;
|
||||
|
||||
// Release and close all sockets.
|
||||
Sockets.Reset();
|
||||
|
||||
// Delete the engine.
|
||||
if (Luprex.release != nullptr)
|
||||
{
|
||||
Luprex.release(&Luprex);
|
||||
}
|
||||
|
||||
// Release and close all sockets.
|
||||
Sockets.Reset();
|
||||
|
||||
// Reset the clocks.
|
||||
EngineSeconds = 0;
|
||||
NextThreadTrigger = 1.0;
|
||||
@@ -115,7 +115,7 @@ void AIntegrationGameModeBase::Tick(float DeltaSeconds)
|
||||
if ((Thread != nullptr) && (EngineSeconds >= NextThreadTrigger))
|
||||
{
|
||||
ThreadEvent->Trigger();
|
||||
NextThreadTrigger += 1.0;
|
||||
NextThreadTrigger += 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ void AIntegrationGameModeBase::BeginPlay()
|
||||
}
|
||||
std::string_view srcpakv = srcpak.view();
|
||||
char* argv[1];
|
||||
argv[0] = const_cast<char*>("lpxclient");
|
||||
argv[0] = const_cast<char*>("lpxserver");
|
||||
Luprex.play_initialize(&Luprex, 1, argv, srcpakv.size(), srcpakv.data(), "");
|
||||
if (Luprex.error[0])
|
||||
{
|
||||
@@ -186,6 +186,8 @@ void AIntegrationGameModeBase::BeginPlay()
|
||||
if (Luprex.engine != nullptr)
|
||||
{
|
||||
Sockets.Reset(FLpxSockets::Create(&Luprex));
|
||||
std::string error = Sockets->GetError();
|
||||
check(error.empty());
|
||||
ThreadEvent = FPlatformProcess::GetSynchEventFromPool(false);
|
||||
Thread = FRunnableThread::Create(this, TEXT("Worker Thread"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user