0
votes

I am using this library to communicate with steam. I need to "run" a game, connect to the game server and execute console command (I actually want to get players list with their steam64 IDs). Docs don't have much information about this.

EDIT: I have an example code that use Messaging (?) interface to post friend request. I think I should use it to execute game commands:

from steam.enums import EResult
from steam.core.msg import MsgProto
from steam.enums.emsg import EMsg

message = MsgProto(EMsg.ClientAddFriend)
message.body.steamid_to_add = 76561197960265728

# client is a SteamClient() object
resp = client.send_message_and_wait(message, EMsg.ClientAddFriendResponse)

But how to run a game and connect to the server?

1
How to Ask what did you try? So is not code writing service.Björn
Sorry, but I really don't know what I should even TRY to write. There is not so many docs about it. If you give me a link to docs which contains info about it - you will really help me. I have an example code, so I can add it to edit.FlashlightED

1 Answers

0
votes

The docs mention that this method

steam.client.builtins.gameservers.SteamGameServers(steam).query(filter_text, 
    max_servers=10, 
    timeout=30, 
    **kw)

returns a list of servers that looks like

[{'auth_players': 0, 'server_ip': '1.2.3.4', 'server_port': 27015},
 {'auth_players': 6, 'server_ip': '1.2.3.4', 'server_port': 27016},
 ...
]