Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Feature Request Allow Sending/Handling custom data when calling NetworkStreamReceiveSystem.Connect

Discussion in 'NetCode for ECS' started by Opeth001, Jul 14, 2022.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,078
    Hello Unity Team,

    it will be very useful to allow custom data to be sent when calling NetworkStreamReceiveSystem.Connect and give the server the ability to access that data and decide whether the client is allowed to connect or not.

    at the moment I give each NetworkStreamConnection a countdown in which it identifies itself by sending a secret key (assigned/sent to each game participant when the matchmaker completes).

    are you planning to add this features to the NetCode package ?

    Thank you!
     
  2. Jawsarn

    Jawsarn

    Joined:
    Jan 12, 2017
    Posts:
    215
    I do something similar by using a RPCs to handshake and finally add the NetworkStreamInGame component. Does that not work for you or you think this is bad approach?
     
  3. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,078
    this is exactly what i am doing but i think this is a bad approach, i prefer to allow clients to connect using a per client security key instead of allowing all clients to connect with a public ip and port and have unrestricted access to RPCs.

    Knowing that RPCs are a bit vulnerable, a corrupted client can actually break the server by sending a large number of RPCs per frame.
     
    Jawsarn likes this.
  4. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    804
    in 1.0 we are supporting TLS so that would help a little bit with that.
    In regard the custom data in the connect phase, I would say it something nice to have and we may consider to add.