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

A2S_RULES contains binary data for Arma 3 servers #67

Open
overfl0 opened this issue Sep 15, 2018 · 5 comments
Open

A2S_RULES contains binary data for Arma 3 servers #67

overfl0 opened this issue Sep 15, 2018 · 5 comments

Comments

@overfl0
Copy link
Contributor

overfl0 commented Sep 15, 2018

The Arma 3 game uses A2S_RULES entries to store additional data about the server, as described here:
https://community.bistudio.com/wiki/Arma_3_ServerBrowserProtocol2

In short, because some arbitrary (binary) data can be passed in those rules, there is a risk of those rules forming an incorrect UTF-8 string.

How can I best work around the issue of python-vale always trying to decode('utf8') the rules contents without breaking the whole library? (RulesResponse is declared as containing StringFields)
I'd be interested in producing a non-intrusive solution that could then be merged back. I'm not sure that changing the declaration of RulesResponse to contain raw bytestrings a good idea, for example.

  • Python-valve Version(s): 0.2.1
@Yepoleb
Copy link
Member

Yepoleb commented Jan 17, 2020

I've implemented this now in python-a2s using the encoding parameter. Sorry for the (very) late response.

@gust4vsson
Copy link

How in the heck do I actually use a2s.rules to get the rules decoded in the correct way?

I'm trying to do this with DayZ and that protocol should be the same as Arma 3.

@Yepoleb
Copy link
Member

Yepoleb commented Feb 25, 2022

Pass encoding=None to the function and then use whatever binary magic is necessary to decode it. I can't tell you, I never investigated the Arma 3 specifics. This commit implements it in a shitty way, please be aware that this can easily be done without modifying the library: JonBons/python-a2s@2fd65d9

@overfl0
Copy link
Contributor Author

overfl0 commented Feb 25, 2022

Hello there! Oh my, it's been almost 4 years since I've written here :)

@Yepoleb what you're linking to is a branch that parses A2S_INFO for arma keywords found in that packet and nothing else. The rules that gust4vsson is talking about are a completely different set of data.

The Arma 3 rules stored in the A2S_RULES are described here: https://community.bistudio.com/wiki/Arma_3:_ServerBrowserProtocol3

The only thing missing there is a few flag values of the DLC flags, AFAIR, but they are rather easy to figure out.
Hit me up in the #arma3_tools_makers channel of the Arma 3 Discord if you really need more information (as to not clutter this discussion).

However, I have to admit, DayZ rules may be completely different as they have completely revamped the multiplayer module, I think. But anyway, you can check how much different they are by looking at the link I gave you. You can parse these packets using either Construct or Kaitai.

@Yepoleb
Copy link
Member

Yepoleb commented Feb 26, 2022

@Yepoleb what you're linking to is a branch that parses A2S_INFO for arma keywords found in that packet and nothing else. The rules that gust4vsson is talking about are a completely different set of data.

Oops, guess I need to practice to read again. Sorry for the confusion.

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

No branches or pull requests

3 participants