Fix loginInfo load

- Changed .xml -> .py because pack.Get does not allow .xml extension
- Added production guard to not be able to run python code with it
This commit is contained in:
Alaric
2026-02-17 15:56:23 +02:00
parent 6db7c72650
commit 3ce93bd99d

View File

@@ -16,6 +16,7 @@ import time
import serverCommandParser import serverCommandParser
import ime import ime
import uiScriptLocale import uiScriptLocale
import debugInfo
# Multi-language hot-reload system # Multi-language hot-reload system
from uilocaleselector import LocaleSelector from uilocaleselector import LocaleSelector
@@ -200,7 +201,8 @@ class LoginWindow(ui.ScriptWindow):
dbg.TraceError("SelectCharacterWindow.Open - __LoadScript Error") dbg.TraceError("SelectCharacterWindow.Open - __LoadScript Error")
return return
self.__LoadLoginInfo("loginInfo.xml") # Changed .xml -> .py because pack.Get does not allow .xml extension
self.__LoadLoginInfo("loginInfo.py")
if app.loggined: if app.loggined:
self.loginFailureFuncDict = { self.loginFailureFuncDict = {
@@ -324,7 +326,7 @@ class LoginWindow(ui.ScriptWindow):
def __LoadChannelInfo(self): def __LoadChannelInfo(self):
try: try:
with open("config/channel.inf") as file: with open("config/channel.inf", "r") as file:
lines=file.readlines() lines=file.readlines()
if len(lines)>0: if len(lines)>0:
@@ -680,7 +682,10 @@ class LoginWindow(ui.ScriptWindow):
self.serverInfo.SetText(name) self.serverInfo.SetText(name)
def __LoadLoginInfo(self, loginInfoFileName): def __LoadLoginInfo(self, loginInfoFileName):
# This should not work in production
if not debugInfo.IsDebugMode():
app.loggined = FALSE
else:
try: try:
loginInfo={} loginInfo={}
exec(compile(open(loginInfoFileName, "rb").read(), loginInfoFileName, 'exec'), loginInfo) exec(compile(open(loginInfoFileName, "rb").read(), loginInfoFileName, 'exec'), loginInfo)