diff --git a/game/engines/default/engine/PlayerProfile.lua b/game/engines/default/engine/PlayerProfile.lua index 8f6cf8f04caaa84e99946299a2ae0ae01a29c4eb..2606d4ae1782941a5859173112ed875dff92aac8 100644 --- a/game/engines/default/engine/PlayerProfile.lua +++ b/game/engines/default/engine/PlayerProfile.lua @@ -524,7 +524,7 @@ function _M:checkModuleHash(module, md5) if game and game:isTainted() then return nil, "savefile tainted" end core.profile.pushOrder(table.serialize{o="CheckModuleHash", module=module, md5=md5}) - self:waitEvent("CheckModuleHash", function(e) ok = e.ok end) + self:waitEvent("CheckModuleHash", function(e) ok = e.ok end, 10000) if not ok then return nil, "bad game version" end print("[ONLINE PROFILE] module hash is valid") @@ -543,7 +543,7 @@ function _M:registerNewCharacter(module) core.profile.pushOrder(table.serialize{o="RegisterNewCharacter", module=module}) local uuid = nil - self:waitEvent("RegisterNewCharacter", function(e) uuid = e.uuid end) + self:waitEvent("RegisterNewCharacter", function(e) uuid = e.uuid end, 10000) game:unregisterDialog(dialog) if not uuid then return end diff --git a/game/engines/default/engine/interface/PlayerDumpJSON.lua b/game/engines/default/engine/interface/PlayerDumpJSON.lua index ea31f63075c74dcae61e95e39108b0b084a2bcc6..bc9532eb9a1a10993a56b3b92fea6596564d8931 100644 --- a/game/engines/default/engine/interface/PlayerDumpJSON.lua +++ b/game/engines/default/engine/interface/PlayerDumpJSON.lua @@ -24,6 +24,8 @@ require "Json2" -- This is used for auto uploads to te4.org, could be for other stuff too module(..., package.seeall, class.make) +allow_late_uuid = false + --- Register the character on te4.org and return a UUID for it function _M:getUUID() local uuid = profile:registerNewCharacter(game.__mod_info.short_name) @@ -34,7 +36,11 @@ end --- Call this when a character is saved to upload data to te4.org function _M:saveUUID() - if not self.__te4_uuid then return end + if not self.__te4_uuid then + -- Try to grab an UUID even after char reg + if self.allow_late_uuid and not game:isTainted() then self:getUUID() end + if not self.__te4_uuid then return end + end local data = {sections={}} setmetatable(data, {__index={ newSection = function(self, display, table, type, column, sectable) diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index e0bcd20a6bd5901636039431922b71bff22408d4..182bd37748d434b090057d5af47924ab040c527c 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -159,7 +159,7 @@ function _M:run() end --- Checks if the current character is "tainted" by cheating -function _M:isTainted() +function _M:isTainted() do if config.settings.cheat then return true end return (game.player and game.player.__cheated) and true or false end @@ -494,18 +494,18 @@ function _M:changeLevel(lev, zone, keep_old_lev, force_down) if game.player:isTalentActive(game.player.T_JUMPGATE) then game.player:forceUseTalent(game.player.T_JUMPGATE, {ignore_energy=true}) end - + if game.player:isTalentActive(game.player.T_JUMPGATE_TWO) then game.player:forceUseTalent(game.player.T_JUMPGATE_TWO, {ignore_energy=true}) end -- clear chrono worlds and their various effects if game._chronoworlds then game._chronoworlds = nil end - + if game.player:isTalentActive(game.player.T_DOOR_TO_THE_PAST) then game.player:forceUseTalent(game.player.T_DOOR_TO_THE_PAST, {ignore_energy=true}) end - + local left_zone = self.zone if self.zone and self.zone.on_leave then diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 675448cc88244876f0d3b3ab7d56aa056dc12563..9a05fe7b87f0742f40c33904d4c062eebdf1fbd8 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -49,6 +49,9 @@ module(..., package.seeall, class.inherit( mod.class.interface.PartyDeath )) +-- Allow character registration even after birth +allow_late_uuid = true + function _M:init(t, no_default) t.display=t.display or '@' t.color_r=t.color_r or 230