Skip to content

Commit 51538b3

Browse files
committed
Initial WorkshopStopper9000 upload. It's pretty much complete with this one commit, hopefully.
1 parent c77a763 commit 51538b3

737 files changed

Lines changed: 207641 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ms-build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: MSBuild
2+
3+
on:
4+
push
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Add MSBuild into PATH
17+
uses: microsoft/setup-msbuild@v2
18+
with:
19+
# Version of Visual Studio to search; defaults to latest if not specified
20+
vs-version: "latest"
21+
# The preferred processor architecture of MSBuild. Can be either "x86", "x64", or "arm64". "x64" is only available from Visual Studio version 17.0 and later.
22+
msbuild-architecture: "x86"
23+
24+
- name: Build
25+
working-directory: ${{env.GITHUB_WORKSPACE}}
26+
# Add additional options to the MSBuild command line here (like platform or verbosity level).
27+
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
28+
run: msbuild /m /p:Configuration="Release" .
29+
30+
- name: Upload Artifact
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: workshopstopper9000
34+
path: Release/workshopstopper9000.dll

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030
*.exe
3131
*.out
3232
*.app
33+
/.vs
34+
/Release

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# WorkshopStopper9000
2-
A Source Engine Plugin for Portal 2 to stop workshop maps downloading for Sourcemods.
1+
# ***WorkshopStopper9000***
2+
3+
## ***A Source Engine Plugin for Portal 2 Source Mods to stop workshop maps downloading.***
4+
5+
One issue that plagues Source Mods for Portal 2 is the issue where the game sees that the workshop folder is empty, so it re-downloads ***ALL*** of the users workshop maps into the Source Mods maps folder. There has been no proper way to stop this from happening, so here is a plugin to solve the issue!
6+
7+
Simply stick this plugin and its respective `.vdc` file into a `addons` folder in the Source Mod's game directory, and Portal 2 should automatically start the plugin up with the game and thus stop the game from downloading workshop maps. That's pretty much it. This took about 20 minutes to make, so if there are any issues, make a Issue post. I'll get to it within the next 20 years.
8+
9+
**As of writing, 11/09/2024, the plugin is only able compatible for Windows, the signature scanner needs to be made compatible for Linux still. Apologizes for any inconvenience.**
10+
11+
```
12+
Please give credit to Orsell/OrsellGaming, Nanoman2525, and NULLderef, as well as the Portal 2: Multiplayer Mod Team (plugin is built off some of the P2:MM plugin's code) if you use this plugin or use its code in any way with your Source Mod. You also need to include this repository's and the P2:MM's License (see below).
13+
```
14+
15+
```
16+
MIT License
17+
18+
Copyright (c) 2024 Portal 2: Multiplayer Mod Team
19+
20+
Permission is hereby granted, free of charge, to any person obtaining a copy
21+
of this software and associated documentation files (the "Software"), to deal
22+
in the Software without restriction, including without limitation the rights
23+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24+
copies of the Software, and to permit persons to whom the Software is
25+
furnished to do so, subject to the following conditions:
26+
27+
The above copyright notice and this permission notice shall be included in all
28+
copies or substantial portions of the Software.
29+
30+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36+
SOFTWARE.
37+
```

common/ConfigManager.h

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
2+
//
3+
// Purpose:
4+
//
5+
//=============================================================================//
6+
7+
#ifndef CONFIGMANAGER_H
8+
#define CONFIGMANAGER_H
9+
#ifdef _WIN32
10+
#pragma once
11+
#endif
12+
13+
#include "KeyValues.h"
14+
#include "utlvector.h"
15+
#include "filesystem_init.h"
16+
17+
18+
// See filesystem_init for the vconfig registry values.
19+
20+
21+
#define TOKEN_GAMES "Games"
22+
#define TOKEN_GAME_DIRECTORY "GameDir"
23+
#define TOKEN_TOOLS "Tools"
24+
25+
// STEAM CLOUD FLAGS
26+
#define STEAMREMOTESTORAGE_CLOUD_CONFIG (1<<0)
27+
#define STEAMREMOTESTORAGE_CLOUD_SPRAY (1<<1)
28+
29+
#define STEAMREMOTESTORAGE_CLOUD_ALL 0x7fff // all bits set, so any new items added will be on by default
30+
31+
struct defaultConfigInfo_t
32+
{
33+
char gameName[MAX_PATH];
34+
char gameDir[MAX_PATH];
35+
char FGD[MAX_PATH];
36+
char steamPath[MAX_PATH];
37+
char defaultPointEntity[MAX_PATH];
38+
char exeName[MAX_PATH];
39+
int steamAppID;
40+
};
41+
42+
enum eSDKEpochs
43+
{
44+
HL2 = 1,
45+
EP1 = 2,
46+
EP2 = 3,
47+
SWARM = 4,
48+
};
49+
50+
extern defaultConfigInfo_t *gDefaultConfigs[];
51+
52+
class CGameConfigManager
53+
{
54+
public:
55+
56+
enum loadStatus_t
57+
{
58+
LOADSTATUS_NONE = 0, // Configs were loaded with no error
59+
LOADSTATUS_CONVERTED, // GameConfig.txt did not exist and was created by converting GameCfg.INI
60+
LOADSTATUS_CREATED, // GameCfg.INI was not found, the system created the default configuration based on found GameInfo.txt resources
61+
LOADSTATUS_ERROR, // File was not loaded and was unable to perform the above fail-safe procedures
62+
};
63+
64+
CGameConfigManager( void );
65+
CGameConfigManager( const char *fileName );
66+
67+
~CGameConfigManager( void );
68+
69+
bool LoadConfigs( const char *baseDir = NULL );
70+
bool SaveConfigs( const char *baseDir = NULL );
71+
bool ResetConfigs( const char *baseDir = NULL );
72+
73+
int GetNumConfigs( void );
74+
75+
KeyValues *GetGameBlock( void );
76+
KeyValues *GetGameSubBlock( const char *keyName );
77+
bool GetDefaultGameBlock( KeyValues *pIn );
78+
79+
bool IsLoaded( void ) const { return m_pData != NULL; }
80+
81+
bool WasConvertedOnLoad( void ) const { return m_LoadStatus == LOADSTATUS_CONVERTED; }
82+
bool WasCreatedOnLoad( void ) const { return m_LoadStatus == LOADSTATUS_CREATED; }
83+
84+
bool AddDefaultConfig( const defaultConfigInfo_t &info, KeyValues *out, const char *rootDirectory, const char *gameExeDir );
85+
86+
void SetBaseDirectory( const char *pDirectory );
87+
88+
void GetRootGameDirectory( char *out, size_t outLen, const char *rootDir, const char *steamDir );
89+
90+
const char *GetRootDirectory( void );
91+
void SetSDKEpoch( eSDKEpochs epoch ) { m_eSDKEpoch = epoch; };
92+
93+
private:
94+
95+
void GetRootContentDirectory( char *out, size_t outLen, const char *rootDir );
96+
97+
const char *GetBaseDirectory( void );
98+
const char *GetIniFilePath( void );
99+
100+
bool LoadConfigsInternal( const char *baseDir, bool bRecursiveCall );
101+
void UpdateConfigsInternal( void );
102+
void VersionConfig( void );
103+
bool IsConfigCurrent( void );
104+
105+
bool ConvertGameConfigsINI( void );
106+
bool CreateAllDefaultConfigs( void );
107+
bool IsAppSubscribed( int nAppID );
108+
109+
loadStatus_t m_LoadStatus; // Holds various state about what occured while loading
110+
KeyValues *m_pData; // Data as read from configuration file
111+
char m_szBaseDirectory[MAX_PATH]; // Default directory
112+
eSDKEpochs m_eSDKEpoch; // Holds the "working version" of the SDK for times when we need to create an older set of game configurations.
113+
// This is required now that the SDK is deploying the tools for both the latest and previous versions of the engine.
114+
};
115+
116+
#endif // CONFIGMANAGER_H

common/GameUI/IGameConsole.h

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
2+
//
3+
// Purpose:
4+
//
5+
//===========================================================================//
6+
7+
#ifndef IGAMECONSOLE_H
8+
#define IGAMECONSOLE_H
9+
#ifdef _WIN32
10+
#pragma once
11+
#endif
12+
13+
#include "tier1/interface.h"
14+
15+
16+
//-----------------------------------------------------------------------------
17+
// Purpose: interface to game/dev console
18+
//-----------------------------------------------------------------------------
19+
abstract_class IGameConsole : public IBaseInterface
20+
{
21+
public:
22+
// activates the console, makes it visible and brings it to the foreground
23+
virtual void Activate() = 0;
24+
25+
virtual void Initialize() = 0;
26+
27+
// hides the console
28+
virtual void Hide() = 0;
29+
30+
// clears the console
31+
virtual void Clear() = 0;
32+
33+
// return true if the console has focus
34+
virtual bool IsConsoleVisible() = 0;
35+
36+
virtual void SetParent( int parent ) = 0;
37+
};
38+
39+
#define GAMECONSOLE_INTERFACE_VERSION "GameConsole004"
40+
41+
#endif // IGAMECONSOLE_H

common/GameUI/IGameUI.h

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
2+
//
3+
// Purpose:
4+
//
5+
// $NoKeywords: $
6+
//=============================================================================//
7+
8+
#ifndef IGAMEUI_H
9+
#define IGAMEUI_H
10+
#ifdef _WIN32
11+
#pragma once
12+
#endif
13+
14+
#include "interface.h"
15+
#include "vgui/ipanel.h"
16+
17+
#if !defined( _X360 )
18+
#include "xbox/xboxstubs.h"
19+
#endif
20+
21+
class CCommand;
22+
23+
// reasons why the user can't connect to a game server
24+
enum ESteamLoginFailure
25+
{
26+
STEAMLOGINFAILURE_NONE,
27+
STEAMLOGINFAILURE_BADTICKET,
28+
STEAMLOGINFAILURE_NOSTEAMLOGIN,
29+
STEAMLOGINFAILURE_VACBANNED,
30+
STEAMLOGINFAILURE_LOGGED_IN_ELSEWHERE
31+
};
32+
33+
enum ESystemNotify
34+
{
35+
SYSTEMNOTIFY_STORAGEDEVICES_CHANGED,
36+
SYSTEMNOTIFY_USER_SIGNEDIN,
37+
SYSTEMNOTIFY_USER_SIGNEDOUT,
38+
SYSTEMNOTIFY_XLIVE_LOGON_ESTABLISHED, // we are logged into live service
39+
SYSTEMNOTIFY_XLIVE_LOGON_CLOSED, // no longer logged into live - either from natural (signed out) or unnatural (e.g. severed net connection) causes
40+
SYSTEMNOTIFY_XUIOPENING,
41+
SYSTEMNOTIFY_XUICLOSED,
42+
SYSTEMNOTIFY_INVITE_SHUTDOWN, // Cross-game invite is causing us to shutdown
43+
SYSTEMNOTIFY_MUTECHANGED, // Player changed mute settings
44+
SYSTEMNOTIFY_INPUTDEVICESCHANGED, // Input device has changed (used for controller disconnection)
45+
SYSTEMNOTIFY_PROFILE_UNAVAILABLE, // Profile failed to read or write
46+
};
47+
48+
//-----------------------------------------------------------------------------
49+
// Purpose: contains all the functions that the GameUI dll exports
50+
//-----------------------------------------------------------------------------
51+
abstract_class IGameUI
52+
{
53+
public:
54+
// initialization/shutdown
55+
virtual void Initialize( CreateInterfaceFn appFactory ) = 0;
56+
virtual void PostInit() = 0;
57+
58+
// connect to other interfaces at the same level (gameui.dll/server.dll/client.dll)
59+
virtual void Connect( CreateInterfaceFn gameFactory ) = 0;
60+
61+
virtual void Start() = 0;
62+
virtual void Shutdown() = 0;
63+
virtual void RunFrame() = 0;
64+
65+
// notifications
66+
virtual void OnGameUIActivated() = 0;
67+
virtual void OnGameUIHidden() = 0;
68+
69+
// OLD: Use OnConnectToServer2
70+
virtual void OLD_OnConnectToServer(const char *game, int IP, int port) = 0;
71+
72+
virtual void OnDisconnectFromServer_OLD( uint8 eSteamLoginFailure, const char *username ) = 0;
73+
virtual void OnLevelLoadingStarted( const char *levelName, bool bShowProgressDialog ) = 0;
74+
virtual void OnLevelLoadingFinished(bool bError, const char *failureReason, const char *extendedReason) = 0;
75+
76+
// level loading progress, returns true if the screen needs updating
77+
virtual bool UpdateProgressBar(float progress, const char *statusText) = 0;
78+
// Shows progress desc, returns previous setting... (used with custom progress bars )
79+
virtual bool SetShowProgressText( bool show ) = 0;
80+
81+
// !!!!!!!!!members added after "GameUI011" initial release!!!!!!!!!!!!!!!!!!!
82+
// Allows the level loading progress to show map-specific info
83+
virtual void SetProgressLevelName( const char *levelName ) = 0;
84+
85+
// inserts specified panel as background for level load dialog
86+
virtual void SetLoadingBackgroundDialog( vgui::VPANEL panel ) = 0;
87+
88+
virtual void OnConnectToServer2(const char *game, int IP, int connectionPort, int queryPort) = 0;
89+
90+
virtual void SetProgressOnStart() = 0;
91+
virtual void OnDisconnectFromServer( uint8 eSteamLoginFailure ) = 0;
92+
93+
virtual void NeedConnectionProblemWaitScreen() = 0;
94+
virtual void ShowPasswordUI( char const *pchCurrentPW ) = 0;
95+
96+
#if defined( _X360 ) && defined( _DEMO )
97+
virtual void OnDemoTimeout( void ) = 0;
98+
#endif
99+
};
100+
101+
#define GAMEUI_INTERFACE_VERSION "GameUI011"
102+
103+
#endif // IGAMEUI_H

0 commit comments

Comments
 (0)