Page MenuHomeFeedback Tracker

Improve A2S_PLAYER response
Feedback, NormalPublic

Description

A2S_PLAYER for Reforger currently doesn't report the player details properly:

  • Player name is always reported as "player"
  • Score and time are always zero (Scores likely don't exist yet, so this can probably be ignored)

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 11 x64
Category
General
Steps To Reproduce

Python script for testing the responses:

import re
import socket
import struct

a2s_player_request = 'ÿÿÿÿUÿÿÿÿ'.encode('iso-8859-1')
a2s_player_challenge_prefix = 'ÿÿÿÿU'.encode('iso-8859-1')
a2s_player_pattern = re.compile(b'\x00(?P<name>.*?)\x00(?P<score>.).{3}(?P<time>.{4})')
buffer_size = 65535

for game, port in [('Arma 3', 2503), ('Reforger', 17977)]:
    address = ("88.198.47.46", port)
    client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    client.sendto(a2s_player_request, address)
    response, _ = client.recvfrom(buffer_size)
    challenge = a2s_player_challenge_prefix + response[-4:]
    client.sendto(challenge, address)
    response, _ = client.recvfrom(buffer_size)
    player_list = []
    for match in a2s_player_pattern.finditer(response):
        player = {}
        player['name'] = match.group('name').decode('utf8', 'replace')
        player['score'] = int.from_bytes(match.group('score'), 'big')
        player['time'] = int(struct.unpack('f', match.group('time'))[0])
        player_list.append(player)
    print(game, player_list)

The current result is:

Arma 3 [{'name': 'Kex', 'score': 0, 'time': 17}]
Reforger [{'name': 'player', 'score': 0, 'time': 0}]

Event Timeline

ookexoo created this task.Jun 6 2023, 8:40 PM
Geez changed the task status from New to Feedback.Jun 14 2023, 12:46 PM