Panakotta00 / FicsIt-Networks

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

Friend can't join game with mod enabled. #95

Closed jayzosayers closed 3 years ago

jayzosayers commented 3 years ago

Granted, I've got a lot of other mods installed, but the issue started shortly after installing the mod and seemed to resolve itself upon uninstalling.

As my Lua code has increased in complexity my friend has had increasing difficulty joining the game. It appears to just stop loading at some point in the loading screen. The game doesn't freeze, it just appears to stop loading resulting in him being stuck in the loading screen until he hits Alt-F4. It started off with it doing it once, with it working on the first re-attempt, but as our base expanded and as the code I'd written increased in complexity it started taking more and more re-attempts to join until the current situation he where he's no longer able to join.

We are both on v0.0.10, both SML and Satisfactory are up to date, and we've tried both Experimental and Early Access.

I've included my code below (please don't shame my noob Lua code), which is for switching entire sections of the factory on/off to manage power issues:

gpu = computer.getGPUs()[1]
screen = component.proxy("A3E9D5444F50A99CC7FBA696E242BAD5")

gpu:bindScreen(screen)

BreakerPanel = component.proxy("170FCDB5473CA8F6127E11A2137C784B")
MainBreakerSwitch = BreakerPanel:getModule(0,9)
MasterBreaker = component.proxy("48F9D18248CA3ABEDB1CDF93C7111BBC")
HyperTubeSwitch = BreakerPanel:getModule(2,9)
HyperTubeBreaker = component.proxy("19BF717B434B678FE7056DB70622D1AA")
L0NonCritSwitch = BreakerPanel:getModule(0,0)
L0NonCritBreaker = component.proxy("C6B2D5FB43ED3F4C5DECAE932DD9CEB0")
L1NonCritSwitch = BreakerPanel:getModule(0,2)
L1NonCritBreaker = component.proxy("7398A7EA45E4D892E5333E84A454E555")
L2Switch = BreakerPanel:getModule(0,4)
--[L2Breaker = component.proxy("") --]
L3Switch = BreakerPanel:getModule(0,6)
--[L3Breaker = component.proxy("") --]

gpu:setSize(90,20)
w,h = gpu:getSize()
print(w,h)

while true do
  gpu:fill(0,0,w,h," ")
  gpu:setForeground(1,1,1,1)
  gpu:setBackground(0,0,0,1)
  gpu:setText(2,1,"CIRCUIT BREAKER STATUS")
  gpu:setText(2,2,"=================================")
  gpu:setText(2,3,"MASTER POWER:           [       ]")
  gpu:setText(2,4,"HYPER TUBE ELEVATOR:    [       ]")
  gpu:setText(2,5,"LVL 0 NON-CRIT SYSTEMS: [       ]")
  gpu:setText(2,6,"LVL 1 NON-CRIT SYSTEMS: [       ]")
  gpu:setText(2,7,"LVL 2 MAIN BREAKER:     [       ]")
  gpu:setText(2,8,"LVL 3 MAIN BREAKER:     [       ]")

  if (MainBreakerSwitch:getState())
  then
    MasterBreaker:setConnected(true)
    gpu:setForeground(0,1,0,1)
    gpu:setText(27,3,"ON LINE")
  else
    MasterBreaker:setConnected(false)
    gpu:setForeground(1,0,0,1)
    gpu:setText(27,3,"OFFLINE")
  end

  if (HyperTubeSwitch:getState() and MainBreakerSwitch:getState())
  then
    HyperTubeBreaker:setConnected(true)
    gpu:setForeground(0,1,0,1)
    gpu:setText(27,4,"ON LINE")
  else
    HyperTubeBreaker:setConnected(false)
    gpu:setForeground(1,0,0,1)
    gpu:setText(27,4,"OFFLINE")
  end

  if (L0NonCritSwitch:getState() and MainBreakerSwitch:getState())
  then
    L0NonCritBreaker:setConnected(true)
    gpu:setForeground(0,1,0,1)
    gpu:setText(27,5,"ON LINE")
  else
    L0NonCritBreaker:setConnected(false)
    gpu:setForeground(1,0,0,1)
    gpu:setText(27,5,"OFFLINE")
  end

  if (L1NonCritSwitch:getState() and MainBreakerSwitch:getState())
  then
    L1NonCritBreaker:setConnected(true)
    gpu:setForeground(0,1,0,1)
    gpu:setText(27,6,"ON LINE")
  else
    L1NonCritBreaker:setConnected(false)
    gpu:setForeground(1,0,0,1)
    gpu:setText(27,6,"OFFLINE")
  end

  gpu:setForeground(1,0,0,1)
  gpu:setText(27,7,"OFFLINE")

  gpu:setForeground(1,0,0,1)
  gpu:setText(27,8,"OFFLINE")

  gpu:flush()
  computer.skip()
end
Panakotta00 commented 3 years ago

Sorry for the late response,

I think the issue is more in the code... you constantly send heavy screen update changes to your friend basically... multiple times per frame... this is not good... you should try to add after your computer.skip() at the bottom of your while loop, a event.pull(0.5) so your code only gets executed two times per second.