Skip to content

Commit

Permalink
1.56
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu committed Jan 9, 2024
1 parent bc07b73 commit 0d21653
Show file tree
Hide file tree
Showing 46 changed files with 978 additions and 797 deletions.
2 changes: 1 addition & 1 deletion .ci/azure.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Azure Pipeline YAML file

name: 1.55$(Rev:.r)
name: 1.56$(Rev:.r)

trigger:
branches:
Expand Down
2 changes: 1 addition & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include(ExternalProject)

set(SWSDK_VERSION "1.55")
set(SWSDK_VERSION "1.56")
set(SWSDK_RELEASE "x86")
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(SWSDK_RELEASE "x64")
Expand Down
7 changes: 3 additions & 4 deletions steamworks_sdk/SteamworksExample/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define MAX_PATH PATH_MAX
#include <unistd.h>
#define _getcwd getcwd
#define _snprintf snprintf
#endif

#if defined(WIN32)
Expand Down Expand Up @@ -259,14 +260,12 @@ static int RealMain( const char *pchCmdLine, HINSTANCE hInstance, int nCmdShow )
}

char rgchFullPath[1024];
#if defined(_WIN32)
_snprintf( rgchFullPath, sizeof( rgchFullPath ), "%s\\%s", rgchCWD, "steam_input_manifest.vdf" );
#elif defined(OSX)
#if defined(OSX)
// hack for now, because we do not have utility functions available for finding the resource path
// alternatively we could disable the SteamController init on OS X
_snprintf( rgchFullPath, sizeof( rgchFullPath ), "%s/steamworksexample.app/Contents/Resources/%s", rgchCWD, "steam_input_manifest.vdf" );
#else
_snprintf( rgchFullPath, sizeof( rgchFullPath ), "%s/%s", rgchCWD, "steam_input_manifest.vdf" );
_snprintf( rgchFullPath, sizeof( rgchFullPath ), "%s\\%s", rgchCWD, "steam_input_manifest.vdf" );
#endif

SteamInput()->SetInputActionManifestFilePath( rgchFullPath );
Expand Down
47 changes: 45 additions & 2 deletions steamworks_sdk/SteamworksExample/OverlayExamples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,20 @@ class COverlayExamplesMenu : public CBaseMenu<OverlayExample_t>
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - friendrequestaccept", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "friendrequestaccept" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToUser - friendrequestignore", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToUser, "friendrequestignore" } ) );

AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToWebPage", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToWebPage, "https://steamcommunity.com" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToWebPage", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToWebPage, "https://tomb.valve.org/community/actions/buttons/" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToStore", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToStore, "" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToStore - Add to Cart", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToStore, "addtocart" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayToStore - Add to Cart & Show", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayToStore, "addtocartandshow" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "ActivateGameOverlayInviteDialogConnectString", { OverlayExample_t::k_EOverlayExampleItem_ActivateGameOverlayInviteDialogConnectString, NULL } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( SteamScreenshots()->IsScreenshotsHooked() ? "Screenshots Hooked!" : "Hook Screenshots", { OverlayExample_t::k_EOverlayExampleItem_HookScreenshots, NULL } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Request Keyboard", { OverlayExample_t::k_EOverlayExampleItem_RequestKeyboard, NULL } ) );

AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Inset", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetInset, "100" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Reset Notification Inset", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetInset, "0" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Position: Top Left", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition, "0" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Position: Top Right", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition, "1" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Position: Bottom Left", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition, "2" } ) );
AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Set Notification Position: Bottom Right", { OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition, "3" } ) );

AddMenuItem( COverlayExamplesMenu::MenuItem_t( "Return to main menu", { OverlayExample_t::k_EOverlayExampleItem_BackToMenu, NULL } ) );

Expand Down Expand Up @@ -154,8 +163,33 @@ void COverlayExamples::RunFrame()
}
break;

case OverlayExample_t::k_EOverlayExampleItem_HookScreenshots:
{
SteamScreenshots()->HookScreenshots( !SteamScreenshots()->IsScreenshotsHooked() );
m_pMenu->Rebuild();
}
break;

case OverlayExample_t::k_EOverlayExampleItem_RequestKeyboard:
{
EGamepadTextInputMode eInputMode = k_EGamepadTextInputModeNormal;
EGamepadTextInputLineMode eLineInputMode = k_EGamepadTextInputLineModeSingleLine;
const char *pchDescription = "Enter Text Here";
uint32 unCharMax = 20;
const char *pchExistingText = "Placeholder";
SteamUtils()->ShowGamepadTextInput( eInputMode , eLineInputMode, pchDescription, unCharMax, pchExistingText );
}
break;

case OverlayExample_t::k_EOverlayExampleItem_Notification_SetInset:
SteamUtils()->SetOverlayNotificationInset( atoi( m_delayedCommand.m_pchExtraCommandData ), atoi( m_delayedCommand.m_pchExtraCommandData ) );
break;
case OverlayExample_t::k_EOverlayExampleItem_Notification_SetPosition:
SteamUtils()->SetOverlayNotificationPosition( (ENotificationPosition)atoi( m_delayedCommand.m_pchExtraCommandData ) );
break;

default:
OutputDebugString( "wat" );
break;
}

m_delayedCommand.m_eItem = OverlayExample_t::k_EOverlayExampleItem_Invalid;
Expand All @@ -180,3 +214,12 @@ void COverlayExamples::Show()
m_pMenu->Rebuild();
}

void COverlayExamples::OnScreenshotRequested( ScreenshotRequested_t *pCallback )
{
SteamFriends()->ActivateGameOverlayToWebPage( "google.com" );
}

void COverlayExamples::OnSteamScreenshotReady( ScreenshotReady_t *pCallback )
{

}
3 changes: 3 additions & 0 deletions steamworks_sdk/SteamworksExample/OverlayExamples.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class COverlayExamples

COverlayExamplesMenu *m_pMenu;
OverlayExample_t m_delayedCommand;

STEAM_CALLBACK( COverlayExamples, OnScreenshotRequested, ScreenshotRequested_t );
STEAM_CALLBACK( COverlayExamples, OnSteamScreenshotReady, ScreenshotReady_t );
};

#endif // OVERLAYEXAMPLES_H
5 changes: 5 additions & 0 deletions steamworks_sdk/SteamworksExample/RemoteStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ bool CRemoteStorageScreen::BHandleCancel()
// always cancel
m_rgchGreetingNext[0] = 0;

if( m_pGameEngine->BIsSteamInputDeviceActive() )
{
SteamUtils()->DismissFloatingGamepadTextInput();
}

m_bFinished = true;
return true;
}
Expand Down
14 changes: 12 additions & 2 deletions steamworks_sdk/SteamworksExample/SpaceWarClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define MAX_PATH PATH_MAX
#include <unistd.h>
#define _getcwd getcwd
#define _snprintf snprintf
#endif


Expand Down Expand Up @@ -277,6 +278,7 @@ void CSpaceWarClient::DisconnectFromServer()
if ( m_hConnServer != k_HSteamNetConnection_Invalid )
SteamNetworkingSockets()->CloseConnection( m_hConnServer, k_EDRClientDisconnect, nullptr, false );
m_steamIDGameServer = CSteamID();
m_steamIDGameServerFromBrowser = CSteamID();
m_hConnServer = k_HSteamNetConnection_Invalid;
}

Expand All @@ -301,9 +303,17 @@ void CSpaceWarClient::OnReceiveServerInfo( CSteamID steamIDGameServer, bool bVAC

MsgClientBeginAuthentication_t msg;
#ifdef USE_GS_AUTH_API
SteamNetworkingIdentity snid;
// if the server Steam ID was aquired from another source ( m_steamIDGameServerFromBrowser )
// then use it as the identity
// if it only came from the server itself, then use the IP address
if ( m_steamIDGameServer == m_steamIDGameServerFromBrowser )
snid.SetSteamID( m_steamIDGameServer );
else
snid.SetIPv4Addr( m_unServerIP, m_usServerPort );
char rgchToken[1024];
uint32 unTokenLen = 0;
m_hAuthTicket = SteamUser()->GetAuthSessionTicket( rgchToken, sizeof( rgchToken ), &unTokenLen );
m_hAuthTicket = SteamUser()->GetAuthSessionTicket( rgchToken, sizeof( rgchToken ), &unTokenLen, &snid );
msg.SetToken( rgchToken, unTokenLen );

#else
Expand Down Expand Up @@ -625,7 +635,7 @@ void CSpaceWarClient::InitiateServerConnection( CSteamID steamIDGameServer )

SetGameState( k_EClientGameConnecting );

m_steamIDGameServer = steamIDGameServer;
m_steamIDGameServerFromBrowser = m_steamIDGameServer = steamIDGameServer;

SteamNetworkingIdentity identity;
identity.SetSteamID(steamIDGameServer);
Expand Down
12 changes: 10 additions & 2 deletions steamworks_sdk/SteamworksExample/SpaceWarClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ struct OverlayExample_t
k_EOverlayExampleItem_ActivateGameOverlayToWebPage,
k_EOverlayExampleItem_ActivateGameOverlayToStore,
// k_EOverlayExampleItem_ActivateGameOverlayRemotePlayTogetherInviteDialog,
k_EOverlayExampleItem_ActivateGameOverlayInviteDialogConnectString
k_EOverlayExampleItem_ActivateGameOverlayInviteDialogConnectString,
k_EOverlayExampleItem_HookScreenshots,
k_EOverlayExampleItem_RequestKeyboard,
k_EOverlayExampleItem_Notification_SetInset,
k_EOverlayExampleItem_Notification_SetPosition,
};

EOverlayExampleItem m_eItem;
Expand Down Expand Up @@ -295,6 +299,7 @@ class CSpaceWarClient

// load subscribed workshop items
void LoadWorkshopItems();
void QueryWorkshopItems();

// Set appropriate rich presence keys for a player who is currently in-game and
// return the value that should go in steam_display
Expand Down Expand Up @@ -360,6 +365,7 @@ class CSpaceWarClient

// Server address data
CSteamID m_steamIDGameServer;
CSteamID m_steamIDGameServerFromBrowser;
uint32 m_unServerIP;
uint16 m_usServerPort;
HAuthTicket m_hAuthTicket;
Expand Down Expand Up @@ -424,7 +430,7 @@ class CSpaceWarClient

// Steam Workshop items
CWorkshopItem *m_rgpWorkshopItems[ MAX_WORKSHOP_ITEMS ];
int m_nNumWorkshopItems; // items in m_rgpWorkshopItems
int m_nNumWorkshopItems; // items in m_rgpWorkshopItem

// Main menu instance
CMainMenu *m_pMainMenu;
Expand Down Expand Up @@ -481,6 +487,8 @@ class CSpaceWarClient

// callback when new Workshop item was installed
STEAM_CALLBACK(CSpaceWarClient, OnWorkshopItemInstalled, ItemInstalled_t);
void OnUGCQueryCompleted( SteamUGCQueryCompleted_t *pParam, bool bIOFailure );
CCallResult<CSpaceWarClient, SteamUGCQueryCompleted_t> m_SteamCallResultUGCQueryCompleted;

// Steam China support. duration control callback can be posted asynchronously, but we also
// call it directly.
Expand Down
2 changes: 1 addition & 1 deletion steamworks_sdk/SteamworksExample/flags.mak
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ RELEASE_CXXFLAGS := $(RELEASE_CFLAGS)

MACOS_FRAMEWORKS :=

LDFLAGS := $(shell STEAM_RUNTIME_ROOT=$(STEAM_RUNTIME_ROOT) $(SDL_CONFIG) --libs) -lSDL2_ttf -lfreetype -lz -lGL -lopenal
LDFLAGS := $(shell STEAM_RUNTIME_ROOT=$(STEAM_RUNTIME_ROOT) $(SDL_CONFIG) --libs) -lSDL3_ttf -lfreetype -lz -lGL -lopenal
DEBUG_LDFLAGS :=
RELEASE_LDGLAGS :=

Expand Down
2 changes: 1 addition & 1 deletion steamworks_sdk/SteamworksExample/gameenginesdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ bool CGameEngineGL::BDrawString( HGAMEFONT hFont, RECT rect, DWORD dwColor, DWOR
m_MapTextures[ hTexture ].m_uWidth = surface->w;
m_MapTextures[ hTexture ].m_uHeight = surface->h;

SDL_FreeSurface( surface );
SDL_DestroySurface( surface );

m_MapStrings[ std::string(szFontPrefix) + std::string(pchText) ] = hTexture;
}
Expand Down
6 changes: 3 additions & 3 deletions steamworks_sdk/SteamworksExample/gameenginesdl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ typedef unsigned char byte;
#include <AL/al.h>
#include <AL/alc.h>

#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <SDL2/SDL_ttf.h>
#include <SDL3/SDL.h>
#include <SDL3/SDL_opengl.h>
#include <SDL3/SDL_ttf.h>

#include <string>
#include <set>
Expand Down
4 changes: 3 additions & 1 deletion steamworks_sdk/SteamworksExample/p2pauth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ void CP2PAuthPlayer::StartAuthPlayer()
// Create a ticket if we haven't yet
if ( m_cubTicketIGaveThisUser == 0 )
{
m_hAuthTicketIGaveThisUser = SteamUser()->GetAuthSessionTicket( m_rgubTicketIGaveThisUser, sizeof( m_rgubTicketIGaveThisUser ), &m_cubTicketIGaveThisUser );
SteamNetworkingIdentity snid;
snid.SetSteamID( m_steamID );
m_hAuthTicketIGaveThisUser = SteamUser()->GetAuthSessionTicket( m_rgubTicketIGaveThisUser, sizeof( m_rgubTicketIGaveThisUser ), &m_cubTicketIGaveThisUser, &snid );
}

// Send the ticket to the server. It will relay to the client
Expand Down
1 change: 0 additions & 1 deletion steamworks_sdk/SteamworksExample/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#pragma once

#include <assert.h>
#include <stdio.h>
#include <stdarg.h>

Expand Down
1 change: 1 addition & 0 deletions steamworks_sdk/SteamworksExample/steam_input_manifest.vdf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"TurnRight" "Turn Right"
"FireLasers" "Fire Lasers"
"PauseMenu" "Pause Menu"
"ForwardThrust" "Forward Thrust"
"BackwardThrust" "Backward Thrust"
"MenuControls" "Menu Controls"
"MenuUp" "Menu Up"
Expand Down
Loading

0 comments on commit 0d21653

Please sign in to comment.