Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callbacks don't seem to work for me #9

Closed
oniietzschan opened this issue Apr 8, 2019 · 3 comments
Closed

Callbacks don't seem to work for me #9

oniietzschan opened this issue Apr 8, 2019 · 3 comments

Comments

@oniietzschan
Copy link
Contributor

Here's my code. I would expect userStatsReceived to be called eventually, and onGameOverlayActivated to be called whenever I open and close the team overlay, but neither happen for me. Is there something I'm doing wrong? I've tested this with Steamwork SDK 1.42 and SDK 1.44, both behave identically.

Despite all this, I'm still able to execute setAchievement, getAchievement, storeStats, and resetAllStats, and they all appear to work in real time.

Thank you.

local Steam = require 'luasteam'

function love.load()
  Steam.init()
  Steam.userStats.requestCurrentStats()
end

-- This never gets triggered!!
function Steam.userStats.userStatsReceived(...)
  print('userStatsReceived')
  print(...)
end

-- Activating and Deactivating the game overlay does not trigger this.
function Steam.userStats.onGameOverlayActivated(data)
  print("Steam overlay is now " .. (data.active and "active" or "inactive"))
end

function love.update()
  Steam.runCallbacks()
end

function love.quit()
  -- prints:
  --   Setting breakpad minidump AppID = 1040490
  --   Steam_SetMinidumpSteamID:  Caching Steam ID:  76561197967143787 [API loaded no]
  Steam.shutdown()
end
@yancouto
Copy link
Collaborator

yancouto commented Apr 8, 2019

I will take a look at this tomorrow or Wednesday.

@yancouto
Copy link
Collaborator

Hello, sorry for the delay.

The problem is that the first callback is called Steam.userStats.onUserStatsReceived, and the second callback is called Steam.friends.onGameOverlayActivated(doc).

I'm so sorry, it seems like the Getting Started page is wrong for onGameOverlayActivated, that's what led to you mistake. I'll fix that.

It seems the doc is also wrong in mentioning userStatsReceived.

@yancouto
Copy link
Collaborator

yancouto commented Apr 10, 2019

I fixed these mistakes in the doc. Should show up in the next release (I'll probably make a small release with just the docs, since not much is going on here).

Please reopen this if you still have problems :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants