From 4b97228080fdf5f8f12efdac1b2fee86e52e7616 Mon Sep 17 00:00:00 2001 From: ppeb Date: Sat, 5 Apr 2025 00:06:11 -0500 Subject: [PATCH] Send specific message to clients for invalid versions during log-in --- gpcm/error.go | 4 ++-- gpcm/error_messages.go | 14 +++++++++++++- translations/gen_translations.lua | 3 ++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gpcm/error.go b/gpcm/error.go index 5700df3..7f8a6a7 100644 --- a/gpcm/error.go +++ b/gpcm/error.go @@ -89,7 +89,7 @@ var ( ErrLoginBadPackID = MakeGPError(0x010D, "The provided Pack ID was invalid.", true) ErrLoginBadPackVersion = MakeGPError(0x010E, "The provided Pack Version was invalid.", true) ErrLoginBadRegion = MakeGPError(0x0110, "The provided Region was invalid for the provided Pack ID.", true) - ErrLoginBadHash = MakeGPError(0x0111, "The hash for the provided Pack ID and Version was invalid.", true) + ErrLoginBadHash = GPError{0x0111, "The hash for the provided Pack ID and Version was invalid.", true, WWFCMsgInvalidHash, ""} // New user errors ErrNewUser = MakeGPError(0x0200, "There was an error creating a new user.", true) @@ -263,7 +263,7 @@ func (err GPError) GetMessageTranslate(gameName string, region byte, lang byte, func (g *GameSpySession) replyError(err GPError) { logging.Error(g.ModuleName, "Reply error:", err.ErrorString) - if !g.LoginInfoSet { + if !g.LoginInfoSet && err.ErrorCode != ErrLoginBadHash.ErrorCode { msg := err.GetMessage() // logging.Info(g.ModuleName, "Sending error message:", msg) common.SendPacket(ServerName, g.ConnIndex, []byte(msg)) diff --git a/gpcm/error_messages.go b/gpcm/error_messages.go index 5a25248..e592eef 100644 --- a/gpcm/error_messages.go +++ b/gpcm/error_messages.go @@ -1074,4 +1074,16 @@ var ( }, } -) \ No newline at end of file + WWFCMsgInvalidHash = WWFCErrorMessage{ + ErrorCode: 22010, + MessageRMC: map[byte]string{ + LangEnglish: "" + + "Invalid pack version!\n" + + "Please update or reinstall your pack\n" + + "to log in\n" + + "\n" + + "Error Code: %[1]d", + }, + } +) + diff --git a/translations/gen_translations.lua b/translations/gen_translations.lua index 0db9f36..d43850c 100644 --- a/translations/gen_translations.lua +++ b/translations/gen_translations.lua @@ -2,7 +2,7 @@ local http_request = require("http.request") local utils = require("./utils") local SHEETS_CSV_URL = - [[https://docs.google.com/spreadsheets/d/1kas1J6RcIePcaRRxtTluPZm8C8kydpaoQBtRg15M-zM/export?format=tsv&gid=1517055494#gid=1517055494]] +[[https://docs.google.com/spreadsheets/d/1kas1J6RcIePcaRRxtTluPZm8C8kydpaoQBtRg15M-zM/export?format=tsv&gid=1517055494#gid=1517055494]] local SHEET_LANG_TO_WWFC_LANG = { Japanese = "LangJapanese", @@ -49,6 +49,7 @@ local ORDERED_MESSAGES = { "WWFCMsgProfileIDInUse", "WWFCMsgPayloadInvalid", "WWFCMsgInvalidELO", + "WWFCMsgInvalidHash", } local ORDERED_LANGUAGES = {