philippj / SteamworksPy

A working Python API system for Valve's Steamworks.
MIT License
212 stars 39 forks source link

GetFriendCount() error #67

Closed NikitaYezhov closed 3 years ago

NikitaYezhov commented 3 years ago
friends_count = steamworks.Friends.GetFriendCount(0x10)

File "c:\Visual Code\python\Ark-steam\steamworks\interfaces\friends.py", line 23, in GetFriendCount return self.steam.GetFriendCount(flag.value) AttributeError: 'int' object has no attribute 'value'

NikitaYezhov commented 3 years ago

image

philippj commented 3 years ago

Hi,

The method works as expected and documented. You need to pass an enum of type FriendFlags.

[...]
from steamworks import STEAMWORKS
from steamworks.enums import FriendFlags
[...]
friend_count: int = steamworks.Friends.GetFriendCount(FriendFlags.ALL)
[...]
NikitaYezhov commented 3 years ago

Thanks. Can you tell me one thing? When I run it while on the game server, it showed me 24 players, but its false. Steam servers browser says only about 13 people

philippj commented 3 years ago

The method returns you the amount of Stream friends currently online on Steam. To check player counts you need to use Steams A2S protocol or the Steam Web API.