diff --git a/gpcm/login.go b/gpcm/login.go index d35531b..487ebd2 100644 --- a/gpcm/login.go +++ b/gpcm/login.go @@ -181,6 +181,7 @@ func (g *GameSpySession) login(command common.GameSpyCommand) { return } + deviceAuth := false if g.UnitCode == UnitCodeWii { if isLocalhost && !payloadVerExists && !signatureExists { // Players using the DNS, need patching using a QR2 exploit @@ -195,14 +196,17 @@ func (g *GameSpySession) login(command common.GameSpyCommand) { } g.NeedsExploit = true + deviceAuth = false } else { deviceId = g.verifyExLoginInfo(command, authToken) if deviceId == 0 { return } + deviceAuth = true } } else if g.UnitCode == UnitCodeDS { g.NeedsExploit = common.DoesGameNeedExploit(g.GameName) + deviceAuth = true } else { logging.Error(g.ModuleName, "Invalid unit code specified:", aurora.Cyan(unitcd)) g.replyError(ErrLogin) @@ -272,7 +276,7 @@ func (g *GameSpySession) login(command common.GameSpyCommand) { g.LoginTicket = common.MarshalGPCMLoginTicket(g.User.ProfileId) g.SessionKey = rand.Int31n(290000000) + 10000000 - g.DeviceAuthenticated = !g.NeedsExploit + g.DeviceAuthenticated = deviceAuth g.LoggedIn = true g.ModuleName = "GPCM:" + strconv.FormatInt(int64(g.User.ProfileId), 10) g.ModuleName += "/" + common.CalcFriendCodeString(g.User.ProfileId, "RMCJ") diff --git a/qr2/heartbeat.go b/qr2/heartbeat.go index 10373f2..abb98dd 100644 --- a/qr2/heartbeat.go +++ b/qr2/heartbeat.go @@ -117,9 +117,9 @@ func heartbeat(moduleName string, conn net.PacketConn, addr net.Addr, buffer []b sendChallenge(conn, addr, session, lookupAddr) } - if !session.ExploitReceived && session.Login != nil && session.Login.NeedsExploit { + if login := session.Login; !session.ExploitReceived && login != nil && session.Login.NeedsExploit { // The version of DWC in Mario Kart DS doesn't check matching status - if (!noIP && statechanged == "1") || payload["gamename"] == "mariokartds" { + if (!noIP && statechanged == "1") || login.GameCode == "AMCE" || login.GameCode == "AMCP" || login.GameCode == "AMCJ" { logging.Notice(moduleName, "Sending SBCM exploit to DNS patcher client") sendClientExploit(moduleName, session) } diff --git a/qr2/main.go b/qr2/main.go index c32438b..2385c90 100644 --- a/qr2/main.go +++ b/qr2/main.go @@ -150,6 +150,9 @@ func handleConnection(conn net.PacketConn, addr net.Addr, buffer []byte) { logging.Info(moduleName, "Command:", aurora.Yellow("CLIENT_EXPLOIT_ACK")) session.ExploitReceived = true + if login := session.Login; login != nil { + login.NeedsExploit = false + } break default: