Page MenuHomeFeedback Tracker

Arma 3 servers are failing to report correct "Rules" to Steam API
Closed, ResolvedPublic

Description

I have a fully constructed Arma game server launcher I have developed in C# WPF. It will work with any Steam / Steamworks API game, but I have targeted Arma games for this launcher.

To the point:

  • When I query the Steamworks API for the Rules for Arma 3, they come back like this example:
{
  "Name": "\u0001\u0002",
  "Value": "\u0002\u0001\u0002\u0007\u0001\u0002\u0001\u0001k<f\u0012\u0015>\u0006d\u0019\u00040\"\u0019CUP Terrains - Maps 1.1.0A\u001e\u001f\u0004q\"\u0019CUP Terrains - Core 1.1.0mҹ\u0004sL \u0012CUP Vehicles - 1.3\u0004ڷ"
}

The code to get the game rules looks like this:

internal string ReadString()
{
    string str = string.Empty;
    int temp = 0;


    CurrentPosition++;
    temp = CurrentPosition;


    while (Data[CurrentPosition] != 0x00)
    {
        CurrentPosition++;
        if (CurrentPosition > LastPosition)
            throw new ParseException("Unable to parse bytes to string.");
    }


    str= Encoding.UTF8.GetString(Data, temp, CurrentPosition - temp);


    return str;
}

The line from above:

str= Encoding.UTF8.GetString(Data, temp, CurrentPosition - temp);

...is the part that decodes the byte[] to the string result.

If I change the Game Directory filter from 'arma3' to 'arma2arrowpc', the same code above returns this decoded result example for the Rules:

{
  "Name": "modNames:0-1",
  "Value": "Arma 2: British Armed Forces (Lite);Arma 2: Private Military Company (Lite);Arma 2;Arma 2: Operation Arrowhead;"
}

If I switch the Game Directory filter to an entirely different game (ARK: Survival Evolved), I get the following example for the Rules:

{
  "Name": "GameMode_s",
  "Value": "TestGameMode_Genesis_C"
}

The Arma 3 Steamswork API Rules do not seem to be working properly when querying Steamworks API. I have looked all over for help and used other Steamworks API query tools. All examples are showing the same Rules bytes[] decoding issue.

Another test -

If I convert the byte[] to char by char and exclude the limit it to these char types only, 'Char.IsLetterOrDigit(c) || Char.IsPunctuation(c) || Char.IsSeparator(c) || Char.IsWhiteSpace(c)'...

...this mod param Steam rule:
"\avvDQH\f@ExileServer\b\tExile Modx._Ryan's Zombies & Demons"
...turns into this:
"EvvÉDQH\f@ExileServerÌ\tExile Modx._Ryan's Zombies & Demons"

Here is the test logic:

var test = string.Empty;


foreach (var b in Data)
{
    char c = Convert.ToChar(Char.ConvertFromUtf32(b));
    if (Char.IsLetterOrDigit(c) || Char.IsPunctuation(c) || Char.IsSeparator(c) || Char.IsWhiteSpace(c))
    {
        test += c;
    }
}

References and my simple sample Console Application program that will reproduce what I have described above.

For all tests listed above, I am using this sample Steam Query tool "QueryMaster".

Details

Severity
Major
Resolution
No Bug
Reproducibility
Always
Operating System
Windows 10 x64
Category
Steam Workshop
Steps To Reproduce

See description.

Additional Information

The majority of Arma 3 servers show this issue, but I found 1 that does not show this issue.

Example of a working Arma 3 server - Reports non-corrupt rules:

  • IP: 108.61.114.89
  • Query Port: 2303

Example of a failing Arma 3 server - Reports corrupt rules:

  • IP: 50.170.101.89
  • Query Port: 2583

Event Timeline

moosemilker edited Additional Information. (Show Details)Jun 23 2016, 7:55 AM
BISWizard closed this task as Resolved.
BISWizard added a subscriber: BISWizard.

Hello,
the protocol is working fine, the data are just packed more densely: https://community.bistudio.com/wiki/Arma_3_ServerBrowserProtocol2

Disclaimer: The protocol format is considered an internal implementation detail and we may change it without notice as we see fit.

BISWizard changed Resolution from Open to No Bug.Jun 23 2016, 8:39 AM
moosemilker added a comment.EditedJun 23 2016, 9:16 AM

Do you have some sample code on how to decode this?

All other games just go off of decoding bytes? Is there some sort of performance gain you achieved by switching to this more densely packed protocol?

I'm sorry, I'm not allowed to share any source code.

The reason behind the protocol is a space limitation. We had to transfer more information and keep it small at the same time, at this was the only option. Steam API is unable transmit more than once packet, even if their protocol supports that.

moosemilker added a comment.EditedJul 4 2016, 8:35 AM

How about sending some pseudo logic? At the time of writing this I have 1,019 hours in just Arma 3... I played Arma 2 easily that much, but realistically far more... I am also a DayZ SA player... I am loyal to BIS. I run two 24/7 Arma 3 servers. The launcher I am developing could only attract more players to Arma and help them connect to servers with weird mod configurations. Anything you can send to help me is appreciated. If you want to contact me directly, use the contact form at: http://moosemilker.com

@moosemilker did you manage to solve it

moosemilker added a comment.EditedJun 28 2022, 2:20 AM

@Mateuus - No. I lost interest in the project. It was a shame. This blocker issue caused my loss of interest. I found it extremely annoying BIS did not want to help me and treated this issue like I am some common idiot not worthy of using their API. Seriously, why not help me? I would only continue to support the game. Lol. Whatever. Not worth my time…

I would think other 3rd party launchers, such as A3 Launcher figured it out, but that developer did not respond to me on questions I had about their service.

Good luck!