2021-04-10 16:33:19 +05:30
|
|
|
|
2021-11-10 17:26:07 +05:30
|
|
|
import ba
|
|
|
|
|
import _ba
|
|
|
|
|
from chatHandle import handlechat
|
|
|
|
|
import setting
|
2021-11-14 17:02:13 +05:30
|
|
|
from tools import servercheck
|
2021-11-26 13:18:24 +05:30
|
|
|
from tools import ServerUpdate
|
2021-11-15 21:11:03 +05:30
|
|
|
import _thread
|
|
|
|
|
from stats import mystats
|
|
|
|
|
from datetime import datetime
|
|
|
|
|
from ba import _activity
|
|
|
|
|
|
2021-11-26 13:18:24 +05:30
|
|
|
from typing import Optional, Any
|
|
|
|
|
from spazmod import modifyspaz
|
|
|
|
|
from bastd.activity import dualteamscore
|
|
|
|
|
from bastd.activity import multiteamscore
|
|
|
|
|
from bastd.actor.zoomtext import ZoomText
|
|
|
|
|
# from tools import fireflies
|
2021-11-15 21:11:03 +05:30
|
|
|
settings = setting.get_settings_data()
|
|
|
|
|
|
2021-04-20 20:35:12 +05:30
|
|
|
def filter_chat_message(msg, client_id):
|
2021-11-10 17:26:07 +05:30
|
|
|
|
|
|
|
|
return handlechat.filter_chat_message(msg, client_id)
|
2021-04-02 14:00:25 +05:30
|
|
|
|
2021-04-10 16:33:19 +05:30
|
|
|
|
2021-04-02 14:00:25 +05:30
|
|
|
def on_app_launch():
|
2021-11-10 17:26:07 +05:30
|
|
|
from tools import whitelist
|
|
|
|
|
whitelist.Whitelist()
|
|
|
|
|
bootstraping()
|
2021-11-14 17:02:13 +05:30
|
|
|
servercheck.checkserver().start()
|
2021-11-26 13:18:24 +05:30
|
|
|
ServerUpdate.check()
|
|
|
|
|
|
2021-11-14 17:02:13 +05:30
|
|
|
|
2021-04-30 19:13:53 +05:30
|
|
|
|
2021-04-02 14:00:25 +05:30
|
|
|
#something
|
|
|
|
|
|
|
|
|
|
def score_screen_on_begin(_stats):
|
2021-04-07 03:58:40 +05:30
|
|
|
pass
|
2021-04-02 14:00:25 +05:30
|
|
|
#stats
|
|
|
|
|
|
|
|
|
|
def playerspaz_init(player):
|
2021-04-07 03:58:40 +05:30
|
|
|
pass
|
2021-04-02 14:00:25 +05:30
|
|
|
#add tag,rank,effect
|
2021-04-02 20:53:19 +05:30
|
|
|
|
2021-11-10 17:26:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def bootstraping():
|
2021-11-14 17:02:13 +05:30
|
|
|
|
2021-11-12 09:54:30 +05:30
|
|
|
#_ba.disconnect_client=new_disconnect
|
2021-11-15 21:11:03 +05:30
|
|
|
|
2021-11-10 17:26:07 +05:30
|
|
|
_ba.set_server_device_name(settings["HostDeviceName"])
|
|
|
|
|
_ba.set_server_name(settings["HostName"])
|
|
|
|
|
_ba.set_transparent_kickvote(settings["ShowKickVoteStarterName"])
|
|
|
|
|
_ba.set_kickvote_msg_type(settings["KickVoteMsgType"])
|
2021-11-15 21:11:03 +05:30
|
|
|
_thread.start_new_thread(mystats.refreshStats,())
|
|
|
|
|
|
2021-11-10 17:26:07 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def new_disconnect(clid,duration=120):
|
|
|
|
|
print("new new_disconnect")
|
|
|
|
|
_ba.ban_client(clid,duration)
|
|
|
|
|
|
2021-11-15 21:11:03 +05:30
|
|
|
org_begin=ba._activity.Activity.on_begin
|
|
|
|
|
def new_begin(self):
|
|
|
|
|
org_begin(self)
|
|
|
|
|
night_mode()
|
|
|
|
|
|
|
|
|
|
ba._activity.Activity.on_begin=new_begin
|
|
|
|
|
|
2021-11-26 13:18:24 +05:30
|
|
|
org_end=ba._activity.Activity.end
|
|
|
|
|
def new_end(self,results:Any=None,delay:float=0.0,force:bool=False):
|
|
|
|
|
|
|
|
|
|
org_end(self,results,delay,force)
|
|
|
|
|
ba._activity.Activity.end=new_end
|
|
|
|
|
|
2021-11-15 21:11:03 +05:30
|
|
|
|
|
|
|
|
def night_mode():
|
|
|
|
|
|
|
|
|
|
if(settings['autoNightMode']['enable']):
|
|
|
|
|
|
|
|
|
|
start=datetime.strptime(settings['autoNightMode']['startTime'],"%H:%M")
|
|
|
|
|
end=datetime.strptime(settings['autoNightMode']['endTime'],"%H:%M")
|
|
|
|
|
now=datetime.now()
|
|
|
|
|
|
|
|
|
|
if now.time() > start.time() or now.time() < end.time():
|
|
|
|
|
activity = _ba.get_foreground_host_activity()
|
2021-11-26 13:18:24 +05:30
|
|
|
|
|
|
|
|
activity.globalsnode.tint = (0.5, 0.7, 1.0)
|
|
|
|
|
|
|
|
|
|
# if settings['autoNightMode']['fireflies']:
|
|
|
|
|
# fireflies.factory()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|