Search Unity

No funciton to handle package rensend when it was lost in 'NetworkConnection.cs' file?

Discussion in 'FPS.Sample Game' started by liuz223, Jun 5, 2019.

  1. liuz223

    liuz223

    Joined:
    Jun 22, 2018
    Posts:
    3
    Seems like that when package was not acked by the other side after it was fall off the ack mask, function 'NotifyDelivered' in file 'NetworkConnection.cs' didn't handle the package resend operation. Is it a mistake or I understand it wrong?

    Sorry my English is not very good, hope for your reply, thank you!
     
  2. minibotan

    minibotan

    Joined:
    Oct 4, 2016
    Posts:
    15
    FPSSample uses UDP not TCP, so it not resends lost packages
     
  3. Aquastar

    Aquastar

    Joined:
    Jul 17, 2013
    Posts:
    18
    In NotifyDelivered, reliable NetworkEvent will be re-added into eventsOut when fail to deliver.
     
  4. liuz223

    liuz223

    Joined:
    Jun 22, 2018
    Posts:
    3
    It's not about the networking protocol it used, if you use UDP in gameplay, you have to handle the package lost issue (you have to make the UDP reliable). But I didn't see any code to do package resending in file "NetworkConnection.cs" or "NetworkClient.cs" or "NetworkServer.cs".
     
  5. liuz223

    liuz223

    Joined:
    Jun 22, 2018
    Posts:
    3
    Yeah, I saw that, but I don't understand the NetworkEvent's duty. If you had read the file 'NetworkClient.cs' and 'NetworkServer.cs', you would see that they override function 'NotifyDelivered', and only the NetworkClient handle the 'ClientConfig' resending, and nothing else with the 'Command' or 'SnapShot', this is what I care about.
     
  6. Aquastar

    Aquastar

    Joined:
    Jul 17, 2013
    Posts:
    18
    You can read callers of NetworkServer.QueueEvent and NetworkClient.QueueEvent. Chat messages, console commands, ... etc are all reliable.