Support for Query Protocol #150

Merged
manio143 merged 3 commits from Query into master 2015-06-20 14:15:37 -04:00
manio143 commented 2015-06-20 02:47:36 -04:00 (Migrated from github.com)

I finally did it. I tested it with my own test http://pastebin.com/SQ7TekwR

I finally did it. I tested it with my own test http://pastebin.com/SQ7TekwR
manio143 commented 2015-06-20 02:58:33 -04:00 (Migrated from github.com)

Actually, because I had to rewrite it after first accidentally deleting all my work, I forgot something and going to fix it.

Actually, because I had to rewrite it after first accidentally deleting all my work, I forgot something and going to fix it.
ddevault commented 2015-06-20 09:03:10 -04:00 (Migrated from github.com)

Looks good for the most part, just a few corrections and I'll get this merged up.

Looks good for the most part, just a few corrections and I'll get this merged up.
manio143 commented 2015-06-20 11:23:38 -04:00 (Migrated from github.com)

Ok, I'll fix all of it. One thing though, when I tried setting the port to 26556 it simply didn't work.

Ok, I'll fix all of it. One thing though, when I tried setting the port to 26556 it simply didn't work.
ddevault commented 2015-06-20 11:26:44 -04:00 (Migrated from github.com)

25565, and how so?

25565, and how so?
manio143 commented 2015-06-20 11:30:57 -04:00 (Migrated from github.com)

Sorry, 25565. I don't know how. But apparently I was receiving ICMP host unreachable via a SocketException. I'll try it again.

Sorry, 25565. I don't know how. But apparently I was receiving ICMP host unreachable via a SocketException. I'll try it again.
ddevault commented 2015-06-20 11:32:16 -04:00 (Migrated from github.com)

Okay. If you can't figure it out, we can merge with 25566 and look into it later.

Okay. If you can't figure it out, we can merge with 25566 and look into it later.
manio143 commented 2015-06-20 12:31:51 -04:00 (Migrated from github.com)

FIY the build failed in the TrueCraft.Client, because of some other commit. It's a property which needs to have both {get; set;} not just get.

FIY the build failed in the TrueCraft.Client, because of some other commit. It's a property which needs to have both `{get; set;}` not just get.
ddevault commented 2015-06-20 12:51:10 -04:00 (Migrated from github.com)

I'll get this merged as soon as I fix some other things.

I'll get this merged as soon as I fix some other things.
moorehousew commented 2015-06-20 12:51:23 -04:00 (Migrated from github.com)

That, or mark the property as abstract, not virtual.

That, or mark the property as abstract, not virtual.
ddevault commented 2015-06-20 12:54:40 -04:00 (Migrated from github.com)

That's not why the build failed. Don't worry about it, I'm on top of it.

That's not why the build failed. Don't worry about it, I'm on top of it.
ddevault commented 2015-06-20 14:25:34 -04:00 (Migrated from github.com)

@manio143 I tested this on localhost and it does not seem to work. The reason why isn't immediately obvious to me. I used Dinnerbone's mcstatus to test it.

@manio143 I tested this on localhost and it does not seem to work. The reason why isn't immediately obvious to me. I used Dinnerbone's [mcstatus](https://github.com/Dinnerbone/mcstatus) to test it.
manio143 commented 2015-06-20 15:15:08 -04:00 (Migrated from github.com)

Ok, I'm working on that. With one thing to have in mind: only MinecraftServer.query from mcstatus applies here.

Ok, I'm working on that. With one thing to have in mind: only `MinecraftServer.query` from **mcstatus** applies here.
ddevault commented 2015-06-20 15:17:26 -04:00 (Migrated from github.com)

Yep, that's what I used.

Yep, that's what I used.
manio143 commented 2015-06-20 15:53:37 -04:00 (Migrated from github.com)

I think I found the problem. Python is sending the challenge token (and other int as well) as LittleEndian. Which is wrong since we expect BigEndian. Weird thing is though, it works with some old Minecraft server (12w2 or something like that).

I think I found the problem. Python is sending the challenge token (and other **int** as well) as LittleEndian. Which is wrong since we expect BigEndian. Weird thing is though, it works with some old Minecraft server (12w2 or something like that).
ddevault commented 2015-06-20 15:57:39 -04:00 (Migrated from github.com)

Only the lower 4-bits on each byte of the session ID should be used as Minecraft does not process the higher 4-bits on each byte. To convert any 4-byte session ID to a valid Minecraft session ID, simply mask the bits with sessionId & 0x0F0F0F0F.

> Only the lower 4-bits on each byte of the session ID should be used as Minecraft does not process the higher 4-bits on each byte. To convert any 4-byte session ID to a valid Minecraft session ID, simply mask the bits with sessionId & 0x0F0F0F0F.
ddevault commented 2015-06-20 15:58:11 -04:00 (Migrated from github.com)

I'd say that Dinnerbone's implementation is effectively the reference implementation.

I'd say that Dinnerbone's implementation is effectively the reference implementation.
manio143 commented 2015-06-20 16:02:42 -04:00 (Migrated from github.com)

Yes, but in his script I set sessionId to 1, and in truecraft, when debugging, I get 16777216, so clearly something is wrong.

Yes, but in his script I set sessionId to 1, and in truecraft, when debugging, I get 16777216, so clearly something is wrong.
manio143 commented 2015-06-20 16:03:51 -04:00 (Migrated from github.com)

Maybe I shouldn't be processing those high bits, I don't know.

Maybe I shouldn't be processing those high bits, I don't know.
ddevault commented 2015-06-20 16:04:13 -04:00 (Migrated from github.com)

Yeah, that's just the endianness being wrong. Reverse the endianness of 16777216 and you get 1.

Yeah, that's just the endianness being wrong. Reverse the endianness of 16777216 and you get 1.
manio143 commented 2015-06-20 16:05:38 -04:00 (Migrated from github.com)

But then won't I be using Little Endian, which is against the specification?

But then won't I be using Little Endian, which is against the specification?
ddevault commented 2015-06-20 16:06:25 -04:00 (Migrated from github.com)

The "spec" was authored by the community through reverse engineering. If it's wrong in practice, then go with the practical spec.

The "spec" was authored by the community through reverse engineering. If it's wrong in practice, then go with the practical spec.
manio143 commented 2015-06-20 16:07:01 -04:00 (Migrated from github.com)

Alright, will do.

Alright, will do.
ddevault commented 2015-06-20 16:07:17 -04:00 (Migrated from github.com)

It shouldn't matter anyway, though. Whatever endianness you read, so long as you write it back in the same endianness, in theory won't case any side effects on the client.

It shouldn't matter anyway, though. Whatever endianness you read, so long as you write it back in the same endianness, in theory won't case any side effects on the client.
ddevault commented 2015-06-20 16:07:26 -04:00 (Migrated from github.com)

You just have to be consistent with your endianness.

You just have to be consistent with your endianness.
manio143 commented 2015-06-20 16:14:48 -04:00 (Migrated from github.com)

The thing is, the script reads big endian and send little endian which is confusing.

The thing is, the script reads big endian and send little endian which is confusing.
ddevault commented 2015-06-20 16:16:38 -04:00 (Migrated from github.com)

That's weird.

That's weird.
manio143 commented 2015-06-20 16:36:46 -04:00 (Migrated from github.com)

Ok, I fixed it all. I added a new commit to the same branch. Do I have to open another pull request?

Ok, I fixed it all. I added a new commit to the same branch. Do I have to open another pull request?
ddevault commented 2015-06-20 16:37:29 -04:00 (Migrated from github.com)

Yep.

Yep.
This repo is archived. You cannot comment on pull requests.
No Reviewers
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: AstralTransRocketries/TrueCraft#150
No description provided.