Skip to content

Instantly share code, notes, and snippets.

View ProdigySim's full-sized avatar

Michael Busby ProdigySim

View GitHub Profile
@ProdigySim
ProdigySim / 1.l4d2-2200-gamedata-fixes.md
Last active April 30, 2023 18:18
L4D2 2.2.0.0 gamedata fixes

Introduction

SirPlease and ProdigySim were allowed early access to the Last Stand beta to check mod compatibility. We have been working on testing some sourcemod extensions and plugins, as well as reverse engineering some of the server code to discover necessary GameData changes.

These are the high level results of our investigations. Be aware that the server binaries could change up to the release day an these may no be perfectly accurate. I hope these will be a helpful starting point and/or reference for other plugin makers who are validating their gamedata and patches.

Breaking Changes

CBaseEntity Vtable

CBaseEntity vtable has a new member:

  • Linux: 14 CBaseEntity::ScriptGetModelName(void)const
@ProdigySim
ProdigySim / cterrorplayer_updatezombiefrustration.cpp
Created July 8, 2014 10:39
CTerrorPlayer::UpdateZombieFrustration()
// Reverse-engineered CTerrorPlayer::UpdateZombieFrustration().
// I can claim no copyright for this code.
// This representation of code was produced by reverse engineering for interoperability.
// Any resemblance to original source is completely accidental.
void CTerrorPlayer::UpdateZombieFrustration()
{
if ( !ZombieFrustration.GetBool())
|| this->GetTeamNumber() != 3
|| this->GetClass() != 8
@ProdigySim
ProdigySim / hidden_cvars.txt
Created August 29, 2020 15:08
hidden client cvars from 2041 dump l4d2
_fov : 0 : , "cl", "launcher" : Automates fov command to server.
achievement_evaluate : cmd : , "cl", "launcher" : <internal name> Causes failable achievement to be evaluated
achievement_mark_dirty : cmd : , "cl", "launcher" : Mark achievement data as dirty
achievement_notification_test : cmd : , "cheat", "cl", "launcher" : Test the hud notification UI
achievement_reset : cmd : , "cl", "launcher" : <internal name> Clears specified achievement
achievement_reset_all : cmd : , "cl", "launcher" : Clears all achievements
achievement_status : cmd : , "cl", "launcher" : Shows status of all achievement
achievement_test_clan_count : cmd : , "cl", "launcher" : Determines if specified # of teammates belong to same clan w/local player
achievement_test_friend_count : cmd : , "cl", "launcher" : Counts the #
@ProdigySim
ProdigySim / l4d2_boss_announce.sp
Created March 10, 2012 06:14
Announce boss flow percents accurately.
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <l4d2_direct>
public Plugin:myinfo = {
name = "L4D2 Boss Flow Announce",
author = "ProdigySim",
version = "1.0",
@ProdigySim
ProdigySim / enquirer-names-and-types.patch
Created April 25, 2022 16:31
First pass at enabling inferred names and types on output answers object for enquirer library
diff --git a/module-type-overrides/enquirer.d.ts b/module-type-overrides/enquirer.d.ts
index 27dee4e90..5172f0c5c 100644
--- a/module-type-overrides/enquirer.d.ts
+++ b/module-type-overrides/enquirer.d.ts
@@ -67,6 +67,21 @@ declare namespace Enquirer {
...args: ConstructorParameters<new (...args: any) => T>
) => T;
+ export function prompt<Name extends string, Q extends prompt.Question>(
+ question: Q & { name: Name }
/* TerrorNavArea::SpawnAttributeFromString(char const*) */
uint TerrorNavArea::SpawnAttributeFromString(char *param_1)
{
char cVar1;
int iVar2;
uint uVar3;
@ProdigySim
ProdigySim / sgspread_linux.asm
Last active January 13, 2021 20:48
Previous iteration of sgspread patch
0: 8d 8d 54 ff ff ff lea ecx,[ebp-0xac]
6: f3 0f 11 01 movss DWORD PTR [ecx],xmm0
a: 8b 55 20 mov edx,DWORD PTR [ebp+0x20]
d: 8b c4 mov eax,esp
f: 83 fa 04 cmp edx,0x4 ; "Bullet offset 0"
12: 7f 02 jg 0x16
14: eb 16 jmp 0x2c
16: 89 10 mov DWORD PTR [eax],edx
18: 01 38 add DWORD PTR [eax],edi
void CGameclient::ExecuteStringcommand() {
double now = getRealTime();
int maxCmdsPerSecond = sv_quota_stringcmdspersecond->GetInt();
if ( now - this->m_dLastCmdTime < 1.0 )
{
this->m_cmdQuotaCount = this->m_cmdQuotaCount + 1;
}
else
{
this->m_dLastCmdTime = now;
sm_cvarlist /file
--------------
_autosave : cmd : : Autosave
_autosavedangerous : cmd : : AutoSaveDangerous
_bugreporter_restart : cmd : : Restarts bug reporter .dll
_fov : 0 : , "cl", "launcher" : Automates fov command to server.
_record : cmd : , "norecord" : Record a demo incrementally.
_resetgamestats : cmd : , "sv" : Erases current game stats and writes out a blank stats file
_restart : cmd : : Shutdown and restart the engine.
achievement_debug : 0 : , "cheat", "rep", "cl" : Turn on achievement debug msgs.
sm_cvarlist /file
--------------
_autosave : cmd : : Autosave
_autosavedangerous : cmd : : AutoSaveDangerous
_bugreporter_restart : cmd : : Restarts bug reporter .dll
_fov : 0 : , "cl", "launcher" : Automates fov command to server.
_record : cmd : , "norecord" : Record a demo incrementally.
_resetgamestats : cmd : , "sv" : Erases current game stats and writes out a blank stats file
_restart : cmd : : Shutdown and restart the engine.
achievement_debug : 0 : , "cheat", "rep", "cl" : Turn on achievement debug msgs.