[Server] Remove result from the OnPlayerConnect callback

Now it's recommended to use tes3mp.Kick() function
experimental-mono
Koncord 6 years ago
parent f1e8569291
commit 20a7619a4a

@ -140,11 +140,10 @@ void Networking::processPlayerPacket(RakNet::Packet *packet)
{
player->setLoadState(Player::LOADED);
static constexpr unsigned int ident = Script::CallbackIdentity("OnPlayerConnect");
Script::CallBackReturn<ident> result = true;
Script::Call<ident>(result, Players::getPlayer(packet->guid)->getId());
unsigned short pid = Players::getPlayer(packet->guid)->getId();
Script::Call<Script::CallbackIdentity("OnPlayerConnect")>(pid);
if (!result)
if (player->getLoadState() == Player::KICKED) // kicked inside in OnPlayerConnect
{
playerPacketController->GetPacket(ID_USER_DISCONNECTED)->setPlayer(Players::getPlayer(packet->guid));
playerPacketController->GetPacket(ID_USER_DISCONNECTED)->Send(false);

@ -153,7 +153,7 @@ public:
{"OnServerInit", Function<void>()},
{"OnServerPostInit", Function<void>()},
{"OnServerExit", Function<void, bool>()},
{"OnPlayerConnect", Function<bool, unsigned short>()},
{"OnPlayerConnect", Function<void, unsigned short>()},
{"OnPlayerDisconnect", Function<void, unsigned short>()},
{"OnPlayerDeath", Function<void, unsigned short>()},
{"OnPlayerResurrect", Function<void, unsigned short>()},

Loading…
Cancel
Save