Commit dccf58be3feecce963f763fad86c64bbaa32a4b5

Authored by DarkGod
1 parent 4ffb745d

Use https links in ingame tooltips and server requests

Conflicts:
	game/modules/tome/init.lua
@@ -756,7 +756,7 @@ end @@ -756,7 +756,7 @@ end
756 756
757 function _M:registerNewCharacter(module) 757 function _M:registerNewCharacter(module)
758 if not self.auth or not self.hash_valid then return end 758 if not self.auth or not self.hash_valid then return end
759 - local dialog = Dialog:simpleWaiter("Registering character", "Character is being registered on http://te4.org/") 759 + local dialog = Dialog:simpleWaiter("Registering character", "Character is being registered on https://te4.org/")
760 core.display.forceRedraw() 760 core.display.forceRedraw()
761 761
762 core.profile.pushOrder(table.serialize{o="RegisterNewCharacter", module=module}) 762 core.profile.pushOrder(table.serialize{o="RegisterNewCharacter", module=module})
@@ -38,7 +38,7 @@ function _M:init(t) @@ -38,7 +38,7 @@ function _M:init(t)
38 self.custom_calls = t.custom_calls or {} 38 self.custom_calls = t.custom_calls or {}
39 if self.allow_login == nil then self.allow_login = true end 39 if self.allow_login == nil then self.allow_login = true end
40 40
41 - if self.allow_login and self.url:find("^http://te4%.org/") and profile.auth then 41 + if self.allow_login and (self.url:find("^http://te4%.org/") or self.url:find("^https://te4%.org/")) and profile.auth then
42 local param = "_te4ah="..profile.auth.hash.."&_te4ad="..profile.auth.drupid 42 local param = "_te4ah="..profile.auth.hash.."&_te4ad="..profile.auth.drupid
43 43
44 local first = self.url:find("?", 1, 1) 44 local first = self.url:find("?", 1, 1)
@@ -46,7 +46,7 @@ function _M:init(t) @@ -46,7 +46,7 @@ function _M:init(t)
46 else self.url = self.url.."?"..param end 46 else self.url = self.url.."?"..param end
47 end 47 end
48 48
49 - if self.url:find("^http://te4%.org/") then 49 + if self.url:find("^http://te4%.org/") or self.url:find("^https://te4%.org/") then
50 local param = "_te4" 50 local param = "_te4"
51 51
52 local first = self.url:find("?", 1, 1) 52 local first = self.url:find("?", 1, 1)
@@ -187,7 +187,7 @@ function _M:onDownload(handlers) @@ -187,7 +187,7 @@ function _M:onDownload(handlers)
187 local Dialog = require "engine.ui.Dialog" 187 local Dialog = require "engine.ui.Dialog"
188 188
189 handlers.on_download_request = function(downid, url, file, mime) 189 handlers.on_download_request = function(downid, url, file, mime)
190 - if mime == "application/t-engine-addon" and self.allow_downloads.addons and url:find("^http://te4%.org/") then 190 + if mime == "application/t-engine-addon" and self.allow_downloads.addons and (url:find("^http://te4%.org/") or url:find("^https://te4%.org/")) then
191 local path = fs.getRealPath("/addons/") 191 local path = fs.getRealPath("/addons/")
192 if path then 192 if path then
193 local name = file 193 local name = file
@@ -205,7 +205,7 @@ function _M:onDownload(handlers) @@ -205,7 +205,7 @@ function _M:onDownload(handlers)
205 end) 205 end)
206 return 206 return
207 end 207 end
208 - elseif mime == "application/t-engine-module" and self.allow_downloads.modules and url:find("^http://te4%.org/") then 208 + elseif mime == "application/t-engine-module" and self.allow_downloads.modules and (url:find("^http://te4%.org/") or url:find("^https://te4%.org/")) then
209 local path = fs.getRealPath("/modules/") 209 local path = fs.getRealPath("/modules/")
210 if path then 210 if path then
211 local name = file 211 local name = file
@@ -101,7 +101,7 @@ end @@ -101,7 +101,7 @@ end
101 101
102 function _M:makeWebtooltip() 102 function _M:makeWebtooltip()
103 self.webtooltip = require("engine.ui.WebView").new{width=380, height=500, has_frame=true, never_clean=true, allow_popup=true, 103 self.webtooltip = require("engine.ui.WebView").new{width=380, height=500, has_frame=true, never_clean=true, allow_popup=true,
104 - url = ("http://te4.org/tooltip-ingame?steam=%d&vM=%d&vm=%d&vp=%d"):format(core.steam and 1 or 0, engine.version[1], engine.version[2], engine.version[3]) 104 + url = ("https://te4.org/tooltip-ingame?steam=%d&vM=%d&vm=%d&vp=%d"):format(core.steam and 1 or 0, engine.version[1], engine.version[2], engine.version[3])
105 } 105 }
106 if self.webtooltip.unusable then 106 if self.webtooltip.unusable then
107 self.webtooltip = nil 107 self.webtooltip = nil
@@ -153,7 +153,7 @@ function _M:run() @@ -153,7 +153,7 @@ function _M:run()
153 if not self.news then 153 if not self.news then
154 self.news = { 154 self.news = {
155 title = "Welcome to T-Engine and the Tales of Maj'Eyal", 155 title = "Welcome to T-Engine and the Tales of Maj'Eyal",
156 - text = [[#GOLD#"Tales of Maj'Eyal"#WHITE# is the main game, you can also install more addons or modules by by going to http://te4.org/ 156 + text = [[#GOLD#"Tales of Maj'Eyal"#WHITE# is the main game, you can also install more addons or modules by by going to https://te4.org/
157 157
158 When inside a module remember you can press Escape to bring up a menu to change keybindings, resolution and other module specific options. 158 When inside a module remember you can press Escape to bring up a menu to change keybindings, resolution and other module specific options.
159 159
@@ -539,7 +539,7 @@ function _M:onQuit() @@ -539,7 +539,7 @@ function _M:onQuit()
539 end, "Quit", "Continue") 539 end, "Quit", "Continue")
540 end 540 end
541 541
542 -profile_help_text = [[#LIGHT_GREEN#T-Engine4#LAST# allows you to sync your player profile with the website #LIGHT_BLUE#http://te4.org/#LAST# 542 +profile_help_text = [[#LIGHT_GREEN#T-Engine4#LAST# allows you to sync your player profile with the website #LIGHT_BLUE#https://te4.org/#LAST#
543 543
544 This allows you to: 544 This allows you to:
545 * Play from several computers without having to copy unlocks and achievements. 545 * Play from several computers without having to copy unlocks and achievements.
@@ -548,7 +548,7 @@ This allows you to: @@ -548,7 +548,7 @@ This allows you to:
548 * Cool statistics for each module to help sharpen your gameplay style 548 * Cool statistics for each module to help sharpen your gameplay style
549 * Help the game developers balance and refine the game 549 * Help the game developers balance and refine the game
550 550
551 -You will also have a user page on http://te4.org/ where you can show off your achievements to your friends. 551 +You will also have a user page on https://te4.org/ where you can show off your achievements to your friends.
552 This is all optional, you are not forced to use this feature at all, but the developers would thank you if you did as it will make balancing easier. 552 This is all optional, you are not forced to use this feature at all, but the developers would thank you if you did as it will make balancing easier.
553 Online profile requires an internet connection, if not available it will wait and sync when it finds one.]] 553 Online profile requires an internet connection, if not available it will wait and sync when it finds one.]]
554 554
@@ -593,7 +593,7 @@ function _M:createProfile(loginItem) @@ -593,7 +593,7 @@ function _M:createProfile(loginItem)
593 end 593 end
594 else 594 else
595 self.auth_tried = nil 595 self.auth_tried = nil
596 - local d = Dialog:simpleWaiter("Registering...", "Registering on http://te4.org/, please wait...") core.display.forceRedraw() 596 + local d = Dialog:simpleWaiter("Registering...", "Registering on https://te4.org/, please wait...") core.display.forceRedraw()
597 local ok, err = profile:newProfile(loginItem.login, loginItem.name, loginItem.pass, loginItem.email, loginItem.news) 597 local ok, err = profile:newProfile(loginItem.login, loginItem.name, loginItem.pass, loginItem.email, loginItem.news)
598 profile:waitFirstAuth() 598 profile:waitFirstAuth()
599 d:done() 599 d:done()
@@ -601,9 +601,9 @@ function _M:createProfile(loginItem) @@ -601,9 +601,9 @@ function _M:createProfile(loginItem)
601 Dialog:simplePopup(self.justlogin and "Logged in!" or "Profile created!", "Your online profile is now active. Have fun!", function() end ) 601 Dialog:simplePopup(self.justlogin and "Logged in!" or "Profile created!", "Your online profile is now active. Have fun!", function() end )
602 else 602 else
603 if err ~= "unknown" and err then 603 if err ~= "unknown" and err then
604 - Dialog:simplePopup("Profile creation failed!", "Creation failed: "..err.." (you may also register on http://te4.org/)", function() end ) 604 + Dialog:simplePopup("Profile creation failed!", "Creation failed: "..err.." (you may also register on https://te4.org/)", function() end )
605 else 605 else
606 - Dialog:simplePopup("Profile creation failed!", "Try again in in a few moments, or try online at http://te4.org/", function() end ) 606 + Dialog:simplePopup("Profile creation failed!", "Try again in in a few moments, or try online at https://te4.org/", function() end )
607 end 607 end
608 end 608 end
609 end 609 end
@@ -32,11 +32,11 @@ function _M:init() @@ -32,11 +32,11 @@ function _M:init()
32 Dialog.init(self, "Configure Addons", game.w * 0.8, game.h * 0.8) 32 Dialog.init(self, "Configure Addons", game.w * 0.8, game.h * 0.8)
33 33
34 local webaddonload = function() 34 local webaddonload = function()
35 - local method, d = util.browserOpenUrl("http://te4.org/addons/tome", {steam=true}) 35 + local method, d = util.browserOpenUrl("https://te4.org/addons/tome", {steam=true})
36 if method == "webview" and d then d.unload = function() self:regen() end end 36 if method == "webview" and d then d.unload = function() self:regen() end end
37 end 37 end
38 local webdlcload = function() 38 local webdlcload = function()
39 - local method, d = util.browserOpenUrl("http://te4.org/tome/dlc", {steam=true}) 39 + local method, d = util.browserOpenUrl("https://te4.org/tome/dlc", {steam=true})
40 if method == "webview" and d then d.unload = function() self:regen() end end 40 if method == "webview" and d then d.unload = function() self:regen() end end
41 end 41 end
42 42
@@ -182,11 +182,11 @@ function _M:playSave(ignore_mod_compat) @@ -182,11 +182,11 @@ function _M:playSave(ignore_mod_compat)
182 Dialog:yesnoLongPopup("Incompatible savefile", [[Due to huge changes in 1.2.0 all previous savefiles will not work with it. 182 Dialog:yesnoLongPopup("Incompatible savefile", [[Due to huge changes in 1.2.0 all previous savefiles will not work with it.
183 This savefile requires a game version lower than 1.2.0 and thus can not be loaded. 183 This savefile requires a game version lower than 1.2.0 and thus can not be loaded.
184 184
185 -But despair not, if you wish to finish it you can simply download the old version corresponding to the savefile on #{italic}##LIGHT_BLUE#http://te4.org/download#WHITE##{normal}#. 185 +But despair not, if you wish to finish it you can simply download the old version corresponding to the savefile on #{italic}##LIGHT_BLUE#https://te4.org/download#WHITE##{normal}#.
186 186
187 We apologize for the annoyance, most of the time we try to keep compatibility but this once it was simply not possible.]], 187 We apologize for the annoyance, most of the time we try to keep compatibility but this once it was simply not possible.]],
188 700, function(ret) if ret then 188 700, function(ret) if ret then
189 - util.browserOpenUrl("http://te4.org/download", {webview=true, steam=true}) 189 + util.browserOpenUrl("https://te4.org/download", {webview=true, steam=true})
190 end end, "Go to download in your browser", "Cancel" 190 end end, "Go to download in your browser", "Cancel"
191 ) 191 )
192 return 192 return
@@ -244,17 +244,17 @@ function _M:installOldGame(version_string) @@ -244,17 +244,17 @@ function _M:installOldGame(version_string)
244 local dls = {} 244 local dls = {}
245 -- Later on we can request the server for a list, but heh 245 -- Later on we can request the server for a list, but heh
246 if version_string == "tome-1.2.5" then 246 if version_string == "tome-1.2.5" then
247 - dls[#dls+1] = {url="http://te4.org/dl/modules/tome/tome-1.2.5-gfx.team", name="tome-1.2.5-gfx.team"}  
248 - dls[#dls+1] = {url="http://te4.org/dl/modules/tome/tome-1.2.5-music.team", name="tome-1.2.5-music.team"}  
249 - dls[#dls+1] = {url="http://te4.org/dl/modules/tome/tome-1.2.5.team", name="tome-1.2.5.team"} 247 + dls[#dls+1] = {url="https://te4.org/dl/modules/tome/tome-1.2.5-gfx.team", name="tome-1.2.5-gfx.team"}
  248 + dls[#dls+1] = {url="https://te4.org/dl/modules/tome/tome-1.2.5-music.team", name="tome-1.2.5-music.team"}
  249 + dls[#dls+1] = {url="https://te4.org/dl/modules/tome/tome-1.2.5.team", name="tome-1.2.5.team"}
250 elseif version_string == "tome-1.3.3" then 250 elseif version_string == "tome-1.3.3" then
251 - dls[#dls+1] = {url="http://te4.org/dl/modules/tome/tome-1.3.3-gfx.team", name="tome-1.3.3-gfx.team"}  
252 - dls[#dls+1] = {url="http://te4.org/dl/modules/tome/tome-1.3.3-music.team", name="tome-1.3.3-music.team"}  
253 - dls[#dls+1] = {url="http://te4.org/dl/modules/tome/tome-1.3.3.team", name="tome-1.3.3.team"} 251 + dls[#dls+1] = {url="https://te4.org/dl/modules/tome/tome-1.3.3-gfx.team", name="tome-1.3.3-gfx.team"}
  252 + dls[#dls+1] = {url="https://te4.org/dl/modules/tome/tome-1.3.3-music.team", name="tome-1.3.3-music.team"}
  253 + dls[#dls+1] = {url="https://te4.org/dl/modules/tome/tome-1.3.3.team", name="tome-1.3.3.team"}
254 elseif version_string == "tome-1.4.9" then 254 elseif version_string == "tome-1.4.9" then
255 - dls[#dls+1] = {url="http://te4.org/dl/modules/tome/tome-1.4.9-gfx.team", name="tome-1.4.9-gfx.team"}  
256 - dls[#dls+1] = {url="http://te4.org/dl/modules/tome/tome-1.4.9-music.team", name="tome-1.4.9-music.team"}  
257 - dls[#dls+1] = {url="http://te4.org/dl/modules/tome/tome-1.4.9.team", name="tome-1.4.9.team"} 255 + dls[#dls+1] = {url="https://te4.org/dl/modules/tome/tome-1.4.9-gfx.team", name="tome-1.4.9-gfx.team"}
  256 + dls[#dls+1] = {url="https://te4.org/dl/modules/tome/tome-1.4.9-music.team", name="tome-1.4.9-music.team"}
  257 + dls[#dls+1] = {url="https://te4.org/dl/modules/tome/tome-1.4.9.team", name="tome-1.4.9.team"}
258 end 258 end
259 259
260 if #dls == 0 then 260 if #dls == 0 then
@@ -169,7 +169,7 @@ function _M:uiLoginSteam(uis) @@ -169,7 +169,7 @@ function _M:uiLoginSteam(uis)
169 end 169 end
170 170
171 function _M:uiStats(uis) 171 function _M:uiStats(uis)
172 - self.logged_url = "http://te4.org/users/"..profile.auth.page 172 + self.logged_url = "https://te4.org/users/"..profile.auth.page
173 local str1 = Textzone.new{auto_width=true, auto_height=true, text="#GOLD#Online Profile#WHITE#"} 173 local str1 = Textzone.new{auto_width=true, auto_height=true, text="#GOLD#Online Profile#WHITE#"}
174 local str2 = Textzone.new{auto_width=true, auto_height=true, text="#LIGHT_BLUE##{underline}#"..self.logged_url.."#LAST##{normal}#", fct=function() util.browserOpenUrl(self.logged_url, {is_external=true}) end} 174 local str2 = Textzone.new{auto_width=true, auto_height=true, text="#LIGHT_BLUE##{underline}#"..self.logged_url.."#LAST##{normal}#", fct=function() util.browserOpenUrl(self.logged_url, {is_external=true}) end}
175 175
@@ -36,7 +36,7 @@ function _M:init() @@ -36,7 +36,7 @@ function _M:init()
36 self.c_switch = Checkbox.new{default=false, width=math.floor(self.iw / 3 - 40), title="Show all versions", on_change=function() self:switch() end} 36 self.c_switch = Checkbox.new{default=false, width=math.floor(self.iw / 3 - 40), title="Show all versions", on_change=function() self:switch() end}
37 self.c_compat = Checkbox.new{default=false, width=math.floor(self.iw / 3 - 40), title="Show incompatible", on_change=function() self:switch() end} 37 self.c_compat = Checkbox.new{default=false, width=math.floor(self.iw / 3 - 40), title="Show incompatible", on_change=function() self:switch() end}
38 38
39 - local url = Textzone.new{text="You can get new games at\n#LIGHT_BLUE##{underline}#http://te4.org/games#{normal}#", auto_height=true, auto_width=true, fct=function() util.browserOpenUrl("http://te4.org/games") end} 39 + local url = Textzone.new{text="You can get new games at\n#LIGHT_BLUE##{underline}#https://te4.org/games#{normal}#", auto_height=true, auto_width=true, fct=function() util.browserOpenUrl("https://te4.org/games") end}
40 40
41 self:generateList() 41 self:generateList()
42 42
@@ -75,7 +75,7 @@ function _M:okclick() @@ -75,7 +75,7 @@ function _M:okclick()
75 return 75 return
76 end 76 end
77 77
78 - local d = self:simpleWaiter("Registering...", "Registering on http://te4.org/, please wait...") core.display.forceRedraw() 78 + local d = self:simpleWaiter("Registering...", "Registering on https://te4.org/, please wait...") core.display.forceRedraw()
79 d:timeout(30, function() Dialog:simplePopup("Steam", "Steam client not found.") end) 79 d:timeout(30, function() Dialog:simplePopup("Steam", "Steam client not found.") end)
80 core.steam.sessionTicket(function(ticket) 80 core.steam.sessionTicket(function(ticket)
81 if not ticket then 81 if not ticket then
@@ -128,7 +128,7 @@ function _M:updateAll() @@ -128,7 +128,7 @@ function _M:updateAll()
128 local fname = ("/tmp-dl/engines/%s-%d.%d.%d.teae"):format(eversion[4], eversion[1], eversion[2], eversion[3]) 128 local fname = ("/tmp-dl/engines/%s-%d.%d.%d.teae"):format(eversion[4], eversion[1], eversion[2], eversion[3])
129 local f = fs.open(fname, "w") 129 local f = fs.open(fname, "w")
130 130
131 - local url = ("http://te4.org/dl/engines/%s-%d.%d.%d.teae"):format(eversion[4], eversion[1], eversion[2], eversion[3]) 131 + local url = ("https://te4.org/dl/engines/%s-%d.%d.%d.teae"):format(eversion[4], eversion[1], eversion[2], eversion[3])
132 local d = DownloadDialog.new(("Downloading engine: %s"):format(next.name), url, function(chunk) 132 local d = DownloadDialog.new(("Downloading engine: %s"):format(next.name), url, function(chunk)
133 f:write(chunk) 133 f:write(chunk)
134 end, function(di, data) 134 end, function(di, data)
@@ -141,7 +141,7 @@ function _M:updateAll() @@ -141,7 +141,7 @@ function _M:updateAll()
141 local fname = ("/tmp-dl/modules/boot-%s-%d.%d.%d.team"):format(eversion[4], eversion[1], eversion[2], eversion[3]) 141 local fname = ("/tmp-dl/modules/boot-%s-%d.%d.%d.team"):format(eversion[4], eversion[1], eversion[2], eversion[3])
142 local f = fs.open(fname, "w") 142 local f = fs.open(fname, "w")
143 143
144 - local url = ("http://te4.org/dl/engines/boot-%s-%d.%d.%d.team"):format(eversion[4], eversion[1], eversion[2], eversion[3]) 144 + local url = ("https://te4.org/dl/engines/boot-%s-%d.%d.%d.team"):format(eversion[4], eversion[1], eversion[2], eversion[3])
145 local d = DownloadDialog.new(("Downloading engine boot menu: %s"):format(next.name), url, function(chunk) 145 local d = DownloadDialog.new(("Downloading engine boot menu: %s"):format(next.name), url, function(chunk)
146 f:write(chunk) 146 f:write(chunk)
147 end, function(di, data) 147 end, function(di, data)
@@ -446,7 +446,7 @@ function _M:drawDialog(kind, actor_to_compare) @@ -446,7 +446,7 @@ function _M:drawDialog(kind, actor_to_compare)
446 local dur_text = "" 446 local dur_text = ""
447 447
448 if player.__te4_uuid and profile.auth and profile.auth.drupid then 448 if player.__te4_uuid and profile.auth and profile.auth.drupid then
449 - local path = "http://te4.org/characters/"..profile.auth.drupid.."/tome/"..player.__te4_uuid 449 + local path = "https://te4.org/characters/"..profile.auth.drupid.."/tome/"..player.__te4_uuid
450 local LinkTxt = "Online URL: #LIGHT_BLUE##{underline}#"..path.."#{normal}#" 450 local LinkTxt = "Online URL: #LIGHT_BLUE##{underline}#"..path.."#{normal}#"
451 local Link_w, Link_h = self.font:size(LinkTxt) 451 local Link_w, Link_h = self.font:size(LinkTxt)
452 h = self.c_desc.h - Link_h 452 h = self.c_desc.h - Link_h
@@ -88,7 +88,7 @@ function _M:ok() @@ -88,7 +88,7 @@ function _M:ok()
88 88
89 if not inside then self:simplePopup("Thank you", "Thank you, a paypal page should now open in your browser.") end 89 if not inside then self:simplePopup("Thank you", "Thank you, a paypal page should now open in your browser.") end
90 90
91 - local url = ("http://te4.org/ingame-donate/%s/%s/%s/EUR/%s"):format(self.c_donate.number, self.c_recur.checked and "monthly" or "onetime", (profile.auth and profile.auth.drupid) and profile.auth.drupid or "0", self.donation_source) 91 + local url = ("https://te4.org/ingame-donate/%s/%s/%s/EUR/%s"):format(self.c_donate.number, self.c_recur.checked and "monthly" or "onetime", (profile.auth and profile.auth.drupid) and profile.auth.drupid or "0", self.donation_source)
92 92
93 if inside then util.browserOpenUrl(url, {is_external=true}) 93 if inside then util.browserOpenUrl(url, {is_external=true})
94 else util.browserOpenUrl(url, {webview=true, is_external=true}) end 94 else util.browserOpenUrl(url, {webview=true, is_external=true}) end
@@ -21,7 +21,7 @@ name = "T.o.M.E" @@ -21,7 +21,7 @@ name = "T.o.M.E"
21 long_name = "Tales of Maj'Eyal: Age of Ascendancy" 21 long_name = "Tales of Maj'Eyal: Age of Ascendancy"
22 short_name = "tome" 22 short_name = "tome"
23 author = { "DarkGod", "darkgod@te4.org" } 23 author = { "DarkGod", "darkgod@te4.org" }
24 -homepage = "http://te4.org/" 24 +homepage = "https://te4.org/"
25 version = {1,5,1} 25 version = {1,5,1}
26 engine = {1,5,1,"te4"} 26 engine = {1,5,1,"te4"}
27 description = [[ 27 description = [[