-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shorts, Threes, and Ints aren’t unsigned #149
Comments
Yeah this is a big problem. I also went through and tried to update it to use signed values and had the same issue, 100+ files changed quickly became a headache. The actual problem is that because What I ended up doing to resolve it is just casting to Which session id specifically was causing the issue? |
In reoserv I generate a random short value between 0 and the max2 value. https://github.com/sorokya/reoserv/blob/async-rewrite/src/player/player.rs#L154 the error was coming up during the welcome message packet. The session id reoserv sent was too big. |
I'll see if I can reproduce it against reoserv. That commit I linked (b80ff5c) was working for me with larger player IDs on GameServer and etheos |
Ah you’re right casting it back to unsigned does fix it. I’ll just do that for now in my branch. :P edit: Using In #150 I did a dirty workaround by just adding an overload to PacketBuilder Let me know what you think :) |
I didn't have that issue for shorts in my testing. I also added a line to EndlessClient/EOLib/Net/PacketBuilder.cs Line 70 in 5fa705f
I forgot I updated it in both these places, but it was working consistently for me on both etheos and gameserver |
You're right that totally fixes it. No need for the overload :) |
I'm going to take the |
Noticed while testing this with reoserv that the client reads shorts, threes, and ints as signed values.
This became an issue when reoserv tried to send a a session id that was bigger than a signed short can hold.
I tried fixing this myself but it quickly became a huge change to over 100 files and broke a lot of stuff.
The text was updated successfully, but these errors were encountered: