From 7aef2f1750508e863f15e889e2c50bd27effdcc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sat, 20 Apr 2024 13:43:13 +0100 Subject: [PATCH] notifications/3ds: Send events to the target user --- notifications/3ds/send_comment_update.go | 8 ++++---- notifications/3ds/send_favorite_update.go | 8 ++++---- notifications/3ds/send_mii_notification.go | 8 ++++---- notifications/3ds/send_presence_update.go | 8 ++++---- notifications/3ds/send_user_went_offline.go | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/notifications/3ds/send_comment_update.go b/notifications/3ds/send_comment_update.go index 179e671..3058a13 100644 --- a/notifications/3ds/send_comment_update.go +++ b/notifications/3ds/send_comment_update.go @@ -49,15 +49,15 @@ func SendCommentUpdate(connection *nex.PRUDPConnection, comment string) { connectedUser, ok := globals.ConnectedUsers.Get(friend.PID.LegacyValue()) if ok && connectedUser != nil { - requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connection, nil) + requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connectedUser.Connection, nil) requestPacket.SetType(constants.DataPacket) requestPacket.AddFlag(constants.PacketFlagNeedsAck) requestPacket.AddFlag(constants.PacketFlagReliable) - requestPacket.SetSourceVirtualPortStreamType(connection.StreamType) + requestPacket.SetSourceVirtualPortStreamType(connectedUser.Connection.StreamType) requestPacket.SetSourceVirtualPortStreamID(globals.SecureEndpoint.StreamID) - requestPacket.SetDestinationVirtualPortStreamType(connection.StreamType) - requestPacket.SetDestinationVirtualPortStreamID(connection.StreamID) + requestPacket.SetDestinationVirtualPortStreamType(connectedUser.Connection.StreamType) + requestPacket.SetDestinationVirtualPortStreamID(connectedUser.Connection.StreamID) requestPacket.SetPayload(notificationRequestBytes) globals.SecureServer.Send(requestPacket) diff --git a/notifications/3ds/send_favorite_update.go b/notifications/3ds/send_favorite_update.go index dee92ce..a789096 100644 --- a/notifications/3ds/send_favorite_update.go +++ b/notifications/3ds/send_favorite_update.go @@ -46,15 +46,15 @@ func SendFavoriteUpdate(connection *nex.PRUDPConnection, gameKey *friends_3ds_ty connectedUser, ok := globals.ConnectedUsers.Get(friend.PID.LegacyValue()) if ok && connectedUser != nil { - requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connection, nil) + requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connectedUser.Connection, nil) requestPacket.SetType(constants.DataPacket) requestPacket.AddFlag(constants.PacketFlagNeedsAck) requestPacket.AddFlag(constants.PacketFlagReliable) - requestPacket.SetSourceVirtualPortStreamType(connection.StreamType) + requestPacket.SetSourceVirtualPortStreamType(connectedUser.Connection.StreamType) requestPacket.SetSourceVirtualPortStreamID(globals.SecureEndpoint.StreamID) - requestPacket.SetDestinationVirtualPortStreamType(connection.StreamType) - requestPacket.SetDestinationVirtualPortStreamID(connection.StreamID) + requestPacket.SetDestinationVirtualPortStreamType(connectedUser.Connection.StreamType) + requestPacket.SetDestinationVirtualPortStreamID(connectedUser.Connection.StreamID) requestPacket.SetPayload(notificationRequestBytes) globals.SecureServer.Send(requestPacket) diff --git a/notifications/3ds/send_mii_notification.go b/notifications/3ds/send_mii_notification.go index 7675fec..d953e9b 100644 --- a/notifications/3ds/send_mii_notification.go +++ b/notifications/3ds/send_mii_notification.go @@ -48,15 +48,15 @@ func SendMiiUpdateNotification(connection *nex.PRUDPConnection) { connectedUser, ok := globals.ConnectedUsers.Get(friend.PID.LegacyValue()) if ok && connectedUser != nil { - requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connection, nil) + requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connectedUser.Connection, nil) requestPacket.SetType(constants.DataPacket) requestPacket.AddFlag(constants.PacketFlagNeedsAck) requestPacket.AddFlag(constants.PacketFlagReliable) - requestPacket.SetSourceVirtualPortStreamType(connection.StreamType) + requestPacket.SetSourceVirtualPortStreamType(connectedUser.Connection.StreamType) requestPacket.SetSourceVirtualPortStreamID(globals.SecureEndpoint.StreamID) - requestPacket.SetDestinationVirtualPortStreamType(connection.StreamType) - requestPacket.SetDestinationVirtualPortStreamID(connection.StreamID) + requestPacket.SetDestinationVirtualPortStreamType(connectedUser.Connection.StreamType) + requestPacket.SetDestinationVirtualPortStreamID(connectedUser.Connection.StreamID) requestPacket.SetPayload(notificationRequestBytes) globals.SecureServer.Send(requestPacket) diff --git a/notifications/3ds/send_presence_update.go b/notifications/3ds/send_presence_update.go index 6cd76ae..429f2b4 100644 --- a/notifications/3ds/send_presence_update.go +++ b/notifications/3ds/send_presence_update.go @@ -46,15 +46,15 @@ func SendPresenceUpdate(connection *nex.PRUDPConnection, presence *friends_3ds_t connectedUser, ok := globals.ConnectedUsers.Get(friend.PID.LegacyValue()) if ok && connectedUser != nil { - requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connection, nil) + requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connectedUser.Connection, nil) requestPacket.SetType(constants.DataPacket) requestPacket.AddFlag(constants.PacketFlagNeedsAck) requestPacket.AddFlag(constants.PacketFlagReliable) - requestPacket.SetSourceVirtualPortStreamType(connection.StreamType) + requestPacket.SetSourceVirtualPortStreamType(connectedUser.Connection.StreamType) requestPacket.SetSourceVirtualPortStreamID(globals.SecureEndpoint.StreamID) - requestPacket.SetDestinationVirtualPortStreamType(connection.StreamType) - requestPacket.SetDestinationVirtualPortStreamID(connection.StreamID) + requestPacket.SetDestinationVirtualPortStreamType(connectedUser.Connection.StreamType) + requestPacket.SetDestinationVirtualPortStreamID(connectedUser.Connection.StreamID) requestPacket.SetPayload(notificationRequestBytes) globals.SecureServer.Send(requestPacket) diff --git a/notifications/3ds/send_user_went_offline.go b/notifications/3ds/send_user_went_offline.go index 3d64306..bddad11 100644 --- a/notifications/3ds/send_user_went_offline.go +++ b/notifications/3ds/send_user_went_offline.go @@ -55,15 +55,15 @@ func SendUserWentOffline(connection *nex.PRUDPConnection, pid *types.PID) { connectedUser, ok := globals.ConnectedUsers.Get(pid.LegacyValue()) if ok && connectedUser != nil { - requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connection, nil) + requestPacket, _ := nex.NewPRUDPPacketV0(globals.SecureEndpoint.Server, connectedUser.Connection, nil) requestPacket.SetType(constants.DataPacket) requestPacket.AddFlag(constants.PacketFlagNeedsAck) requestPacket.AddFlag(constants.PacketFlagReliable) - requestPacket.SetSourceVirtualPortStreamType(connection.StreamType) + requestPacket.SetSourceVirtualPortStreamType(connectedUser.Connection.StreamType) requestPacket.SetSourceVirtualPortStreamID(globals.SecureEndpoint.StreamID) - requestPacket.SetDestinationVirtualPortStreamType(connection.StreamType) - requestPacket.SetDestinationVirtualPortStreamID(connection.StreamID) + requestPacket.SetDestinationVirtualPortStreamType(connectedUser.Connection.StreamType) + requestPacket.SetDestinationVirtualPortStreamID(connectedUser.Connection.StreamID) requestPacket.SetPayload(notificationRequestBytes) globals.SecureServer.Send(requestPacket)