Skip to content

Indev#53

Merged
ORelio merged 5 commits intoMCCTeam:Indevfrom
lokulin:Indev
Nov 6, 2014
Merged

Indev#53
ORelio merged 5 commits intoMCCTeam:Indevfrom
lokulin:Indev

Conversation

@lokulin
Copy link
Contributor

@lokulin lokulin commented Nov 6, 2014

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.

meep
meep
beep

lokulin and others added 5 commits November 5, 2014 01:59
 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
@ORelio
Copy link
Member

ORelio commented Nov 6, 2014

You're absolutely right, completely forgot to use ToInt32 instead of ToInt16. Nice catch ! :)

ORelio added a commit that referenced this pull request Nov 6, 2014
@ORelio ORelio merged commit 157aa2a into MCCTeam:Indev Nov 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants