Search Unity

NetworkReader:ReadByte out of range:NetBuf sz:0 pos:0

Discussion in 'Multiplayer' started by PhoenixAdvanced, May 18, 2021.

  1. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    I am using UNET (latest version), and Unity 2021.1, and I am getting this issue intermittently.

    I know UNET is deprecated, and I have plans to port away from it, but I would like to know if thre is a solution to this issue, since it will take some time to port from UNET.

    I can solve this issue with a combination of:
    Removing and reinstalling HLAPI (Client and server) and
    Rebuilding the Library.

    I am also noticing odd issues with some messages, such as this one:


    Code (CSharp):
    1. public class testmessage : MessageBase
    2. {
    3.     public string testvariable;
    4.     public string testdata;
    5. }
    It's pretty simple, but starting in 2021.1, I have noticed that sometimes the message variables seem to be blank, and I need to change the function, and rebuild the script, then it works for a while again.

    I'm guessing these issues are just due to UNET slowly becoming obsolete, but is there anything I can do to patch it together for a while before I port?
     
  2. ep1s0de

    ep1s0de

    Joined:
    Dec 24, 2015
    Posts:
    168
    uNet is outdated and forgotten that even the developers forgot to remove it...

    Question from the category " I have content, now make me a game"
     
  3. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Removing it is one thing, but they didn't announce an official replacement yet, so some of us are a little stuck!
     
  4. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    The official replacement for UNet will be MLAPI. Right now MLAPI is still an experimental package but it will replace UNet in the future.

    If you are looking for a networking library which is very similar to UNet but potentially more stable I can recommend to check out Mirror.
     
  5. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Mirror is exactly what I am looking at, it seems the upgrade path will be cleaner (For my setup at least) and easier than MLAPI.

    Thanks.
     
    mischa2k likes this.