mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-08-20 07:34:32 -05:00
GPCM: Handle new wwfc_report command
This commit is contained in:
@@ -199,6 +199,7 @@ func handleRequest(conn net.Conn) {
|
||||
return
|
||||
}
|
||||
|
||||
commands = session.handleCommand("wwfc_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)
|
||||
|
||||
37
gpcm/report.go
Normal file
37
gpcm/report.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package gpcm
|
||||
|
||||
import (
|
||||
"wwfc/common"
|
||||
"wwfc/logging"
|
||||
"wwfc/qr2"
|
||||
|
||||
"github.com/logrusorgru/aurora/v3"
|
||||
)
|
||||
|
||||
func (g *GameSpySession) handleWWFCReport(command common.GameSpyCommand) {
|
||||
for key, value := range command.OtherValues {
|
||||
logging.Info(g.ModuleName, "WWFC Report:", aurora.Yellow(key))
|
||||
|
||||
switch key {
|
||||
case "mkw_user":
|
||||
if g.GameName != "mariokartwii" {
|
||||
logging.Warn(g.ModuleName, "Ignoring mkw_user packet from wrong game")
|
||||
continue
|
||||
}
|
||||
|
||||
packet, err := common.Base64DwcEncoding.DecodeString(value)
|
||||
if err != nil {
|
||||
logging.Error(g.ModuleName, "Error decoding mkw_user packet:", err.Error())
|
||||
continue
|
||||
}
|
||||
|
||||
if len(packet) != 0xC0 {
|
||||
logging.Error(g.ModuleName, "Invalid mkw_user packet length:", len(packet))
|
||||
continue
|
||||
}
|
||||
|
||||
qr2.ProcessUSER(g.User.ProfileId, g.QR2IP, packet)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,6 +252,10 @@ func CheckGPReservationAllowed(senderIP uint64, senderPid uint32, destPid uint32
|
||||
return checkReservationAllowed(moduleName, from, to, joinType)
|
||||
}
|
||||
|
||||
func ProcessUSER(senderPid uint32, senderIP uint64, packet []byte) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
// findNewServer attempts to find the new server/host in the group when the current server goes down.
|
||||
// If no server is found, the group's server pointer is set to nil.
|
||||
// Expects the mutex to be locked.
|
||||
|
||||
Reference in New Issue
Block a user