philippj / SteamworksPy

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

[LINUX] Callback returns wrong result, but Windows is fine #62

Closed rimpy-custom closed 2 years ago

rimpy-custom commented 3 years ago

I have this code:

import os
import sys

if sys.version_info >= (3, 8):
  os.add_dll_directory(os.getcwd()) # Required since Python 3.8

from steamworks import STEAMWORKS # Import main STEAMWORKS class

def checkCallbacks(obj):
  obj.run_forever(0.5)

def call_me(result):
  print("Result =", result.result)
  print("ID =", result.publishedFileId)

if __name__ == '__main__':

  steamworks = STEAMWORKS()
  steamworks.initialize()

  from threading import Thread
  th = Thread(target=checkCallbacks, args=(steamworks,))
  th.start()

  steamworks.Workshop.SetItemSubscribedCallback(call_me)
  steamworks.Workshop.SubscribeItem(2336610918)

On Windows I get (as it should):

Result = 1
ID = 2336610918

on Linux:

Result = 1860236288
ID = 10035667476286537729

On linux code always returns the same ID 10035667476286537729 all the time, but Result may change (I got atleast four different results, even negative). I compiled code with x64 libsteam_api.so, if that matter, used 1.50 SDK. Debian 10 system. Steam itself is i386, I was unable to find 64bit version for Linux.

rimpy-custom commented 3 years ago

Update on that. Recompilled with SDK 1.47, the same issue.

philippj commented 3 years ago

I have not yet tested it on Linux. Once I resolve #61 I will get back to you about this.

philippj commented 2 years ago

Resolved by #72