Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feature Request Please provide access to NetworkStreamDriver.DriverStore for custom INetworkInterface.

Discussion in 'NetCode for ECS' started by Shinyclef, Nov 18, 2023.

  1. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    498
    Hello,

    I am integrating Steamworks into Unity Transport. With the 2.1 changes, nearly all hurdles are removed, but Netcode is making it a little hard still.

    In this post, I talk about how I need internal access to netcode to be able to bind my custom Steamworks Network Interface before I call connect on it.
    https://forum.unity.com/threads/can...to-networkfamily-custom.1517485/#post-9479125

    Could you please expose access to NetworkStreamDriver.DriverStore, or alternatively provide a public method Bind() that we can call before calling Connect(), to pass in our custom endpoint. Bind is public in Transport, but I just can't get to it through netcode's NetworkStreamDriver struct.

    Thanks :).
     
    Kmsxkuse likes this.
  2. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    498
    Sorry, I missed a crucial point in the linked post which will let this work correctly next Transport version anyway:
    However, a little discussion on discord with @Kmsxkuse on this subject...
    Therefore, it might still be a good idea to have access to the driver store so we can interact with our custom interfaces.
     
    Kmsxkuse likes this.
  3. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    304
    I just want to expand on this suggestion with a use-case I've encountered that making DriverStore on NetworkStreamDriver component public would help with.

    In order to access EOS, I am provided by their API at login a "local user" handle that is basically the signature for all actions done through their API. However, due to mysterious black box shenanigans, this handle may change over the course of gameplay as EOS refreshes the user's login and passes back a new handle.

    Since the NetworkInterface driver has already been created, I need some way to inform the driver of this new handle for all Send/Receive packet requests. At the moment, I have a public static singleton that has hardcoded slots for a maximum two drivers (client and server, thins are always on IPC) that I manually monitor and refresh whenever necessary.

    But this is just bad. A bandaid solution because I can not directly access the driver from a UI system which controls user supplied login info without internal access.

    One current alternative I've floated will be relocating the entirety of the network handling into the driver, the UI code would feed in the user's inputs at construction and the driver would be completely independent from there.

    However, I would still require direct access to the driver since, to prevent overloading the RPC queue, I've bypassed the entire Netcode-Transport framework and manually generate and receive packets of text chat data to send through a second independent EOS channel. This will require login info and inputs from DOTS land during active gameplay and post-construction which requires public access to the driver.
     
    Shinyclef likes this.
  4. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    873
    Yeah, we know and we are going to expose all these interfaces to you guys to customise the driver the way you want.
     
    toomasio, bb8_1, WAYNGames and 2 others like this.
  5. Richay

    Richay

    Joined:
    Aug 5, 2013
    Posts:
    109
    Is there an ETA for exposing the driver store? I'm trying to access it to check the value of IsAnyUsingSimulator, as I strip out predicted systems for the local IPC client, but apparently when using the network simulator the connection is forced to use a socket and so I need to stop the stripping.

    https://docs.unity3d.com/Packages/com.unity.netcode@1.2/manual/playmode-tool.html#networksimulator
    -edit-
    Nevermind, I stumbled upon NetworkSimulatorSettings.Enabled, which is perfect for my use case.
     
    Last edited: Jan 18, 2024
    te_headfirst likes this.