@@ -5,11 +5,11 @@ import (
5
5
"slices"
6
6
7
7
"github.com/PretendoNetwork/nex-go/v2"
8
- "github.com/PretendoNetwork/nex-protocols-go/v2/match-making/constants"
9
8
"github.com/PretendoNetwork/nex-go/v2/types"
10
9
common_globals "github.com/PretendoNetwork/nex-protocols-common-go/v2/globals"
11
10
"github.com/PretendoNetwork/nex-protocols-common-go/v2/match-making/tracking"
12
11
match_making "github.com/PretendoNetwork/nex-protocols-go/v2/match-making"
12
+ "github.com/PretendoNetwork/nex-protocols-go/v2/match-making/constants"
13
13
notifications "github.com/PretendoNetwork/nex-protocols-go/v2/notifications"
14
14
notifications_types "github.com/PretendoNetwork/nex-protocols-go/v2/notifications/types"
15
15
pqextended "github.com/PretendoNetwork/pq-extended"
@@ -30,7 +30,7 @@ func JoinGatheringWithParticipants(manager *common_globals.MatchmakingManager, g
30
30
}
31
31
}
32
32
33
- if uint32 (len (oldParticipants ) + 1 + len (additionalParticipants )) > maxParticipants {
33
+ if uint32 (len (oldParticipants )+ 1 + len (additionalParticipants )) > maxParticipants {
34
34
return 0 , nex .NewError (nex .ResultCodes .RendezVous .SessionFull , "change_error" )
35
35
}
36
36
@@ -71,7 +71,7 @@ func JoinGatheringWithParticipants(manager *common_globals.MatchmakingManager, g
71
71
var participantJoinedTargets []uint64
72
72
73
73
// * When the VerboseParticipants or the VerboseParticipantsEx flags are set, all participant notification events are sent to everyone
74
- if flags & (match_making .GatheringFlags .VerboseParticipants | match_making .GatheringFlags .VerboseParticipantsEx ) != 0 {
74
+ if flags & (match_making .GatheringFlags .VerboseParticipants | match_making .GatheringFlags .VerboseParticipantsEx ) != 0 {
75
75
participantJoinedTargets = common_globals .RemoveDuplicates (participants )
76
76
} else {
77
77
participantJoinedTargets = []uint64 {ownerPID }
@@ -89,9 +89,9 @@ func JoinGatheringWithParticipants(manager *common_globals.MatchmakingManager, g
89
89
90
90
oEvent := notifications_types .NewNotificationEvent ()
91
91
oEvent .PIDSource = connection .PID ()
92
- oEvent .Type = types .NewUInt32 (notifications .BuildNotificationType (notificationCategory , notificationSubtype ))
93
- oEvent .Param1 = types .NewUInt32 (gatheringID )
94
- oEvent .Param2 = types .NewUInt32 ( uint32 ( participant )) // TODO - This assumes a legacy client. Will not work on the Switch
92
+ oEvent .Type = types .UInt32 (notifications .BuildNotificationType (notificationCategory , notificationSubtype ))
93
+ oEvent .Param1 = types .UInt64 (gatheringID )
94
+ oEvent .Param2 = types .UInt64 ( participant )
95
95
96
96
// * Send the notification to the participant
97
97
common_globals .SendNotificationEvent (connection .Endpoint ().(* nex.PRUDPEndPoint ), oEvent , []uint64 {participant })
@@ -100,35 +100,35 @@ func JoinGatheringWithParticipants(manager *common_globals.MatchmakingManager, g
100
100
for _ , participant := range newParticipants {
101
101
// * If the new participant is the same as the owner, then we are creating a new gathering.
102
102
// * We don't need to send the new participant notification event in that case
103
- if flags & (match_making .GatheringFlags .VerboseParticipants | match_making .GatheringFlags .VerboseParticipantsEx ) != 0 || uint64 (connection .PID ()) != ownerPID {
103
+ if flags & (match_making .GatheringFlags .VerboseParticipants | match_making .GatheringFlags .VerboseParticipantsEx ) != 0 || uint64 (connection .PID ()) != ownerPID {
104
104
notificationCategory := notifications .NotificationCategories .Participation
105
105
notificationSubtype := notifications .NotificationSubTypes .Participation .NewParticipant
106
106
107
107
oEvent := notifications_types .NewNotificationEvent ()
108
108
oEvent .PIDSource = connection .PID ()
109
- oEvent .Type = types .NewUInt32 (notifications .BuildNotificationType (notificationCategory , notificationSubtype ))
110
- oEvent .Param1 = types .NewUInt32 (gatheringID )
111
- oEvent .Param2 = types .NewUInt32 ( uint32 ( participant )) // TODO - This assumes a legacy client. Will not work on the Switch
109
+ oEvent .Type = types .UInt32 (notifications .BuildNotificationType (notificationCategory , notificationSubtype ))
110
+ oEvent .Param1 = types .UInt64 (gatheringID )
111
+ oEvent .Param2 = types .UInt64 ( participant )
112
112
oEvent .StrParam = types .NewString (joinMessage )
113
- oEvent .Param3 = types .NewUInt32 ( uint32 ( len (participants ) ))
113
+ oEvent .Param3 = types .UInt64 ( len (participants ))
114
114
115
115
common_globals .SendNotificationEvent (connection .Endpoint ().(* nex.PRUDPEndPoint ), oEvent , participantJoinedTargets )
116
116
}
117
117
118
118
// * This flag also sends a recap of all currently connected players on the gathering to the participant that is connecting
119
- if flags & match_making .GatheringFlags .VerboseParticipantsEx != 0 {
119
+ if flags & match_making .GatheringFlags .VerboseParticipantsEx != 0 {
120
120
// TODO - Should this actually be deduplicated?
121
121
for _ , oldParticipant := range common_globals .RemoveDuplicates (oldParticipants ) {
122
122
notificationCategory := notifications .NotificationCategories .Participation
123
123
notificationSubtype := notifications .NotificationSubTypes .Participation .NewParticipant
124
124
125
125
oEvent := notifications_types .NewNotificationEvent ()
126
126
oEvent .PIDSource = connection .PID ()
127
- oEvent .Type = types .NewUInt32 (notifications .BuildNotificationType (notificationCategory , notificationSubtype ))
128
- oEvent .Param1 = types .NewUInt32 (gatheringID )
129
- oEvent .Param2 = types .NewUInt32 ( uint32 ( oldParticipant )) // TODO - This assumes a legacy client. Will not work on the Switch
127
+ oEvent .Type = types .UInt32 (notifications .BuildNotificationType (notificationCategory , notificationSubtype ))
128
+ oEvent .Param1 = types .UInt64 (gatheringID )
129
+ oEvent .Param2 = types .UInt64 ( oldParticipant )
130
130
oEvent .StrParam = types .NewString (joinMessage )
131
- oEvent .Param3 = types .NewUInt32 ( uint32 ( len (participants ) ))
131
+ oEvent .Param3 = types .UInt64 ( len (participants ))
132
132
133
133
// * Send the notification to the joining participant
134
134
common_globals .SendNotificationEvent (connection .Endpoint ().(* nex.PRUDPEndPoint ), oEvent , []uint64 {participant })
0 commit comments