PDA

View Full Version : Function call


ot_207
06-24-2010, 08:05
I am interested in the function that is called when a cvar that has the FCVAR_SERVER flag is changed on the server. The function sends players info about the cvar change. Does anybody know about it?

xPaw
06-24-2010, 08:06
There is none

ot_207
06-24-2010, 08:20
There is none

But there must be something that the server does to inform players about cvar change. A message maybe?

GXLZPGX
06-24-2010, 11:51
But there must be something that the server does to inform players about cvar change. A message maybe?

AmxModX only displays what the cvar has changed to. You cannot make it display a message to the player when it happens.

grimvh2
06-24-2010, 12:15
AmxModX only displays what the cvar has changed to. You cannot make it display a message to the player when it happens.

So not true, it only displays when u use amx_cvar.

ot_207
06-24-2010, 12:26
I am interested in functions that can be hooked with orpheu not messages that print that the x cvar has changed.

GXLZPGX
06-24-2010, 12:49
So not true, it only displays when u use amx_cvar.

You obviously haven't had administrative rights on any server before. Please try not to talk unless you know what you're talking about. It displays a message no matter if you use:

amx_cvar cvar_name value

Or if you go into amxmodmenu -> plugin cvars and change it.


I am interested in functions that can be hooked with orpheu not messages that print that the x cvar has changed.

And I haven't yet come to far with Orpheu. Orpheu is very powerful, I'm sure their is a way.

YamiKaitou
06-24-2010, 12:53
You obviously haven't had administrative rights on any server before. Please try not to talk unless you know what you're talking about.
I could say the same to you

It displays a message no matter if you use:

amx_cvar cvar_name value

Or if you go into amxmodmenu -> plugin cvars and change it.
That is because amx_cvar and the menu are displaying the message, not the server. ot_207 is wanting to hook the message generated when you change a cvar with the FCVAR_SERVER flag. If you do not know what this flag does, then take a cvar that has this flag and change the value using RCON, you will see that all clients get notified of the new value.

grimvh2
06-24-2010, 12:59
You obviously haven't had administrative rights on any server before. Please try not to talk unless you know what you're talking about. It displays a message no matter if you use:

amx_cvar cvar_name value

Or if you go into amxmodmenu -> plugin cvars and change it.




And I haven't yet come to far with Orpheu. Orpheu is very powerful, I'm sure their is a way.

I guess your the kind of people that whines about admin, when im the kind of person who ignores ur whining.

joropito
06-24-2010, 16:04
OT, check at Cvar_DirectSet() function.

It does the following depending on cvar flags:


Log_Printf("Server cvar \"%s\" = \"%s\"\n", *(_DWORD *)a2);
SV_BroadcastPrintf("\"%s\" changed to \"%s\"\n", *(_DWORD *)a2);


Here's the code:



void __usercall Cvar_DirectSet(long double a1<st0>, int a2, char *a3)
{
char *v3; // edi@1
char *v4; // ecx@4
char *v5; // esi@4
int v6; // esi@11
int v7; // ST24_4@13
int v8; // eax@13
char v9; // al@13
int v10; // eax@14
char *v11; // edx@20
int v12; // eax@20
int v13; // eax@24
int v14; // eax@24
char v15; // [sp+10h] [bp-40Ch]@4

v3 = a3;
if ( a2 )
{
if ( a3 )
{
if ( *(_BYTE *)(a2 + 8) < 0 )
{
v15 = 0;
v4 = a3;
v5 = &v15;
v3 = &v15;
while ( *v4 )
{
if ( (unsigned __int8)(*v4 - 32) <= 0x5Eu )
*v5++ = *v4++;
else
++v4;
}
*v5 = 0;
if ( !Q_strlen(&v15) )
Q_strcpy(&v15, "empty");
}
v6 = Q_strcmp(*(_DWORD *)(a2 + 4), v3);
if ( *(_BYTE *)(a2 + 8) & 2 )
{
if ( !*(_DWORD *)cls )
{
v7 = *(_DWORD *)a2;
v8 = Info_Serverinfo();
Info_SetValueForKey(v8, v7, v3, 512);
v9 = Info_Serverinfo();
SV_BroadcastCommand("fullserverinfo \"%s\"\n", v9);
}
}
v10 = *(_DWORD *)(a2 + 8);
if ( v10 & 4 )
{
if ( v6 )
{
if ( !(BYTE1(v10) & 1) )
{
Log_Printf("Server cvar \"%s\" = \"%s\"\n", *(_DWORD *)a2);
SV_BroadcastPrintf("\"%s\" changed to \"%s\"\n", *(_DWORD *)a2);
}
if ( *(_BYTE *)(a2 + 8) & 0x20 )
{
if ( Q_strlen(v3) <= 0 || (v12 = Q_stricmp(v3, "none"), v11 = (char *)&off_A7F80, !v12) )
v11 = (char *)&off_A7F80 + 2;
}
else
{
v11 = v3;
}
Steam_SetCVar(*(_DWORD *)a2, v11);
}
}
Z_Free(*(_DWORD *)(a2 + 4));
v13 = Q_strlen(v3);
v14 = Z_Malloc(v13 + 1);
*(_DWORD *)(a2 + 4) = v14;
Q_strcpy(v14, v3);
Q_atof(*(_DWORD *)(a2 + 4));
*(float *)(a2 + 12) = a1;
}
}
}

xPaw
06-24-2010, 18:19
joropito thats interesting, that should work well for standart cvars, what about registered cvars by plugins ?

joropito
06-24-2010, 18:29
joropito thats interesting, that should work well for standart cvars, what about registered cvars by plugins ?

If I'm not wrong:

set_pcvar_* is using pfnCvar_DirectSet so should be the same I guess.

set_cvar_* calls pfnCVarSet* which calls Cvar_DirectSet.


If someone can test it using orpheu would be nice.

GXLZPGX
06-25-2010, 00:53
I guess your the kind of people that whines about admin, when im the kind of person who ignores ur whining.

That has absolutely nothing to do with this conversation. I apologize for destroying your e-rep, I won't do it again.

grimvh2
06-25-2010, 02:39
That has absolutely nothing to do with this conversation. I apologize for destroying your e-rep, I won't do it again.

No one cares about you, nor your flames. You don't have the knowledge to even get reply to me in a maturily. All I see you doing is serving as a nuisance to people opposed to having any intention of assisting them.

GXLZPGX
06-25-2010, 04:10
No one cares about you, nor your flames. You don't have the knowledge to even get reply to me in a maturily. All I see you doing is serving as a nuisance to people opposed to having any intention of assisting them.

#1: Who are you to speak for everyone else.
#2: My flames? You don't know what your talking about, so you change the subject, I'm sorry I made you mad by proving you wrong.
#3: Don't have the knowledge to reply to you in a "Maturily?" Maturily isn't a word. And even if you spelling it right, it still wouldn't make sense.

And as for the last part, I did have the intention of helping him, you obviously don't know how to read.

DruGzOG
06-25-2010, 10:34
#1: Who are you to speak for everyone else.
#2: My flames? You don't know what your talking about, so you change the subject, I'm sorry I made you mad by proving you wrong.
#3: Don't have the knowledge to reply to you in a "Maturily?" Maturily isn't a word. And even if you spelling it right, it still wouldn't make sense.

And as for the last part, I did have the intention of helping him, you obviously don't know how to read.

Honestly if your going to criticize people for their grammar, you need to grow up.

Your previous post on him not knowing anything explains the flame. Maybe you could of approached the situation in another way.

And in conclusion, stop the flaming, its annoying.

ConnorMcLeod
06-25-2010, 10:50
So you are talking about messages such as :

"mp_startmoney" changed to "4500"

that are sent when FCVAR_SERVER flag is set on a cvar flags.

grimvh2
06-25-2010, 19:26
#2: My flames? You don't know what your talking about, so you change the subject, I'm sorry I made you mad by proving you wrong.


In fact, ur wrong. And now im going to stop posting on this topic since you can't come up with anything good.

joropito
06-25-2010, 19:40
.

.

Stop off topic please.

ot_207
06-26-2010, 06:10
So you are talking about messages such as :

"mp_startmoney" changed to "4500"

that are sent when FCVAR_SERVER flag is set on a cvar flags.

I already know that but I want to send false info about a cvar. For example when mp_footsteps is 1 the clients think that it is 0.