Panakotta00 / FicsIt-Networks

Control, Monitor, Manage and Automate your Satisfactory.
https://ficsit.app/mod/FicsItNetworks
GNU General Public License v3.0
163 stars 52 forks source link

bug: binding gpu to a large screen crashes game #145

Closed boneskull closed 3 years ago

boneskull commented 3 years ago

Hi,

Using v0.2.2. I have a "Large Screen" attached to my network. I'm trying to bind to it, but it is consistently crashing. This is my code:


local Plotter = {}
Plotter.__index = Plotter

function Plotter:createWithScreen(screen)
  if not screen then error('screen required') end
  local plotter = {}
  setmetatable(plotter, Plotter)
  local gpu = computer.getPCIDevices(findClass("GPUT1"))[1]
  if not gpu then error('gpu not found') end
  return plotter:setup(gpu, screen)
end

function Plotter:setup(gpu, screen)
  if not screen and gpu then error('gpu and screen required') end
  gpu:bindScreen(screen) -- crash happens here, I think
  local w, h = gpu:getSize()
  self.width = w
  self.height = h
  self.gpu = gpu
  self.screen = screen
  self.ready = true
  return self
end

local plotter = Plotter:createWithScreen(component.proxy(
                                             component.findComponent(findClass(
                                                                         'Build_Screen_C'))[1]))

Here are the crash diagnostics:

Version: 160628, IsEditor: No, IsPerforceBuild: No, BuildConfiguration: Shipping, Launcher: Steam, NetMode: Listen Server, IsUsingMods: Yes

Assertion failed: IsInGameThread() || IsInSlateThread() [File:D:/ws/SB-210421141322-21c/UE4/Engine/Source/Runtime/SlateCore/Private/Widgets/SWidget.cpp] [Line: 1067] Slate can only be accessed from the GameThread or the SlateLoadingThread!

FactoryGame_Core_Win64_Shipping!AssertFailedImplV() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\core\private\misc\assertionmacros.cpp:100]
FactoryGame_Core_Win64_Shipping!FDebug::CheckVerifyFailedImpl() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\core\private\misc\assertionmacros.cpp:450]
FactoryGame_SlateCore_Win64_Shipping!SWidget::Invalidate() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\slatecore\private\widgets\swidget.cpp:1067]
FactoryGame_SlateCore_Win64_Shipping!SWidget::ConditionallyDetatchParentWidget() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\slatecore\private\widgets\swidget.cpp:678]
FactoryGame_Slate_Win64_Shipping!TSlotBase<SBox::FBoxSlot>::operator[]() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\slatecore\public\slotbase.h:122]
FactoryGame_Slate_Win64_Shipping!SBox::SetContent() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\slate\private\widgets\layout\sbox.cpp:45]
FactoryGame_FicsItNetworks_Win64_Shipping!UFINScreenWidget::OnNewGPU() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\Computer\FINComputerGPU.cpp:102]
FactoryGame_CoreUObject_Win64_Shipping!UFunction::Invoke() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\coreuobject\private\uobject\class.cpp:5543]
FactoryGame_CoreUObject_Win64_Shipping!UObject::ProcessEvent() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1916]
FactoryGame_FicsItNetworks_Win64_Shipping!TMulticastScriptDelegate<FWeakObjectPtr>::ProcessMulticastDelegate<UObject>() [G:\Projects\Satisfactory\SatisfactoryUnrealEngine\Engine\Source\Runtime\Core\Public\UObject\ScriptDelegates.h:488]
FactoryGame_FicsItNetworks_Win64_Shipping!AFINComputerScreen::NetMulti_OnGPUUpdate_Implementation() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\Computer\FINComputerScreen.cpp:81]
FactoryGame_CoreUObject_Win64_Shipping!UFunction::Invoke() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\coreuobject\private\uobject\class.cpp:5543]
FactoryGame_CoreUObject_Win64_Shipping!UObject::ProcessEvent() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1916]
FactoryGame_Engine_Win64_Shipping!AActor::ProcessEvent() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\engine\private\actor.cpp:851]
FactoryGame_FicsItNetworks_Win64_Shipping!AFINComputerGPU::BindScreen() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\Computer\FINComputerGPU.cpp:55]
FactoryGame_FicsItNetworks_Win64_Shipping!AFINComputerGPUT1::netFunc_bindScreen() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\Computer\FINComputerGPUT1.cpp:308]
FactoryGame_FicsItNetworks_Win64_Shipping!AFINComputerGPUT1::execnetFunc_bindScreen() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Intermediate\Build\Win64\FactoryGame\Inc\FicsItNetworks\FINComputerGPUT1.gen.cpp:452]
FactoryGame_CoreUObject_Win64_Shipping!UFunction::Invoke() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\coreuobject\private\uobject\class.cpp:5543]
FactoryGame_CoreUObject_Win64_Shipping!UObject::ProcessEvent() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\coreuobject\private\uobject\scriptcore.cpp:1916]
FactoryGame_Engine_Win64_Shipping!AActor::ProcessEvent() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\engine\private\actor.cpp:851]
FactoryGame_FicsItNetworks_Win64_Shipping!UFINUFunction::Execute() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\Reflection\FINUFunction.h:50]
FactoryGame_FicsItNetworks_Win64_Shipping!FicsItKernel::Lua::luaCallFINFunc() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\FicsItKernel\Processor\Lua\LuaRef.cpp:48]
FactoryGame_FicsItNetworks_Win64_Shipping!FicsItKernel::Lua::luaInstanceFuncCall() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\FicsItKernel\Processor\Lua\LuaInstance.cpp:122]
FactoryGame_FicsItNetworks_Win64_Shipping!luaD_call() [G:\Projects\eris\src\ldo.c:483]
FactoryGame_FicsItNetworks_Win64_Shipping!luaV_execute() [G:\Projects\eris\src\lvm.c:1615]
FactoryGame_FicsItNetworks_Win64_Shipping!luaD_call() [G:\Projects\eris\src\ldo.c:511]
FactoryGame_FicsItNetworks_Win64_Shipping!luaV_execute() [G:\Projects\eris\src\lvm.c:1615]
FactoryGame_FicsItNetworks_Win64_Shipping!unroll() [G:\Projects\eris\src\ldo.c:567]
FactoryGame_FicsItNetworks_Win64_Shipping!luaD_rawrunprotected() [G:\Projects\eris\src\ldo.c:146]
FactoryGame_FicsItNetworks_Win64_Shipping!lua_resume() [G:\Projects\eris\src\ldo.c:680]
FactoryGame_FicsItNetworks_Win64_Shipping!UFINLuaProcessor::LuaTick() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\FicsItKernel\Processor\Lua\LuaProcessor.cpp:541]
FactoryGame_FicsItNetworks_Win64_Shipping!FFINLuaProcessorTick::syncTick() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\FicsItKernel\Processor\Lua\LuaProcessor.cpp:158]
FactoryGame_FicsItNetworks_Win64_Shipping!UFINKernelSystem::Tick() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\FicsItKernel\FicsItKernel.cpp:123]
FactoryGame_FicsItNetworks_Win64_Shipping!AFINComputerCase::Factory_Tick() [G:\Projects\Satisfactory\SatisfactoryModLoader\Plugins\FicsItNetworks\Source\FicsItNetworks\Computer\FINComputerCase.cpp:134]
FactoryGame_FactoryGame_Win64_Shipping!<lambda_643bc97631e1119ca6d24cb4ba21c30f>::operator()() [d:\ws\sb-210421141322-21c\ue4\games\factorygame\source\factorygame\private\fgbuildablesubsystem.cpp:478]
FactoryGame_FactoryGame_Win64_Shipping!ParallelForImpl::TParallelForData<TFunctionRef<void __cdecl(int)> >::Process() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\core\public\async\parallelfor.h:169]
FactoryGame_FactoryGame_Win64_Shipping!TGraphTask<ParallelForImpl::TParallelForTask<TFunctionRef<void __cdecl(int)> > >::ExecuteTask() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\core\public\async\taskgraphinterfaces.h:849]
FactoryGame_Core_Win64_Shipping!FTaskThreadAnyThread::ProcessTasksUntilQuit() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\core\private\async\taskgraph.cpp:862]
FactoryGame_Core_Win64_Shipping!FTaskThreadBase::Run() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\core\private\async\taskgraph.cpp:529]
FactoryGame_Core_Win64_Shipping!FRunnableThreadWin::Run() [d:\ws\sb-210421141322-21c\ue4\engine\source\runtime\core\private\windows\windowsrunnablethread.cpp:86]

FWIW the built-in screen module for the computer does not cause a crash, and I can bind to it.