mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 03:35:12 -06:00
bans: minor changes
This commit is contained in:
parent
6a05d84b04
commit
3c85a9e886
1 changed files with 5 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
|||
from direct.directnotify import DirectNotifyGlobal
|
||||
from toontown.uberdog.ClientServicesManagerUD import executeHttpRequest
|
||||
import datetime
|
||||
import time
|
||||
from direct.fsm.FSM import FSM
|
||||
from direct.distributed.PyDatagram import PyDatagram
|
||||
from direct.distributed.MsgTypes import *
|
||||
|
@ -22,9 +22,9 @@ class BanFSM(FSM):
|
|||
self.accountId = None
|
||||
self.avName = None
|
||||
|
||||
def performBan(self, bannedUntil):
|
||||
executeHttpRequest('accounts/ban/', Id=self.accountId, Release=bannedUntil,
|
||||
Reason=self.comment)
|
||||
def performBan(self, duration):
|
||||
executeHttpRequest('ban', username=self.accountId, start=int(time.time()),
|
||||
duration=duration, reason=self.comment, bannedby='todo')
|
||||
|
||||
def ejectPlayer(self):
|
||||
av = self.air.doId2do.get(self.avId)
|
||||
|
@ -49,15 +49,9 @@ class BanFSM(FSM):
|
|||
if not self.accountId:
|
||||
return
|
||||
|
||||
date = datetime.date.today()
|
||||
if simbase.config.GetBool('want-bans', True):
|
||||
if self.duration == 0:
|
||||
bannedUntil = "0000-00-00" # Terminated.
|
||||
else:
|
||||
bannedUntil = date + datetime.timedelta(days=self.duration)
|
||||
|
||||
self.performBan(self.duration)
|
||||
self.duration = None
|
||||
self.performBan(bannedUntil)
|
||||
|
||||
def getAvatarDetails(self):
|
||||
av = self.air.doId2do.get(self.avId)
|
||||
|
|
Loading…
Reference in a new issue