1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-21 04:30:30 -05:00

add game log server

This commit is contained in:
RaidMax
2018-09-06 13:25:58 -05:00
parent 85f910272a
commit 8a721bb53a
23 changed files with 362 additions and 71 deletions

View File

@ -0,0 +1,17 @@
from flask_restful import Resource
from GameLogServer.log_reader import reader
from base64 import urlsafe_b64decode
class LogResource(Resource):
def get(self, path):
path = urlsafe_b64decode(path).decode('utf-8')
log_info = reader.read_file(path)
if not log_info:
print('could not read log file ' + path)
return {
'success' : log_info is not False,
'length': -1 if log_info is False else len(log_info),
'data': log_info
}