Merged
Conversation
Each side of a TCP connection has an associated 16-bit unsigned port number (0-65535). Use an unsigned short rather than a signed short otherwise you'll only get half the ports!
I'm not so familiar with this syntax.
Conflicts: MinecraftClient/McTcpClient.cs MinecraftClient/Protocol/ProtocolHandler.cs MinecraftClient/Settings.cs
Member
|
You're absolutely right, completely forgot to use ToInt32 instead of ToInt16. Nice catch ! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fix you made for the overflow exception did not quite work as you were still using Convert.ToInt16 which would still overflow on high ports. I've now merged my changes on to the Indev branch and tested it and it seems to work ok. I think the choice of ushort is better because the tcp rfc specifies that a port is a maximum of 16 bits long and you can't have negative port numbers.
Console Client for MC 1.4.6 to 1.8.1 - v1.8.0 - By ORelio & Contributors
Username : xxxxxxxxx
Password : <******> Connecting to Minecraft.net...
Success. (session ID: xxxxxxxxxxx)
Server IP : xxxxxxxxx.com:40003
Retrieving Server Info...
Downloading 'en_GB.lang' from Mojang servers...
Done. File saved as 'lang/en_GB.lang'
Translations file loaded.
Version is supported.
Logging in...
Crypto keys & hash generated.
Checking Session...
Server was successfully joined.
Type '/quit' to leave the server.