Skip to content
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

add key request to protocol support #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

d47081
Copy link

@d47081 d47081 commented Dec 24, 2023

well, have removed the warning, but what's next to do with the client key passing

@a1batross
Copy link
Member

a1batross commented Dec 25, 2023 via email

@d47081
Copy link
Author

d47081 commented Dec 25, 2023

I'm just trying to setup master server able to search servers in Yggdrasil network could not be listed by mentality.rip

With those 2-6 PRs I think it close to run this server, but looks I'm stuck with protocol misunderstanding as different - at least it should contain key string https://developer.valvesoftware.com/wiki/Master_Server_Query_Protocol

By current PR trying to fix this issue FWGS/xash3d-fwgs#1542

Is there any plans to share the rust version soon?

@a1batross
Copy link
Member

a1batross commented Dec 25, 2023 via email

@d47081
Copy link
Author

d47081 commented Dec 25, 2023

Yes, just found that protocol definitions does not correspond xash3d client definitions:
https://github.com/FWGS/pymaster/blob/master/protocol.py

I have changed queryPacketHeader to b'\x7f\x0a' but not sure it's correct.

Could you please advice about this file corrections just?

Thank you!

class MasterProtocol:
	# Client To Master
	clientQuery = b'1'

	# Server To Master
	challengeRequest = b'q\xFF'
	addServer = b'0\n'
	removeServer = b'\x62\x0A'

	# Master To Client
	queryPacketHeader = b'\xff\xff\xff\xff\x7f\x0a'

	# Master To Server
	challengePacketHeader = b'\xff\xff\xff\xff\x73\x0a'

@d47081 d47081 mentioned this pull request Dec 25, 2023
@a1batross
Copy link
Member

The \xff\xff\xff\xff is important because it's a special header for connectionless packets in the engine. Everything that goes to client and server must have that header.

@d47081
Copy link
Author

d47081 commented Dec 25, 2023

Thank you, just fixed #7

@a1batross
Copy link
Member

Sorry, but it's not a fix.

The engine expects an "f". The hex value for ASCII character 'f' is 0x66. 0x0a gets ignored by the engine, but it might not be ignored with third-party tools.

Anyway, better wait for Rust version. It's much cleaner than this.

@d47081
Copy link
Author

d47081 commented Dec 26, 2023

As understand protocol requires something like

packet = MasterProtocol.queryPacketHeader
...
packet += b"\x7f"
packet += key # but I don't know how this value should be packed as gives 'invalid key' on xash3d side

maybe like this one
packet = b"\x7f" + key.encode('latin_1')

@d47081
Copy link
Author

d47081 commented Dec 26, 2023

Well, I have added this draft by commit

Now it's no errors in xash debug
Warning: unexpected server list packet from ... (invalid key)

If the random key is 45c6cbbe maybe this part must have format \x7f\x45\xc6\xcb\xbe
FWGS/xash3d-fwgs#1542 (comment)

PS I have closed previous PR
PPS how long to wait for rust edition? Not sure it will published be soon...

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