{"id":61,"date":"2014-08-16T01:16:51","date_gmt":"2014-08-15T16:16:51","guid":{"rendered":"http:\/\/manatails.net\/blog\/?p=61"},"modified":"2022-04-03T13:48:56","modified_gmt":"2022-04-03T04:48:56","slug":"getting-the-steamid-from-current-user-using-steam_api","status":"publish","type":"post","link":"https:\/\/manatails.net\/blog\/2014\/08\/getting-the-steamid-from-current-user-using-steam_api\/","title":{"rendered":"Getting the SteamID of current user using Steam_API"},"content":{"rendered":"<p>This is the code I used when integrating ManaGuardian with Steam.<br \/>\nI could not find any other posts regarding this so I am publishing my code for reference. I hope it helps<\/p>\n<p>Steam API header files from valve SDK are required<\/p>\n<p><a href=\"https:\/\/github.com\/ValveSoftware\/source-sdk-2013\/tree\/master\/sp\/src\/public\/steam\">https:\/\/github.com\/ValveSoftware\/source-sdk-2013\/tree\/master\/sp\/src\/public\/steam<\/a><br \/>\n<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">\/\/Initialize Steam API\r\n\r\nInitResult irResult = g_oSteamAPI.Initialize(g_szAppPath);\r\n\r\nif (irResult != IR_SUCCESS)\r\n    return EXIT_FAILURE;\r\n\r\n\/\/Open Steam User Interface\r\nISteamUser* pSteamUser = g_oSteamAPI.GetSteamUserInterface();\r\n\r\nif (!pSteamUser)\r\n    return EXIT_FAILURE;\r\n\r\nCSteamID sSteamID = pSteamUser-&gt;GetSteamID();\r\nuint64 uSteamID = sSteamID.ConvertToUint64();\r\nchar cSteamID[64];\r\nsprintf(cSteamID, \"%lld\", (long long)uSteamID);\r\nprintf(\"User SteamID : %s\\n\", cSteamID);\r\n<\/pre>\n<p>The code is pretty much self-explanatory.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the code I used when integrating ManaGuardian with Steam. I could not find any other posts regarding this so I am publishing my code for reference. I hope it helps Steam API header files from valve SDK are required https:\/\/github.com\/ValveSoftware\/source-sdk-2013\/tree\/master\/sp\/src\/public\/steam \/\/Initialize Steam API InitResult irResult = g_oSteamAPI.Initialize(g_szAppPath); if (irResult != IR_SUCCESS) return EXIT_FAILURE; &hellip; <a href=\"https:\/\/manatails.net\/blog\/2014\/08\/getting-the-steamid-from-current-user-using-steam_api\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Getting the SteamID of current user using Steam_API<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[27,28],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-computer","tag-steam","tag-valve"],"_links":{"self":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":7,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":1047,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions\/1047"}],"wp:attachment":[{"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/manatails.net\/blog\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}