Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Steamworks handler - Gideros Forum

Steamworks handler

tkhnomantkhnoman Member
edited October 2015 in Plugins
Currently finished developing super minimum Steamworks handler, that deal with Leaderboard & achievement (set only).

For Windows, i used MSVC 2010 Express.
For Mac, i used Qt 5.4 and inject it directly to desktop export template.
Gideros version that i used is 2015.08, which is currently the most stable.

Download:

https://www.mediafire.com/?qu9tn0hi9udppqk

-Feel free to use-

SteamCore:enterFrame will process leaderboard's callback, when SteamCore:checkStatus reach "success" (or "notFound" or "failScoring") you can proceed to another sendScore. Default status is "" (empty string).
You don't need to call this on each frame, just call when dealing with sendScore.

Code example for upload score:
SteamCore.uploadNext = {}
function SteamCore:uploadScore(namez,scorez)
	local status = SteamCore:checkStatus()
 
	if status == "success" or status == "notFound" or status == "failScoring" or status == "" then
		SteamCore:sendScore(namez,scorez)
 
		local function recheckScore()
			local status = SteamCore:checkStatus()
			if status == "success" or status == "notFound" or status == "failScoring" or status == "" then
				if #SteamCore.uploadNext > 0 then
					SteamCore:uploadScore( unpack(SteamCore.uploadNext[1]) )
					table.remove(SteamCore.uploadNext,1)
				end
			else
				-- print(status,namez,scorez)
				SteamCore:enterFrame()
				Timer.delayedCall(500,recheckScore)
			end
		end
 
		recheckScore()
	else
		table.insert(SteamCore.uploadNext,{namez,scorez})
	end
 
end
No Event Dispatcher is available, because i don't know how. =))




Not forget to mention, the source code is in a mess, because i just try to manage it to work, and not too care about other things.
Follow this to make it work,
http://giderosmobile.com/forum/discussion/1025/step-by-step-how-to-write-a-c-plugin-and-deploy-it-to-the-desktop-windows-player/p1

(No source code shared for Mac version, because it is a total mess... and include many of my own modification.
But i use exactly the same leaderboard.h and leaderboard.cpp)


If you want more than this wihtout doing anything with the source code, another option is to use Web API :
https://developer.valvesoftware.com/wiki/Steam_Web_API
But Web API should be called from a server, that is php, because Steam want it like that...
Also it limited to 100000 call / day.

Likes: pie, Tom2012

zip
zip
steam-gideros-0.01-msvc2010.zip
2K
+1 -1 (+2 / -0 ) Share on Facebook

Comments

Sign In or Register to comment.