mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 15:26:49 +01:00
Fix a vulnerability in password encryption
* There was an error in the encryption used to save passwords, now it's really harder to decrypt the password from the config file * Other minor changes
This commit is contained in:
@@ -82,6 +82,14 @@ function init()
|
||||
|
||||
g_keyboard.bindKeyDown('Ctrl+Shift+R', reloadScripts)
|
||||
|
||||
-- generate machine uuid, this is a security measure for storing passwords
|
||||
if not g_crypt.setMachineUUID(g_configs.get('uuid')) then
|
||||
local uuid = g_crypt.genUUID()
|
||||
g_crypt.setMachineUUID(uuid)
|
||||
g_configs.set('uuid', uuid)
|
||||
g_configs.save()
|
||||
end
|
||||
|
||||
connect(g_app, { onRun = startup })
|
||||
end
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ function refresh()
|
||||
|
||||
local contentsPanel = skillsWindow:getChildById('contentsPanel')
|
||||
skillsWindow:setContentMinimumHeight(44)
|
||||
skillsWindow:setContentMaximumHeight(contentsPanel:getChildrenRect().height)
|
||||
skillsWindow:setContentMaximumHeight(390)
|
||||
end
|
||||
|
||||
function offline()
|
||||
|
||||
@@ -79,7 +79,12 @@ function getIconImageClip(id)
|
||||
return (((id-1)%12)*SpelllistSettings[SpelllistProfile].iconSize.width) .. ' ' .. ((math.ceil(id/12)-1)*SpelllistSettings[SpelllistProfile].iconSize.height) .. ' ' .. SpelllistSettings[SpelllistProfile].iconSize.width .. ' ' .. SpelllistSettings[SpelllistProfile].iconSize.height
|
||||
end
|
||||
|
||||
function setOptions()
|
||||
function online()
|
||||
if g_game.getProtocolVersion() < 870 then
|
||||
spelllistButton:setVisible(false)
|
||||
else
|
||||
spelllistButton:setVisible(true)
|
||||
end
|
||||
if g_game.getProtocolVersion() >= 950 then -- Vocation is only send in newer clients
|
||||
spelllistWindow:getChildById('buttonFilterVocation'):setVisible(true)
|
||||
else
|
||||
@@ -87,11 +92,13 @@ function setOptions()
|
||||
end
|
||||
end
|
||||
|
||||
function init()
|
||||
if g_game.getProtocolVersion() < 870 then return end
|
||||
function offline()
|
||||
resetWindow()
|
||||
end
|
||||
|
||||
connect(g_game, { onGameStart = setOptions,
|
||||
onGameEnd = resetWindow })
|
||||
function init()
|
||||
connect(g_game, { onGameStart = online,
|
||||
onGameEnd = offline })
|
||||
|
||||
spelllistWindow = g_ui.displayUI('spelllist', modules.game_interface.getRightPanel())
|
||||
spelllistWindow:hide()
|
||||
@@ -157,17 +164,12 @@ function init()
|
||||
g_keyboard.bindKeyPress('Up', function() spellList:focusPreviousChild(KeyboardFocusReason) end, spelllistWindow)
|
||||
|
||||
initialiseSpelllist()
|
||||
setOptions()
|
||||
resizeWindow()
|
||||
end
|
||||
|
||||
function terminate()
|
||||
if g_game.getProtocolVersion() < 870 then return end
|
||||
|
||||
disconnect(g_game, { onGameStart = setOptions,
|
||||
onGameEnd = resetWindow,
|
||||
onSpellGroupCooldown = modules.game_interface.setGroupCooldown,
|
||||
onSpellCooldown = onSpellCooldown })
|
||||
disconnect(g_game, { onGameStart = online,
|
||||
onGameEnd = offline })
|
||||
|
||||
disconnect(spellList, { onChildFocusChange = function(self, focusedChild)
|
||||
if focusedChild == nil then return end
|
||||
|
||||
@@ -78,6 +78,7 @@ GameDiagonalAnimatedText = 34
|
||||
GameLoginPending = 35
|
||||
GameNewSpeedLaw = 36
|
||||
GameForceFirstAutoWalkStep = 37
|
||||
GameLoginUUID = 38
|
||||
|
||||
TextColors = {
|
||||
red = '#f55e5e', --'#c83200'
|
||||
|
||||
Reference in New Issue
Block a user