Skip to content

Commit

Permalink
improve startup gmcp init
Browse files Browse the repository at this point in the history
  • Loading branch information
fiendish committed Apr 19, 2023
1 parent aa63b92 commit 283a661
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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

r2270 snapshot
- bug fix: Hopefully get better client startup/connect initialization of GMCP variables by deferring initial requests until first arrival.

r2269 snapshot
- new feature: aardwolf_colors.lua's StylesToColours will also return the closest x256 color code match if there isn't an exact one.

Expand Down
14 changes: 11 additions & 3 deletions MUSHclient/worlds/plugins/aard_GMCP_handler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ require "json"
require "serialize"
require "gmcphelper"
initialized = false
luacom = require "luacom"
if luacom then
wshell = luacom.CreateObject("WScript.Shell")
Expand Down Expand Up @@ -162,6 +164,11 @@ function OnPluginTelnetSubnegotiation (msg_type, data)
return
end
if not initialized then
fetch_all()
return
end
if GMCPDebug > 0 then ColourNote ("#FFAF00", "", utils.utf8convert(data)) end
local message, params = string.match (data, "([%a.]+)%s+(.*)")
Expand Down Expand Up @@ -260,16 +267,16 @@ end
function OnPluginInstall()
BroadcastPlugin(1, "reload") -- reload basically tells other plugins "clear all your gmcp data"
if IsConnected() then
-- pretend like we just logged in
OnPluginConnect()
-- pretend like we just connected
fetch_all()
end
end
function OnPluginSaveState()
SetVariable("GMCPDebug", GMCPDebug)
end
function OnPluginConnect()
function fetch_all()
Send_GMCP_Packet("config compact")
Send_GMCP_Packet("config prompt")
Send_GMCP_Packet("config xterm yes")
Expand All @@ -279,6 +286,7 @@ function OnPluginConnect()
Send_GMCP_Packet("request area")
Send_GMCP_Packet("request quest")
Send_GMCP_Packet("request group")
initialized = true
end
function OnPluginTelnetRequest (msg_type, data)
Expand Down

0 comments on commit 283a661

Please sign in to comment.