Using asynchronous queries in hooksSolved

Hello People!

Would like to know if there are elegant ways to use webrequest in hooks, for example hooks: CanPlayerLogin / CanBypassQueue. I would like to make 1 webrequest or 1 query to the database, rather than loading the whole list and asynchronously updating. Thanks in advance!

Web requests are not waited for, hooks will continue to process. You won't be able to cancel any hooks with web requests, but you can do things such as kicking the player after you have the result.

For example, I would like to implement a skip queue
For this there is a hook CanBypassQueue (Returning true will bypass the queue, returning nothing will by default queue the player) Is it possible beautifully load not all data, but specifically for this user?

Merged post

And little offtop, is there any way around this
(UnauthorizedAccessException: System access is restricted, you are not allowed to use System.Net.HttpWebRequest). I'm writing a plugin for my server and I don't think I'll hack myself)

I was already thinking of forking core. Can you please tell me why webrequest was implemented, via callback? Are there any pitfalls, am I stupid somewhere?)

I don't know personally, sorry. The original developer who implemented it isn't around.

The Response StreamData can be retrieved asynchronously, but for some reason there is no such implementation

kJyTRuGJuKhmlnf.jpg Wulf

I don't know personally, sorry. The original developer who implemented it isn't around.

No problem, you helped me a lot) Thank you very much for your help) 😙

Locked automatically