精華區beta mud_sanc 關於我們 聯絡資訊
【 OnPluginTelnetRequest 】 說明: This is called if the server sends IAC WILL x, or IAC DO x to the client. In that case the callback lets you decide whether or not to handle the protocol (eg. ATCP or ZMP). The following protocols are handled internally and may not cause a call to this function (in some cases for DO and in some cases for WILL): 1 (ECHO) - output echo on/off 3 (SGA) - Suppress Go Ahead 24 (TERMTYPE) - send terminal type 25 (EOR) - End Of Record 31 (NAWS) - Negotiate About Window Size 70 (MSSP) - MUD Server Status Protocol 85 (MCCP v1) - MUD Client Compression Protocol version 1 86 (MCCP v2) - MUD Client Compression Protocol version 2 91 (MXP) - MUD eXtension Protocol 102 (Aardwolf options) - used by Aardwolf MUD and some MUSHclient plugins If you return true then MUSHclient will send a positive response to the server and then call OnPluginTelnetRequest a second time with another code, as follows: If it initially called the plugin with "WILL" it will call back with " SENT_DO". If it initially called the plugin with "DO" it will call back with " SENT_WILL". This is because the positive response to WILL is DO, and the positive response to DO is WILL. This second call to OnPluginTelnetRequest lets you do extra processing after agreeing to the negotiation with the server, such as logging on to it. The OnPluginTelnetRequest function should return true to indicate it handled the message, or false if it did not. Once OnPluginTelnetRequest returns true in one plugin, no further plugins are checked. This is to stop multiple plugins logging in, as presumably a single login is all that is required. 如果伺服器發送 IAC WILL x 或 IAC DO x 到客戶端時被呼叫。在這種情況下 ,這個回傳可讓您決定是否要處理協議(如:ATCP 或 ZMP) 。以下協議採內部處 理可能導致不呼叫此功能(當 DO 和 WILL在某些情況時): 1 (ECHO) - output echo on/off 3 (SGA) - Suppress Go Ahead 24 (TERMTYPE) - Telnet 終端機類型 25 (EOR) - End Of Record 31 (NAWS) - 協商視窗大小 70 (MSSP) - MUD 伺服器狀態協議 85 (MCCP v1) - MUD 客戶端壓縮協議第 1 版 86 (MCCP V2) - MUD 客戶端壓縮協議第 2 版 91 (MXP) - MUD 擴展協議 102 (Aardwolf options) - 用於 Aardwolf MUD 和一些 MUSHclient Plugin 。 如果返回true ,那麼MUSHclient會送出積極地回應到伺服器,然後再次用另 一個程式碼呼叫 OnPluginTelnetRequest ,如下: 如果它最初以"WILL"呼叫 Plugins,將回傳"SENT_DO"。 如果它最初以"DO"呼叫 Plugins,將回傳"SENT_WILL"。 這是因為積極回應 WILL 的是 DO 、與積極回應 DO 的是 WILL。這種再次呼 叫 OnPluginTelnetRequest 能讓你做額外的處理,之後同意與伺服器的協議,如 :登入。 OnPluginTelnetRequest 函數應傳回true ,以表明它處理的訊息,或假的- 當它未有時。一旦 OnPluginTelnetRequest 在 Plugin 傳回 true,,沒有 Plugin 進一步檢查。這將停止多個 Plugin 登錄,想必單一登入會所有需要。 *無信心翻譯。 範例: function OnPluginTelnetRequest () 自訂內容 end function OnPluginTelnetRequest (type, data) if type == 200 and data == "WILL" then return true elseif type == 200 and data == "SENT_DO" then -- IAC SB 200 response IAC SE SendPkt ("255250200Server.Logon Nick255240") -- example only end -- if end -- function OnPluginTelnetRequest --==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--==-==--