Skip to content

Commit 4b97228

Browse files
committed
Send specific message to clients for invalid versions during log-in
1 parent 7ea395e commit 4b97228

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

gpcm/error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var (
8989
ErrLoginBadPackID = MakeGPError(0x010D, "The provided Pack ID was invalid.", true)
9090
ErrLoginBadPackVersion = MakeGPError(0x010E, "The provided Pack Version was invalid.", true)
9191
ErrLoginBadRegion = MakeGPError(0x0110, "The provided Region was invalid for the provided Pack ID.", true)
92-
ErrLoginBadHash = MakeGPError(0x0111, "The hash for the provided Pack ID and Version was invalid.", true)
92+
ErrLoginBadHash = GPError{0x0111, "The hash for the provided Pack ID and Version was invalid.", true, WWFCMsgInvalidHash, ""}
9393

9494
// New user errors
9595
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,
263263

264264
func (g *GameSpySession) replyError(err GPError) {
265265
logging.Error(g.ModuleName, "Reply error:", err.ErrorString)
266-
if !g.LoginInfoSet {
266+
if !g.LoginInfoSet && err.ErrorCode != ErrLoginBadHash.ErrorCode {
267267
msg := err.GetMessage()
268268
// logging.Info(g.ModuleName, "Sending error message:", msg)
269269
common.SendPacket(ServerName, g.ConnIndex, []byte(msg))

gpcm/error_messages.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,4 +1074,16 @@ var (
10741074
},
10751075
}
10761076

1077-
)
1077+
WWFCMsgInvalidHash = WWFCErrorMessage{
1078+
ErrorCode: 22010,
1079+
MessageRMC: map[byte]string{
1080+
LangEnglish: "" +
1081+
"Invalid pack version!\n" +
1082+
"Please update or reinstall your pack\n" +
1083+
"to log in\n" +
1084+
"\n" +
1085+
"Error Code: %[1]d",
1086+
},
1087+
}
1088+
)
1089+

translations/gen_translations.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ local http_request = require("http.request")
22
local utils = require("./utils")
33

44
local SHEETS_CSV_URL =
5-
[[https://docs.google.com/spreadsheets/d/1kas1J6RcIePcaRRxtTluPZm8C8kydpaoQBtRg15M-zM/export?format=tsv&gid=1517055494#gid=1517055494]]
5+
[[https://docs.google.com/spreadsheets/d/1kas1J6RcIePcaRRxtTluPZm8C8kydpaoQBtRg15M-zM/export?format=tsv&gid=1517055494#gid=1517055494]]
66

77
local SHEET_LANG_TO_WWFC_LANG = {
88
Japanese = "LangJapanese",
@@ -49,6 +49,7 @@ local ORDERED_MESSAGES = {
4949
"WWFCMsgProfileIDInUse",
5050
"WWFCMsgPayloadInvalid",
5151
"WWFCMsgInvalidELO",
52+
"WWFCMsgInvalidHash",
5253
}
5354

5455
local ORDERED_LANGUAGES = {

0 commit comments

Comments
 (0)