1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-25 12:13:00 +01:00

Update SteamSDK to 1.55

Add ContentBuilder tools
This commit is contained in:
Elias Steurer 2022-08-26 15:43:50 +02:00
parent a59de4a8e2
commit 3e283aa5d5
43 changed files with 487 additions and 23 deletions

3
.gitignore vendored
View File

@ -252,3 +252,6 @@ cython_debug/
/aqtinstall.log /aqtinstall.log
/ThirdParty/** /ThirdParty/**
*.nupkg *.nupkg
# SteamCmd creates a ton of tmp files
/Tools/Steam/ContentBuilder/builder/**

View File

@ -8,6 +8,16 @@ Copyright
Welcome to the Steamworks SDK. For documentation please see our partner Welcome to the Steamworks SDK. For documentation please see our partner
website at: http://partner.steamgames.com website at: http://partner.steamgames.com
----------------------------------------------------------------
v1.55 29th July 2022
----------------------------------------------------------------
ISteamInput
* Added SetDualSenseTriggerEffect and corresponding header isteamdualsense.h for setting the adaptive trigger effect on DualSense controllers
Spacewar example:
* Added an example of using SetDualSenseTriggerEffect
---------------------------------------------------------------- ----------------------------------------------------------------
v1.54 16th June 2022 v1.54 16th June 2022
---------------------------------------------------------------- ----------------------------------------------------------------

View File

@ -108,6 +108,9 @@ public:
// check if game is a timed trial with limited playtime // check if game is a timed trial with limited playtime
virtual bool BIsTimedTrial( uint32* punSecondsAllowed, uint32* punSecondsPlayed ) = 0; virtual bool BIsTimedTrial( uint32* punSecondsAllowed, uint32* punSecondsPlayed ) = 0;
// set current DLC AppID being played (or 0 if none). Allows Steam to track usage of major DLC extensions
virtual bool SetDlcContext( AppId_t nAppID ) = 0;
}; };
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008" #define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008"

View File

@ -0,0 +1,169 @@
/* SIE CONFIDENTIAL
* $PSLibId$
* Copyright (C) 2019 Sony Interactive Entertainment Inc.
* All Rights Reserved.
*/
#ifndef _SCE_PAD_TRIGGER_EFFECT_H
#define _SCE_PAD_TRIGGER_EFFECT_H
#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 0x01
#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 0x02
#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2 0
#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 1
#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM 2
/* Definition of control point num */
#define SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM 10
typedef enum ScePadTriggerEffectMode{
SCE_PAD_TRIGGER_EFFECT_MODE_OFF,
SCE_PAD_TRIGGER_EFFECT_MODE_FEEDBACK,
SCE_PAD_TRIGGER_EFFECT_MODE_WEAPON,
SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION,
SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_FEEDBACK,
SCE_PAD_TRIGGER_EFFECT_MODE_SLOPE_FEEDBACK,
SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_VIBRATION,
} ScePadTriggerEffectMode;
/**
*E
* @brief parameter for setting the trigger effect to off mode.
* Off Mode: Stop trigger effect.
**/
typedef struct ScePadTriggerEffectOffParam{
uint8_t padding[48];
} ScePadTriggerEffectOffParam;
/**
*E
* @brief parameter for setting the trigger effect to Feedback mode.
* Feedback Mode: The motor arm pushes back trigger.
* Trigger obtains stiffness at specified position.
**/
typedef struct ScePadTriggerEffectFeedbackParam{
uint8_t position; /*E position where the strength of target trigger start changing(0~9). */
uint8_t strength; /*E strength that the motor arm pushes back target trigger(0~8 (0: Same as Off mode)). */
uint8_t padding[46];
} ScePadTriggerEffectFeedbackParam;
/**
*E
* @brief parameter for setting the trigger effect to Weapon mode.
* Weapon Mode: Emulate weapon like gun trigger.
**/
typedef struct ScePadTriggerEffectWeaponParam{
uint8_t startPosition; /*E position where the stiffness of trigger start changing(2~7). */
uint8_t endPosition; /*E position where the stiffness of trigger finish changing(startPosition+1~8). */
uint8_t strength; /*E strength of gun trigger(0~8 (0: Same as Off mode)). */
uint8_t padding[45];
} ScePadTriggerEffectWeaponParam;
/**
*E
* @brief parameter for setting the trigger effect to Vibration mode.
* Vibration Mode: Vibrates motor arm around specified position.
**/
typedef struct ScePadTriggerEffectVibrationParam{
uint8_t position; /*E position where the motor arm start vibrating(0~9). */
uint8_t amplitude; /*E vibration amplitude(0~8 (0: Same as Off mode)). */
uint8_t frequency; /*E vibration frequency(0~255[Hz] (0: Same as Off mode)). */
uint8_t padding[45];
} ScePadTriggerEffectVibrationParam;
/**
*E
* @brief parameter for setting the trigger effect to ScePadTriggerEffectMultiplePositionFeedbackParam mode.
* Multi Position Feedback Mode: The motor arm pushes back trigger.
* Trigger obtains specified stiffness at each control point.
**/
typedef struct ScePadTriggerEffectMultiplePositionFeedbackParam{
uint8_t strength[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E strength that the motor arm pushes back target trigger at position(0~8 (0: Same as Off mode)).
* strength[0] means strength of motor arm at position0.
* strength[1] means strength of motor arm at position1.
* ...
* */
uint8_t padding[38];
} ScePadTriggerEffectMultiplePositionFeedbackParam;
/**
*E
* @brief parameter for setting the trigger effect to Feedback3 mode.
* Slope Feedback Mode: The motor arm pushes back trigger between two spedified control points.
* Stiffness of the trigger is changing depending on the set place.
**/
typedef struct ScePadTriggerEffectSlopeFeedbackParam{
uint8_t startPosition; /*E position where the strength of target trigger start changing(0~endPosition). */
uint8_t endPosition; /*E position where the strength of target trigger finish changing(startPosition+1~9). */
uint8_t startStrength; /*E strength when trigger's position is startPosition(1~8) */
uint8_t endStrength; /*E strength when trigger's position is endPosition(1~8) */
uint8_t padding[44];
} ScePadTriggerEffectSlopeFeedbackParam;
/**
*E
* @brief parameter for setting the trigger effect to Vibration2 mode.
* Multi Position Vibration Mode: Vibrates motor arm around specified control point.
* Trigger vibrates specified amplitude at each control point.
**/
typedef struct ScePadTriggerEffectMultiplePositionVibrationParam{
uint8_t frequency; /*E vibration frequency(0~255 (0: Same as Off mode)) */
uint8_t amplitude[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E vibration amplitude at position(0~8 (0: Same as Off mode)).
* amplitude[0] means amplitude of vibration at position0.
* amplitude[1] means amplitude of vibration at position1.
* ...
* */
uint8_t padding[37];
} ScePadTriggerEffectMultiplePositionVibrationParam;
/**
*E
* @brief parameter for setting the trigger effect mode.
**/
typedef union ScePadTriggerEffectCommandData{
ScePadTriggerEffectOffParam offParam;
ScePadTriggerEffectFeedbackParam feedbackParam;
ScePadTriggerEffectWeaponParam weaponParam;
ScePadTriggerEffectVibrationParam vibrationParam;
ScePadTriggerEffectMultiplePositionFeedbackParam multiplePositionFeedbackParam;
ScePadTriggerEffectSlopeFeedbackParam slopeFeedbackParam;
ScePadTriggerEffectMultiplePositionVibrationParam multiplePositionVibrationParam;
} ScePadTriggerEffectCommandData;
/**
*E
* @brief parameter for setting the trigger effect.
**/
typedef struct ScePadTriggerEffectCommand{
ScePadTriggerEffectMode mode;
uint8_t padding[4];
ScePadTriggerEffectCommandData commandData;
} ScePadTriggerEffectCommand;
/**
*E
* @brief parameter for the scePadSetTriggerEffect function.
**/
typedef struct ScePadTriggerEffectParam{
uint8_t triggerMask; /*E Set trigger mask to activate trigger effect commands.
* SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 : 0x01
* SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 : 0x02
* */
uint8_t padding[7];
ScePadTriggerEffectCommand command[SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM]; /*E command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2] is for L2 trigger setting
* and param[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2] is for R2 trgger setting.
* */
} ScePadTriggerEffectParam;
#if defined(__cplusplus) && __cplusplus >= 201103L
static_assert( sizeof( ScePadTriggerEffectParam ) == 120, "ScePadTriggerEffectParam has incorrect size" );
#endif
#endif /* _SCE_PAD_TRIGGER_EFFECT_H */

View File

@ -682,6 +682,11 @@ struct SteamInputActionEvent_t
}; };
}; };
//-----------------------------------------------------------------------------
// Forward declaration for ScePadTriggerEffectParam, defined in isteamdualsense.h
//-----------------------------------------------------------------------------
struct ScePadTriggerEffectParam;
#pragma pack( pop ) #pragma pack( pop )
typedef void ( *SteamInputActionEventCallbackPointer )( SteamInputActionEvent_t * ); typedef void ( *SteamInputActionEventCallbackPointer )( SteamInputActionEvent_t * );
@ -895,6 +900,9 @@ public:
// Get a bitmask of the Steam Input Configuration types opted in for the current session. Returns ESteamInputConfigurationEnableType values.? // Get a bitmask of the Steam Input Configuration types opted in for the current session. Returns ESteamInputConfigurationEnableType values.?
// Note: user can override the settings from the Steamworks Partner site so the returned values may not exactly match your default configuration // Note: user can override the settings from the Steamworks Partner site so the returned values may not exactly match your default configuration
virtual uint16 GetSessionInputConfigurationSettings() = 0; virtual uint16 GetSessionInputConfigurationSettings() = 0;
// Set the trigger effect for a DualSense controller
virtual void SetDualSenseTriggerEffect( InputHandle_t inputHandle, const ScePadTriggerEffectParam *pParam ) = 0;
}; };
#define STEAMINPUT_INTERFACE_VERSION "SteamInput006" #define STEAMINPUT_INTERFACE_VERSION "SteamInput006"

View File

@ -2099,7 +2099,8 @@
{ "name":"k_EResultNoVerifiedPhone", "value":"123" }, { "name":"k_EResultNoVerifiedPhone", "value":"123" },
{ "name":"k_EResultInsufficientBattery", "value":"124" }, { "name":"k_EResultInsufficientBattery", "value":"124" },
{ "name":"k_EResultChargerRequired", "value":"125" }, { "name":"k_EResultChargerRequired", "value":"125" },
{ "name":"k_EResultCachedCredentialInvalid", "value":"126" } { "name":"k_EResultCachedCredentialInvalid", "value":"126" },
{ "name":"K_EResultPhoneNumberIsVOIP", "value":"127" }
] ]
}, },
{ {
@ -8026,6 +8027,14 @@
{ "paramname":"punSecondsPlayed", "paramtype":"uint32 *" } { "paramname":"punSecondsPlayed", "paramtype":"uint32 *" }
], ],
"returntype": "bool" "returntype": "bool"
},
{
"methodname": "SetDlcContext",
"methodname_flat": "SteamAPI_ISteamApps_SetDlcContext",
"params": [
{ "paramname":"nAppID", "paramtype":"AppId_t" }
],
"returntype": "bool"
} }
], ],
"version_string": "STEAMAPPS_INTERFACE_VERSION008" "version_string": "STEAMAPPS_INTERFACE_VERSION008"
@ -9378,6 +9387,15 @@
"methodname_flat": "SteamAPI_ISteamInput_GetSessionInputConfigurationSettings", "methodname_flat": "SteamAPI_ISteamInput_GetSessionInputConfigurationSettings",
"params": [], "params": [],
"returntype": "uint16" "returntype": "uint16"
},
{
"methodname": "SetDualSenseTriggerEffect",
"methodname_flat": "SteamAPI_ISteamInput_SetDualSenseTriggerEffect",
"params": [
{ "paramname":"inputHandle", "paramtype":"InputHandle_t" },
{ "paramname":"pParam", "paramtype":"const ScePadTriggerEffectParam *" }
],
"returntype": "void"
} }
], ],
"version_string": "SteamInput006" "version_string": "SteamInput006"

View File

@ -510,6 +510,7 @@ S_API SteamAPICall_t SteamAPI_ISteamApps_GetFileDetails( ISteamApps* self, const
S_API int SteamAPI_ISteamApps_GetLaunchCommandLine( ISteamApps* self, char * pszCommandLine, int cubCommandLine ); S_API int SteamAPI_ISteamApps_GetLaunchCommandLine( ISteamApps* self, char * pszCommandLine, int cubCommandLine );
S_API bool SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing( ISteamApps* self ); S_API bool SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing( ISteamApps* self );
S_API bool SteamAPI_ISteamApps_BIsTimedTrial( ISteamApps* self, uint32 * punSecondsAllowed, uint32 * punSecondsPlayed ); S_API bool SteamAPI_ISteamApps_BIsTimedTrial( ISteamApps* self, uint32 * punSecondsAllowed, uint32 * punSecondsPlayed );
S_API bool SteamAPI_ISteamApps_SetDlcContext( ISteamApps* self, AppId_t nAppID );
// ISteamNetworking // ISteamNetworking
@ -706,6 +707,7 @@ S_API EInputActionOrigin SteamAPI_ISteamInput_TranslateActionOrigin( ISteamInput
S_API bool SteamAPI_ISteamInput_GetDeviceBindingRevision( ISteamInput* self, InputHandle_t inputHandle, int * pMajor, int * pMinor ); S_API bool SteamAPI_ISteamInput_GetDeviceBindingRevision( ISteamInput* self, InputHandle_t inputHandle, int * pMajor, int * pMinor );
S_API uint32 SteamAPI_ISteamInput_GetRemotePlaySessionID( ISteamInput* self, InputHandle_t inputHandle ); S_API uint32 SteamAPI_ISteamInput_GetRemotePlaySessionID( ISteamInput* self, InputHandle_t inputHandle );
S_API uint16 SteamAPI_ISteamInput_GetSessionInputConfigurationSettings( ISteamInput* self ); S_API uint16 SteamAPI_ISteamInput_GetSessionInputConfigurationSettings( ISteamInput* self );
S_API void SteamAPI_ISteamInput_SetDualSenseTriggerEffect( ISteamInput* self, InputHandle_t inputHandle, const ScePadTriggerEffectParam * pParam );
// ISteamController // ISteamController

View File

@ -155,6 +155,7 @@ enum class EResult
K_EResultInsufficientBattery = 124, K_EResultInsufficientBattery = 124,
K_EResultChargerRequired = 125, K_EResultChargerRequired = 125,
K_EResultCachedCredentialInvalid = 126, K_EResultCachedCredentialInvalid = 126,
K_EResultPhoneNumberIsVOIP = 127,
}; };
Q_ENUM_NS(EResult) Q_ENUM_NS(EResult)

View File

@ -140,6 +140,7 @@ enum EResult
k_EResultInsufficientBattery = 124, // user device doesn't have enough battery charge currently to complete the action k_EResultInsufficientBattery = 124, // user device doesn't have enough battery charge currently to complete the action
k_EResultChargerRequired = 125, // The operation requires a charger to be plugged in, which wasn't present k_EResultChargerRequired = 125, // The operation requires a charger to be plugged in, which wasn't present
k_EResultCachedCredentialInvalid = 126, // Cached credential was invalid - user must reauthenticate k_EResultCachedCredentialInvalid = 126, // Cached credential was invalid - user must reauthenticate
K_EResultPhoneNumberIsVOIP = 127, // The phone number provided is a Voice Over IP number
}; };
// Error codes for use with the voice functions // Error codes for use with the voice functions

View File

@ -1716,7 +1716,9 @@ inline SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString( const char
template <int N> template <int N>
inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id, char (&szCode)[N] ) inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id, char (&szCode)[N] )
{ {
#if !defined( __GNUC__ ) || __GNUC__ >= 5
static_assert( N >= 5, "Fixed-size buffer not big enough to hold SDR POP ID" ); static_assert( N >= 5, "Fixed-size buffer not big enough to hold SDR POP ID" );
#endif
szCode[0] = char( id >> 16U ); szCode[0] = char( id >> 16U );
szCode[1] = char( id >> 8U ); szCode[1] = char( id >> 8U );
szCode[2] = char( id ); szCode[2] = char( id );

Binary file not shown.

View File

@ -0,0 +1,40 @@
#!/usr/bin/env bash
STEAMROOT="$(cd "${0%/*}" && echo $PWD)"
STEAMEXE=`basename "$0" .sh`
UNAME=`uname`
if [ "$UNAME" == "Linux" ]; then
PLATFORM=linux32
export LD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$LD_LIBRARY_PATH"
else # if [ "$UNAME" == "Darwin" ]; then
PLATFORM=osx32
export DYLD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$DYLD_LIBRARY_PATH"
fi
ulimit -n 2048
MAGIC_RESTART_EXITCODE=42
if [ "$DEBUGGER" == "gdb" ] || [ "$DEBUGGER" == "cgdb" ]; then
ARGSFILE=$(mktemp $USER.steam.gdb.XXXX)
# Set the LD_PRELOAD varname in the debugger, and unset the global version.
if [ "$LD_PRELOAD" ]; then
echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE"
echo show env LD_PRELOAD >> "$ARGSFILE"
unset LD_PRELOAD
fi
$DEBUGGER -x "$ARGSFILE" "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"
rm "$ARGSFILE"
else
$DEBUGGER "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"
fi
STATUS=$?
if [ $STATUS -eq $MAGIC_RESTART_EXITCODE ]; then
exec "$0" "$@"
fi
exit $STATUS

Binary file not shown.

View File

@ -0,0 +1,45 @@
#!/usr/bin/env bash
STEAMROOT="$(cd "${0%/*}" && echo $PWD)"
STEAMCMD=`basename "$0" .sh`
UNAME=`uname`
if [ "$UNAME" == "Linux" ]; then
STEAMEXE="${STEAMROOT}/linux32/${STEAMCMD}"
PLATFORM="linux32"
export LD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$LD_LIBRARY_PATH"
else # if [ "$UNAME" == "Darwin" ]; then
STEAMEXE="${STEAMROOT}/${STEAMCMD}"
if [ ! -x ${STEAMEXE} ]; then
STEAMEXE="${STEAMROOT}/Steam.AppBundle/Steam/Contents/MacOS/${STEAMCMD}"
fi
export DYLD_LIBRARY_PATH="$STEAMROOT:$DYLD_LIBRARY_PATH"
export DYLD_FRAMEWORK_PATH="$STEAMROOT:$DYLD_FRAMEWORK_PATH"
fi
ulimit -n 2048
MAGIC_RESTART_EXITCODE=42
if [ "$DEBUGGER" == "gdb" ] || [ "$DEBUGGER" == "cgdb" ]; then
ARGSFILE=$(mktemp $USER.steam.gdb.XXXX)
# Set the LD_PRELOAD varname in the debugger, and unset the global version.
if [ "$LD_PRELOAD" ]; then
echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE"
echo show env LD_PRELOAD >> "$ARGSFILE"
unset LD_PRELOAD
fi
$DEBUGGER -x "$ARGSFILE" "$STEAMEXE" "$@"
rm "$ARGSFILE"
else
$DEBUGGER "$STEAMEXE" "$@"
fi
STATUS=$?
if [ $STATUS -eq $MAGIC_RESTART_EXITCODE ]; then
exec "$0" "$@"
fi
exit $STATUS

View File

@ -0,0 +1,9 @@
"depotbuild"
{
"appid" "672870"
"depotid" "672871"
"flags" "0"
"steamid" "76561199003139914"
"manifest" "5082605710944459942"
"baselinemanifest" "5653585089304124390"
}

View File

@ -0,0 +1 @@
run_build.bat shows how to run a Steam content build for AppID 1000 which has one depot 1001.

View File

@ -0,0 +1 @@
builder\steamcmd.exe +login account password +run_app_build ..\scripts\simple_app_build.vdf +quit

View File

@ -0,0 +1,16 @@
"AppBuild"
{
"AppID" "1000" // Your AppID
"Desc" "Your build description here" // internal description for this build
"Preview" "1" // make this a preview build only, nothing is uploaded
"Local" "..\..\ContentServer\htdocs" // put content on local content server instead of uploading to Steam
"SetLive" "AlphaTest" // set this build live on beta branch AlphaTest
"ContentRoot" "..\content\" // content root folder relative to this script file
"BuildOutput" "D:\build_output\" // put build cache and log files on different drive for better performance
"Depots"
{
// file mapping instructions for each depot are in separate script files
"1001" "depot_build_1001.vdf"
"1002" "depot_build_1002.vdf"
}
}

View File

@ -0,0 +1,20 @@
"DepotBuild"
{
// Set your assigned depot ID here
"DepotID" "1001"
// include all files recursivley
"FileMapping"
{
// This can be a full path, or a path relative to ContentRoot
"LocalPath" "*"
// This is a path relative to the install folder of your game
"DepotPath" "."
// If LocalPath contains wildcards, setting this means that all
// matching files within subdirectories of LocalPath will also
// be included.
"Recursive" "1"
}
}

View File

@ -0,0 +1,40 @@
"DepotBuild"
{
"DepotID" "1002"
"ContentRoot" "D:\content\depot1002" // override ContentRoot from app build script
"FileMapping"
{
// all source files and folders in ".\bin" will be mapped into folder ".\executables" in depot
"LocalPath" "bin\*"
"DepotPath" "executables\"
"Recursive" "1" // include all subfolders
}
"FileMapping"
{
// override audio files in \\audio with German versions
"LocalPath" "localization\german\audio\*"
"DepotPath" "audio\"
}
"FileMapping"
{
// copy install script for german version into depot root folder
"LocalPath" "localization\german\german_installscript.vdf"
"DepotPath" "."
}
"FileExclusion" "bin\server.exe" // exclude this file
"FileExclusion" "*.pdb" // exclude all .PDB files everywhere
"FileExclusion" "bin\tools*" // exclude all files under bin/tools/
"InstallScript" "localization\german\german_installscript.vdf"
"FileProperties"
{
"LocalPath" "bin\setup.cfg"
"Attributes" "userconfig" // this file will be modified during runtime
}
}

View File

@ -0,0 +1,21 @@
"AppBuild"
{
"AppID" "1000" // your AppID
"Desc" "This is a simple build script" // internal description for this build
"ContentRoot" "..\content\" // root content folder, relative to location of this file
"BuildOutput" "..\output\" // build output folder for build logs and build cache files
"Depots"
{
"1001" // your DepotID
{
"FileMapping"
{
"LocalPath" "*" // all files from contentroot folder
"DepotPath" "." // mapped into the root of the depot
"recursive" "1" // include all subfolders
}
}
}
}

View File

@ -2,7 +2,7 @@
{ {
"appid" "672870" "appid" "672870"
"desc" "CI Build linux {{BUILD_DESCRIPTION}}" "desc" "CI Build linux {{BUILD_DESCRIPTION}}"
"buildoutput" "../../ContentBuilder/output" // build output folder for .log, .csm & .csd files, relative to location of this file "buildoutput" "../Steam/ContentBuilder/output" // build output folder for .log, .csm & .csd files, relative to location of this file
"contentroot" "../../" // root content folder, relative to location of this file "contentroot" "../../" // root content folder, relative to location of this file
"setlive" "{{SET_LIVE_ON_BRANCH}}" // branch to set live after successful build, none if empty "setlive" "{{SET_LIVE_ON_BRANCH}}" // branch to set live after successful build, none if empty
"preview" "0" // to enable preview builds "preview" "0" // to enable preview builds

View File

@ -2,7 +2,7 @@
{ {
"appid" "672870" "appid" "672870"
"desc" "CI Build mac {{BUILD_DESCRIPTION}}" "desc" "CI Build mac {{BUILD_DESCRIPTION}}"
"buildoutput" "../../ContentBuilder/output" // build output folder for .log, .csm & .csd files, relative to location of this file "buildoutput" "../Steam/ContentBuilder/output" // build output folder for .log, .csm & .csd files, relative to location of this file
"contentroot" "../../" // root content folder, relative to location of this file "contentroot" "../../" // root content folder, relative to location of this file
"setlive" "{{SET_LIVE_ON_BRANCH}}" // branch to set live after successful build, none if empty "setlive" "{{SET_LIVE_ON_BRANCH}}" // branch to set live after successful build, none if empty
"preview" "0" // to enable preview builds "preview" "0" // to enable preview builds

View File

@ -2,7 +2,7 @@
{ {
"appid" "672870" "appid" "672870"
"desc" "CI Build Windows {{BUILD_DESCRIPTION}}" "desc" "CI Build Windows {{BUILD_DESCRIPTION}}"
"buildoutput" "../../ContentBuilder/output" // build output folder for .log, .csm & .csd files, relative to location of this file "buildoutput" "../Steam/ContentBuilder/output" // build output folder for .log, .csm & .csd files, relative to location of this file
"contentroot" "../../" // root content folder, relative to location of this file "contentroot" "../../" // root content folder, relative to location of this file
"setlive" "{{SET_LIVE_ON_BRANCH}}" // branch to set live after successful build, none if empty "setlive" "{{SET_LIVE_ON_BRANCH}}" // branch to set live after successful build, none if empty
"preview" "0" // to enable preview builds "preview" "0" // to enable preview builds

View File

@ -6,6 +6,7 @@ from pathlib import Path
from macos_lipo import run_lipo, check_fat_binary from macos_lipo import run_lipo, check_fat_binary
import platform import platform
import paramiko import paramiko
from util import sftp_exists
if __name__ == "__main__": if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Build and Package ScreenPlay') parser = argparse.ArgumentParser(description='Build and Package ScreenPlay')
@ -57,11 +58,18 @@ if __name__ == "__main__":
build_result = build.execute(build_config) build_result = build.execute(build_config)
ssh = paramiko.SSHClient() ssh = paramiko.SSHClient()
ssh.load_host_keys(os.path.expanduser(os.path.join("~", ".ssh", "known_hosts"))) ssh.load_system_host_keys()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('kelteseth.com', username=args.hosting_username, password=args.hosting_password) ssh.connect('kelteseth.com', username=args.hosting_username, password=args.hosting_password)
sftp = ssh.open_sftp() sftp = ssh.open_sftp()
release_folder = "/kelteseth_com/public/releases/" + build_config.screenplay_version + "/" release_folder = "/kelteseth_com/public/releases/" + build_config.screenplay_version + "/"
sftp.mkdir(release_folder) if sftp_exists(sftp,release_folder):
remoteFiles = sftp.listdir(path=release_folder)
for file in remoteFiles:
print(f"Delte old: {release_folder+file}")
sftp.remove(release_folder+file)
else:
sftp.mkdir(release_folder)
print("Uploading files...") print("Uploading files...")
sftp.put(build_result.build_zip, release_folder + str(build_result.build_zip.name)) sftp.put(build_result.build_zip, release_folder + str(build_result.build_zip.name))
@ -71,12 +79,10 @@ if __name__ == "__main__":
sftp.close() sftp.close()
ssh.close() ssh.close()
# Make sure to reset to tools path # Make sure to reset to tools path
#os.chdir(tools_path) os.chdir(tools_path)
#steam_publish.publish( steam_publish.publish(
# steam_username="tachiom", steam_username="tachiom",
# steam_password=args.steam_password, steam_password=args.steam_password,
# set_live_branch_name="internal" set_live_branch_name="internal"
#) )

View File

@ -8,7 +8,8 @@ from execute_util import execute
from datetime import datetime from datetime import datetime
from shutil import copyfile from shutil import copyfile
import subprocess import subprocess
from util import cd_repo_root_path
import platform
# Executes steamcmd with username and password. Changes the content of the config # Executes steamcmd with username and password. Changes the content of the config
# for better readability in the steam builds tab # for better readability in the steam builds tab
@ -27,20 +28,31 @@ def publish(
set_live_branch_name set_live_branch_name
): ):
# Make sure the script is always started from the same folder
root_path = cd_repo_root_path()
tools_path = os.path.join(root_path, "Tools")
contentBuiler_path = os.path.join(tools_path, "Steam/ContentBuilder/")
vdf_config_name = "" vdf_config_name = ""
depot_config_name = "" depot_config_name = ""
if platform == "win32": steamcmd_path = ""
if platform.system() == "Windows":
vdf_config_name = "app_build_windows.vdf" vdf_config_name = "app_build_windows.vdf"
depot_config_name = "depot_build_windows.vdf" depot_config_name = "depot_build_windows.vdf"
elif platform == "darwin": steamcmd_path = os.path.join(contentBuiler_path, "builder/steamcmd.exe")
steamcmd_path = steamcmd_path.replace("/","\\")
elif platform.system() == "Darwin":
vdf_config_name = "app_build_mac.vdf" vdf_config_name = "app_build_mac.vdf"
depot_config_name = "depot_build_mac.vdf" depot_config_name = "depot_build_mac.vdf"
elif platform == "linux": steamcmd_path = os.path.join(contentBuiler_path, "builder_osx/steamcmd")
elif platform.system() == "Linux":
vdf_config_name = "app_build_linux.vdf" vdf_config_name = "app_build_linux.vdf"
depot_config_name = "depot_build_linux.vdf" depot_config_name = "depot_build_linux.vdf"
steamcmd_path = os.path.join(contentBuiler_path, "builder_linux/steamcmd.sh")
print(f"Set steamCmd path: {steamcmd_path}")
abs_vdf_path = os.path.abspath("steamcmd/" + vdf_config_name) abs_vdf_path = os.path.join(tools_path,"Steam/steamcmd/" + vdf_config_name)
if not os.path.isfile(abs_vdf_path): if not os.path.isfile(abs_vdf_path):
print("Incorrect vdf name") print("Incorrect vdf name")
@ -57,7 +69,7 @@ def publish(
config_content = config_content.replace("{{BUILD_DESCRIPTION}}", build_description) config_content = config_content.replace("{{BUILD_DESCRIPTION}}", build_description)
config_content = config_content.replace("{{SET_LIVE_ON_BRANCH}}", set_live_branch_name) config_content = config_content.replace("{{SET_LIVE_ON_BRANCH}}", set_live_branch_name)
tmp_steam_config_foldername = "tmp_steam_config/" tmp_steam_config_foldername = "tmp_steam_config/"
tmp_steam_config_dir = os.path.abspath(tmp_steam_config_foldername) tmp_steam_config_dir = os.path.abspath(os.path.join(tools_path,tmp_steam_config_foldername))
if os.path.isdir(tmp_steam_config_dir): if os.path.isdir(tmp_steam_config_dir):
shutil.rmtree(tmp_steam_config_dir) shutil.rmtree(tmp_steam_config_dir)
@ -71,13 +83,13 @@ def publish(
print(f"Using config:\n {config_content}\n") print(f"Using config:\n {config_content}\n")
# We also must copy the depot file # We also must copy the depot file
abs_depot_path = os.path.abspath("steamcmd/" + depot_config_name) abs_depot_path = os.path.join(tools_path, "Steam/steamcmd/" + depot_config_name)
copyfile(abs_depot_path, tmp_steam_config_dir + "/" + depot_config_name) copyfile(abs_depot_path, tmp_steam_config_dir + "/" + depot_config_name)
tmp_steam_config_path = "\"" + os.path.abspath(tmp_steam_config_foldername + vdf_config_name) + "\"" tmp_steam_config_path = "\"" + os.path.abspath(os.path.join(tmp_steam_config_dir,vdf_config_name) ) + "\""
print("Execute steamcmd on: " + tmp_steam_config_path) print("Execute steamcmd on: " + tmp_steam_config_path)
execute("steamcmd +login {username} {password} +run_app_build {config} +quit".format(username=steam_username, password=steam_password, config=tmp_steam_config_path)) execute(f"{steamcmd_path} +login {steam_username} {steam_password} +run_app_build {tmp_steam_config_path} +quit")
print("Deleting tmp config") print("Deleting tmp config")
shutil.rmtree(tmp_steam_config_dir) shutil.rmtree(tmp_steam_config_dir)

View File

@ -7,6 +7,14 @@ import os
import subprocess import subprocess
import zipfile import zipfile
def sftp_exists(sftp, path) -> bool:
try:
sftp.stat(path)
return True
except FileNotFoundError:
return False
def run(cmd, cwd=Path.cwd()): def run(cmd, cwd=Path.cwd()):
result = subprocess.run(cmd, shell=True, cwd=cwd) result = subprocess.run(cmd, shell=True, cwd=cwd)
if result.returncode != 0: if result.returncode != 0:

View File

@ -0,0 +1,15 @@
"appbuild"
{
"appid" "672870"
"desc" "CI Build Windows - git hash: a59de4a8, commit: Fix not called lipo - upload datetime: 08/26/2022, 15:06:27"
"buildoutput" "../ContentBuilder/output" // build output folder for .log, .csm & .csd files, relative to location of this file
"contentroot" "../../../" // root content folder, relative to location of this file
"setlive" "internal" // branch to set live after successful build, none if empty
"preview" "0" // to enable preview builds
"nobaseline" "0" // build without using baseline manifest
"depots"
{
"672871" "depot_build_windows.vdf"
}
}

View File

@ -0,0 +1,13 @@
"DepotBuildConfig"
{
"DepotID" "672871"
// include all files recursively
"FileMapping"
{
"LocalPath" "build-x64-windows-release/bin/*"
"DepotPath" "."
"recursive" "1"
}
}