This commit is contained in:
Matt Woodrow 2009-07-28 15:06:57 +12:00
commit d273750849
12 changed files with 162 additions and 163 deletions

View File

@ -214,14 +214,28 @@ void CoreConfig::Initialize()
/* Try to get command line value of core config convar */ /* Try to get command line value of core config convar */
const char *corecfg = icvar->GetCommandLineValue("sm_corecfgfile"); const char *corecfg = icvar->GetCommandLineValue("sm_corecfgfile");
/* If sm_corecfgfile not specified on command line, use default value */ /* If sm_corecfgfile is on the command line, use that
if (!corecfg) * If sm_corecfgfile isn't there, check sm_basepath on the command line and build the path off that
* If sm_basepath isn't there, just use the default path for the cfg
*/
if (corecfg)
{ {
corecfg = sm_corecfgfile.GetDefault(); g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s", g_SourceMod.GetGamePath(), corecfg);
} }
else
{
const char *basepath = icvar->GetCommandLineValue("sm_basepath");
/* Format path to config file */ /* Format path to config file */
g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s", g_SourceMod.GetGamePath(), corecfg); if (basepath)
{
g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s/%s", g_SourceMod.GetGamePath(), basepath, "configs/core.cfg");
}
else
{
g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s", g_SourceMod.GetGamePath(), sm_corecfgfile.GetDefault());
}
}
/* Reset cached key values */ /* Reset cached key values */
m_KeyValues.clear(); m_KeyValues.clear();

View File

@ -128,7 +128,7 @@
"game" "synergy" "game" "synergy"
"game" "left4dead" "game" "left4dead"
"game" "obsidian" "game" "obsidian"
"game" "ageofchivalry" "game" "empires"
} }
"Keys" "Keys"
@ -145,7 +145,7 @@
"game" "tf" "game" "tf"
"game" "synergy" "game" "synergy"
"game" "dod" "game" "dod"
"game" "ageofchivalry" "game" "empires"
} }
"Keys" "Keys"
@ -190,4 +190,11 @@
"GameExtension" "game.tf2" "GameExtension" "game.tf2"
} }
} }
"insurgency"
{
"Keys"
{
"ChatSayText" "yes"
}
}
} }

View File

@ -19,7 +19,7 @@
"game" "dod" "game" "dod"
"game" "tf" "game" "tf"
"game" "ageofchivalry" "game" "ageofchivalry"
"game" "ZPS" "game" "zps"
} }
"Offsets" "Offsets"

View File

@ -24,7 +24,6 @@
"game" "pvkii" "game" "pvkii"
"game" "sourceforts" "game" "sourceforts"
"game" "FortressForever" "game" "FortressForever"
"game" "empires"
"game" "synergy" "game" "synergy"
"game" "hidden" "game" "hidden"
"game" "zombie_master" "game" "zombie_master"
@ -83,7 +82,6 @@
"game" "pvkii" "game" "pvkii"
"game" "sourceforts" "game" "sourceforts"
"game" "FortressForever" "game" "FortressForever"
"game" "empires"
"game" "synergy" "game" "synergy"
"game" "hidden" "game" "hidden"
} }
@ -133,7 +131,6 @@
"game" "pvkii" "game" "pvkii"
"game" "sourceforts" "game" "sourceforts"
"game" "FortressForever" "game" "FortressForever"
"game" "empires"
"game" "synergy" "game" "synergy"
"game" "hidden" "game" "hidden"
"game" "zombie_master" "game" "zombie_master"
@ -161,7 +158,6 @@
"game" "insurgency" "game" "insurgency"
"game" "pvkii" "game" "pvkii"
"game" "sourceforts" "game" "sourceforts"
"game" "empires"
"game" "synergy" "game" "synergy"
"game" "hidden" "game" "hidden"
"game" "FortressForever" "game" "FortressForever"

View File

@ -19,7 +19,8 @@
"game" "dod" "game" "dod"
"game" "tf" "game" "tf"
"game" "ageofchivalry" "game" "ageofchivalry"
"game" "ZPS" "game" "zps"
"game" "empires"
} }
"Offsets" "Offsets"
@ -69,7 +70,8 @@
"game" "dod" "game" "dod"
"game" "tf" "game" "tf"
"game" "ageofchivalry" "game" "ageofchivalry"
"game" "ZPS" "game" "zps"
"game" "empires"
} }
"Signatures" "Signatures"
@ -97,7 +99,8 @@
"game" "dod" "game" "dod"
"game" "tf" "game" "tf"
"game" "ageofchivalry" "game" "ageofchivalry"
"game" "ZPS" "game" "zps"
"game" "empires"
} }
"Signatures" "Signatures"
@ -120,7 +123,8 @@
"game" "dod" "game" "dod"
"game" "tf" "game" "tf"
"game" "ageofchivalry" "game" "ageofchivalry"
"game" "ZPS" "game" "zps"
"game" "empires"
} }
"Offsets" "Offsets"

View File

@ -11,35 +11,35 @@
"Games" "Games"
{ {
/* Age of Chivalry */ /* Age of Chivalry (CR2) */
"ageofchivalry" "ageofchivalry"
{ {
"Offsets" "Offsets"
{ {
"GiveNamedItem" "GiveNamedItem"
{ {
"windows" "351" "windows" "352"
"linux" "352" "linux" "353"
} }
"RemovePlayerItem" "RemovePlayerItem"
{ {
"windows" "239" "windows" "240"
"linux" "240" "linux" "241"
} }
"Weapon_GetSlot" "Weapon_GetSlot"
{ {
"windows" "237" "windows" "238"
"linux" "238" "linux" "239"
} }
"Ignite" "Ignite"
{ {
"windows" "194" "windows" "195"
"linux" "195" "linux" "196"
} }
"Extinguish" "Extinguish"
{ {
"windows" "198" "windows" "199"
"linux" "199" "linux" "200"
} }
"Teleport" "Teleport"
{ {
@ -48,8 +48,8 @@
} }
"CommitSuicide" "CommitSuicide"
{ {
"windows" "389" "windows" "390"
"linux" "389" "linux" "390"
} }
"GetVelocity" "GetVelocity"
{ {
@ -88,8 +88,8 @@
} }
"WeaponEquip" "WeaponEquip"
{ {
"windows" "230" "windows" "231"
"linux" "231" "linux" "232"
} }
"Activate" "Activate"
{ {

View File

@ -11,7 +11,7 @@
"Games" "Games"
{ {
/* Empires 2 */ /* Empires 2.24 */
"empires" "empires"
{ {
@ -19,99 +19,89 @@
{ {
"GiveNamedItem" "GiveNamedItem"
{ {
"windows" "332" "windows" "354"
"linux" "333" "linux" "355"
} }
"RemovePlayerItem" "RemovePlayerItem"
{ {
"windows" "230" "windows" "241"
"linux" "231" "linux" "242"
} }
"Weapon_GetSlot" "Weapon_GetSlot"
{ {
"windows" "228" "windows" "239"
"linux" "229" "linux" "240"
} }
"Ignite" "Ignite"
{ {
"windows" "192" "windows" "196"
"linux" "193" "linux" "197"
} }
"Extinguish" "Extinguish"
{ {
"windows" "193" "windows" "200"
"linux" "194" "linux" "201"
} }
"Teleport" "Teleport"
{ {
"windows" "102" "windows" "104"
"linux" "103" "linux" "105"
} }
"CommitSuicide" "CommitSuicide"
{ {
"windows" "360" "windows" "401"
"linux" "361" "linux" "402"
} }
"GetVelocity" "GetVelocity"
{ {
"windows" "130" "windows" "133"
"linux" "131" "linux" "134"
} }
"EyeAngles" "EyeAngles"
{ {
"windows" "122" "windows" "125"
"linux" "123" "linux" "126"
}
"AcceptInput"
{
"windows" "36"
"linux" "37"
} }
"DispatchKeyValue" "DispatchKeyValue"
{ {
"windows" "31" "windows" "29"
"linux" "30" "linux" "28"
} }
"DispatchKeyValueFloat" "DispatchKeyValueFloat"
{ {
"windows" "30" "windows" "28"
"linux" "31" "linux" "29"
} }
"DispatchKeyValueVector" "DispatchKeyValueVector"
{ {
"windows" "29" "windows" "27"
"linux" "32" "linux" "30"
} }
"SetEntityModel" "AcceptInput"
{ {
"windows" "25" "windows" "35"
"linux" "26" "linux" "36"
}
"WeaponEquip"
{
"windows" "221"
"linux" "222"
} }
"Activate" "Activate"
{ {
"windows" "32" "windows" "31"
"linux" "33" "linux" "32"
} }
"TakeHealth"
/* Offset into LevelShutdown for CGlobalEntList */
"gEntList"
{ {
"windows" "64" "windows" "62"
"linux" "63"
} }
} "ChangeTeam"
"Signatures"
{
"LevelShutdown"
{ {
"library" "server" "windows" "87"
"windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2B\x56\xE8\x2A\x2A\x2A\x2A\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x8B\xF1\x74\x0E" "linux" "88"
}
"SetEntityModel"
{
"windows" "23"
"linux" "24"
} }
} }
} }
} }

View File

@ -11,36 +11,36 @@
"Games" "Games"
{ {
/* Insurgency */ /* Insurgency (2009-07-10) */
"insurgency" "insurgency"
{ {
"Offsets" "Offsets"
{ {
/* CBasePlayer */ /* CBasePlayer */
"Ignite" "Ignite"
{
"windows" "174"
"linux" "175"
}
"Extinguish"
{ {
"windows" "175" "windows" "175"
"linux" "176" "linux" "176"
} }
"Extinguish"
{
"windows" "176"
"linux" "177"
}
"Teleport" "Teleport"
{ {
"windows" "90" "windows" "91"
"linux" "91" "linux" "92"
} }
"GetVelocity" "GetVelocity"
{ {
"windows" "115" "windows" "116"
"linux" "116" "linux" "117"
} }
"EyeAngles" "EyeAngles"
{ {
"windows" "107" "windows" "108"
"linux" "108" "linux" "109"
} }
"AcceptInput" "AcceptInput"
{ {
@ -83,5 +83,14 @@
"linux" "289" "linux" "289"
} }
} }
"Signatures"
{
"FireOutput"
{
"library" "server"
"windows" "\x81\xEC\x20\x01\x00\x00\x53\x55\x56\x8B\x71\x14"
"linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
}
}
} }
} }

View File

@ -11,7 +11,7 @@
"Games" "Games"
{ {
/* Zombie Master 1.1.3 */ /* Zombie Master 1.2.1 */
"zombie_master" "zombie_master"
{ {
"Offsets" "Offsets"
@ -87,10 +87,6 @@
"windows" "25" "windows" "25"
"linux" "26" "linux" "26"
} }
"s_pTempEntities"
{
"windows" "30"
}
"g_pGameRules" "g_pGameRules"
{ {
"windows" "7" "windows" "7"
@ -109,27 +105,22 @@
"Signatures" "Signatures"
{ {
"CBaseTempEntity"
{
"library" "server"
"windows" "\x55\x8B\xEC\x51\x89\x4D\xFC\x8B\x45\xFC\xC7\x00\x2A\x2A\x2A\x2A\x8B\x4D\xFC\x8B\x55\x08\x89\x51\x04\x8B\x45\xFC\x8B\x0D\x2A\x2A"
}
"DispatchSpawn" "DispatchSpawn"
{ {
"library" "server" "library" "server"
"linux" "@_Z13DispatchSpawnP11CBaseEntity" "linux" "@_Z13DispatchSpawnP11CBaseEntity"
"windows" "\x55\x8B\xEC\x83\xEC\x20\x83\x7D\x08\x00\x0F\x84\x95\x01\x00\x00\xA1\x2A\x2A\x2A\x2A\x50\x8D\x4D\xF0\xE8\x2A\x2A\x2A\x2A\x8D\x4D" "windows" "\x53\x55\x56\x8B\x74\x24\x10\x85\xF6\x57\x0F\x84\x3A\x01\x00\x00\x8B\x1D\x5C\x35\x6F\x22\x8B\x03\x8B\xCB\xFF\x50\x60\x8B\x16\x8B"
} }
"CreateEntityByName" "CreateEntityByName"
{ {
"library" "server" "library" "server"
"linux" "@_Z18CreateEntityByNamePKci" "linux" "@_Z18CreateEntityByNamePKci"
"windows" "\x55\x8B\xEC\x83\xEC\x0C\x83\x7D\x0C\xFF\x74\x39\x8B\x45\x0C\x50\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x11\x8B\x0D\x2A\x2A\x2A\x2A\xFF\x52" "windows" "\x56\x8B\x74\x24\x0C\x83\xFE\xFF\x57\x8B\x7C\x24\x0C\x74\x25\x8B\x0D\x20\x35\x6F\x22\x8B\x01\x56\xFF\x50\x54\x85\xC0\xA3\x54\x31"
} }
"FindEntityByClassname" "FindEntityByClassname"
{ {
"library" "server" "library" "server"
"windows" "\x55\x8B\xEC\x83\xEC\x10\x89\x4D\xF4\x83\x7D\x08\x00\x74\x1C\x8B\x45\x08\x8B\x10\x8B\x4D\x08\xFF\x52\x08\x50\x8B\x4D\xF4\xE8\x2A\x2A\x2A\x2A\x8B\x40\x0C\x89\x45\x\xF0\xEB\x0B\x8B\x4D\xF4\xE8\x2A\x2A\x2A\x2A\x89\x45\xF0\x8B\x4D\xF0\x89\x4D\xFC\xEB\x09\x8B\x55\xFC\x8B\x42\x0C\x89\x45\xFC\x83\x7D\xFC\x00\x74\x38\x8B\x4D\xFC\x8B\x11\x89" "windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x85\xC9\x57\x74\x18\x8B\x01\xFF\x50\x08\x8B\x08\x81\xE1\xFF\x0F\x00\x00\x83\xC1\x01\xC1\xE1\x04\x8B\x3C\x31\xEB\x06\x8B\xBE\x04\x00\x01\x00\x85\xFF\x74\x3A\x8B\x5C\x24\x18\x8B\x2D\x6C\xE5\x73\x22\x8D\x9B\x00\x00\x00\x00\x8B\x37\x85\xF6\x75\x0C\x68\xFC\xFB\x56\x22\xFF\xD5\x83\xC4\x04\xEB\x11\x39"
"linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc" "linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc"
} }
"CreateGameRulesObject" "CreateGameRulesObject"
@ -144,4 +135,4 @@
} }
} }
} }
} }

View File

@ -11,59 +11,55 @@
"Games" "Games"
{ {
/* Zombie Panic! Source 1.2b /* Zombie Panic! Source (1.6.1) */
* Note: This mod is not fully supported yet. "zps"
* The definitions below were supplied by a third party.
* (thanks "noob cannon lol")
*/
"ZPS"
{ {
"Offsets" "Offsets"
{ {
"GiveNamedItem" "GiveNamedItem"
{ {
"windows" "333" "windows" "356"
"linux" "334" "linux" "357"
} }
"RemovePlayerItem" "RemovePlayerItem"
{ {
"windows" "230" "windows" "243"
"linux" "231" "linux" "244"
} }
"Weapon_GetSlot" "Weapon_GetSlot"
{ {
"windows" "226" "windows" "238"
"linux" "227" "linux" "239"
} }
"Ignite" "Ignite"
{ {
"windows" "190" "windows" "195"
"linux" "191" "linux" "196"
} }
"Extinguish" "Extinguish"
{ {
"windows" "191" "windows" "199"
"linux" "192" "linux" "200"
} }
"Teleport" "Teleport"
{ {
"windows" "100" "windows" "103"
"linux" "101" "linux" "104"
} }
"CommitSuicide" "CommitSuicide"
{ {
"windows" "361" "windows" "397"
"linux" "362" "linux" "397"
} }
"GetVelocity" "GetVelocity"
{ {
"windows" "128" "windows" "132"
"linux" "129" "linux" "133"
} }
"EyeAngles" "EyeAngles"
{ {
"windows" "120" "windows" "124"
"linux" "121" "linux" "125"
} }
"AcceptInput" "AcceptInput"
{ {
@ -72,28 +68,28 @@
} }
"DispatchKeyValue" "DispatchKeyValue"
{ {
"windows" "31" "windows" "30"
"linux" "30" "linux" "29"
} }
"DispatchKeyValueFloat" "DispatchKeyValueFloat"
{ {
"windows" "30" "windows" "29"
"linux" "31" "linux" "30"
} }
"DispatchKeyValueVector" "DispatchKeyValueVector"
{ {
"windows" "29" "windows" "28"
"linux" "32" "linux" "31"
} }
"SetEntityModel" "SetEntityModel"
{ {
"windows" "25" "windows" "24"
"linux" "26" "linux" "25"
} }
"WeaponEquip" "WeaponEquip"
{ {
"windows" "219" "windows" "231"
"linux" "220" "linux" "232"
} }
"Activate" "Activate"
{ {

View File

@ -113,7 +113,7 @@
"game.zpanic.txt" "game.zpanic.txt"
{ {
"game" "ZPS" "game" "zps"
} }
"game.obsidian.txt" "game.obsidian.txt"

View File

@ -190,10 +190,7 @@ public Action:Command_SayAdmin(client, args)
decl String:message[192]; decl String:message[192];
strcopy(message, 192, text[startidx+1]); strcopy(message, 192, text[startidx+1]);
decl String:name[64]; SendChatToAdmins(client, message);
GetClientName(client, name, sizeof(name));
SendChatToAdmins(name, message);
LogAction(client, -1, "%L triggered sm_chat (text %s)", client, message); LogAction(client, -1, "%L triggered sm_chat (text %s)", client, message);
return Plugin_Handled; return Plugin_Handled;
@ -313,10 +310,7 @@ public Action:Command_SmChat(client, args)
decl String:text[192]; decl String:text[192];
GetCmdArgString(text, sizeof(text)); GetCmdArgString(text, sizeof(text));
decl String:name[64]; SendChatToAdmins(client, text);
GetClientName(client, name, sizeof(name));
SendChatToAdmins(name, text);
LogAction(client, -1, "%L triggered sm_chat (text %s)", client, text); LogAction(client, -1, "%L triggered sm_chat (text %s)", client, text);
return Plugin_Handled; return Plugin_Handled;
@ -451,22 +445,20 @@ DisplayCenterTextToAll(client, String:message[])
} }
} }
SendChatToAdmins(String:name[], String:message[]) SendChatToAdmins(from, String:message[])
{ {
new fromAdmin = CheckCommandAccess(from, "sm_chat", ADMFLAG_CHAT);
for (new i = 1; i <= MaxClients; i++) for (new i = 1; i <= MaxClients; i++)
{ {
if (IsClientInGame(i)) if (IsClientInGame(i) && (from == i || CheckCommandAccess(i, "sm_chat", ADMFLAG_CHAT)))
{ {
if (CheckCommandAccess(i, "sm_chat", ADMFLAG_CHAT)) if (g_DoColor)
{ {
if (g_DoColor) PrintToChat(i, "\x04(%sADMINS) %N: \x01%s", fromAdmin ? "" : "TO ", from, message);
{ }
PrintToChat(i, "\x04(ADMINS) %s: \x01%s", name, message); else
} {
else PrintToChat(i, "(%sADMINS) %N: %s", fromAdmin ? "" : "TO ", from, message);
{
PrintToChat(i, "(ADMINS) %s: %s", name, message);
}
} }
} }
} }