Skip to content

Commit

Permalink
Merge branch 'development' into MUSHclient
Browse files Browse the repository at this point in the history
  • Loading branch information
fiendish committed Apr 18, 2018
2 parents 4802060 + bfcae4b commit bb6ce64
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 22 deletions.
3 changes: 3 additions & 0 deletions MUSHclient/AardwolfPackageChanges.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Aardwolf Client Package Major Changes List

r1991 snapshot
- bug fix: Ignore sleeping status telopt during login. It arrives at the wrong time.

r1990 snapshot
- bug fix: Fix a string/int comparison bug in the communication log's findTab function. Thanks Crowley.

Expand Down
2 changes: 1 addition & 1 deletion MUSHclient/lua/mw_theme_base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function DrawResizeTag(win, type, x1, y1)

local m = 2
local n = 2
if type == 2 then -- full
if (type == 2) or (type == "full") then
Draw3DRect(win, x1, y1, x2, y2, false)
while (x1+m < x2 and y1+n+1 < y2) do
WindowLine(win, x1+m-1, y2-2, x2-1, y1+n-2, THREE_D_HIGHLIGHT, 0, 1)
Expand Down
50 changes: 34 additions & 16 deletions MUSHclient/worlds/plugins/aard_GMCP_handler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,36 +143,53 @@ function OnPluginTelnetSubnegotiation (msg_type, data)
-- find where to insert the new data
local node = gmcpdata
local prev_node = nil
local prev_item = ""
for next_item in string.gmatch(message,"%a+") do
-- some messages don't have invariant structure, so always clear them
if (next_item == "room" and message ~= "room.wrongdir") -- don't let room.wrongdir erase current room info
or next_item == "comm" or next_item == "group" then
node[next_item] = nil
end
node[next_item] = node[next_item] or {}
prev_node = node
prev_item = next_item
node = node[next_item]
end
function clone(from, to)
for k,v in pairs(from) do
-- A loveletter.
-- Some GMCP messages are just messages, not state. The "current" comm.channel message isn't a meaningful
-- concept except in the exact moment it arrives, for example (though most recent might be).
-- Since room.area is not sent automatically, and is only ever sent in response to a request,
-- having seen a room.area message tells you only what the area details were for the area your
-- character was in at the time the request was processed, but has no relation to where you are
-- after or even to the area your character was in when the request was sent and especially not
-- to the actual transition from one area to the next. If you run 5e through an area entrance,
-- you would be 5 rooms deep into a new area before that area info arrives back to you, with
-- mismatching area info the whole way in.
-- (You send run 5e, you go e, new area in room.info triggers sending request for room.area, you go 4e,
-- room.area request seen by game, room.area response sent back, room.area response seen by client)
-- If you had also run back out of the area, then you'd also be receiving room.area information
-- after five moves for an area you are no longer in.
-- I do this next part for your own good.
if (message == "room.info") then
gmcpdata["room"] = {}
prev_node = gmcpdata["room"]
end
-- For some reason we've historically treated numbers as strings.
-- It's bad form, but we should preserve that behavior.
function stringify(things)
for k,v in pairs(things) do
if type(v) == "table" then
to[k] = to[k] or {}
clone(from[k], to[k])
stringify(v)
else
to[k] = tostring(v)
things[k] = tostring(v)
end
end
end
clone(t, node)
stringify(t)
prev_node[prev_item] = t
if GMCPDebug > 1 then
print ("gmcpdata serialized: " .. gmcpdata_as_string(""))
end
BroadcastPlugin(1,message)
BroadcastPlugin(1, message)
else
ColourNote("white","red","GMCP DATA ERROR: "..t)
end -- if
Expand Down Expand Up @@ -201,12 +218,13 @@ function OnPluginSaveState()
end
function OnPluginConnect()
GMCP_send("config xterm yes")
GMCP_send("rawcolor on")
GMCP_send("request char")
GMCP_send("request room")
GMCP_send("request area")
GMCP_send("request quest")
GMCP_send("request group")
GMCP_send("rawcolor on")
end
function OnPluginTelnetRequest (msg_type, data)
Expand Down
2 changes: 1 addition & 1 deletion MUSHclient/worlds/plugins/aard_Theme_Controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function apply_theme(theme)
end
function choose_theme()
res = utils.listbox("Which theme would you like to use?", "Choose Theme", list_themes(), theme_file)
res = utils.listbox("Which theme would you like to use?\r\n\r\nDo you have a custom theme that you want to share? Send it to Fiendish!", "Choose Theme", list_themes(), theme_file)
if res then
theme_file = res
SetVariable("theme_file", theme_file)
Expand Down
7 changes: 4 additions & 3 deletions MUSHclient/worlds/plugins/aard_channels_fiendish.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,19 @@ function makeRect(i)
end
end
function findTab(name)
function findTab(name_or_number)
-- prefer named tabs first
for i=1,num_tabs do
if tabs_names[i] and (tabs_names[i]:upper() == tostring(name):upper()) then
if tabs_names[i] and (tabs_names[i]:upper() == tostring(name_or_number):upper()) then
return i
end
end
-- but if the "name" is a number and there isn't a matching named tab,
-- pick that number tab.
for i=1,num_tabs do
if (tabs_names[i] == nil) and (tostring(i) == tostring(name)) then
if tostring(i) == tostring(name_or_number) then
return i
end
end
Expand Down
2 changes: 1 addition & 1 deletion MUSHclient/worlds/plugins/aard_prompt_fixer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function OnPluginTelnetOption(data)
if doinit then
local hexcodes = {
['6403'] = true,
['6409'] = true,
--['6409'] = true,
['640B'] = true
}
if hexcodes[utils.tohex(data)] then
Expand Down

0 comments on commit bb6ce64

Please sign in to comment.