Search Unity

Resolved [0.51] Dedicated server build platform compile error

Discussion in 'NetCode for ECS' started by optimise, Jun 17, 2022.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I try to build linux server at Dedicated server build platform but hit the following error. Any idea how to fix it?

    Library\PackageCache\com.unity.netcode@0.51.0-preview.32\Runtime\ClientServerWorld\ClientServerBootstrap.cs(87,38): error CS0103: The name 'RequestedNumThinClients' does not exist in the current context
     
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    894
    mmm.. this looks strange. The RequestedNumThinClients is under #if UNITY_EDITOR conditional compilation.
    (everywhere is used). That should not hit at all when building a player.

    I'm supposing you are passing the UNITY_SERVER define via build config. That means you should hit line ClientServerBootstrap.cs:370, where we don't have any RequestedNumThinClients (because is editor only).
    But because you are then getting the error, that imply the UNITY_EDITOR is defined, that looks like a bigger problem..
    How do you build that project?
     
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    When u switch to Dedicated Server platform at Unity 2021.3.4f1. You will immediately get the error. I ady locally change dots netcode package to fix the compile error.
     
  4. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    894
    The DedicatedServer platform is not currently supported (at least for wha I remember) in dots (in 0.51). In NetCode we didn't get through a complete round of test for that platform either.
    You still need to use the ScriptableBuildPipeline for building your project
     
  5. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    894
    In your other post you mentioned you weren't able to build a Linux server targeting the desktop platform (you get the same error).

    I tried building a linux server, targeting PC/OSX/Linux desktop, using 0.51 release and Unity 2021.3.4f1.
    I created a super simple project (just one assembly and one scene with one ghost).

    This is the build config I made: nothing fancy here, and the build complete successfully (I did that on my Mac).
    Screenshot 2022-06-19 at 09.30.12.png
     
  6. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    I mean you can build linux runtime but when executing the runtime the CPU and memory will keep spiking then crash. I test at my production dots netcode project. Not sure about the simple dots netcode project. You can try run ur linux runtime at linux machine to test it.

    This is the error message when the linux runtime crash:

    "memorysetup-cache-allocator-block-size=4194304" "memorysetup-typetree-allocator-block-size=2097152" "memorysetup-profiler-bucket-allocator-granularity=16" "memorysetup-profiler-bucket-allocator-bucket-count=8" "memorysetup-profiler-bucket-allocator-block-size=4194304" "memorysetup-profiler-bucket-allocator-block-count=1" "memorysetup-profiler-allocator-block-size=16777216" "memorysetup-profiler-editor-allocator-block-size=1048576" "memorysetup-temp-allocator-size-main=4194304" "memorysetup-job-temp-allocator-block-size=2097152" "memorysetup-job-temp-allocator-block-size-background=1048576" "memorysetup-job-temp-allocator-reduction-small-platforms=262144" "memorysetup-temp-allocator-size-background-worker=32768" "memorysetup-temp-allocator-size-job-worker=262144" "memorysetup-temp-allocator-size-preload-manager=262144" "memorysetup-temp-allocator-size-nav-mesh-worker=65536" "memorysetup-temp-allocator-size-audio-worker=65536" "memorysetup-temp-allocator-size-cloud-worker=32768" "memorysetup-temp-allocator-size-gfx=262144" error: XDG_RUNTIME_DIR not set in the environment.
     
    Last edited: Jun 19, 2022
  7. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    894
    Oh yeah, the runtime is another things. I just replied to the fact you weren't; able to build there linux server using 2021.3.4f1
    But I can, so I want to understand why you can't.
     
  8. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Alright. Let me know whether u able to repro the Linux runtime crash bug at your side.