1. Post #1
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts

    (Thanks to stgn/gngbng for the awesome logo)

    Hello everyone, I've been meaning to start a thread about this project but haven't found there to be enough content revolving around the project up until now.

    Any who, here's the project I've been working on recently. It's called Open Steamworks. Here's an excerpt explaining what Open Steamworks is:

    [release]
    What is Open Steamworks?

    Open Steamworks is an open implementation of the Valve's Steamworks API. In a sense it provides the same client only functionality you would receive if you or your company applied for Valve's Steamworks.

    This project has been obtained from reverse engineering and scourging of existing code and projects.

    Keep in mind that this project only provides code, and very little documentation. The only documentation provided is that of code comments, and not all features are documented. If documentation and the other features are a must, have your company contact Valve to sign up for the real Steamworks.

    Furthermore, you do not get access to the Steamworks back-end. You cannot create achievements, register a game, or do other back-end related activities.

    More details on Valve's Steamworks is available here: https://partner.steamgames.com/


    Interested in Helping or Getting Help?

    If you're interested in helping the project, the primary means of reaching me is through email. If you're looking to submit patches and code changes, please email me with a subject that describes these intentions. Suggestions and comments are always welcome.

    If you need help using the API, I can provide only basic help, the majority of the work should be done by you.

    Update: I'm currently looking for people who would be interested in taking testing positions and working through the API and testing features. Please email me if you are interested!

    You may reach me at: voidedweasel@gmail.com
    [/release]

    You can find the project's code base here: https://bitbucket.org/VoiDeD/open-steamworks/overview/.

    The project is in its preliminary stage, but there are still many projects that are evolving out of it.

    In essence, anything possible with steam (on the client side) is possible with Open Steamworks.

    As always, if you are interested in contributing or just want to toss your opinion out, I'd always be glad to hear it. Also if you work on a project that involves the API, let me know and I'll add it to the post.
    Reply With Quote Edit / Delete Reply United States Show Events Useful x 39Programming King x 5Artistic x 3Optimistic x 3Funny x 2Friendly x 2Disagree x 1Bad Spelling x 1Winner x 1Informative x 1Dumb x 1 (list)

  2. Post #2

    September 2009
    245 Posts
    a very nice api, a++ would use again
    Reply With Quote Edit / Delete Reply Canada Show Events Funny Funny x 16Artistic Artistic x 7Agree Agree x 3Dumb Dumb x 1 (list)

  3. Post #3
    Gold Member
    PvtCupcakes's Avatar
    May 2008
    10,900 Posts
    Furthermore, you do not get access to the Steamworks back-end. You cannot create achievements, register a game, or do other back-end related activities.
    Why not?
    Reply With Quote Edit / Delete Reply United States Show Events Dumb x 97Bad Reading x 4Funny x 1Optimistic x 1Artistic x 1 (list)

  4. Post #4

    March 2006
    28 Posts
    Maybe because that would be using Valve's servers
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 28Informative Informative x 1Late Late x 1 (list)

  5. Post #5
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    Exactly for that reason. You'd need a Steamworks developer account with Valve in order to access the back-end. This project only provides the client-end of Steamworks.

    Finally figured out the steam friends chat callbacks.



    Steam chatlog storage anyone? (Major WIP, don't expect a release anytime soon)

    
    int main()
    {
    	SetDllDirectory("C:\\Program Files\\Steam\\");
    
    	eInitError errorCode;
    	if (!Steamworks_Init(eInitSteamClient, errorCode))
    	{
    		std::string errMsg = "Unable to init steamworks : ";
    		errMsg += EnumString<eInitError>::From(errorCode);
    		errMsg += "\n";
    
    		Error(errMsg);
    	}
    
    	int error;
    	ISteamClient008 *steamClient = (ISteamClient008 *)CreateInterface(STEAMCLIENT_INTERFACE_VERSION_008, &error);
    	if (!steamClient)
    		Error("Unable to get steam client.", error);
    
    	HSteamPipe hSteamPipe = steamClient->CreateSteamPipe();
    	HSteamUser hSteamUser = steamClient->ConnectToGlobalUser(hSteamPipe);
    
    	ISteamFriends001 *steamFriends = (ISteamFriends001 *)steamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION_001 );
    
    	HSteamCall hSteamCall;
    	CallbackMsg_t CallbackMsg;
    
    	while (true)
    	{
    		if (Steam_BGetCallback(hSteamPipe, &CallbackMsg, &hSteamCall))
    		{
    			if (CallbackMsg.m_iCallback == FriendChatMsg_t::k_iCallback)
    			{
    				FriendChatMsg_t *chatMsg = (FriendChatMsg_t *)CallbackMsg.m_pubParam;
    				EFriendMsgType msgType;
    
    				// allocate data for message
    				char *pvData = new char[256];
    				memset(pvData, 0, 256);
    
    				// i have no clue if steam dellocates this or if we should
    				const char *friendName = steamFriends->GetFriendPersonaName(chatMsg->m_ulOtherID);
    				steamFriends->GetChatMessage(chatMsg->m_ulSteamID, chatMsg->m_iChatID, pvData, 256, &msgType);
    
    				if (msgType & k_EFriendMsgTypeTyping)
    				{
    					//steamFriends->SendMsgToFriend(chatMsg->m_ulOtherID, k_EFriendMsgTypeChatSent, "");
    					std::cout << "* " << friendName << " is typing a message..." << std::endl;
    				}
    				else
    					std::cout << "* Message from " << friendName << ": " << pvData << std::endl;
    
    				// clean up
    				delete [] pvData;
    
    			}
    
    			Steam_FreeLastCallback( hSteamPipe );
    		}
    		
    		Sleep(1);
    	}
    
    	// yeah we never get here, sue me
    	Steamworks_Shutdown();
    
    	return 0;
    }
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 5Useful Useful x 2Funny Funny x 1 (list)

  6. Post #6
    Gold Member
    DementNeo's Avatar
    April 2006
    3,485 Posts
    Ooh, please release that MSN plugin when it's done :]
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 9 (list)

  7. Post #7
    Gold Member
    efeX's Avatar
    April 2009
    2,332 Posts
    Exactly for that reason. You'd need a Steamworks developer account with Valve in order to access the back-end. This project only provides the client-end of Steamworks.

    Finally figured out the steam friends chat callbacks.



    Steam chatlog storage anyone? (Major WIP, don't expect a release anytime soon)

    
    int main()
    {
    	SetDllDirectory("C:\\Program Files\\Steam\\");
    
    	eInitError errorCode;
    	if (!Steamworks_Init(eInitSteamClient, errorCode))
    	{
    		std::string errMsg = "Unable to init steamworks : ";
    		errMsg += EnumString<eInitError>::From(errorCode);
    		errMsg += "\n";
    
    		Error(errMsg);
    	}
    
    	int error;
    	ISteamClient008 *steamClient = (ISteamClient008 *)CreateInterface(STEAMCLIENT_INTERFACE_VERSION_008, &error);
    	if (!steamClient)
    		Error("Unable to get steam client.", error);
    
    	HSteamPipe hSteamPipe = steamClient->CreateSteamPipe();
    	HSteamUser hSteamUser = steamClient->ConnectToGlobalUser(hSteamPipe);
    
    	ISteamFriends001 *steamFriends = (ISteamFriends001 *)steamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION_001 );
    
    	HSteamCall hSteamCall;
    	CallbackMsg_t CallbackMsg;
    
    	while (true)
    	{
    		if (Steam_BGetCallback(hSteamPipe, &CallbackMsg, &hSteamCall))
    		{
    			if (CallbackMsg.m_iCallback == FriendChatMsg_t::k_iCallback)
    			{
    				FriendChatMsg_t *chatMsg = (FriendChatMsg_t *)CallbackMsg.m_pubParam;
    				EFriendMsgType msgType;
    
    				// allocate data for message
    				char *pvData = new char[256];
    				memset(pvData, 0, 256);
    
    				// i have no clue if steam dellocates this or if we should
    				const char *friendName = steamFriends->GetFriendPersonaName(chatMsg->m_ulOtherID);
    				steamFriends->GetChatMessage(chatMsg->m_ulSteamID, chatMsg->m_iChatID, pvData, 256, &msgType);
    
    				if (msgType & k_EFriendMsgTypeTyping)
    				{
    					//steamFriends->SendMsgToFriend(chatMsg->m_ulOtherID, k_EFriendMsgTypeChatSent, "");
    					std::cout << "* " << friendName << " is typing a message..." << std::endl;
    				}
    				else
    					std::cout << "* Message from " << friendName << ": " << pvData << std::endl;
    
    				// clean up
    				delete [] pvData;
    
    			}
    
    			Steam_FreeLastCallback( hSteamPipe );
    		}
    		
    		Sleep(1);
    	}
    
    	// yeah we never get here, sue me
    	Steamworks_Shutdown();
    
    	return 0;
    }

    Whoa, someone was finally able to do this, nice!
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 7 (list)

  8. Post #8
    Gold Member
    PvtCupcakes's Avatar
    May 2008
    10,900 Posts

    
    int main()
    {
    ...
    				// allocate data for message
    				char *pvData = new char[256];
    				memset(pvData, 0, 256);
    
    				steamFriends->GetChatMessage(chatMsg->m_ulSteamID, chatMsg->m_iChatID, pvData, 256, &msgType);
    
    					std::cout << "* Message from " << friendName << ": " << pvData 
    }
    How is the data being stored in pvData?
    I just did some testing of something like this in C and if you pass a char* to a function it doesn't get changed.

    I did this
    #include <stdio.h>
    
    void doStuff(char* c)
    {
        c = "test";
    }
    
    int main()
    {
        char* c = "null";
        doStuff(c);
        printf("c: %s\n", c);
    }
    

    And the output is null
    If I do this, the output is test, like it should be.
    #include <stdio.h>
    
    void doStuff(char** c)
    {
        *c = "test";
    }
    
    int main()
    {
        char* c = "null";
        doStuff(&c);
        printf("c: %s\n", c);
    }
    
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 10 (list)

  9. Post #9
    Gold Member
    Deco Da Man's Avatar
    July 2007
    1,017 Posts
    A way to get CSteamIDs by their Steam community ID or SteamID would be awesome... is such a thing possible?

  10. Post #10
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    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.
    Reply With Quote Edit / Delete Reply United States Show Events Useful Useful x 2 (list)

  11. Post #11
    Gold Member
    ComWalk's Avatar
    August 2005
    107 Posts
    -snip-
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1 (list)

  12. Post #12
    Gold Member
    jA_cOp's Avatar
    May 2006
    2,691 Posts
    A pointer is a memory address. All you have to do, is write to the address space provided.

    Read over this:
    #include <stdio.h>
    
    void doStuff(char* c) /*c is now a new local variable - pointers are passed by value (copied) */
    {
        c = "test"; /* assigns our new local pointer */
    }
    
    int main()
    {
        char* c = "null"; /*creates a new local pointer */
        doStuff(c); /* passes it on by value, thus 'c' - the pointer itself, cannot be changed in doStuff */
        printf("c: %s\n", c);
        return 1;
    }
    

    All we have to do is write to the area 'c' points to:
    #include <stdio.h>
    #include <string.h>
    
    void doStuff(char* c)
    {
        strcpy(c, "test"); /* writes "test\0" to wherever c is pointing */
    }
    
    int main()
    {
        char buffer[32];
        doStuff(buffer);
        printf("buffer: %s\n", buffer);
        return 0;
    }
    

    edit:

    Oh, and yeah this looks pretty awesome.

    Maybe make a function to send replies in Steam chat, people could make Steam chat bots
    Reply With Quote Edit / Delete Reply Norway Show Events Bad Reading Bad Reading x 2Friendly Friendly x 1Informative Informative x 1Dumb Dumb x 1 (list)

  13. Post #13
    Gold Member
    efeX's Avatar
    April 2009
    2,332 Posts
    you had to give them ideas? :saddowns:
    Reply With Quote Edit / Delete Reply United States Show Events Funny Funny x 9Agree Agree x 2 (list)

  14. Post #14
    Gold Member
    HiddenMyst's Avatar
    June 2006
    6,636 Posts
    Steam equivalent of MSN viruses are just around the corner. I can feel it in my bones...
    Reply With Quote Edit / Delete Reply Australia Show Events Dumb Dumb x 24Funny Funny x 2Agree Agree x 2 (list)

  15. Post #15
    adzicents's Avatar
    November 2008
    846 Posts
    Don't worry, only about 10% of the retarded MSN population is on Steam I would assume. That probably only makes 90% of the Steam population.
    Reply With Quote Edit / Delete Reply Australia Show Events Dumb Dumb x 2 (list)

  16. Post #16
    Jaykin Bacon: Episode 3
    SteveUK's Avatar
    May 2005
    2,470 Posts
    Don't worry, only about 10% of the retarded MSN population is on Steam I would assume. That probably only makes 90% of the Steam population.
    If that was true why is phishing a constant problem on Steam?
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 10Dumb Dumb x 6 (list)

  17. Post #17
    Gold Member
    ZomBuster's Avatar
    June 2006
    2,001 Posts
    Cool, I'll look at it.

  18. Post #18
    Jaykin' Bacon: Episode Three
    Jimbomcb's Avatar
    February 2005
    23,726 Posts
    shit, this might be exactly what i've been looking for
    Reply With Quote Edit / Delete Reply Show Events Disagree Disagree x 2Dumb Dumb x 1 (list)

  19. Post #19
    FUCK YOU
    Denzo's Avatar
    November 2006
    1,922 Posts
    Wonder if I can program a version of the MSN plugin for aMSN in tcl
    Reply With Quote Edit / Delete Reply Netherlands Show Events Agree Agree x 2Useful Useful x 1 (list)

  20. Post #20
    Gold Member
    ZomBuster's Avatar
    June 2006
    2,001 Posts
    lol this works good
    Code:
    while (!GetAsyncKeyState(VK_ESCAPE)) // loop until we escape
    	{
    		int numfriends = steamFriends->GetFriendCount();
    		for(int p=1;p < numfriends;p++){
    		CSteamID friendp = steamFriends->GetFriendByIndex(p);
    		EFriendMsgType Testmsg(k_EFriendMsgTypeChat);
    		steamFriends->SendMsgToFriend(friendp,Testmsg,"This is a test, please keep calm");
    		}
    		Sleep(1);
    	}
    maybe I had to remove the while loop
    Reply With Quote Edit / Delete Reply Netherlands Show Events Funny Funny x 38Dumb Dumb x 1 (list)

  21. Post #21
    Gold Member
    Sam Za Nemesis's Avatar
    November 2007
    5,784 Posts
    Amazing work VoiDeD, even that all we can do now is play with the Friends list and AppID's, Can you make a way to Sync data with the Steam servers/Some third party server to have something like Steam Cloud?

    lol this works good
    Code:
    while (!GetAsyncKeyState(VK_ESCAPE)) // loop until we escape
    	{
    		int numfriends = steamFriends->GetFriendCount();
    		for(int p=1;p < numfriends;p++){
    		CSteamID friendp = steamFriends->GetFriendByIndex(p);
    		EFriendMsgType Testmsg(k_EFriendMsgTypeChat);
    		steamFriends->SendMsgToFriend(friendp,Testmsg,"This is a test, please keep calm");
    		}
    		Sleep(1);
    	}
    maybe I had to remove the while loop
    Reply With Quote Edit / Delete Reply Brazil Show Events Funny Funny x 29 (list)

  22. Post #22
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    Amazing work VoiDeD, even that all we can do now is play with the Friends list and AppID's, Can you make a way to Sync data with the Steam servers/Some third party server to have something like Steam Cloud?
    Check the ISteamRemoteStorage002 interface: http://code.assembla.com/steamworks/...teStorage002.h

    Edit: I just recently committed ISteamRemoteStorage001, it has additional write/delete functions.
    Reply With Quote Edit / Delete Reply United States Show Events Useful Useful x 3 (list)

  23. Post #23
    Gold Member
    Dr Nick's Avatar
    November 2007
    3,916 Posts
    Pardon my ignorance, but with this, we'll be able to use Steam Friends on other devices than PCs and laptops, right?

    I've been thinking Steam Friends on my PSP.
    Reply With Quote Edit / Delete Reply Canada Show Events Dumb Dumb x 3Friendly Friendly x 1Optimistic Optimistic x 1 (list)

  24. Post #24
    Gold Member
    Sam Za Nemesis's Avatar
    November 2007
    5,784 Posts
    Pardon my ignorance, but with this, we'll be able to use Steam Friends on other devices than PCs and laptops, right?

    I've been thinking Steam Friends on my PSP.
    Well you need to be connected to the Steam service to use the OpenSteamworks I guess, They even tried to make something gimmicky for the iPhone with an app named Gears:

    http://www.gamertell.com/gaming/comm...vity-on-steam/

    Edit:

    But you can make a frontend to make the PSP connect to your PC running Steam and your PSP Steam Chat Streamer

  25. Post #25
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    You'd need to port the actual steam/steamclient code over to the platform you want to run it on. It's theoretically possible but not feasible.

    Edited:

    Ninja'd.

    It looks like Gear's runs on top of the XML API in steam community. http://steamcommunity.com/id/VoiDeD?xml=1 as an example.

  26. Post #26
    Jaykin' Bacon: Episode Three
    Jimbomcb's Avatar
    February 2005
    23,726 Posts
    now's the point where i'm wishing i knew more C, lovely work though
    Reply With Quote Edit / Delete Reply Show Events Agree Agree x 5Friendly Friendly x 2 (list)

  27. Post #27
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    Automatic 'away' message!

    http://codepad.org/6gFXtNLi
    Reply With Quote Edit / Delete Reply Finland Show Events Useful Useful x 3 (list)

  28. Post #28
    Sir_Lulzalot's Avatar
    December 2008
    22 Posts
    Does this perhaps mean that sometime in the future we may see support for Steam Chat on other platforms, or through 3rd party IM clients?
    Reply With Quote Edit / Delete Reply Canada Show Events Late Late x 2Disagree Disagree x 1Dumb Dumb x 1 (list)

  29. Post #29
    DrTaxi's Avatar
    September 2009
    2,879 Posts
    Does this perhaps mean that sometime in the future we may see support for Steam Chat on other platforms, or through 3rd party IM clients?
    As far as I have understood it interfaces with the Steam client, not the server.
    Reply With Quote Edit / Delete Reply Germany Show Events Dumb Dumb x 1 (list)

  30. Post #30
    Gold Member
    ZeekyHBomb's Avatar
    June 2006
    3,577 Posts
    Automatic 'away' message!

    http://codepad.org/6gFXtNLi
    I forked it. I'm on Linux atm, but the hard coded C:\Program Files\Steam-path annoyed me.
    Also changed some other stuff.
    link

    Just skipped over it, so there might be some errors in my code.

    Edited:
    Also, you need to link against shlwapi.lib now.

    Edited:

    I forked it. I'm on Linux atm, but the hard coded C:\Program Files\Steam-path annoyed me.
    Also changed some other stuff.
    link

    Just skipped over it, so there might be some errors in my code.
    As far as I have understood it interfaces with the Steam client, not the server.
    Yeah. You'd need a Steam-application for you platform.. or someone to hack the Steam-interface.
    Reply With Quote Edit / Delete Reply Germany Show Events Useful Useful x 2Dumb Dumb x 1 (list)

  31. Post #31
    Jaykin' Bacon: Episode Three
    Jimbomcb's Avatar
    February 2005
    23,726 Posts
    I assume InviteFriendToClan( CSteamID steamIDfriend, CSteamID steamIDclan ) is the invite to group... in that case, how do you get the ID for particular groups (or even better, have an example?)

  32. Post #32
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    I introduced a new article describing the available interfaces: http://steamworks.assembla.com/wiki/...rface_Overview

    I'm adding more articles as I go to describe/document some features.

    Eventually I plan to implement doxygen comments, but this is far in the future.

    I assume InviteFriendToClan( CSteamID steamIDfriend, CSteamID steamIDclan ) is the invite to group... in that case, how do you get the ID for particular groups (or even better, have an example?)
    ISteamFriends 003 and 005 contain
    	virtual int GetClanCount() = 0;
    	virtual CSteamID GetClanByIndex( int iClan ) = 0;
    	virtual const char *GetClanName( CSteamID steamIDClan ) = 0;
    

    But these only allow access to groups that the local user is in. Other than that I'm not sure, haven't looked at anything related to that.

    Groups have their own identifier based off of a CSteamID, you can normally find these on steamcommunity website.

    Check: https://partner.steamgames.com/docum...community_data for more details.

    Once you've got a group ID you want, simply construct it with

    CSteamID group(gid);
    

    Edited:

    I forked it. I'm on Linux atm, but the hard coded C:\Program Files\Steam-path annoyed me.
    Also changed some other stuff.
    link

    Just skipped over it, so there might be some errors in my code.

    Edited:
    Also, you need to link against shlwapi.lib now.
    Yeah, I tried a little to make the code cross-platform, but eventually considered the fact that not many people would be running steam on *nix platforms anyways.

    I'm interested in writing cross-platform compatible code, but it isn't my strong suite so I often don't go too far with it do to my lack of knowledge on *nix.

  33. Post #33
    Jaykin' Bacon: Episode Three
    Jimbomcb's Avatar
    February 2005
    23,726 Posts
    cheers, new to the language pretty much so i'm sure this isn't the best place to start but anyway, if you can put up with these questions

    I see that for example, SendMsgToFriend is part of steamFriends, declared here,
    ISteamFriends001 *steamFriends = (ISteamFriends001 *)steamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION_001 );

    while the stuff you showed for the clan ids, names etc are part of ISteamFriends003/5 but the invite function is only found in IClientFriends. How would I go about getting the IClientFriends the same way ISteamFriends001 is so I can use the Invite function

  34. Post #34
    Gold Member
    iPope's Avatar
    October 2008
    1,774 Posts
    Awesome thread, nicely presented. I have no use for this tool but it is really awesome.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Useful Useful x 1 (list)

  35. Post #35
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    cheers, new to the language pretty much so i'm sure this isn't the best place to start but anyway, if you can put up with these questions

    I see that for example, SendMsgToFriend is part of steamFriends, declared here,
    ISteamFriends001 *steamFriends = (ISteamFriends001 *)steamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION_001 );

    while the stuff you showed for the clan ids, names etc are part of ISteamFriends003/5 but the invite function is only found in IClientFriends. How would I go about getting the IClientFriends the same way ISteamFriends001 is so I can use the Invite function
    The Invite function seems to be located in version 002, which I haven't created yet. I'm going to start work on that after I post this.

    The reason I mention this is because the IClient* interfaces are not reliable. They're interfaces to internal classes that map the ISteam* calls to calls within internal classes. As such, these interfaces are bound to change without warning, so it's not safe to use them.

    The ISteam* interfaces are version safe, and thus have multiple instances with version numbers appended.

    Anyhow, here's how you'd do it:

    	int error;
    	ISteamClient008 *steamClient = (ISteamClient008 *)CreateInterface(STEAMCLIENT_INTERFACE_VERSION_008, &error);
    	if (!steamClient)
    		Error("Unable to get steam client.", error);
    
    	IClientEngine *clientEngine = (IClientEngine *)CreateInterface(CLIENTENGINE_INTERFACE_VERSION, &error);
    	if (!clientEngine)
    		Error("Unable to get client engine.", error);
    
    
    	HSteamPipe hSteamPipe = steamClient->CreateSteamPipe();
    	HSteamUser hSteamUser = steamClient->ConnectToGlobalUser(hSteamPipe);
    
    	IClientFriends *clientFriends = clientEngine->GetIClientFriends(hSteamUser, hSteamPipe, CLIENTFRIENDS_INTERFACE_VERSION);
    	if (!clientFriends)
    		Error("Unable to get client friends.");
    

    Be sure to replace this when ISteamFriends002 is committed.

    Edit:
    Committed ISteamFriends002. Along with that I committed ISteamRemoteStorage001, this version allows the write/delete access that version 002 lacks. They're both untested but hopefully will work right out of the box. :)

    	ISteamFriends002 *steamFriends = (ISteamFriends002 *)steamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION_002 );
    Reply With Quote Edit / Delete Reply United States Show Events Friendly Friendly x 3Bad Spelling Bad Spelling x 1Informative Informative x 1 (list)

  36. Post #36
    Jaykin' Bacon: Episode Three
    Jimbomcb's Avatar
    February 2005
    23,726 Posts
    thanks, you've been a great help
    Reply With Quote Edit / Delete Reply Show Events Friendly Friendly x 2 (list)

  37. Post #37
    Gold Member
    Darkimmortal's Avatar
    April 2009
    2,740 Posts
    -snip-
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Dumb Dumb x 22 (list)

  38. Post #38
    Gold Member
    VoiDeD's Avatar
    August 2005
    860 Posts
    I've been messing with the ISteamRemoteStorage interfaces.

    Code:
    Steam Cloud Quota, Current: 131072, Max: 35825
    Loading Steam Cloud details for 3 files...
     File #0: cfg/config.cfg (7469 bytes)
     File #1: materials/vgui/logos/spray.vtf (87640 bytes)
     File #2: materials/vgui/logos/spray.vmt (138 bytes)
    Total Size: 95247
    The numbers don't add up for me either...
    Here's what my friend figures:
    ExileLord: Maybe they had a max
    ExileLord: And then they were like
    ExileLord: FUCK IT
    ExileLord: LETS GO WAY OVER
    	int error;
    	ISteamClient008 *steamClient = (ISteamClient008 *)CreateInterface(STEAMCLIENT_INTERFACE_VERSION_008, &error);
    	if (!steamClient)
    		Error("Unable to get steam client.", error);
    
    	IClientEngine *clientEngine = (IClientEngine *)CreateInterface(CLIENTENGINE_INTERFACE_VERSION, &error);
    
    	HSteamPipe hSteamPipe = steamClient->CreateSteamPipe();
    	HSteamUser hSteamUser = steamClient->ConnectToGlobalUser(hSteamPipe);
    
    	ISteamFriends002 *steamFriends = (ISteamFriends002 *)steamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION_002 );
    
    	IClientUtils *clientUtils = (IClientUtils *)clientEngine->GetIClientUtils(hSteamPipe, CLIENTUTILS_INTERFACE_VERSION);
    	clientUtils->SetAppIDForCurrentPipe(500); // l4d
    
    	ISteamRemoteStorage001 *remoteStore = (ISteamRemoteStorage001 *)steamClient->GetISteamGenericInterface(hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION_001);
    
    	uint32 fileCount = remoteStore->GetFileCount();
    
    	int curr, max, total = 0;
    	remoteStore->GetQuota(&curr, &max);
    
    	std::cout << "Steam Cloud Quota, Current: " << curr << ", Max: " << max << std::endl;
    	
    	std::cout << "Loading Steam Cloud details for " << fileCount << " files..." << std::endl;
    
    	for (uint32 x = 0; x < fileCount; x++)
    	{
    		int fileSize;
    		const char *fileName = remoteStore->GetFileNameAndSize(x, &fileSize);
    		total += fileSize;
    		std::cout << " File #" << x << ": " << fileName << " (" << fileSize << " bytes)" << std::endl;
    	}
    	std::cout << "Total Size: " << total << std::endl;
    

    Edit:

    Code:
    Writing new file...
    File contents: this is a test file.
    	std::cout << "Writing new file...";
    
    	char test[] = "this is a test file.";
    	if (!remoteStore->FileWrite("test.txt", test, sizeof(test)))
    		std::cout << "Unable to write file." << std::endl;
    
    	std::cout << std::endl;
    
    	char buff[256];
    	remoteStore->FileRead("test.txt", buff, sizeof(buff));
    
    	std::cout << "File contents: " << buff << std::endl;
    

    Cool stuff. :)
    Reply With Quote Edit / Delete Reply United States Show Events Funny Funny x 3 (list)

  39. Post #39

    September 2009
    245 Posts

    meh, making progress slow
    Reply With Quote Edit / Delete Reply Canada Show Events Funny Funny x 1 (list)

  40. Post #40
    Gold Member
    AzuiSleet's Avatar
    September 2007
    758 Posts
    My thread died, but since people seemed interested in the steam API, this is an example of using the ISteamGameServer interface along with the TF2 items interface. http://www.facepunch.com/showthread.php?t=813736
    Reply With Quote Edit / Delete Reply United States Show Events Useful Useful x 1 (list)