From 59a5b8115a8877a3066bb1e8912c5cb45baeca83 Mon Sep 17 00:00:00 2001 From: Henrique Santiago Date: Mon, 18 Feb 2013 22:18:10 -0300 Subject: [PATCH] Fix locale send, spelllist reload, few changes --- modules/client_locales/locales.lua | 3 +++ modules/corelib/const.lua | 1 + modules/game_healthinfo/healthinfo.otui | 2 +- modules/game_spelllist/spelllist.lua | 4 ++++ modules/gamelib/const.lua | 19 ++++++++++++------- modules/gamelib/protocollogin.lua | 8 ++++---- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/modules/client_locales/locales.lua b/modules/client_locales/locales.lua index aa620c2c..b0642f49 100644 --- a/modules/client_locales/locales.lua +++ b/modules/client_locales/locales.lua @@ -146,6 +146,9 @@ function setLocale(name) pwarning("Locale " .. name .. ' does not exist.') return false end + if currentLocale then + sendLocale(locale.name) + end currentLocale = locale g_settings.set('locale', name) if onLocaleChanged then onLocaleChanged(name) end diff --git a/modules/corelib/const.lua b/modules/corelib/const.lua index d4493333..d199530c 100644 --- a/modules/corelib/const.lua +++ b/modules/corelib/const.lua @@ -317,4 +317,5 @@ NetworkMessageTypes = { SoundChannels = { Music = 1, Ambient = 2, + Effect = 3, } diff --git a/modules/game_healthinfo/healthinfo.otui b/modules/game_healthinfo/healthinfo.otui index 4dc3783b..81b5fd3f 100644 --- a/modules/game_healthinfo/healthinfo.otui +++ b/modules/game_healthinfo/healthinfo.otui @@ -67,7 +67,7 @@ MiniWindow icon: /images/topbuttons/healthinfo id: healthInfoWindow !text: tr('Health Info') - height: 121 + height: 126 @onClose: modules.game_healthinfo.onMiniWindowClose() &save: true diff --git a/modules/game_spelllist/spelllist.lua b/modules/game_spelllist/spelllist.lua index d2facf65..e80e1bbd 100644 --- a/modules/game_spelllist/spelllist.lua +++ b/modules/game_spelllist/spelllist.lua @@ -161,6 +161,10 @@ function init() initialiseSpelllist() resizeWindow() + + if g_game.isOnline() then + online() + end end function terminate() diff --git a/modules/gamelib/const.lua b/modules/gamelib/const.lua index 8a001bbc..eaa5f789 100644 --- a/modules/gamelib/const.lua +++ b/modules/gamelib/const.lua @@ -92,7 +92,7 @@ TextColors = { --blue1 = '#6e50dc', --blue2 = '#3264c8', --blue3 = '#0096c8', - white = '#ffffff' --'#bebebe' + white = '#ffffff', --'#bebebe' } MessageModes = { @@ -146,7 +146,7 @@ MessageModes = { RVRAnswer = 47, RVRContinue = 48, Last = 49, - Invalid = 255 + Invalid = 255, } OTSERV_RSA = "1091201329673994292788609605089955415282375029027981291234687579" .. @@ -170,7 +170,7 @@ OsTypes = { Flash = 3, OtclientLinux = 10, OtclientWindows = 11, - OtclientMac = 12 + OtclientMac = 12, } PathFindResults = { @@ -178,26 +178,31 @@ PathFindResults = { Position = 1, Impossible = 2, TooFar = 3, - NoWay = 4 + NoWay = 4, } PathFindFlags = { AllowNullTiles = 1, AllowCreatures = 2, AllowNonPathable = 4, - AllowNonWalkable = 8 + AllowNonWalkable = 8, } VipState = { Offline = 0, Online = 1, - Pending = 2 + Pending = 2, } ExtendedIds = { Activate = 0, Locale = 1, - Ping = 2 + Ping = 2, + Sound = 3, + Game = 4, + Particles = 5, + MapShader = 6, + NeedsUpdate = 7 } -- @} diff --git a/modules/gamelib/protocollogin.lua b/modules/gamelib/protocollogin.lua index 9dca3479..065c6a15 100644 --- a/modules/gamelib/protocollogin.lua +++ b/modules/gamelib/protocollogin.lua @@ -25,7 +25,7 @@ function ProtocolLogin:cancelLogin() self:disconnect() end -function ProtocolLogin:sendLoginPacket(extended) +function ProtocolLogin:sendLoginPacket() local msg = OutputMessage.create() msg:addU8(ClientOpcodes.ClientEnterAccount) @@ -130,12 +130,12 @@ function ProtocolLogin:parseCharacterList(msg) character.worldName = msg:getString() character.worldIp = iptostring(msg:getU32()) character.worldPort = msg:getU16() - characters[i] = character - -- ?? if g_game.getProtocolVersion() >= 971 then - msg:getU8() + character.unknown = msg:getU8() end + + characters[i] = character end local account = {}