forked from juho-p/wot-debugserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
executable file
·39 lines (32 loc) · 868 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
XPM_MOD_VERSION = '1.2.1'
XPM_MOD_URL = 'https://github.com/juho-p/wot-debugserver'
XPM_MOD_UPDATE_URL = ''
XPM_GAME_VERSIONS = ['0.9.5']
run = True
import datetime
import tcprepl
def log(text):
ds = datetime.time.strftime(datetime.datetime.now().time(), '%H:%M')
print 'replserver %s: %s' % (ds, text)
def run_server():
log('run server...')
try:
while True:
tcprepl.run_repl()
log('REPL stopped, restarting...')
except:
log('* Crashed *')
import traceback
traceback.print_exc()
log('Server stopped!')
if run:
log('starting..')
try:
import threading
thread = threading.Thread(target=run_server, args=())
thread.setDaemon(True)
thread.start()
log('thread started..')
except:
import traceback
traceback.print_exc()