def Player_Checkin():
'''Accepts json formatted request containing the teams TeamID, IP, and Port and pushes the info over to CheckinUpdate to be stored in the DB
json data should be in format {"TeamID": "Mudkips","IP": "192.168.0.1","Port": "5001"}
Example:
curl -H "Content-Type: application/json" -X POST -d '{"TeamID": "Mudkips","IP": "192.168.0.1","Port": "5001"}' http://localhost:5001/checkin/
'''
try:
checkin_resp = request.data
IP = checkin_resp.get('IP')
Port = checkin_resp.get('Port')
TeamID = checkin_resp.get('TeamID')
if IP and Port and TeamID is not None:
Token, key = CheckinUpdate(IP, Port, TeamID)
return {'Score Token': Token,
'Key': key}
else:
return {'Invalid': 'request'}
except:
return {'Invalid': 'request'}
评论列表
文章目录