View Single Post
Author Message
smaaps
New Member
Join Date: Dec 2004
Old 12-09-2004 , 08:12   FireGameEvent problem: no name and no data in events
Reply With Quote #1

I finally managed to compile (debian 3.0 testing / gcc342) the Serverplugin_Empty and make it load on my cssource server. (If anyone needs help there .. [email protected])

Unfortunaly I have a number of problems with the events that are passed through FireGameEvent ...

First of all, the sample code in the plugin
..
const char * name = event->GetName();
Msg( "CEmptyServerPlugin::FireGameEvent: Got event + \"%s\" + \n", name );
..
which tries just to show the name of the events does not give useful information. Most times it does not give a name at all, sometimes it gives odd characters live yyyyyyyoi.

Using the GetNameSymbol() method of the KeyValues class at least gives a unique number, that is supposed to identify the events. It would be more comfortable though if I could get strings so I wouldnt have to try to figure out what real events these numbers stand for. When i look at these nummbers on the server console, they seem to make sense because the same numbers appear, when I do similar actions in the game.

The second problem is, that these events seem to contain no data. When I use the sample code of the KeyValues.h file to iterate through the subkeyvalue of the event pairs ... i get nothing at all:

..
for ( KeyValues *pKey = event->GetFirstTrueSubKey(); pKey; pKey = pKey->GetNextTrueSubKey() )
{
Msg( "Key name: %s\n", pKey->GetName() );
}
..

So please. Does anyone know how to get the correct event names and how to access their data? It would really help in developing a plugin


SAMPLE LOG:
CEmptyServerPlugin::FireGameEvent: Got event + "684" +
CEmptyServerPlugin::FireGameEvent: Got event + "684" +
CEmptyServerPlugin::FireGameEvent: Got event + "684" +
L 12/09/2004 - 1271: "[CH]RaMpAgE<5><STEAM_0:1:5108607><TERRORIST>" triggered "Dropped_The_Bomb"
CEmptyServerPlugin::FireGameEvent: Got event + "1072" +
L 12/09/2004 - 1271: "bgm | smaaps<2><STEAM_0:0:6817><CT>" killed "[CH]RaMpAgE<5><STEAM_0:1:5108607><TERRORIST>" with "deagle"
CEmptyServerPlugin::FireGameEvent: Got event + "653" +
L 12/09/2004 - 1271: Team "CT" triggered "CTs_Win" (CT "6") (T "3")
L 12/09/2004 - 1271: Team "CT" scored "6" with "2" players
L 12/09/2004 - 1271: Team "TERRORIST" scored "3" with "3" players
L 12/09/2004 - 1271: World triggered "Round_End"
CEmptyServerPlugin::FireGameEvent: Got event + "933" +
CEmptyServerPlugin::FireGameEvent: Got event + "921" +
L 12/09/2004 - 1277: "[CH]RaMpAgE<5><STEAM_0:1:5108607><TERRORIST>" triggered "Got_The_Bomb"
CEmptyServerPlugin::FireGameEvent: Got event + "1085" +
L 12/09/2004 - 127:41: World triggered "Round_Start"
CEmptyServerPlugin::FireGameEvent: Got event + "684" +
L 12/09/2004 - 127:42: "[CH]RaMpAgE<5><STEAM_0:1:5108607><TERRORIST>" killed "nOOk<6><STEAM_0:1:2828226><TERRORIST>" with "galil" (headshot)
CEmptyServerPlugin::FireGameEvent: Got event + "653" +
smaaps is offline