Closed insthync closed 1 year ago
@insthync how do you know that it reached maxlength on receive side?
Know because it will return null (notice at line 292
), but if its length is 0
it will returns string.Empty
But if it reach max size on "send" side - it will be 0 https://github.com/RevenantX/LiteNetLib/blob/master/LiteNetLib/Utils/NetDataWriter.cs#L366
Oh, I just saw that one.
Hmm, then I think it is up to how users like it, I've just upgraded from 0.9
, the old one did not return null, so I change yours to return string.Empty
for my convenience.
I think it should return an empty string when its size is 0, so we won't have to check null string when reading it, but still return null when its size reached the max length so we can know error occurring because of too big string size