Add CRASHREPORT, show contact form on panic/impossible
When calling panic() or impossible(), create the option of opening a browser window with most of the fields already populated. Code for MacOS and linux is included; other ports are affected by argument change to early_init which are done but not tested. To enable, define CRASHREPORT in config.h and set CRASHREPORTURL in sysconf to (for the moment at least) http[s]://www.nethack.org/common/contactcr.html Adds --grep-defined option to makedefs for Makefiles. Adds "bid" (binary identifier), an MD4 of the main nethack binary. This is ONLY for helping (in the future) contact.html to set the "NetHack from" field automatically for our own binaries. This can be faked, but the user can lie so nothing lost. There's nothing magic about MD4; other ports can use anything that prodcues a long apparently random string we can match against. - new option --bidshow for us to get the MD4 of a released binary so I can add it to the website. Only available in wizard mode and not in nethack.6. - typo macos -> macosx in hints file No support for packaging builds as I'm not sure what that would look like. Adds a javascript helper for MacOS. Adds a lua helper for linux (and builds and installs nhlua).
This commit is contained in:
1
win/share/.gitattributes
vendored
1
win/share/.gitattributes
vendored
@@ -1,2 +1,3 @@
|
||||
tile.doc NHSUBST
|
||||
*.lua NHSUBST
|
||||
* NH_filestag=(file%s_for_versions_using_optional_tiles)
|
||||
|
||||
38
win/share/nhcrashreport.lua
Executable file
38
win/share/nhcrashreport.lua
Executable file
@@ -0,0 +1,38 @@
|
||||
#!./nhlua
|
||||
-- NetHack 3.7 nhcrashreport.lua $NHDT-Date: 1693083824 2023/08/26 21:03:44 $ $NHDT-Branch: keni-crashweb2 $:$NHDT-Revision: 1.0 $
|
||||
-- Copyright (c) 2023 Kenneth Lorber
|
||||
-- NetHack may be freely redistributed. See license for details.
|
||||
|
||||
-- Call with URL then field value pairs. Opens a new browser window
|
||||
-- to: URL?field=value+field=value.....
|
||||
-- This program encodes the values; fieldnames don't require encoding.
|
||||
--
|
||||
-- Should be installed in the playground.
|
||||
|
||||
----
|
||||
-- from
|
||||
-- https://github.com/daurnimator/lua-http/blob/master/http/util.lua
|
||||
-- Encodes a character as a percent encoded string
|
||||
local function char_to_pchar(c)
|
||||
return string.format("%%%02X", c:byte(1,1))
|
||||
end
|
||||
-- encodeURIComponent escapes all characters except the following: alphabetic, decimal digits, - _ . ! ~ * ' ( )
|
||||
local function encodeURIComponent(str)
|
||||
return (str:gsub("[^%w%-_%.%!%~%*%'%(%)]", char_to_pchar))
|
||||
end
|
||||
----
|
||||
|
||||
function un20(str)
|
||||
return str:gsub("%%20","+")
|
||||
end
|
||||
|
||||
url = table.remove(arg,1) .. "?cos=1"; -- Start the query string and set mode
|
||||
while #arg > 0 do
|
||||
local field = table.remove(arg,1)
|
||||
local value = table.remove(arg,1)
|
||||
url = url .. "&" .. field .. "=" .. un20(encodeURIComponent(value))
|
||||
end
|
||||
--print("url='"..url.."'")
|
||||
cmd = '/usr/bin/xdg-open "'..url..'"'
|
||||
os.execute(cmd)
|
||||
os.exit()
|
||||
Reference in New Issue
Block a user