• Open Steamworks
    616 replies, posted
  • [url=http://osw.limetech.org/][img]http://dl.getdropbox.com/u/99606/open_steamworks.png[/img][/url] (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] [b]What is Open Steamworks?[/b] 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: [url]https://partner.steamgames.com/[/url] [b]Interested in Helping or Getting Help?[/b] 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: [email]voidedweasel@gmail.com[/email] [/release] You can find the project's code base here: [url]https://bitbucket.org/VoiDeD/open-steamworks/overview/[/url]. 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.
  • a very nice api, a++ would use again [img]http://i33.tinypic.com/okv5m1.png[/img]
  • [quote] 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. [/quote] Why not?
  • [QUOTE=PvtCupcakes;17668216]Why not?[/QUOTE] Maybe because that would be using Valve's servers :downs:
  • 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. [img]http://dl.getdropbox.com/u/99606/steam_chatlogs.PNG[/img] Steam chatlog storage anyone? (Major WIP, don't expect a release anytime soon) [cpp] 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; }[/cpp]
  • [QUOTE=VoiDeD;17668850]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. [img]http://dl.getdropbox.com/u/99606/steam_chatlogs.PNG[/img] Steam chatlog storage anyone? (Major WIP, don't expect a release anytime soon) [cpp] 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; }[/cpp][/QUOTE] Whoa, someone was finally able to do this, nice!
  • [QUOTE=VoiDeD;17668850] [cpp] 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 }[/cpp][/QUOTE] 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 [cpp] #include <stdio.h> void doStuff(char* c) { c = "test"; } int main() { char* c = "null"; doStuff(c); printf("c: %s\n", c); } [/cpp] And the output is null If I do this, the output is test, like it should be. [cpp] #include <stdio.h> void doStuff(char** c) { *c = "test"; } int main() { char* c = "null"; doStuff(&c); printf("c: %s\n", c); } [/cpp]
  • A way to get CSteamIDs by their Steam community ID or SteamID would be awesome... is such a thing possible?
  • The 64bit representation of a CSteamID is a community ID. [cpp] CSteamID id((uint64)76561197969249708L); [/cpp] As for string representations, you'll have to manually parse them.
  • [QUOTE=PvtCupcakes;17669790]-snip-[/QUOTE] A pointer is a memory address. All you have to do, is write to the address space provided. Read over this: [cpp] #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; } [/cpp] All we have to do is write to the area 'c' points to: [cpp] #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; } [/cpp] edit: Oh, and yeah this looks pretty awesome. Maybe make a function to send replies in Steam chat, people could make Steam chat bots :v:
  • Steam equivalent of MSN viruses are just around the corner. I can feel it in my bones...
  • 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.
  • [QUOTE=adzicents;17672651]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.[/QUOTE] If that was true why is phishing a constant problem on Steam?
  • Wonder if I can program a version of the MSN plugin for aMSN in tcl
  • 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); } [/code] maybe I had to remove the while loop [URL=http://www.cubeupload.com][IMG]http://www.cubeupload.com/files/b4600oops.png[/IMG][/URL]
  • 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? [QUOTE=ZomBuster;17673966]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); } [/code] maybe I had to remove the while loop [URL=http://www.cubeupload.com][IMG]http://www.cubeupload.com/files/b4600oops.png[/IMG][/URL][/QUOTE] [img]http://img80.imageshack.us/img80/3044/whatl.png[/img]
  • [QUOTE=Samuelgames;17674147]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?[/QUOTE] Check the ISteamRemoteStorage002 interface: [url]http://code.assembla.com/steamworks/subversion/nodes/steamworks/ISteamRemoteStorage002.h[/url] [b]Edit[/b]: I just recently committed ISteamRemoteStorage001, it has additional write/delete functions.
  • 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. :downs:
  • [QUOTE=Dr Nick;17674272]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. :downs:[/QUOTE] 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: [url]http://www.gamertell.com/gaming/comment/gears-iphone-ipod-touch-app-lets-you-track-user-activity-on-steam/[/url] Edit: But you can make a frontend to make the PSP connect to your PC running Steam and your PSP Steam Chat Streamer
  • 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. [editline]03:38PM[/editline] Ninja'd. It looks like Gear's runs on top of the XML API in steam community. [url]http://steamcommunity.com/id/VoiDeD?xml=1[/url] as an example.
  • 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?
  • [QUOTE=Sir_Lulzalot;17674644]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?[/QUOTE] As far as I have understood it interfaces with the Steam [B]client[/B], not the server.
  • [QUOTE=raBBish;17674462]Automatic 'away' message! [url]http://codepad.org/6gFXtNLi[/url][/QUOTE] I forked it. I'm on Linux atm, but the hard coded C:\Program Files\Steam-path annoyed me. Also changed some other stuff. [url=http://codepad.org/yckYORc9]link[/url] Just skipped over it, so there might be some errors in my code. [editline]06:32PM[/editline] Also, you need to link against shlwapi.lib now. [editline]06:28PM[/editline] [QUOTE=ZeekyHBomb;17674825]I forked it. I'm on Linux atm, but the hard coded C:\Program Files\Steam-path annoyed me. Also changed some other stuff. [url=http://codepad.org/yckYORc9]link[/url] Just skipped over it, so there might be some errors in my code.[/QUOTE] [QUOTE=DrTaxi;17674711]As far as I have understood it interfaces with the Steam [B]client[/B], not the server.[/QUOTE] Yeah. You'd need a Steam-application for you platform.. or someone to hack the Steam-interface.