From 6f16fc77b853cc7b8151d82332d6f0d20b13b4b7 Mon Sep 17 00:00:00 2001 From: Scott Ehlert <ds@alliedmods.net> Date: Tue, 6 Jul 2010 17:32:58 -0500 Subject: [PATCH 1/4] Added GetConVarDefault() native (bug 4502, r=dvander). --- core/smn_console.cpp | 19 +++++++++++++++++++ plugins/include/console.inc | 11 +++++++++++ 2 files changed, 30 insertions(+) diff --git a/core/smn_console.cpp b/core/smn_console.cpp index 186a2a0c..9e9e458f 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -509,6 +509,24 @@ static cell_t sm_ResetConVar(IPluginContext *pContext, const cell_t *params) return 1; } +static cell_t GetConVarDefault(IPluginContext *pContext, const cell_t *params) +{ + Handle_t hndl = static_cast<Handle_t>(params[1]); + HandleError err; + ConVar *pConVar; + + if ((err=g_ConVarManager.ReadConVarHandle(hndl, &pConVar)) + != HandleError_None) + { + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); + } + + size_t bytes; + pContext->StringToLocalUTF8(params[2], params[3], pConVar->GetDefault(), &bytes); + + return bytes; +} + static cell_t sm_GetConVarFlags(IPluginContext *pContext, const cell_t *params) { Handle_t hndl = static_cast<Handle_t>(params[1]); @@ -1406,6 +1424,7 @@ REGISTER_NATIVES(consoleNatives) {"GetConVarBounds", sm_GetConVarBounds}, {"SetConVarBounds", sm_SetConVarBounds}, {"QueryClientConVar", sm_QueryClientConVar}, + {"GetConVarDefault", GetConVarDefault}, {"RegServerCmd", sm_RegServerCmd}, {"RegConsoleCmd", sm_RegConsoleCmd}, {"GetCmdArgString", sm_GetCmdArgString}, diff --git a/plugins/include/console.inc b/plugins/include/console.inc index 9e8b9138..b5dddc31 100644 --- a/plugins/include/console.inc +++ b/plugins/include/console.inc @@ -593,6 +593,17 @@ native SetConVarString(Handle:convar, const String:value[], bool:replicate=false */ native ResetConVar(Handle:convar, bool:replicate=false, bool:notify=false); +/** + * Retrieves the default string value of a console variable. + * + * @param convar Handle to the convar. + * @param default Buffer to store the default value of the convar. + * @param maxlength Maximum length of string buffer. + * @return Number of bytes written to the buffer (UTF-8 safe). + * @error Invalid or corrupt Handle. + */ +native GetConVarDefault(Handle:convar, String:default[], maxlength); + /** * Returns the bitstring of flags on a console variable. * From 9d5e994c018dacfdc637baea2af692bac336c937 Mon Sep 17 00:00:00 2001 From: Scott Ehlert <ds@alliedmods.net> Date: Wed, 7 Jul 2010 02:27:59 -0500 Subject: [PATCH 2/4] Bleh, fixed compiler error in console.inc caused by previous changeset. --- plugins/include/console.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/include/console.inc b/plugins/include/console.inc index b5dddc31..dd28371c 100644 --- a/plugins/include/console.inc +++ b/plugins/include/console.inc @@ -597,12 +597,12 @@ native ResetConVar(Handle:convar, bool:replicate=false, bool:notify=false); * Retrieves the default string value of a console variable. * * @param convar Handle to the convar. - * @param default Buffer to store the default value of the convar. + * @param value Buffer to store the default value of the convar. * @param maxlength Maximum length of string buffer. * @return Number of bytes written to the buffer (UTF-8 safe). * @error Invalid or corrupt Handle. */ -native GetConVarDefault(Handle:convar, String:default[], maxlength); +native GetConVarDefault(Handle:convar, String:value[], maxlength); /** * Returns the bitstring of flags on a console variable. From d986c7cdc074bdcdd8a491055c56b220e96913b6 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings <skamonkey@gmail.com> Date: Thu, 8 Jul 2010 21:07:06 -0400 Subject: [PATCH 3/4] Fixed TF2 sigs that broke with recent update (bug 4506, r=fyren) --- gamedata/sm-tf2.games.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gamedata/sm-tf2.games.txt b/gamedata/sm-tf2.games.txt index efdf0d64..51be92c9 100644 --- a/gamedata/sm-tf2.games.txt +++ b/gamedata/sm-tf2.games.txt @@ -18,7 +18,7 @@ "Burn" { "library" "server" - "windows" "\x56\x8B\xF1\x8B\x8E\x2A\x2A\x00\x00\x8B\x01\x8B\x90\x2A\x2A\x00\x00\xFF\xD2\x84\xC0\x0F\x2A\x2A\x2A\x2A\x2A\x8B" + "windows" "\x56\x8B\xF1\x8B\x8E\x2A\x2A\x00\x00\x8B\x01\x8B\x90\x2A\x2A\x00\x00\xFF\xD2\x84\xC0\x0F\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x8B\xC8\xC1" "linux" "@_ZN15CTFPlayerShared4BurnEP9CTFPlayerP13CTFWeaponBase" "mac" "@_ZN15CTFPlayerShared4BurnEP9CTFPlayerP13CTFWeaponBase" } @@ -67,14 +67,14 @@ "AddCondition" { "library" "server" - "windows" "\x56\x57\x8B\x7C\x2A\x2A\x8B\xF1\x8B\xCF\xBA\x01\x00\x00\x00\xD3\xE2\x8D\x46\x2A\x8D\x4C\x2A\x2A\x51\x0B\x10" + "windows" "\x56\x57\x8B\x7C\x2A\x2A\x8B\xF1\x8B\xCF\xBA\x01\x00\x00\x00\xD3\xE2\x8D\x86\x2A\x2A\x2A\x2A\x8D\x4C\x2A\x2A\x51\x0B\x10\x8B" "linux" "@_ZN15CTFPlayerShared7AddCondEif" "mac" "@_ZN15CTFPlayerShared7AddCondEif" } "RemoveCondition" { "library" "server" - "windows" "\x56\x57\x8B\x7C\x2A\x2A\x8B\xF1\x8B\xCF\xBA\x01\x00\x00\x00\xD3\xE2\x8D\x46\x2A\x8D\x4C\x2A\x2A\x51\xF7\xD2" + "windows" "\x56\x57\x8B\x7C\x2A\x2A\x8B\xF1\x8B\xCF\xBA\x01\x00\x00\x00\xD3\xE2\x8D\x86\x2A\x2A\x2A\x2A\x8D\x4C\x2A\x2A\x51\xF7\xD2\x23" "linux" "@_ZN15CTFPlayerShared10RemoveCondEi" "mac" "@_ZN15CTFPlayerShared10RemoveCondEi" } From abf7aed8808adeb17163bb62cbbe1374ba49f38a Mon Sep 17 00:00:00 2001 From: Scott Ehlert <ds@alliedmods.net> Date: Sun, 11 Jul 2010 03:00:30 -0500 Subject: [PATCH 4/4] Triggering a build to compile against L4D2 SDK changes (bug 4509). --- pushbuild.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/pushbuild.txt b/pushbuild.txt index 94cf8ec3..effae084 100644 --- a/pushbuild.txt +++ b/pushbuild.txt @@ -19,3 +19,4 @@ DS saves us from Valve again. Pants will save us from certain death. Invaders' blood marches through my veins, like GIANT RADIOACTIVE RUBBER PANTS! THE PANTS COMMAND COMMAND ME! DO NOT IGNORE MY VEINS. +This file sure has gotten big. \ No newline at end of file