#!/usr/bin/perl -w

# plus_off.pl
# (c) CWZ, LLC

# Daily rank update

use strict;
use lib '.';
use CWZ;

Exec: {

   qDb_do("UPDATE Plus SET active = 0");
   qDb_do("UPDATE Account SET sess = TRIM(BOTH ',' FROM REPLACE(CONCAT(',', sess, ','), ',plus:1,', ',')) WHERE sess IS NOT NULL AND FIND_IN_SET('plus:1', sess) > 0");
   qDb_do('INSERT INTO Console (id, ts, chan, aid, sid, pid, msg) VALUES (null, NOW(), 0, 0, 0, 0, "[Crypto Warz] System: Plus Mode has ended.")');

}
