Sign in to follow this  
Maris

Issue about pause on dedicated server

Recommended Posts

Maris    233

It's a kind of crash because there is no component in prefab, but it should be for sure.

For example, there is no component "container" for treasurechest prefab. Is it possible? And why?

AddPrefabPostInit("treasurechest",function(inst)
  if not GLOBAL.TheNet:GetIsServer() then
    return --component should exist only on server side. So ignore clients.
  end
  inst:DoTaskInTime(0,function(inst) --Wait a tick to be sure that component created.
    if not inst.components.container then --But it should be!!
      print("No container!") --Opps
    end
  end)
end)

There will be crash if I try to use this component.

Little hint in server log:

[00:02:00]: Sim unpaused
[00:02:01]: No container!

It says the "Sim unpaused". It occurs only if the first player joins the server. It won't occur if there is zero players again and then another player joins again. Only the first player after restart of the server caused the issue.

Also I can't reproduce this issue on common caves server via DST client. Probably there should be an option that the server must be paused if there is no online players. It is possible only on dedicated server.

Help me to figure out what's wrong. And how it is possible that there is no primary component for treasure chest? May be this is a bug of the game? Or may be I missed something?

Edited by Maris

Share this post


Link to post
Share on other sites
CarlZalph    4849

@Maris

Does this print nil on your setup?

AddPrefabPostInit(
    "treasurechest",
    function(inst)
        if not GLOBAL.TheWorld.ismastersim
        then
            return
        end
        GLOBAL.print(inst, "->", inst.components.container)
    end
)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this