Skip to content

Commit 3d5da34

Browse files
committed
2 parents e83ae11 + 157f2c6 commit 3d5da34

File tree

4 files changed

+91
-6
lines changed

4 files changed

+91
-6
lines changed

discordrpc.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ bool CDiscordIntegration::StartDiscordRPC()
302302
RPC.largeImageKey = "p2mmmellogo";
303303
RPC.largeImageText = "Portal Stories: Mel";
304304
break;
305+
case (APERTURE_TAG):
306+
RPC.largeImageKey = "p2mmtaglogo";
307+
RPC.largeImageText = "Aperture Tag";
308+
break;
305309
case (DIVINITY):
306310
RPC.largeImageKey = "p2mmdivinitylogo";
307311
RPC.largeImageText = "Portal: Divinity";
@@ -311,6 +315,7 @@ bool CDiscordIntegration::StartDiscordRPC()
311315
RPC.largeImageText = "Portal 2";
312316
break;
313317
}
318+
314319
UpdateDiscordRPC();
315320

316321
DiscordLog(0, false, "Discord RPC activated!");

p2mm.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ bool CP2MMServerPlugin::Load(CreateInterfaceFn interfaceFactory, CreateInterface
186186
{
187187
this->m_iCurGameIndex = APERTURE_TAG;
188188
P2MMLog(0, false, "Currently running Aperture Tag.");
189-
// Unsupported...for now...
190-
unsupportedGame = true;
191189
}
192190
else if ((FStrEq(gameMainDir, "portalreloaded")))
193191
{
@@ -390,10 +388,6 @@ bool CP2MMServerPlugin::Load(CreateInterfaceFn interfaceFactory, CreateInterface
390388
Memory::Rel32(Memory::Scanner::Scan(SERVERDLL, "E8 ?? ?? ?? ?? 83 C4 04 50 8B 45 10 8B 10", 1)),
391389
&GetEggBotModel_hook, (void**)&GetEggBotModel_orig
392390
);
393-
MH_CreateHook(
394-
Memory::Scanner::Scan(SERVERDLL, "55 8B EC 81 EC 10 01 00 00 53 8B 1D"),
395-
&CPortal_Player__GetPlayerModelName_hook, (void**)&CPortal_Player__GetPlayerModelName_orig
396-
);
397391

398392
// For p2mm_instantrespawn.
399393
MH_CreateHook(
@@ -413,6 +407,16 @@ bool CP2MMServerPlugin::Load(CreateInterfaceFn interfaceFactory, CreateInterface
413407
&UTIL_GetLocalPlayer, (void**)&UTIL_GetLocalPlayer_orig
414408
);
415409

410+
// Game-specific hooks
411+
switch (g_P2MMServerPlugin.m_iCurGameIndex)
412+
{
413+
case PORTAL_STORIES_MEL:
414+
MH_CreateHook(
415+
Memory::Scanner::Scan(SERVERDLL, "55 8B EC 81 EC 10 01 00 00 53 8B 1D"),
416+
&CPortal_Player__GetPlayerModelName_hook, (void**)&CPortal_Player__GetPlayerModelName_orig
417+
);
418+
}
419+
416420
MH_EnableHook(MH_ALL_HOOKS);
417421
} catch (const std::exception& ex) {
418422
P2MMLog(0, false, "Failed to load plugin! :( Exception: \"%s\"", ex.what());

p2mm.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "p2mm", "p2mm.vcxproj", "{53
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Aperture Tag|Win32 = Aperture Tag|Win32
1011
Portal 2|Win32 = Portal 2|Win32
1112
Portal Stories Mel|Win32 = Portal Stories Mel|Win32
1213
Vanilla|Win32 = Vanilla|Win32
1314
EndGlobalSection
1415
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{531796FA-476D-47F1-84FA-CD3613D68536}.Aperture Tag|Win32.ActiveCfg = Aperture Tag|Win32
17+
{531796FA-476D-47F1-84FA-CD3613D68536}.Aperture Tag|Win32.Build.0 = Aperture Tag|Win32
1518
{531796FA-476D-47F1-84FA-CD3613D68536}.Portal 2|Win32.ActiveCfg = Portal 2|Win32
1619
{531796FA-476D-47F1-84FA-CD3613D68536}.Portal 2|Win32.Build.0 = Portal 2|Win32
1720
{531796FA-476D-47F1-84FA-CD3613D68536}.Portal Stories Mel|Win32.ActiveCfg = Portal Stories Mel|Win32

p2mm.vcxproj

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Aperture Tag|Win32">
5+
<Configuration>Aperture Tag</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
48
<ProjectConfiguration Include="Divinity|Win32">
59
<Configuration>Divinity</Configuration>
610
<Platform>Win32</Platform>
@@ -30,6 +34,12 @@
3034
<CharacterSet>MultiByte</CharacterSet>
3135
<PlatformToolset>v143</PlatformToolset>
3236
</PropertyGroup>
37+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Aperture Tag|Win32'" Label="Configuration">
38+
<ConfigurationType>DynamicLibrary</ConfigurationType>
39+
<UseDebugLibraries>true</UseDebugLibraries>
40+
<CharacterSet>MultiByte</CharacterSet>
41+
<PlatformToolset>v143</PlatformToolset>
42+
</PropertyGroup>
3343
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Divinity|Win32'" Label="Configuration">
3444
<ConfigurationType>DynamicLibrary</ConfigurationType>
3545
<UseDebugLibraries>true</UseDebugLibraries>
@@ -54,6 +64,9 @@
5464
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Portal 2|Win32'" Label="PropertySheets">
5565
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
5666
</ImportGroup>
67+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Aperture Tag|Win32'" Label="PropertySheets">
68+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
69+
</ImportGroup>
5770
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Divinity|Win32'" Label="PropertySheets">
5871
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
5972
</ImportGroup>
@@ -67,6 +80,9 @@
6780
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Portal 2|Win32'">
6881
<OutDir>.\Release\.\</OutDir>
6982
</PropertyGroup>
83+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Aperture Tag|Win32'">
84+
<OutDir>.\Release\.\</OutDir>
85+
</PropertyGroup>
7086
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Divinity|Win32'">
7187
<OutDir>.\Release\.\</OutDir>
7288
</PropertyGroup>
@@ -79,6 +95,9 @@
7995
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Portal 2|Win32'">
8096
<IntDir>.\Release\.\</IntDir>
8197
</PropertyGroup>
98+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Aperture Tag|Win32'">
99+
<IntDir>.\Release\.\</IntDir>
100+
</PropertyGroup>
82101
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Divinity|Win32'">
83102
<IntDir>.\Release\.\</IntDir>
84103
</PropertyGroup>
@@ -91,6 +110,9 @@
91110
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Portal 2|Win32'">
92111
<TargetName>p2mm</TargetName>
93112
</PropertyGroup>
113+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Aperture Tag|Win32'">
114+
<TargetName>p2mm</TargetName>
115+
</PropertyGroup>
94116
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Divinity|Win32'">
95117
<TargetName>p2mm</TargetName>
96118
</PropertyGroup>
@@ -103,6 +125,9 @@
103125
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Portal 2|Win32'">
104126
<TargetExt>.dll</TargetExt>
105127
</PropertyGroup>
128+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Aperture Tag|Win32'">
129+
<TargetExt>.dll</TargetExt>
130+
</PropertyGroup>
106131
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Divinity|Win32'">
107132
<TargetExt>.dll</TargetExt>
108133
</PropertyGroup>
@@ -116,6 +141,10 @@
116141
<ExtensionsToDeleteOnClean>*.cdf;*.cache;*.obj;*.ilk;*.resources;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;*.tlog;*.manifest;*.res;*.pch;*.exp;*.idb;*.rep;*.xdc;*.pdb;*_manifest.rc;*.bsc;*.sbr;*.xml;*.metagen;*.bi</ExtensionsToDeleteOnClean>
117142
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)\lib;</IncludePath>
118143
</PropertyGroup>
144+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Aperture Tag|Win32'">
145+
<ExtensionsToDeleteOnClean>*.cdf;*.cache;*.obj;*.ilk;*.resources;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;*.tlog;*.manifest;*.res;*.pch;*.exp;*.idb;*.rep;*.xdc;*.pdb;*_manifest.rc;*.bsc;*.sbr;*.xml;*.metagen;*.bi</ExtensionsToDeleteOnClean>
146+
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)\lib;</IncludePath>
147+
</PropertyGroup>
119148
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Divinity|Win32'">
120149
<ExtensionsToDeleteOnClean>*.cdf;*.cache;*.obj;*.ilk;*.resources;*.tlb;*.tli;*.tlh;*.tmp;*.rsp;*.pgc;*.pgd;*.meta;*.tlog;*.manifest;*.res;*.pch;*.exp;*.idb;*.rep;*.xdc;*.pdb;*_manifest.rc;*.bsc;*.sbr;*.xml;*.metagen;*.bi</ExtensionsToDeleteOnClean>
121150
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);$(SolutionDir)\lib;</IncludePath>
@@ -172,6 +201,50 @@
172201
</Message>
173202
</PostBuildEvent>
174203
</ItemDefinitionGroup>
204+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Aperture Tag|Win32'">
205+
<ClCompile>
206+
<WarningLevel>Level4</WarningLevel>
207+
<Optimization>Disabled</Optimization>
208+
<AdditionalIncludeDirectories>public;public\tier0;public\tier1;$(SolutionDir)\lib;discord-rpc;curl</AdditionalIncludeDirectories>
209+
<MultiProcessorCompilation>true</MultiProcessorCompilation>
210+
<PreprocessorDefinitions>VPC;RAD_TELEMETRY_DISABLED;_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_ALLOW_RUNTIME_LIBRARY_MISMATCH;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ALLOW_MSC_VER_MISMATCH;%(PreprocessorDefinitions);COMPILER_MSVC32;COMPILER_MSVC;_DLL_EXT=.dll;DLLNAME=p2mm;BINK_VIDEO;AVI_VIDEO;WMV_VIDEO;DEV_BUILD;FRAME_POINTER_OMISSION_DISABLED;_MBCS;_EXTERNAL_DLL_EXT=.dll;VPCGAMECAPS=HL2MP;SOURCE1=1;VPCGAME=hl2mp;</PreprocessorDefinitions>
211+
<StringPooling>false</StringPooling>
212+
<ExceptionHandling>false</ExceptionHandling>
213+
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
214+
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
215+
<FunctionLevelLinking>true</FunctionLevelLinking>
216+
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
217+
<FloatingPointModel>Fast</FloatingPointModel>
218+
<RuntimeTypeInfo>true</RuntimeTypeInfo>
219+
<AssemblerListingLocation>
220+
</AssemblerListingLocation>
221+
<ObjectFileName>$(IntDir)/</ObjectFileName>
222+
<ProgramDataBaseFileName>$(IntDir)/</ProgramDataBaseFileName>
223+
<BrowseInformationFile>$(IntDir)/</BrowseInformationFile>
224+
<CompileAs>CompileAsCpp</CompileAs>
225+
<DisableSpecificWarnings>;4316</DisableSpecificWarnings>
226+
<UseFullPaths>true</UseFullPaths>
227+
<ErrorReporting>Prompt</ErrorReporting>
228+
<MinimalRebuild>false</MinimalRebuild>
229+
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
230+
<CompileAsManaged>false</CompileAsManaged>
231+
<LanguageStandard>stdcpplatest</LanguageStandard>
232+
<LanguageStandard_C>Default</LanguageStandard_C>
233+
</ClCompile>
234+
<Link>
235+
<GenerateDebugInformation>DebugFastLink</GenerateDebugInformation>
236+
<AdditionalLibraryDirectories>lib\public;%(AdditionalLibraryDirectories);minhook\lib;curl\lib;discord-rpc\lib</AdditionalLibraryDirectories>
237+
<AdditionalDependencies>Normaliz.lib;Crypt32.lib;Iphlpapi.lib;Advapi32.lib;Ws2_32.lib;wldap32.lib;ole32.lib;legacy_stdio_definitions.lib;vstdlib.lib;tier0.lib;tier1.lib;tier2.lib;mathlib.lib;interfaces.lib;libMinHook-x86-v141-mtd.lib;libcurl_a.lib;discord-rpc.lib</AdditionalDependencies>
238+
<IgnoreSpecificDefaultLibraries>libc;libcd;libcmt;libcpmt;libcpmt1</IgnoreSpecificDefaultLibraries>
239+
<LinkStatus>
240+
</LinkStatus>
241+
</Link>
242+
<PostBuildEvent>
243+
<Command>IF EXIST ./copy.bat copy.bat</Command>
244+
<Message>
245+
</Message>
246+
</PostBuildEvent>
247+
</ItemDefinitionGroup>
175248
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Divinity|Win32'">
176249
<ClCompile>
177250
<WarningLevel>Level4</WarningLevel>

0 commit comments

Comments
 (0)