fix routes
[carveJwlIkooP6JGAAIwe30JlM.git] / steam.h
diff --git a/steam.h b/steam.h
index c0fb7894d21e97846496e1864f78b83b5cccf153..0be3ff64045ee3efadd110eb7b6ac8549c325d52 100644 (file)
--- a/steam.h
+++ b/steam.h
@@ -1,3 +1,8 @@
+/*
+ * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ * All trademarks are property of their respective owners
+ */
+
 #ifndef STEAM_H
 #define STEAM_H
 
@@ -6,6 +11,7 @@
 #include "vg/vg_steam_networking.h"
 #include "vg/vg_steam_auth.h"
 #include "vg/vg_steam_http.h"
+#include "vg/vg_steam_friends.h"
 
 /*
  * We only want to use steamworks if building for the networked version,
@@ -18,6 +24,8 @@
  * nothing.
  */
 
+static char steam_username_at_startup[128];
+
 static void recv_steam_warning( int severity, const char *msg )
 {
    if( severity == 0 )
@@ -34,6 +42,8 @@ static HSteamPipe hSteamClientPipe;
 
 static int steam_init(void)
 {
+   const char *username = NULL;
+
 #ifdef SR_NETWORKED
    vg_info( "Initializing steamworks\n" );
 
@@ -58,8 +68,15 @@ static int steam_init(void)
 
    printf("\n");
    vg_success( "\nSteamworks API running\n" );
+
+   ISteamFriends *hSteamFriends = SteamAPI_SteamFriends();
+   username = SteamAPI_ISteamFriends_GetPersonaName( hSteamFriends );
 #endif
 
+   /* TODO: On username update callback */
+   str_utf8_collapse( username, steam_username_at_startup, 
+                        vg_list_size(steam_username_at_startup) );
+
    return 1;
 }