Prevent remote-mode-forbidden actions server-side

Since some user interface buttons are disabled while in --remote mode,
they should also be disabled in aiserver.py so a malicious user can't
manually send those commands to the server.
This commit is contained in:
Gnome Ann 2021-09-01 13:55:25 -04:00
parent 8ae9304cda
commit 6bd6415749
1 changed files with 4 additions and 4 deletions

View File

@ -610,11 +610,11 @@ def get_message(msg):
deleterequest()
elif(msg['cmd'] == 'memory'):
togglememorymode()
elif(msg['cmd'] == 'savetofile'):
elif(not vars.remote and msg['cmd'] == 'savetofile'):
savetofile()
elif(msg['cmd'] == 'loadfromfile'):
elif(not vars.remote and msg['cmd'] == 'loadfromfile'):
loadfromfile()
elif(msg['cmd'] == 'import'):
elif(not vars.remote and msg['cmd'] == 'import'):
importRequest()
elif(msg['cmd'] == 'newgame'):
newGameRequest()
@ -755,7 +755,7 @@ def get_message(msg):
vars.adventure = msg['data']
settingschanged()
refresh_settings()
elif(msg['cmd'] == 'importwi'):
elif(not vars.remote and msg['cmd'] == 'importwi'):
wiimportrequest()
#==================================================================#