diff --git a/config/config_telnet.go b/config/config_telnet.go index d257d38..5c99d74 100644 --- a/config/config_telnet.go +++ b/config/config_telnet.go @@ -10,7 +10,7 @@ type Telnet struct { IsEnabled bool `toml:"enabled" desc:"Enable Telnet"` IsLegacy bool `toml:"legacy" desc:"EQEMU servers that run 0.8.0 versions need this set to true for item link support, everyone running any newer versions can leave it default (false)"` LinkChunk1Size int `toml:"link_chunk1_size" desc:"Size of item links. Can leave at 0, will dynamically detect, Secrets custom is 9. but RoF2 is 6. Titanium is 6. Left for super custom servers."` - LinkChunk2Size int `toml:"link_chunk2_size" desc:"Size of item links. Can leave at 0, will dynamically detect, Secrets custom is 71. but RoF2 is 50. Titanium is 39. Left for super custom servers."` + LinkChunk2Size int `toml:"link_chunk2_size" desc:"Size of item links. Can leave at 0, will dynamically detect, Secrets custom is 68. but RoF2 is 50. Titanium is 39. Left for super custom servers."` Host string `toml:"host" desc:"Address where telnet is found. By default, newer telnet clients will auto success on 127.0.0.1:9000"` Username string `toml:"username" desc:"Optional. Username to connect to telnet to. (By default, newer telnet clients will auto succeed if localhost)"` Password string `toml:"password" desc:"Optional. Password to connect to telnet to. (By default, newer telnet clients will auto succeed if localhost)"` diff --git a/telnet/telnet_msg.go b/telnet/telnet_msg.go index 32c9247..99d54ef 100644 --- a/telnet/telnet_msg.go +++ b/telnet/telnet_msg.go @@ -15,11 +15,11 @@ import ( var ( // legacy item links in titanium is 6, then 39 bytes - itemLink39 = regexp.MustCompile(`\x12([0-9A-Z]{6})[0-9A-Z]{39}([\+0-9A-Za-z-'` + "`" + `:.,!?* ]+)\x12`) + itemLink39 = regexp.MustCompile(`\x12([0-9A-Z]{6})[0-9A-Z]{39}([\+()0-9A-Za-z-'` + "`" + `:.,!?* ]+)\x12`) // rof2+ item links are 6, then 50 bytes - itemLink50 = regexp.MustCompile(`\x12([0-9A-Z]{6})[0-9A-Z]{50}([\+0-9A-Za-z-'` + "`" + `:.,!?* ]+)\x12`) + itemLink50 = regexp.MustCompile(`\x12([0-9A-Z]{6})[0-9A-Z]{50}([\+()0-9A-Za-z-'` + "`" + `:.,!?* ]+)\x12`) // custom secrets itemlinks (64bit) are 9, then 71 bytes - itemLink71 = regexp.MustCompile(`\x12([0-9A-Z]{9})[0-9A-Z]{71}([\+0-9A-Za-z-'` + "`" + `:.,!?* ]+)\x12`) + itemLink71 = regexp.MustCompile(`\x12([0-9A-Z]{9})[0-9A-Z]{68}([\+()0-9A-Za-z-'` + "`" + `:.,!?* ]+)\x12`) ) func (t *Telnet) convertLinks(message string) string { diff --git a/telnet/telnet_msg_test.go b/telnet/telnet_msg_test.go index c115132..4252641 100644 --- a/telnet/telnet_msg_test.go +++ b/telnet/telnet_msg_test.go @@ -30,8 +30,12 @@ func TestConvertLinks(t *testing.T) { messages := []test{ { name: "mask of tinkering x64", - input: "\x1200000046F00000000000000000000000000000000000000000000000000000000000000014D2720CMask of Tinkering\x12", - output: "http://test.com?itemid=1135 (Mask of Tinkering)", + input: "\x120000027180000000000000000000000000000000000000000000000000000000000003271C223Gold Ring (Latent)\x12", + output: "http://test.com?itemid=10008 (Gold Ring (Latent))", + }, { + name: "mask of tinkering x32", + input: "\r> \b\bShin says ooc, '\x1207A50C000000000000000000000000000000000000000000CC2F1766Infused 2 Handed Damage\x12'\n", + output: "> \u0008\u0008Shin says ooc, 'http://test.com?itemid=501004 (Infused 2 Handed Damage)'", }, { name: "no url test", input: `no url test`,