Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new SVC_InfoString and SVC_Info hooks #237

Open
ShadowsAdi opened this issue Jan 4, 2022 · 0 comments
Open

Add new SVC_InfoString and SVC_Info hooks #237

ShadowsAdi opened this issue Jan 4, 2022 · 0 comments

Comments

@ShadowsAdi
Copy link
Contributor

ShadowsAdi commented Jan 4, 2022

Add an engine hook in reAPI for SVC_InfoString : https://github.com/dreamstalker/rehlds/blob/master/rehlds/engine/sv_main.cpp#L2843 with ability to set Info_SetValueForKey with values for given key buffer.
And for SVC_Info: https://github.com/dreamstalker/rehlds/blob/master/rehlds/engine/sv_main.cpp#L2957 with ability to set given values by [set_]*[get_]key_value for certain packet bytes using bitsum.
( Examples )

enum(<<= 1)
{
	BIT_STRING = 1,
	BIT_LONG,
	BIT_SHORT,
	BIT_BYTE ,
}

public SVC_InfoString_Pre(szPointer[], szKey[], szBuffer[], iLen)
{
	(Some function same as set_key_value / get_key_value but with pointer to buffer as array, not int) 
	const hostname[] = "Tests"
	new iBuf = get_key_value("hostname")
	set_key_value(iBuf, hostname, sizeof(hostname))
}

public SVC_Info_Pre(iPointer, iKey, szBuffer[], iLen)
{
	(Some function same as set_key_value but with pointer to buffer as array, not int) 
	Something related to sizebuf_t struct to set buffers, I think.
	
	Same behaviour as SVC_InfoString but setting key values as they are: string, int, long, short, byte. iKey = bitsum value of the key value which will be sent (string, long, short, byte)

	set_key_value(iKey, hostname, sizeof(hostname), /* additional param */BIT_STRING)
	set_key_value(iKey, mod_version, _, /* additional param */ BIT_BYTE)
}

P.S. : I don't know if it's better to use NET_SendPacket hook or those, so, let me know and thanks for read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant