Steam API Integration



  • Hallo,

    die Suche konnte mir bezüglich meiner Frage nicht weiterhelfen. Ich wollte die API von Steam integrieren und bin folgendermaßen vorgegangen:

    Getting the C++ API

    First, download the Steamworks SDK.
    Unzip into a folder relative to your source tree
    The following files need to go in your run-time directory (next to your game executable, or in your the dll search path)
    steam_api.dll (this is redistributable with your game )
    The following library needs to be included in any project you access
    steam_api.lib
    The following header files need to be included in your C++ project
    steam_api.h
    steam_gameserver.h (for multi-player games only)
    Build!

    Activating the API at run-time
    Before any functions can be used, first SteamAPI_Init() must be called.

    A return of true indicates all required interfaces have been acquired and are accessible.
    A return of false indicates one of three conditions:
    The Steam client isn't running. A running Steam client is required to provide implementations of the various Steamworks interfaces.
    The Steam client couldn't determine the AppID of game. Make sure you have Steam_appid.txt in your game directory.
    Your application is not running under the same user context as the Steam client, including admin privileges.

    Note: When you launch from Steam, Steam will automatically know the AppID of your game. When developing, you need to hint this to Steam with a text file. Create the text file steam_appid.txt containing only the AppID.

    Starten kann ich danach das Programm auch, aber irgendwie wird die API nicht korrekt geladen.

    // SteamAPI.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
    //
    
    #include "stdafx.h"
    #include "steam_api.h"
    
    int main()
    {
    	SteamAPI_Init();
    
    	getchar();
        return 0;
    	SteamAPI_Shutdown();
    }
    

    Folgende Ausgabe wird dann gemacht:

    Setting breakpad minidump AppID = 730
    Steam_SetMinidumpSteamID:  Caching Steam ID:  76561197960266581 [API loaded no]
    

    Etwas passendes zu API loded no finde ich leider nicht. Vielleicht hat das ja hier schonmal einer umgesetzt und kann mir helfen.

    mfg Christian



  • eXc schrieb:

    Starten kann ich danach das Programm auch, aber irgendwie wird die API nicht korrekt geladen.

    Woher weißt du das?



  • Kleine Anmerkung am Rande, es wird wohl wenig bringen, wenn Du SteamAPI_Shutdown nach dem return aus main aufrufst.



  • Hallo,

    Woher weißt du das?

    Setting breakpad minidump AppID = 730
    Steam_SetMinidumpSteamID:  Caching Steam ID:  76561197960266581 [[b]API loaded no[/b]]
    


  • A return of true indicates all required interfaces have been acquired and are accessible.
    A return of false indicates one of three conditions:


Anmelden zum Antworten