From f0744b4040cc82875532e83d8a698e866da6267b Mon Sep 17 00:00:00 2001 From: wish Date: Mon, 27 Nov 2023 21:59:58 +1100 Subject: [PATCH] disable KQF command before G10 --- server/channelserver/handlers_cast_binary.go | 26 +++++++++++--------- server/channelserver/sys_language.go | 2 ++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/server/channelserver/handlers_cast_binary.go b/server/channelserver/handlers_cast_binary.go index dbfafc68c..b6f260bf1 100644 --- a/server/channelserver/handlers_cast_binary.go +++ b/server/channelserver/handlers_cast_binary.go @@ -168,17 +168,21 @@ func parseChatCommand(s *Session, command string) { } case commands["KeyQuest"].Prefix: if commands["KeyQuest"].Enabled { - if len(args) > 1 { - if args[1] == "get" { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandKqfGet"], s.kqf)) - } else if args[1] == "set" { - if len(args) > 2 && len(args[2]) == 16 { - hexd, _ := hex.DecodeString(args[2]) - s.kqf = hexd - s.kqfOverride = true - sendServerChatMessage(s, s.server.dict["commandKqfSetSuccess"]) - } else { - sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandKqfSetError"], commands["KeyQuest"].Prefix)) + if s.server.erupeConfig.RealClientMode < _config.G10 { + sendServerChatMessage(s, s.server.dict["commandKqfVersion"]) + } else { + if len(args) > 1 { + if args[1] == "get" { + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandKqfGet"], s.kqf)) + } else if args[1] == "set" { + if len(args) > 2 && len(args[2]) == 16 { + hexd, _ := hex.DecodeString(args[2]) + s.kqf = hexd + s.kqfOverride = true + sendServerChatMessage(s, s.server.dict["commandKqfSetSuccess"]) + } else { + sendServerChatMessage(s, fmt.Sprintf(s.server.dict["commandKqfSetError"], commands["KeyQuest"].Prefix)) + } } } } diff --git a/server/channelserver/sys_language.go b/server/channelserver/sys_language.go index dbd48cfb8..df74e1212 100644 --- a/server/channelserver/sys_language.go +++ b/server/channelserver/sys_language.go @@ -12,6 +12,7 @@ func getLangStrings(s *Server) map[string]string { strings["commandKqfGet"] = "現在のキークエストフラグ:%x" strings["commandKqfSetError"] = "キークエコマンドエラー 例:%s set xxxxxxxxxxxxxxxx" strings["commandKqfSetSuccess"] = "キークエストのフラグが更新されました。ワールド/ランドを移動してください" + strings["commandKqfVersion"] = "This command is disabled prior to MHFG10" strings["commandRightsError"] = "コース更新コマンドエラー 例:%s x" strings["commandRightsSuccess"] = "コース情報を更新しました:%d" strings["commandCourseError"] = "コース確認コマンドエラー 例:%s " @@ -64,6 +65,7 @@ func getLangStrings(s *Server) map[string]string { strings["commandKqfGet"] = "KQF: %x" strings["commandKqfSetError"] = "Error in command. Format: %s set xxxxxxxxxxxxxxxx" strings["commandKqfSetSuccess"] = "KQF set, please switch Land/World" + strings["commandKqfVersion"] = "This command is disabled prior to MHFG10" strings["commandRightsError"] = "Error in command. Format: %s x" strings["commandRightsSuccess"] = "Set rights integer: %d" strings["commandCourseError"] = "Error in command. Format: %s "