mirror of
https://github.com/PretendoNetwork/friends.git
synced 2026-03-21 18:04:11 -05:00
Replace update_preference with update_preferences
This commit is contained in:
parent
8403c4bdc5
commit
0547153ecc
|
|
@ -1,13 +1,24 @@
|
|||
package friends_3ds
|
||||
|
||||
import (
|
||||
database_3ds "github.com/PretendoNetwork/friends-secure/database/3ds"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
nexproto "github.com/PretendoNetwork/nex-protocols-go"
|
||||
)
|
||||
|
||||
func UpdatePreference(err error, client *nex.Client, callID uint32, unknown1 bool, unknown2 bool, unknown3 bool) {
|
||||
// TODO: Do something with this
|
||||
func UpdatePreference(err error, client *nex.Client, callID uint32, showOnline bool, showCurrentGame bool, showPlayedGame bool) {
|
||||
if !showCurrentGame {
|
||||
emptyPresence := nexproto.NewNintendoPresence()
|
||||
emptyPresence.GameKey = nexproto.NewGameKey()
|
||||
emptyPresence.ChangedFlags = 4294967295 // FF FF FF FF, All flags
|
||||
sendPresenceUpdateNotification(client, emptyPresence)
|
||||
}
|
||||
if !showOnline {
|
||||
SendUserWentOfflineNotificationsGlobally(client)
|
||||
}
|
||||
|
||||
database_3ds.UpdateUserPreferences(client.PID(), showOnline, showCurrentGame)
|
||||
|
||||
rmcResponse := nex.NewRMCResponse(nexproto.Friends3DSProtocolID, callID)
|
||||
rmcResponse.SetSuccess(nexproto.Friends3DSMethodUpdatePreference, nil)
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
package friends_3ds
|
||||
|
||||
import (
|
||||
database_3ds "github.com/PretendoNetwork/friends-secure/database/3ds"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
nexproto "github.com/PretendoNetwork/nex-protocols-go"
|
||||
)
|
||||
|
||||
func UpdatePreferences(err error, client *nex.Client, callID uint32, showOnline bool, showCurrentGame bool, showPlayedGame bool) {
|
||||
if !showCurrentGame {
|
||||
emptyPresence := nexproto.NewNintendoPresence()
|
||||
emptyPresence.GameKey = nexproto.NewGameKey()
|
||||
emptyPresence.ChangedFlags = 4294967295 // FF FF FF FF, All flags
|
||||
sendPresenceUpdateNotification(client, emptyPresence)
|
||||
}
|
||||
if !showOnline {
|
||||
SendUserWentOfflineNotificationsGlobally(client)
|
||||
}
|
||||
|
||||
database_3ds.UpdateUserPreferences(client.PID(), showOnline, showCurrentGame)
|
||||
|
||||
rmcResponse := nex.NewRMCResponse(nexproto.Friends3DSProtocolID, callID)
|
||||
rmcResponse.SetSuccess(nexproto.Friends3DSMethodUpdatePreference, nil)
|
||||
|
||||
rmcResponseBytes := rmcResponse.Bytes()
|
||||
|
||||
responsePacket, _ := nex.NewPacketV0(client, nil)
|
||||
|
||||
responsePacket.SetVersion(0)
|
||||
responsePacket.SetSource(0xA1)
|
||||
responsePacket.SetDestination(0xAF)
|
||||
responsePacket.SetType(nex.DataPacket)
|
||||
responsePacket.SetPayload(rmcResponseBytes)
|
||||
|
||||
responsePacket.AddFlag(nex.FlagNeedsAck)
|
||||
responsePacket.AddFlag(nex.FlagReliable)
|
||||
|
||||
globals.NEXServer.Send(responsePacket)
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ func assignNEXProtocols() {
|
|||
// Friends (3DS) protocol handles
|
||||
friends3DSServer.UpdateProfile(friends_3ds.UpdateProfile)
|
||||
friends3DSServer.UpdateMii(friends_3ds.UpdateMii)
|
||||
friends3DSServer.UpdatePreference(friends_3ds.UpdatePreferences)
|
||||
friends3DSServer.UpdatePreference(friends_3ds.UpdatePreference)
|
||||
friends3DSServer.SyncFriend(friends_3ds.SyncFriend)
|
||||
friends3DSServer.UpdatePresence(friends_3ds.UpdatePresence)
|
||||
friends3DSServer.UpdateFavoriteGameKey(friends_3ds.UpdateFavoriteGameKey)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user