Reformat added record to use "wl:" namespace

This commit is contained in:
Palapeli
2025-03-06 04:56:10 -05:00
parent f1741b0718
commit 1212a4f64c
5 changed files with 13 additions and 14 deletions

View File

@@ -105,7 +105,7 @@ func GetUniqueUserID() uint64 {
func (user *User) UpdateProfile(pool *pgxpool.Pool, ctx context.Context, data map[string]string) {
firstName, firstNameExists := data["firstname"]
lastName, lastNameExists := data["lastname"]
openHost, openHostExists := data["wwfc_openhost"]
openHost, openHostExists := data["wl:oh"]
openHostBool := false
if openHostExists && openHost != "0" {
openHostBool = true

View File

@@ -468,12 +468,11 @@ func (err GPError) GetMessageTranslate(gameName string, region byte, lang byte,
errMsg = fmt.Sprintf(errMsg, wwfcMessage.ErrorCode, ngid, reason)
errMsgUTF16 := utf16.Encode([]rune(errMsg))
errMsgByteArray := common.UTF16ToByteArray(errMsgUTF16)
command.OtherValues["wwfc_errmsg"] = common.Base64DwcEncoding.EncodeToString(errMsgByteArray)
command.OtherValues["wl:errmsg"] = common.Base64DwcEncoding.EncodeToString(errMsgByteArray)
}
command.OtherValues["wwfc_err"] = strconv.Itoa(wwfcMessage.ErrorCode)
}
command.OtherValues["wl:err"] = strconv.Itoa(err.WWFCMessage.ErrorCode)
}
return common.CreateGameSpyMessage(command)

View File

@@ -182,11 +182,11 @@ func (g *GameSpySession) login(command common.GameSpyCommand) {
g.InGameName = ingamesn
g.UnitCode = unitcd
_, payloadVerExists := command.OtherValues["payload_ver"]
_, signatureExists := command.OtherValues["wwfc_sig"]
_, payloadVerExists := command.OtherValues["wl:ver"]
_, signatureExists := command.OtherValues["wl:sig"]
deviceId := uint32(0)
if hostPlatform, exists := command.OtherValues["wwfc_host"]; exists {
if hostPlatform, exists := command.OtherValues["wl:host"]; exists {
g.HostPlatform = hostPlatform
} else {
if g.UnitCode == UnitCodeDS {
@@ -329,7 +329,7 @@ func (g *GameSpySession) login(command common.GameSpyCommand) {
} else {
motdUTF16 := utf16.Encode([]rune(motd))
motdByteArray := common.UTF16ToByteArray(motdUTF16)
otherValues["wwfc_motd"] = common.Base64DwcEncoding.EncodeToString(motdByteArray)
otherValues["wl:motd"] = common.Base64DwcEncoding.EncodeToString(motdByteArray)
}
}
@@ -362,8 +362,8 @@ func (g *GameSpySession) exLogin(command common.GameSpyCommand) {
}
func (g *GameSpySession) verifyExLoginInfo(command common.GameSpyCommand, authToken string) uint32 {
payloadVer, payloadVerExists := command.OtherValues["payload_ver"]
signature, signatureExists := command.OtherValues["wwfc_sig"]
payloadVer, payloadVerExists := command.OtherValues["wl:ver"]
signature, signatureExists := command.OtherValues["wl:sig"]
deviceId := uint32(0)
if !payloadVerExists || payloadVer != "4" {

View File

@@ -235,7 +235,7 @@ func HandlePacket(index uint64, data []byte) {
common.SendPacket(ServerName, session.ConnIndex, []byte(`\ka\\final\`))
})
commands = session.handleCommand("login", commands, session.login)
commands = session.handleCommand("wwfc_exlogin", commands, session.exLogin)
commands = session.handleCommand("wl:exlogin", commands, session.exLogin)
commands = session.ignoreCommand("logout", commands)
if len(commands) != 0 && !session.LoggedIn {
@@ -244,7 +244,7 @@ func HandlePacket(index uint64, data []byte) {
return
}
commands = session.handleCommand("wwfc_report", commands, session.handleWWFCReport)
commands = session.handleCommand("wl:report", commands, session.handleWWFCReport)
commands = session.handleCommand("updatepro", commands, session.updateProfile)
commands = session.handleCommand("status", commands, session.setStatus)
commands = session.handleCommand("addbuddy", commands, session.addFriend)

View File

@@ -82,7 +82,7 @@ func (g *GameSpySession) getProfile(command common.GameSpyCommand) {
}
func (g *GameSpySession) updateProfile(command common.GameSpyCommand) {
if openHost, ok := command.OtherValues["wwfc_openhost"]; ok {
if openHost, ok := command.OtherValues["wl:oh"]; ok {
enabled := openHost != "0"
if !g.User.OpenHost && enabled {
g.openHostEnabled(true, true)