Custom event or listener for "CSourcePython::NetworkIDValidated"

Discuss API design here.
Omega_K2
Senior Member
Posts: 227
Joined: Sat Jul 07, 2012 3:05 am
Location: Europe
Contact:

Custom event or listener for "CSourcePython::NetworkIDValidated"

Postby Omega_K2 » Tue Jul 02, 2013 4:08 pm

Es had an es_player_validated event - and SP should have some sort of equivalent, too. Either a listener or an event (though I think listener seems preferable), as this is very needed for any plugins running with a database that perform authentification with SteamIDs (-- especially caches - like retrieving player info from a db once they've connected)
Libraries: k2tools
Plugins (any): GSRPG (soon) | Pretty Status List | MySQLAds (soon)
Plugins (game-specific): None atm

If you happen to find a bug or need help, either post in the release threads or contact me in IRC gamesurge.net:6667 / #sourcepython
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Postby L'In20Cible » Wed Jul 03, 2013 12:40 am

I can,t check right now but I think ES is calling the event based on IServerPluginCallbacks::ClientActivated or PlayerFullyConnected (not sure of the names) but I know there is functions like that.
Omega_K2
Senior Member
Posts: 227
Joined: Sat Jul 07, 2012 3:05 am
Location: Europe
Contact:

Postby Omega_K2 » Wed Jul 03, 2013 9:00 am

Peeking at the code, it seems to be the proper one, also based on the values passed (name and networkid)

Code: Select all

//---------------------------------------------------------------------------------
// Purpose: called when a client is authenticated
//---------------------------------------------------------------------------------
PLUGIN_RESULT CSourcePython::NetworkIDValidated( const char *pszUserName, const char *pszNetworkID )
{
        return PLUGIN_CONTINUE;
}
Libraries: k2tools

Plugins (any): GSRPG (soon) | Pretty Status List | MySQLAds (soon)

Plugins (game-specific): None atm



If you happen to find a bug or need help, either post in the release threads or contact me in IRC gamesurge.net:6667 / #sourcepython
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Sun Jul 07, 2013 5:55 pm

Omega is right. EventScripts is firing this event in CEventScriptsPlugin::NetworkIDValidated().
Omega_K2
Senior Member
Posts: 227
Joined: Sat Jul 07, 2012 3:05 am
Location: Europe
Contact:

Postby Omega_K2 » Sat Sep 14, 2013 9:40 am

Libraries: k2tools

Plugins (any): GSRPG (soon) | Pretty Status List | MySQLAds (soon)

Plugins (game-specific): None atm



If you happen to find a bug or need help, either post in the release threads or contact me in IRC gamesurge.net:6667 / #sourcepython

Return to “API Design”

Who is online

Users browsing this forum: No registered users and 16 guests