Fix infinite Queue
This commit is contained in:
parent
7cd308fae2
commit
cb80254e59
@ -15,6 +15,7 @@ namespace autojoin
|
||||
{
|
||||
|
||||
extern CatVar auto_queue;
|
||||
extern Timer queuetime;
|
||||
|
||||
void Update();
|
||||
void UpdateSearch();
|
||||
|
@ -46,6 +46,7 @@ bool UnassignedClass()
|
||||
}
|
||||
|
||||
Timer autoqueue_timer{};
|
||||
Timer queuetime{};
|
||||
Timer req_timer{};
|
||||
/*CatVar party_bypass(CV_SWITCH, "party_bypass", "0", "Party Bypass",
|
||||
"Bypass Party restrictions");*/
|
||||
@ -86,6 +87,8 @@ void UpdateSearch()
|
||||
tfmm::queue_leave();
|
||||
if (autoqueue_timer.test_and_set(60000))
|
||||
{
|
||||
if (!gc->BConnectedToMatchServer(false) && queuetime.test_and_set(10 * 1000 * 60))
|
||||
tfmm::queue_leave();
|
||||
if (gc && !gc->BConnectedToMatchServer(false))
|
||||
{
|
||||
logging::Info("Starting queue");
|
||||
|
@ -81,6 +81,7 @@ namespace hooked_methods
|
||||
|
||||
DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
|
||||
{
|
||||
hacks::shared::autojoin::queuetime.update();
|
||||
DelayTimer.update();
|
||||
#if not LAGBOT_MODE
|
||||
playerlist::Save();
|
||||
|
@ -12,6 +12,7 @@ namespace hooked_methods
|
||||
|
||||
DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_)
|
||||
{
|
||||
hacks::shared::autojoin::queuetime.update();
|
||||
need_name_change = true;
|
||||
#if not LAGBOT_MODE
|
||||
playerlist::Save();
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "common.hpp"
|
||||
#include "AutoJoin.hpp"
|
||||
|
||||
CatCommand cmd_queue_start("mm_queue_casual", "Start casual queue",
|
||||
[]() { tfmm::queue_start(); });
|
||||
@ -40,6 +41,7 @@ void queue_start()
|
||||
if (queue == 7)
|
||||
client->LoadSavedCasualCriteria();
|
||||
client->RequestQueueForMatch((int) queue);
|
||||
hacks::shared::autojoin::queuetime.update();
|
||||
}
|
||||
else
|
||||
logging::Info("queue_start: CTFPartyClient == null!");
|
||||
|
Reference in New Issue
Block a user