1. Post #1
    Skondra's Avatar
    June 2009
    333 Posts
    This is my binding to VoiDeD's Steamworks API, Open Steamworks.

    Download

    http://code.google.com/p/chrisaster/...gm_steamworks/ (Last updated 09/06/10 21:40)

    Function List

    Code:
    steamworks.CSteamID()
    steamworks.ISteamClient()
    steamworks.Steam_BGetCallback()
    steamworks.Steam_FreeLastCallback()
    
    ISteamClient007:CreateSteamPipe()
    ISteamClient007:ConnectToGlobalUser(hSteamPipe)
    ISteamClient007:GetISteamUser(hSteamUser, hSteamPipe, interfaceVersion)
    ISteamClient007:GetISteamFriends(hSteamUser, hSteamPipe, interfaceVersion)
    
    ISteamUser005:IsPrimaryChatDestination()
    ISteamUser005:GetHSteamUser()
    ISteamUser005:GetCSteamID()
    ISteamUser005:LoggedOn()
    ISteamUser005:SetSelfAsPrimaryChatDestination()
    
    ISteamUser012:GetHSteamUser()
    ISteamUser012:GetCSteamID()
    ISteamUser012:LoggedOn()
    
    ISteamFriends002:AcknowledgeInviteToClan(CSID, bool)
    ISteamFriends002:AddFriend(CSID)
    ISteamFriends002:AddFriendByName(nameOrEmail)
    ISteamFriends002:GetChatMessage(friendCSID, chatID)
    ISteamFriends002:InviteFriendToClan(friendCSID, groupCSID)
    ISteamFriends002:RemoveFriend(friendCSID)
    ISteamFriends002:SendMsgToFriend(friendCSID, messageType, messageBody)
    ISteamFriends002:SetPersonaState(personaState)
    
    ISteamFriends005:ActivateGameOverlay(pchDialog)
    ISteamFriends005:ActivateGameOverlayToStore(appID)
    ISteamFriends005:ActivateGameOverlayToUser(pchDialog, friendCSID)
    ISteamFriends005:ActivateGameOverlayToWebPage(pchURL)
    ISteamFriends005:GetClanByIndex(clanIndex)
    ISteamFriends005:GetClanCount()
    ISteamFriends005:GetClanName(groupCSID)
    ISteamFriends005:GetFriendByIndex(friendIndex, friendFlags)
    ISteamFriends005:GetFriendCount(friendFlags)
    ISteamFriends005:GetFriendCountFromSource(sourceCSID)
    ISteamFriends005:GetFriendFromSourceByIndex(sourceCSID, friendIndex)
    ISteamFriends005:GetFriendGamePlayed(friendCSID)
    ISteamFriends005:GetFriendPersonaName(friendCSID)
    ISteamFriends005:GetFriendPersonaNameHistory(friendCSID, historyIndex)
    ISteamFriends005:GetFriendPersonaState(friendCSID)
    ISteamFriends005:GetFriendRelationship(friendCSID)
    ISteamFriends005:GetPersonaName()
    ISteamFriends005:GetPersonaState()
    ISteamFriends005:HasFriend(friendCSID, friendFlags)
    ISteamFriends005:IsUserInSource(userCSID, sourceCSID)
    ISteamFriends005:SetInGameVoiceSpeaking(userCSID, bSpeaking)
    ISteamFriends005:SetPersonaName(personaName)
    
    CSteamID:GetAccountID()
    CSteamID:GetEAccountType()
    CSteamID:GetEUniverse()
    CSteamID:GetUnAccountInstance()
    CSteamID:InstancedSet(accountID, accountInstance, eUniverse, eAccountType)
    CSteamID:IsValid()
    CSteamID:Render()
    CSteamID:Set(accountID, eUniverse, accountType)
    CSteamID:SetAccountID(accountID)
    CSteamID:SetEUniverse(eUniverse)
    
    PubParam:To(newTypeMetaID)
    
    CallbackMsg_t:GetCubParam()
    CallbackMsg_t:GetHSteamUser()
    CallbackMsg_t:GetCallback()
    CallbackMsg_t:GetPubParam()
    
    GameOverlayActivated_t:IsActive()
    
    PersonaStateChange_t:GetSteamID()
    PersonaStateChange_t:GetFlags()
    
    FriendChatMsg_t:GetReceiver()
    FriendChatMsg_t:GetSender()
    FriendChatMsg_t:GetChatID()
    
    FriendEndChatSession_t:GetCSteamID()
    
    FriendAdded_t:GetSuccess()
    FriendAdded_t:GetSteamID()
    
    UserRequestingFriendship_t:GetSteamID()
    
    FriendGameInfo_t:GetCGameID()
    FriendGameInfo_t:GetGameIP()
    FriendGameInfo_t:GetGamePort()
    FriendGameInfo_t:GetQueryPort()
    
    CGameID:AppID()
    CGameID:IsMod()
    CGameID:IsP2PFile()
    CGameID:IsShortcut()
    CGameID:IsSteamApp()
    CGameID:IsValid()
    CGameID:ModID()
    Examples

    //steamworks.lua
    
    require("steamworks")
    
    steamClient007 = steamworks.ISteamClient(7)
    
    if (!steamClient007) then return end
    
    hSteamPipe = steamClient007:CreateSteamPipe()
    
    if (!hSteamPipe) then return end
    
    hSteamUser = steamClient007:ConnectToGlobalUser(hSteamPipe)
    
    if (!hSteamUser) then return end
    
    steamUser012 = steamClient007:GetISteamUser(hSteamUser, hSteamPipe, 12)
    
    if (!steamUser012) then	return end
    
    if (!steamUser012:LoggedOn()) then return end
    
    steamFriends005 = steamClient007:GetISteamFriends(hSteamUser, hSteamPipe, 5)
    
    if (!steamFriends005) then return end
    
    steamFriends002 = steamClient007:GetISteamFriends(hSteamUser, hSteamPipe, 2)
    
    if (!steamFriends002) then return end
    
    hook.Add("Think", "Steam_BGetCallback", function()
    	callbackMsg = steamworks.Steam_BGetCallback(hSteamPipe)
    	
    	if (!callbackMsg) then return end
    	
    	if (callbackMsg:GetCallback() == (300 + 31)) then
    		local gameOverlay = callbackMsg:GetPubParam():To(FindMetaTable("GameOverlayActivated_t").MetaID)
    			
    		hook.Call("GameOverlayActivated", nil, gameOverlay:IsActive())
    	elseif (callbackMsg:GetCallback() == (300 + 4)) then
    		local personaChange = callbackMsg:GetPubParam():To(FindMetaTable("PersonaStateChange_t").MetaID)
    		
    		local personaSID = personaChange:GetSteamID()
    		
    		if (personaSID) then
    			local personaCSID = steamworks.CSteamID()
    			
    			personaCSID:Set(personaSID, 1, 1)
    	
    			if (personaChange:GetFlags() == 0x001) then
    				hook.Call("EPersonaChangeName", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x002) then
    				hook.Call("EPersonaChangeStatus", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x004) then
    				hook.Call("EPersonaChangeComeOnline", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x008) then
    				hook.Call("EPersonaChangeGoneOffline", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x010) then
    				hook.Call("EPersonaChangeGamePlayed", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x020) then
    				hook.Call("EPersonaChangeGameServer", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x040) then
    				hook.Call("EPersonaChangeAvatar", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x080) then
    				hook.Call("EPersonaChangeJoinedSource", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x100) then
    				hook.Call("EPersonaChangeLeftSource", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x200) then
    				hook.Call("EPersonaChangeRelationshipChanged", nil, personaCSID)
    			elseif (personaChange:GetFlags() == 0x400) then
    				hook.Call("EPersonaChangeNameFirstSet", nil, personaCSID)
    			end
    		end
    	end
    	
    	steamworks.Steam_FreeLastCallback(hSteamPipe)
    end )
    

    include("steamworks.lua")
    
    local EPersonaStateStrings = {
    	"Offline",
    	"Online",
    	"Busy",
    	"Away",
    	"Snooze",
    }
    
    hook.Add("GameOverlayActivated", "SHook", function(state)
    	if (state) then
    		print(string.format("[%s] Opened game overlay", os.date()))
    	else
    		print(string.format("[%s] Closed game overlay", os.date()))
    	end
    end )
    
    hook.Add("EPersonaChangeName", "SHook", function(id)
    	print(string.format("[%s] The owner of %s changed their name to '%s'", os.date(), id:Render(), steamFriends005:GetFriendPersonaName(id)))
    end )
    
    hook.Add("EPersonaChangeStatus", "SHook", function(id)
    	print(string.format("[%s] '%s' is now %s", os.date(), steamFriends005:GetFriendPersonaName(id), EPersonaStateStrings[steamFriends005:GetFriendPersonaState(id)+1]))
    end )
    
    hook.Add("EPersonaChangeComeOnline", "SHook", function(id)
    	print(string.format("[%s] '%s' signed in", os.date(), steamFriends005:GetFriendPersonaName(id)))
    end )
    
    hook.Add("EPersonaChangeGoneOffline", "SHook", function(id)
    	print(string.format("[%s] '%s' signed out", os.date(), steamFriends005:GetFriendPersonaName(id)))
    end )
    
    hook.Add("EPersonaChangeGamePlayed", "SHook", function(id)
    	local gamePlayed = steamFriends005:GetFriendGamePlayed(id)
    	
    	if (gamePlayed) then
    		print(string.format("[%s] '%s' is now playing {AppID:%d}", os.date(), steamFriends005:GetFriendPersonaName(id), gamePlayed:GetCGameID():AppID()))
    	else
    		print(string.format("[%s] '%s' is no longer playing anything", os.date(), steamFriends005:GetFriendPersonaName(id)))
    	end
    end )
    
    hook.Add("EPersonaChangeGameServer", "SHook", function(id)
    	print(string.format("[%s] '%s' is now playing on %s:%d", os.date(), steamFriends005:GetFriendPersonaName(id), steamFriends005:GetFriendGamePlayed(id):GetGameIP(), steamFriends005:GetFriendGamePlayed(id):GetGamePort()))
    end )
    
    hook.Add("EPersonaChangeAvatar", "SHook", function(id)
    	print(string.format("[%s] '%s' changed their avatar", os.date(), steamFriends005:GetFriendPersonaName(id)))
    end )
    
    hook.Add("EPersonaChangeJoinedSource", "SHook", function(id)
    	print(string.format("[%s] '%s' joined source", os.date(), steamFriends005:GetFriendPersonaName(id)))
    end )
    
    hook.Add("EPersonaChangeLeftSource", "SHook", function(id)
    	print(string.format("[%s] '%s' left source", os.date(), steamFriends005:GetFriendPersonaName(id)))
    end )
    
    hook.Add("EPersonaChangeRelationshipChanged", "SHook", function(id)
    	print(string.format("[%s] Your relationship with '%s' changed", os.date(), steamFriends005:GetFriendPersonaName(id)))
    end )
    
    hook.Add("EPersonaChangeNameFirstSet", "SHook", function(id)
    	print(string.format("[%s] The owner of %s has just set his/her name for the first time", os.date(), id:Render()))
    end )
    

    include("steamworks.lua")
    
    local friendFlag = 4
    
    for i=0, steamFriends005:GetFriendCount(friendFlag)-1 do
    	local targetFriend = steamFriends005:GetFriendByIndex(i, friendFlag)
    	
    	if (steamFriends005:GetFriendPersonaName(targetFriend) == "Chris") then
    		steamFriends002:SendMsgToFriend(targetFriend, 1, "Hi Chris")
    		steamFriends002:SendMsgToFriend(targetFriend, 3, "")
    	end
    end
    

    include("steamworks.lua")
    
    local communityBase = 103582791429521408 --(103582791430000000 - 478592)
    
    local function ClanCommunityIDToClanAccountID(communityID)
    	return communityID - communityBase
    end
    
    local function ClanAccountIDToClanCommunityID(accountID)
    	return accountID + communityBase
    end
    
    local communityID = 103582791430354656
    
    local groupCSID = steamworks.CSteamID()
    groupCSID:InstancedSet(ClanCommunityIDToClanAccountID(communityID), 0, 1, 7)
    
    print(groupCSID)
    
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Useful Useful x 14Dumb Dumb x 4Friendly Friendly x 4 (list)

  2. Post #2
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    I see you didn't manage to work out how to display the user's previous name. :(

  3. Post #3
    Skondra's Avatar
    June 2009
    333 Posts
    I see you didn't manage to work out how to display the user's previous name. :(
    CSteamID:NameHistory(0) might work.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Optimistic Optimistic x 1Informative Informative x 1 (list)

  4. Post #4
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    This is going to be useful, thanks
    Reply With Quote Edit / Delete Reply Finland Show Events Friendly Friendly x 4Dumb Dumb x 1 (list)

  5. Post #5
    Gold Member
    Gbps's Avatar
    December 2008
    3,639 Posts
    Another great release!
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 4Dumb Dumb x 1 (list)

  6. Post #6
    leeetdude's Avatar
    April 2009
    434 Posts
    Well done Chrisaster, well done!
    Reply With Quote Edit / Delete Reply Germany Show Events Friendly Friendly x 4Dumb Dumb x 1 (list)

  7. Post #7
    Internet Detective (HBIED certified)
    leach139's Avatar
    August 2007
    7,215 Posts
    Holy shit, I can see so many uses for this. Thanks Crissie
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Friendly Friendly x 3Dumb Dumb x 1Bad Spelling Bad Spelling x 1 (list)

  8. Post #8
    ashashinand's Avatar
    July 2009
    118 Posts
    pure excellence.
    Reply With Quote Edit / Delete Reply Australia Show Events Friendly Friendly x 2Dumb Dumb x 1 (list)

  9. Post #9
    Creator of Exsto
    Prefan's Avatar
    January 2009
    1,049 Posts
    I love you.

    Tears of joy are streaming from my eyes.
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 3Friendly Friendly x 3 (list)

  10. Post #10
    Mechanical Mind's Avatar
    December 2007
    411 Posts
    Can you make a function to get users/steamids in a group?
    Reply With Quote Edit / Delete Reply Australia Show Events Useful Useful x 1 (list)

  11. Post #11
    blob202's Avatar
    June 2007
    42 Posts
    It has the capability to do all of the above, and more. Scary things.
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 1 (list)

  12. Post #12
    foxcock
    Bletotum's Avatar
    June 2008
    6,873 Posts
    Another great release.

    Don't stop.
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 1Friendly Friendly x 1 (list)

  13. Post #13
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    Glad to see the API is getting some use.

    Feel free to post about any C++ API related issues here as well, since there really is no official thread for the Open Steamworks project.

    Also, I'm looking for anyone who is willing to test functions, and since you seem to be the right person for the job chrisaster, feel free to PM or post details about any functions you've tested. (If any)
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 5 (list)

  14. Post #14
    Skondra's Avatar
    June 2009
    333 Posts
    Can you make a function to get users/steamids in a group?
    Done.

  15. Post #15
    Gold Member
    Crazy Quebec's Avatar
    May 2008
    2,449 Posts
    Just to make sure, with this you can access all of the functionalities of the Steam Community and possibly interface steam with other messaging clients?

  16. Post #16
    blob202's Avatar
    June 2007
    42 Posts
    Yes sir, you can.

  17. Post #17
    Skondra's Avatar
    June 2009
    333 Posts
    I'm still working on hooking chat messages, however it seems that there is no callback being made for incoming nor outgoing messages.

  18. Post #18
    Gold Member
    slayer3032's Avatar
    November 2007
    3,466 Posts
    I just messaged everyone on my friends list with this.

    It messaged people who where appearing offline, it was hilarious.

    This module is awesome.
    Reply With Quote Edit / Delete Reply United States Show Events Funny Funny x 2Dumb Dumb x 1Friendly Friendly x 1Agree Agree x 1 (list)

  19. Post #19
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    Incase anyone's interested, here's a list of friendFlags:

    Code:
    k_EFriendFlagNone = 0
    k_EFriendFlagBlocked = 1
    k_EFriendFlagFriendshipRequested = 2
    k_EFriendFlagImmediate = 4 // "regular" friend
    k_EFriendFlagClanMember = 8
    k_EFriendFlagOnGameServer = 16,
    //k_EFriendFlagHasPlayedWith = 32
    //k_EFriendFlagFriendOfFriend = 64
    k_EFriendFlagRequestingFriendship = 128,
    k_EFriendFlagRequestingInfo = 256
    k_EFriendFlagAll	 = 65 535
    And logon states:
    Code:
    k_ELogonStateNotLoggedOn = 0
    k_ELogonStateLoggingOn = 1
    k_ELogonStateLoggingOff = 2
    k_ELogonStateLoggedOn = 3
    EDIT: Just noticed this takes logon states as strings

    Edited:

    steamworks.SetStatus("anythingbutempty")
    

    Hilarity ensues
    Reply With Quote Edit / Delete Reply Finland Show Events Dumb Dumb x 1 (list)

  20. Post #20
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    I created a thread for the Open Steamworks project. You can find it here: http://www.facepunch.com/showthread.php?p=17667828

    I'll be around in both threads to help out.
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 2 (list)

  21. Post #21
    THERPM's Avatar
    September 2009
    25 Posts
    it's probably a virus chrisaster "SKONDRA" is a hacker
    Reply With Quote Edit / Delete Reply Canada Show Events Dumb Dumb x 17Funny Funny x 4Late Late x 3Agree Agree x 1 (list)

  22. Post #22

    September 2009
    245 Posts
    it's probably a virus chrisaster "SKONDRA" is a hacker
    lol @ this dude
    Reply With Quote Edit / Delete Reply Canada Show Events Agree Agree x 9Disagree Disagree x 1 (list)

  23. Post #23
    Gold Member
    Deco Da Man's Avatar
    July 2007
    1,017 Posts
    Skondra!
    The 64bit representation of a CSteamID is a community ID.

    CSteamID id((uint64)76561197969249708L);
    

    As for string representations, you'll have to manually parse them.
    steamworks.CSteamIDFromID(community_id) please!

    Edited:

    And a hook for chat messages.. I know it's possible cause there's something that uses it in the Open Steamworks thread.
    Reply With Quote Edit / Delete Reply Australia Show Events Dumb Dumb x 1Bad Reading Bad Reading x 1 (list)

  24. Post #24
    ashashinand's Avatar
    July 2009
    118 Posts
    it's probably a virus chrisaster "SKONDRA" is a hacker
    funny

    oh wait you're serious

  25. Post #25
    Gold Member
    Deco Da Man's Avatar
    July 2007
    1,017 Posts
    I've been having fun with this :D
    http://codepad.org/mvJ7gbH3

  26. Post #26
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    I've been having fun with this :D
    http://codepad.org/mvJ7gbH3
    That's awesome :D
    Though I recommend that you do not click your own name, made my Steam crash.

  27. Post #27
    Skondra's Avatar
    June 2009
    333 Posts
    Skondra!


    steamworks.CSteamIDFromID(community_id) please!

    Edited:

    And a hook for chat messages.. I know it's possible cause there's something that uses it in the Open Steamworks thread.
    I'll give it a go when I get home, along with a way to generate CSteamID's from a player's Steam ID string.

    I've also added CSteamID:IsFriend(friendFlags) so that you can check whether a player falls under the specified flags. (Useful for auto-inviting recently met players)

  28. Post #28
    Gold Member

    July 2006
    1,952 Posts
    Oh, this is so awesome.

  29. Post #29
    Gold Member
    Deco Da Man's Avatar
    July 2007
    1,017 Posts
    I'll give it a go when I get home, along with a way to generate CSteamID's from a player's Steam ID string.

    I've also added CSteamID:IsFriend(friendFlags) so that you can check whether a player falls under the specified flags. (Useful for auto-inviting recently met players)
    <3

    Thanks for making this module :D

    And thanks to VoiDeD for putting together Open Steamworks :D

  30. Post #30
    Gold Member
    Skapocalypse's Avatar
    November 2008
    769 Posts
    it's probably a virus chrisaster "SKONDRA" is a hacker
    Have a box :)
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 8Dumb Dumb x 1 (list)

  31. Post #31
    Gold Member
    Deco Da Man's Avatar
    July 2007
    1,017 Posts
    Can you please make a __equal entry into the metatable, as of current:
    ] lua_run_cl print(steamworks.FriendByIndex(10, 0xFFFF) == steamworks.FriendByIndex(10, 0xFFFF))
    false
    

    I see no need for __lt, __le and such, it's just __equal that would be damn handy.

    Edited:

    About to test this:
    require("steamworks")
    
    local speak_invites = CreateClientConVar("speak_serious_invites", "1", true, false)
    local group_name = CreateClientConVar("serious_invite_group", "Played with Deco", true, false)
    
    local group
    for i = 1, steamworks.GroupCount() do
    	group = steamworks.GroupByIndex(i)
    	if group and group:GroupName() == group_name:GetString() then
    		break
    	end
    end
    if not group then
    	error("A serious error has occured. The group '"..group_name:GetString().."' cannot be found.")
    end
    
    local invited = {}
    -- steamworks.FriendByIndex(10, 0xFFFF) ~= steamworks.FriendByIndex(10, 0xFFFF)
    -- so I gotta do it by name :(
    timer.Create("Serious invites", 60, 0, function()
    	local i = 0
    	local friend
    	timer.Create("Serious invites [2]", 1, steamworks.FriendCount("k_EFriendFlagOnGameServer"), function()
    		i = i+1
    		friend = steamworks.FriendByIndex(i, "k_EFriendFlagOnGameServer")
    		if friend and not friend:IsInGroup(group) and not invited[friend:FriendName()] then
    			friend:InviteToGroup(group)
    			if speak_invites:GetBool() then
    				RunConsoleCommand("say", "Congratulations, "..friend:FriendName().."! You've been invited to my '"..group_name:GetString().."' group!")
    			end
    			invited[friend:FriendName()] = true
    		end
    	end)
    end)
    
    

    :|

    Edit: Edited to comply with demands of serious people.
    Reply With Quote Edit / Delete Reply Australia Show Events Funny Funny x 2 (list)

  32. Post #32
    GAY_LUA_SON's Avatar
    June 2008
    12 Posts
    Do you really have to fill your dumb shit up with 4chan memes?
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 2 (list)

  33. Post #33
    LauIsFun's Avatar
    August 2009
    69 Posts
    Do you really have to fill your dumb shit up with 4chan memes?
    ^mmk

    I like this addon, definitely useful in logging IPs and steamids together to create a huge logging spree in which an ip address is a click away.

    Atleast this gets steamids accurately, you could lookup information and probably display it ingame on demand.
    Like use derma and spend a few days coding up a really sick menu that looks like gray 'n shit.

    Love this.

  34. Post #34
    Skondra's Avatar
    June 2009
    333 Posts
    I'm having a problem passing numbers as big as group ID's to the Lua interface. Here's an example of what's happening:

    ] lua_run_cl require("steamworks") print(ConvertToUINT64AndBack(10000000000))
    1410065408
    Code:
    	gLua->CheckType(1, GLua::TYPE_NUMBER);
    
    	uint32 origx = gLua->GetDouble(1);
    	uint64 origy = (uint64)origx;
    	
    	gLua->PushDouble((uint32)origy);
    It seems that when the number is too large, it isn't passed correctly.

    To prove the function works with smaller numbers:

    ] lua_run_cl require("steamworks") print(ConvertToUINT64AndBack(1000000))
    1000000
    This is preventing steam.CreateCSteamID() from working correctly, for example:

    Code:
    require("steamworks")
    
    local gObj = steamworks.GroupByIndex(0)
    	
    print(gObj:AccountUniverse())
    print(gObj:AccountType())
    print(gObj:AccountInstance())
    print(gObj:AccountID())
    print(gObj:AccountID64())
    print(gObj:GroupName())
    
    local newObj = steamworks.CreateCSteamID(103582791430363245, 0, "k_EUniversePublic", "k_EAccountTypeClan")
    
    print(newObj:AccountUniverse())
    print(newObj:AccountType())
    print(newObj:AccountInstance())
    print(newObj:AccountID())
    print(newObj:AccountID64())
    print(newObj:GroupName())
    ] lua_openscript_cl steamworksx.lua
    Running script steamworksx.lua...
    k_EUniversePublic
    k_EAccountTypeClan
    0
    841837
    1.0358279143036e+017
    Exiled Servers

    k_EUniversePublic
    k_EAccountTypeClan
    0
    841840
    1.0358279143036e+017
    As you can see, AccountID64() returns the same number, but AccountID() doesn't.

    Does anyone know how I could go about fixing this?

    Oh and as for chat hooks:

    PM from VoiDeD posted:
    Just an update, I committed an updated FriendChatMsg_t structure. It won't fix your problem but it's updated to the latest callback format.

    One thing I've noticed in my testing is that if there is a steam_appid.txt present in the running directory, I haven't received friend message callbacks either. Alot of callbacks seem to get swallowed by the steam_api.dll when it's loaded (even if it's not SteamAPI_Init'd), so this is most likely the problem you're having.

    As for any fixes... I really don't know. The game is required to have a steam_appid.txt, so there's no easy way getting around it as far as I can tell.
    I've also added the __eq entry to the metatable as requested.

  35. Post #35
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    Released a pretty big update to Open Steamworks. More details available here: http://www.facepunch.com/showpost.ph...2&postcount=41

    One thing to note is that the CCallback class has been changed, it requires an updated version of steam_api.dll, but I'm unsure as to which as of yet.
    Reply With Quote Edit / Delete Reply United States Show Events Informative Informative x 2 (list)

  36. Post #36
    Gold Member
    Deco Da Man's Avatar
    July 2007
    1,017 Posts
    I've also added the __eq entry to the metatable as requested.
    Awsome. Thanks :D

    Released a pretty big update to Open Steamworks.
    Very awesome.

    Oh and as for chat hooks: [fail]
    God dammit :(

    I'm having a problem passing numbers as big as group ID's to the Lua interface.
    Perhaps pass it as a string? Either community ID or SteamID. With SteamID, we could pass the Universe, Type and ID.
    Code:
    steamworks.CSteamIDFromID("76561197960268403") -- community id (for STEAM_0:1:1337)
    steamworks.CSteamIDFromID("STEAM_0:1:1337") -- steam id
    steamworks.CSteamIDFromID(0, 1, 1337) -- steadid

  37. Post #37
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    Updated the project. Added alot of things which I'm too lazy to type out.

    Check the revision log here for details: http://code.assembla.com/steamworks/...e/logs?rev=112

    Additionally, there is an IRC channel for the project located at irc.gamesurge.net / #opensteamworks.
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 2Useful Useful x 1Informative Informative x 1 (list)

  38. Post #38
    Gold Member
    mastersrp's Avatar
    October 2005
    1,742 Posts
    This module, and the whole Open Steamworks thing is genius!
    I've been looking for this stuff EVERYWHERE, and the suddenly *BAM*! module and Open Source Steamworks released. Awesome!
    Reply With Quote Edit / Delete Reply Denmark Show Events Friendly Friendly x 2 (list)

  39. Post #39
    Steins;Gate SUCKS
    Dave_Parker's Avatar
    October 2008
    4,994 Posts
    This is so great to annoy your steam friends with.
    Reply With Quote Edit / Delete Reply Netherlands Show Events Dumb Dumb x 7 (list)

  40. Post #40
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    There haven't been many updates to this module recently it seems...

    On the other hand the OSW project has been since updated numerous times (we're at revision 276 at the time of writing), and the team has grown to 7 members.

    As always we're looking for anyone who can contribute any amount of time to the project. There are no requirements if you join the team, except a willingness to help out in any way.
    Reply With Quote Edit / Delete Reply United States Show Events Informative Informative x 1Agree Agree x 1Friendly Friendly x 1 (list)