Send specific message to clients for invalid versions during log-in

This commit is contained in:
ppeb 2025-04-05 00:06:11 -05:00
parent 7ea395eec2
commit 4b97228080
No known key found for this signature in database
GPG Key ID: CC147AD1B3D318D0
3 changed files with 17 additions and 4 deletions

View File

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

View File

@ -1074,4 +1074,16 @@ var (
},
}
)
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",
},
}
)

View File

@ -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 = {