From d5f4e393ed15eaeb6855dd128e9a273b4bbdb24e Mon Sep 17 00:00:00 2001 From: light <57009359+hauntii@users.noreply.github.com> Date: Thu, 6 Jul 2023 00:07:22 -0400 Subject: [PATCH] Update application data in gRPC notification --- grpc/send_incoming_call_notification.go | 6 ++---- nex/matchmake-extension/update_notification_data.go | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/grpc/send_incoming_call_notification.go b/grpc/send_incoming_call_notification.go index d7c12a6..9defd96 100644 --- a/grpc/send_incoming_call_notification.go +++ b/grpc/send_incoming_call_notification.go @@ -1,7 +1,6 @@ package grpc import ( - "bytes" "context" "encoding/binary" "log" @@ -25,14 +24,13 @@ func SendIncomingCallNotification(caller uint32, target uint32) { presence.GameKey = friends_wiiu_types.NewGameKey() presence.Unknown2 = 0x65 presence.GameServerID = 0x1005A000 - presence.PID = 4 // This is not a PID. + presence.PID = 1 // This is not a PID, but the amount of times the PID is repeated in bytes in the application data. presence.GatheringID = caller - // The application data here is the PID, repeated 4 times. Why, you ask? Who knows! targetBytes := make([]byte, 4) binary.BigEndian.PutUint32(targetBytes, target) - presence.ApplicationData = bytes.Repeat(targetBytes, 4) + presence.ApplicationData = targetBytes presence.GameKey.TitleID = 0x000500101005A100 presence.GameKey.TitleVersion = 55 diff --git a/nex/matchmake-extension/update_notification_data.go b/nex/matchmake-extension/update_notification_data.go index 0e7a7a5..c9e3e8e 100644 --- a/nex/matchmake-extension/update_notification_data.go +++ b/nex/matchmake-extension/update_notification_data.go @@ -1,8 +1,6 @@ package nex_matchmake_extension import ( - "log" - nex "github.com/PretendoNetwork/nex-go" "github.com/PretendoNetwork/wiiu-chat-secure/database" "github.com/PretendoNetwork/wiiu-chat-secure/globals" @@ -14,7 +12,7 @@ import ( ) func UpdateNotificationData(err error, client *nex.Client, callID uint32, uiType uint32, uiParam1 uint32, uiParam2 uint32, strParam string) { - log.Printf("uiType: %d, uiParam1: %d, uiParam2: %d, strParam: %s\r\n", uiType, uiParam1, uiParam2, strParam) + globals.Logger.Infof("uiType: %d, uiParam1: %d, uiParam2: %d, strParam: %s\r\n", uiType, uiParam1, uiParam2, strParam) recipientClient := globals.NEXServer.FindClientFromPID(uiParam2) if uiType == notifications.NotificationCategories.RequestJoinGathering {