mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-21 14:10:39 +01:00
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:
parent
8ae9304cda
commit
6bd6415749
@ -610,11 +610,11 @@ def get_message(msg):
|
|||||||
deleterequest()
|
deleterequest()
|
||||||
elif(msg['cmd'] == 'memory'):
|
elif(msg['cmd'] == 'memory'):
|
||||||
togglememorymode()
|
togglememorymode()
|
||||||
elif(msg['cmd'] == 'savetofile'):
|
elif(not vars.remote and msg['cmd'] == 'savetofile'):
|
||||||
savetofile()
|
savetofile()
|
||||||
elif(msg['cmd'] == 'loadfromfile'):
|
elif(not vars.remote and msg['cmd'] == 'loadfromfile'):
|
||||||
loadfromfile()
|
loadfromfile()
|
||||||
elif(msg['cmd'] == 'import'):
|
elif(not vars.remote and msg['cmd'] == 'import'):
|
||||||
importRequest()
|
importRequest()
|
||||||
elif(msg['cmd'] == 'newgame'):
|
elif(msg['cmd'] == 'newgame'):
|
||||||
newGameRequest()
|
newGameRequest()
|
||||||
@ -755,7 +755,7 @@ def get_message(msg):
|
|||||||
vars.adventure = msg['data']
|
vars.adventure = msg['data']
|
||||||
settingschanged()
|
settingschanged()
|
||||||
refresh_settings()
|
refresh_settings()
|
||||||
elif(msg['cmd'] == 'importwi'):
|
elif(not vars.remote and msg['cmd'] == 'importwi'):
|
||||||
wiimportrequest()
|
wiimportrequest()
|
||||||
|
|
||||||
#==================================================================#
|
#==================================================================#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user