- 0
[ERRO] Meu otc com duas janela de loguin
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
-
Conteúdo Similar
-
- 3 respostas
- 3467 visualizações
-
- 0 respostas
- 2091 visualizações
-
- 0 respostas
- 2253 visualizações
-
- 0 respostas
- 1294 visualizações
-
- 0 respostas
- 2533 visualizações
-

Pergunta
amoxicilinaaaaa 5
Olá caros xtibianos, estou com um problema que pra mim e difícil mas pra muito de vocês pode ser simples, meu OTC quando abro ele aparece duas janelas para login. postarei a imagem e as .outi
Entergame.lua
EnterGame = { }G.host = "25.49.19.200"G.port = 7171G.protocolVersion = 854G.clientVersion = 854-- private variableslocal loadBoxlocal enterGamelocal motdWindowlocal motdButtonlocal enterGameButtonlocal motdEnabled = true-- private functionslocal function onError(protocol, message, errorCode) if loadBox then loadBox:destroy() loadBox = nil end -- if not errorCode then -- EnterGame.clearAccountFields() -- end local errorBox = displayErrorBox(tr('Login Error'), message) connect(errorBox, { onOk = EnterGame.show })endlocal function onMotd(protocol, motd) G.motdNumber = tonumber(motd:sub(0, motd:find("\n"))) G.motdMessage = motd:sub(motd:find("\n") + 1, #motd) if motdEnabled then motdButton:show() endendlocal function onCharacterList(protocol, characters, account) if enterGame:getChildById('rememberPasswordBox'):isChecked() then local account = g_crypt.encrypt(G.account) local password = g_crypt.encrypt(G.password) g_settings.set('account', account) g_settings.set('password', password) g_settings.set('autologin', enterGame:getChildById('autoLoginBox'):isChecked()) else EnterGame.clearAccountFields() end loadBox:destroy() loadBox = nil CharacterList.create(characters, account) CharacterList.show() if motdEnabled then local lastMotdNumber = g_settings.getNumber("motd") if G.motdNumber and G.motdNumber ~= lastMotdNumber then g_settings.set("motd", motdNumber) motdWindow = displayInfoBox(tr('Message of the day'), G.motdMessage) connect(motdWindow, { onOk = function() CharacterList.show() motdWindow = nil end }) CharacterList.hide() end endendlocal function onUpdateNeeded(protocol, signature) loadBox:destroy() loadBox = nil if EnterGame.updateFunc then local continueFunc = EnterGame.show local cancelFunc = EnterGame.show EnterGame.updateFunc(signature, continueFunc, cancelFunc) else local errorBox = displayErrorBox(tr('Update needed'), tr('Your client needs updating, try redownloading it.')) connect(errorBox, { onOk = EnterGame.show }) endend-- public functionsfunction EnterGame.init() enterGame = g_ui.displayUI('entergame') enterGameButton = modules.client_topmenu.addCustomLeftButton('enterGameButton', tr('Login') .. ' (Ctrl + G)', '/images/ui/pxg/topMenu_icons/entrar_icon', EnterGame.openWindow, false) motdButton = modules.client_topmenu.addCustomLeftButton('motdButton', tr('Message of the day'), '/images/ui/pxg/topMenu_icons/news_icon', EnterGame.displayMotd, false) motdButton:hide() g_keyboard.bindKeyDown('Ctrl+G', EnterGame.openWindow) if motdEnabled and G.motdNumber then motdButton:show() end local account = g_settings.get('account') local password = g_settings.get('password') local autologin = g_settings.getBoolean('autologin') EnterGame.setAccountName(account) EnterGame.setPassword(password) enterGame:getChildById('autoLoginBox'):setChecked(autologin) enterGame:hide() -- só usa quando recarrega o module -- if g_app.isRunning() and not g_game.isOnline() then -- enterGame:show() -- endendfunction EnterGame.firstShow() EnterGame.show() local account = g_crypt.decrypt(g_settings.get('account')) local password = g_crypt.decrypt(g_settings.get('password')) local autologin = g_settings.getBoolean('autologin') if #password > 0 and #account > 0 and autologin then addEvent(function() if not g_settings.getBoolean('autologin') then return end EnterGame.doLogin() end) endendfunction EnterGame.terminate() g_keyboard.unbindKeyDown('Ctrl+G') enterGame:destroy() enterGame = nil enterGameButton:destroy() enterGameButton = nil if motdWindow then motdWindow:destroy() motdWindow = nil end if motdButton then motdButton:destroy() motdButton = nil end if loadBox then loadBox:destroy() loadBox = nil end if protocolLogin then protocolLogin:cancelLogin() protocolLogin = nil end EnterGame = nilendfunction EnterGame.show() if loadBox then return end enterGame:show() enterGame:raise() enterGame:focus()endfunction EnterGame.hide() enterGame:hide()endfunction EnterGame.openWindow() if g_game.isOnline() then CharacterList.show() elseif not g_game.isLogging() and not CharacterList.isVisible() then EnterGame.show() endendfunction EnterGame.setAccountName(account) local account = g_crypt.decrypt(account) enterGame:getChildById('accountNameTextEdit'):setText(account) enterGame:getChildById('accountNameTextEdit'):setCursorPos(-1) enterGame:getChildById('rememberPasswordBox'):setChecked(#account > 0)endfunction EnterGame.setPassword(password) local password = g_crypt.decrypt(password) enterGame:getChildById('accountPasswordTextEdit'):setText(password)endfunction EnterGame.clearAccountFields() enterGame:getChildById('accountNameTextEdit'):clearText() enterGame:getChildById('accountPasswordTextEdit'):clearText() enterGame:getChildById('accountNameTextEdit'):focus() g_settings.remove('account') g_settings.remove('password')endfunction EnterGame.doLogin() G.account = enterGame:getChildById('accountNameTextEdit'):getText() G.password = enterGame:getChildById('accountPasswordTextEdit'):getText() EnterGame.hide() if g_game.isOnline() then local errorBox = displayErrorBox(tr('Login Error'), tr('Cannot login while already in game.')) connect(errorBox, { onOk = EnterGame.show }) return end protocolLogin = ProtocolLogin.create() protocolLogin.onLoginError = onError protocolLogin.onMotd = onMotd protocolLogin.onCharacterList = onCharacterList protocolLogin.onUpdateNeeded = onUpdateNeeded loadBox = displayCancelBox(tr('Please wait'), tr('Connecting to login server...')) connect(loadBox, { onCancel = function(msgbox) loadBox = nil protocolLogin:cancelLogin() EnterGame.show() end }) g_game.chooseRsa(G.host) g_game.setClientVersion(G.clientVersion) g_game.setProtocolVersion(G.protocolVersion) if modules.game_things.isLoaded() then protocolLogin:login(G.host, G.port, G.account, G.password) else loadBox:destroy() loadBox = nil EnterGame.show() endendfunction EnterGame.displayMotd() if not motdWindow then motdWindow = displayInfoBox(tr('Message of the day'), G.motdMessage) motdWindow.onOk = function() motdWindow = nil end endendfunction EnterGame.disableMotd() motdEnabled = false motdButton:hide()endentergame.otui
Logo < UIImageView image-source: /images/entergame image-smooth: false image-fixed-ratio: false size: 236 82EnterGameWindow < MainWindow size: 269 280EnterGameButton < Button width: 64EnterGameWindow id: enterGame !text: tr('Enter Game') @onEnter: EnterGame.doLogin() Logo anchors.left: parent.left anchors.top: parent.top MenuLabel !text: tr('Conta') anchors.left: parent.left anchors.top: parent.top margin-top: 87 text-auto-resize: true TextEdit id: accountNameTextEdit anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom margin-top: 2 MenuLabel !text: tr('Senha') anchors.left: prev.left anchors.top: prev.bottom margin-top: 8 text-auto-resize: true PasswordTextEdit id: accountPasswordTextEdit anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom margin-top: 2 CheckBox id: rememberPasswordBox !text: tr('Remember password') !tooltip: tr('Remember account and password when starts client') anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom margin-top: 10 @onCheckChange: self:getParent():getChildById('autoLoginBox'):setEnabled(self:isChecked()) CheckBox id: autoLoginBox enabled: false !text: tr('Auto login') !tooltip: tr('Open charlist automatically when starting client') anchors.left: parent.left anchors.right: parent.right anchors.top: prev.bottom margin-top: 2 EnterGameButton !text: tr('Entrar') anchors.right: parent.right anchors.bottom: parent.bottom @onClick: EnterGame.doLogin()Caso seja necessário algum outro para o bom entendedor do problema apenas me diga onde e como fazer.
Editado por amoxicilinaaaaaLink para o comentário
https://xtibia.com/forum/topic/243610-erro-meu-otc-com-duas-janela-de-loguin/Compartilhar em outros sites
8 respostass a esta questão
Posts Recomendados