disable KQF command before G10

This commit is contained in:
wish
2023-11-27 21:59:58 +11:00
parent bc12f4cd3b
commit f0744b4040
2 changed files with 17 additions and 11 deletions

View File

@@ -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))
}
}
}
}

View File

@@ -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 <name>"
@@ -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 <name>"