Closed hendrikgit closed 5 years ago
Best place to hook this in would be CNWSMessage::SendServerToPlayerCharList
(not really, but best place nwnx can easily access). If the script validation fails, should disconnect the player with something like
Globals::AppManager()->m_pServerExoApp->GetNetLayer()->DisconnectPlayer(playerId, some_strref, 1, "");
Expose the event when a player connects to the server to nwscript. The script should get the cdkey and playername and be able to return whether to accept the player or not. The call to the script should happen before it is possible to see contents of a servervault.
This would allow PWs to make custom checks against a database and make it for example easier to administrate players with 2 or more cdkeys and set to what playernames they may connect.
nwnx_tweak could be the plugin to add this to, if I read the discusion on discord correctly.