Help with AccountScript

Hello everyone,

I need help with a account script. I hope to have posted in the right section. I looked around the forum but I did not find much.

I need to disconnect the connection after a cheking. I’ve already the cheking, but I do not understand how to disconnect, because the WorldSession is not yet initialized. So the example below does not produce any effect. How to search a connection by accountId and disconnect?

Thanks for your help :slight_smile:

Whiroph

class Test_Accounts : public AccountScript { public: Test_Accounts() : AccountScript("Test_Accounts") { }; void OnAccountLogin(uint32 accountId) { if (accountId > 0) { if (WorldSession* sess = sWorld->FindSession(accountId)) { sess->KickPlayer(); } } } };