/**
 * 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"
{
	/* General Temp Entities */
	"#default"
	{
		"Offsets"
		{
			"GetTEName"
			{
				"windows"	"4"
				"windows64"	"8"
				"linux"		"4"
				"linux64"	"8"
			}
			"GetTENext"
			{
				"windows"	"8"
				"windows64"	"16"
				"linux"		"8"
				"linux64"	"16"
			}
			"TE_GetServerClass"
			{
				"windows"	"0"
				"windows64"	"0"
				"linux"		"0"
				"linux64"	"0"
			}
		}
	}

	/* IServer interface pointer */
	"#default"
	{
		"Keys"
		{
			/* Signature for the beginning of IVEngineServer::CreateFakeClientEx.
			 *
			 * 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\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x75\x04"
		}
		
		"Offsets"
		{
			/* Offset into IVEngineServer::CreateFakeClient */
			"sv"
			{
				"windows"	"7"
				"windows64"	"7"
			}
		}

		"Signatures"
		{
			/* CBaseServer object for IServer interface */
			"sv"
			{
				"library"	"engine"
				"linux"		"@sv"
				"linux64"	"@sv"
			}
		}
	}

	/* CBaseEntityOutput::FireOutput */
	"#default"
	{
		"Signatures"
		{
			"FireOutput"
			{
				/* String: "(%0.2f) output: (%s,%s) -> (%s,%s)(%s)" */
				"library"	"server"
				"windows"	"\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x53\x8B\xC1"
				"windows64"	"\x48\x8B\xC4\x48\x89\x50\x10\x48\x89\x48\x08\x41\x54"
				"linux"		"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
				"linux64"	"@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f"
			}
		}
	}
	
	/* 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)%-0.*s"
			 * Cross referenced back to the vtable and counted manually (SetUserCvar is 1 higher, offsets start from 1)
			 */
			"SetUserCvar"
			{
				"windows"	"18"
				"windows64"	"18"
				"linux"		"58"
				"linux64"	"58"
			}
			/**
			 * CBaseClient::SetName(char  const*);
			 * Linux offset straight from VTable dump.
			 * Has string "(%d)%-0.*s"
			 */
			"SetClientName"
			{
				"windows"	"17"
				"windows64"	"17"
				"linux"		"57"
				"linux64"	"57"
			}
			/**
			 * 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+98h], 0
			 * Win:	mov     byte ptr [esi+0A4h], 0
			 */
			"InfoChanged"
			{
				"windows"	"140"
				"windows64"	"140"
				"linux"		"140"
				"linux64"	"160"
			}
		}
	}
}
