/**
 * Do not edit this file.  Any changes will be overwritten by the gamedata
 * updater or by upgrading your SourceMod install.
 *
 * To override data in this file, create a subdirectory named "custom" and
 * place your own gamedata file(s) inside of it.  Such files will be parsed
 * after SM's own.
 *
 * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(SourceMod)
 */

"Games"
{
	/* Sounds */
	"#default"
	{
		"Keys"
		{
			"SlapSoundCount"	"2"
			"SlapSound1"		"player/damage1.wav"
			"SlapSound2"		"player/damage2.wav"
		}
	}
	
	/* General Temp Entities */
	"#default"
	{
		"Offsets"
		{
			/* Offset into CBaseTempEntity constructor */
			"s_pTempEntities"
			{
				"windows"	"16"
			}
			"GetTEName"
			{
				"windows"	"4"
			}
			"GetTENext"
			{
				"windows"	"8"
			}
			"TE_GetServerClass"
			{
				"windows"	"0"
			}
		}

		"Signatures"
		{
			"CBaseTempEntity"
			{
				"library"	"server"
				"windows"	"\x55\x8B\xEC\x8B\x45\x08\x89\x41\x04\xC7\x01"
			}
		}
	}
	
	/* CGlobalEntityList */
	"#default"
	{
		"Signatures"
		{
			/* Functions in CGlobalEntityList */
			"FindEntityByClassname"
			{
				"library"	"server"
				"windows"	"\x55\x8B\xEC\x53\x56\x8B\xF1\x8B\x4D\x08\x57\x85\xC9\x74\x2A\x8B\x01\xFF\x50\x08\x8B\x00\x83\xF8\xFF\x75\x2A\xB8\xFF\x1F\x00\x00\x40\x03\xC0\x8B\x34\xC6\xEB\x2A\x0F\xB7\xC0\x40\x03\xC0\x8B\x34\xC6\xEB\x2A\x8B\xB6\x04\x00\x02\x00\x85\xF6\x74\x2A\x8B\x5D\x0C\x8B\x3E\x85\xFF\x75\x2A\x68\x2A\x2A\x2A\x2A\xFF\x15\x2A\x2A\x2A\x2A\x83\xC4\x04\xEB\x2A\x39\x5F\x7C"
			}
		}
	}
	
	/* CBaseEntityOutput::FireOutput */
	"#default"
	{
		"Signatures"
		{
			"FireOutput"
			{
				"library"	"server"
				"windows"	"\x55\x8B\xEC\x81\xEC\x20\x01\x00\x00\x53"
			}
		}
	}
	
	/* IServer interface pointer */
	"#default"
	{
		"Keys"
		{
			/* Signature for the beginning of IVEngineServer::CreateFakeClient.
			 *
			 * The engine binary is not actually scanned in order to look for
			 * this. SourceHook is used to used to determine the address of the
			 * function and this signature is used to verify that it contains
			 * the expected code. A pointer to sv (IServer interface) is used
			 * here.
			 */
			"CreateFakeClient_Windows"	"\x55\x8B\xEC\xFF\x75\x08\xB9"
		}
		
		"Offsets"
		{
			/* Offset into IVEngineServer::CreateFakeClient */
			"sv"
			{
				"windows"	"6"
			}
		}
	}
	
	/* EntityFactoryDictionary function */
	/* Can't be made unique in current version */
	/*
	"#default"
	{
		"Signatures"
		{
			"EntityFactory"
			{
				"library"	"server"
				"windows"	"xA1\x2A\x2A\x2A\x2A\xA8\x01\x75\x1F\x83\xC8\x01\xB9\x2A\x2A\x2A\x2A\xA3\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x83\xC4\x04\xB8"
			}
		}
	}
	*/
	
	/* SetUserInfo data */
	"#default"
	{
		"Offsets"
		{
			/**
			 * CBaseClient::SetUserCVar(char  const*,char  const*);
			 * Linux offset straight from VTable dump.
			 * Windows offset is crazy. Found the windows SetName function using string "(%d)%-.*s" (aD_S in IDA)
			 * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
			 */
			"SetUserCvar"
			{
				/* Not 100% sure on this, why would windows change and not linux - TEST ME */
				"windows"	"17"
				"linux"		"63"
				"mac"		"63"
			}
			/**
			 * CBaseClient::SetName(char  const*);
			 * Linux offset straight from VTable dump.
			 * Has string "(%d)%-0.*s"
			 */
			"SetClientName"
			{
				"windows"	"16"
				"linux"		"62"
				"mac"		"62"
			}
			/**
			 * Offset into CBaseClient - Used by CBaseServer::UpdateUserSettings to determine when changes have been made.
			 * Find CBaseClient::UpdateUserSettings (strings "net_maxroutable", "cl_updaterate" etc) and the offset is set to 0 near the end.
			 * Linux: 	mov     byte ptr [esi+0B0h], 0
			 * Win:		mov     byte ptr [esi+0B0h], 0
			 *
			 * L4D2: This has been moved into CBaseClient::UpdateUserSettings(), rest of the details are still relevant.
			 */
			"InfoChanged"
			{
				"windows"	"176"
				"linux"		"176"
				"mac"		"176"
			}
		}
	}
	
	"#default"
	{		
		"Offsets"
		{
			"GiveNamedItem"
			{
				"windows"	"445"
			}
			"RemovePlayerItem"
			{
				"windows"	"303"
			}
			"Weapon_GetSlot"
			{
				"windows"	"301"
			}
			"Ignite"
			{
				"windows"	"229"
			}
			"Extinguish"
			{
				"windows"	"232"
			}
			"Teleport"
			{
				"windows"	"125"
			}
			"CommitSuicide"
			{
				"windows"	"489"
			}
			"GetVelocity"
			{
				"windows"	"157"
			}
			"EyeAngles"
			{
				"windows"	"148"
			}
			"AcceptInput"
			{
				"windows"	"49"
			}
			"SetEntityModel"
			{
				"windows"	"32"
			}
			"WeaponEquip"
			{
				"windows"	"294"
			}
			"Activate"
			{
				"windows"	"41"
			}
			"PlayerRunCmd"
			{
				"windows"	"468"
			}
			"GiveAmmo"
			{
				"windows"	"287"
			}
		}
		
		"Keys"
		{
			"GameRulesProxy"	"CTerrorGameRulesProxy"
			"GameRulesDataTable"	"contagion_gamerules_data"
		}
	}
}