mirror of
https://github.com/PretendoNetwork/friends.git
synced 2024-05-17 20:30:47 -04:00
Adjust import names for consistency
This commit is contained in:
parent
3d45d4b32e
commit
db972eacc6
|
@ -7,12 +7,12 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_3ds "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
friends_3ds_types "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
)
|
||||
|
||||
// Get a friend's mii
|
||||
func GetFriendMiis(pids []uint32) []*friends_3ds.FriendMii {
|
||||
friendMiis := make([]*friends_3ds.FriendMii, 0)
|
||||
func GetFriendMiis(pids []uint32) []*friends_3ds_types.FriendMii {
|
||||
friendMiis := make([]*friends_3ds_types.FriendMii, 0)
|
||||
|
||||
rows, err := database.Postgres.Query(`
|
||||
SELECT pid, mii_name, mii_data FROM "3ds".user_data WHERE pid IN ($1)`, database.PIDArrayToString(pids))
|
||||
|
@ -30,13 +30,13 @@ func GetFriendMiis(pids []uint32) []*friends_3ds.FriendMii {
|
|||
for rows.Next() {
|
||||
var pid uint32
|
||||
|
||||
mii := friends_3ds.NewMii()
|
||||
mii := friends_3ds_types.NewMii()
|
||||
mii.Unknown2 = false
|
||||
mii.Unknown3 = 0
|
||||
|
||||
rows.Scan(&pid, &mii.Name, &mii.MiiData)
|
||||
|
||||
friendMii := friends_3ds.NewFriendMii()
|
||||
friendMii := friends_3ds_types.NewFriendMii()
|
||||
friendMii.PID = pid
|
||||
friendMii.Mii = mii
|
||||
friendMii.ModifiedAt = changedTime
|
||||
|
|
|
@ -7,12 +7,12 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_3ds "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
friends_3ds_types "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
)
|
||||
|
||||
// Get a friend's persistent information
|
||||
func GetFriendPersistentInfos(user1_pid uint32, pids []uint32) []*friends_3ds.FriendPersistentInfo {
|
||||
persistentInfos := make([]*friends_3ds.FriendPersistentInfo, 0)
|
||||
func GetFriendPersistentInfos(user1_pid uint32, pids []uint32) []*friends_3ds_types.FriendPersistentInfo {
|
||||
persistentInfos := make([]*friends_3ds_types.FriendPersistentInfo, 0)
|
||||
|
||||
rows, err := database.Postgres.Query(`
|
||||
SELECT pid, region, area, language, favorite_title, favorite_title_version, comment, comment_changed, last_online FROM "3ds".user_data WHERE pid IN ($1)`, database.PIDArrayToString(pids))
|
||||
|
@ -25,9 +25,9 @@ func GetFriendPersistentInfos(user1_pid uint32, pids []uint32) []*friends_3ds.Fr
|
|||
}
|
||||
|
||||
for rows.Next() {
|
||||
persistentInfo := friends_3ds.NewFriendPersistentInfo()
|
||||
persistentInfo := friends_3ds_types.NewFriendPersistentInfo()
|
||||
|
||||
gameKey := friends_3ds.NewGameKey()
|
||||
gameKey := friends_3ds_types.NewGameKey()
|
||||
|
||||
var lastOnlineTime uint64
|
||||
var msgUpdateTime uint64
|
||||
|
|
|
@ -5,12 +5,12 @@ import (
|
|||
|
||||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
friends_3ds "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
friends_3ds_types "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
)
|
||||
|
||||
// Get all of a user's friend relationships
|
||||
func GetUserFriends(pid uint32) []*friends_3ds.FriendRelationship {
|
||||
friendRelationships := make([]*friends_3ds.FriendRelationship, 0)
|
||||
func GetUserFriends(pid uint32) []*friends_3ds_types.FriendRelationship {
|
||||
friendRelationships := make([]*friends_3ds_types.FriendRelationship, 0)
|
||||
|
||||
rows, err := database.Postgres.Query(`
|
||||
SELECT user2_pid, type FROM "3ds".friendships WHERE user1_pid=$1 AND type=1 LIMIT 100`, pid)
|
||||
|
@ -19,7 +19,7 @@ func GetUserFriends(pid uint32) []*friends_3ds.FriendRelationship {
|
|||
}
|
||||
|
||||
for rows.Next() {
|
||||
relationship := friends_3ds.NewFriendRelationship()
|
||||
relationship := friends_3ds_types.NewFriendRelationship()
|
||||
relationship.LFC = 0
|
||||
rows.Scan(&relationship.PID, &relationship.RelationshipType)
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_3ds "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
friends_3ds_types "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
)
|
||||
|
||||
// Save a friend relationship for a user
|
||||
func SaveFriendship(senderPID uint32, recipientPID uint32) *friends_3ds.FriendRelationship {
|
||||
friendRelationship := friends_3ds.NewFriendRelationship()
|
||||
func SaveFriendship(senderPID uint32, recipientPID uint32) *friends_3ds_types.FriendRelationship {
|
||||
friendRelationship := friends_3ds_types.NewFriendRelationship()
|
||||
friendRelationship.PID = recipientPID
|
||||
friendRelationship.LFC = 0
|
||||
friendRelationship.RelationshipType = 0 // Incomplete
|
||||
|
|
|
@ -3,11 +3,11 @@ package database_3ds
|
|||
import (
|
||||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
friends_3ds "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
friends_3ds_types "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
)
|
||||
|
||||
// Update a user's favorite game
|
||||
func UpdateUserFavoriteGame(pid uint32, gameKey *friends_3ds.GameKey) {
|
||||
func UpdateUserFavoriteGame(pid uint32, gameKey *friends_3ds_types.GameKey) {
|
||||
_, err := database.Postgres.Exec(`
|
||||
INSERT INTO "3ds".user_data (pid, favorite_title, favorite_title_version)
|
||||
VALUES ($1, $2, $3)
|
||||
|
|
|
@ -4,11 +4,11 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_3ds "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
friends_3ds_types "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
)
|
||||
|
||||
// Update a user's mii
|
||||
func UpdateUserMii(pid uint32, mii *friends_3ds.Mii) {
|
||||
func UpdateUserMii(pid uint32, mii *friends_3ds_types.Mii) {
|
||||
_, err := database.Postgres.Exec(`
|
||||
INSERT INTO "3ds".user_data (pid, mii_name, mii_data, mii_changed)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
|
|
|
@ -3,11 +3,11 @@ package database_3ds
|
|||
import (
|
||||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
friends_3ds "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
friends_3ds_types "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
)
|
||||
|
||||
// Update a user's profile
|
||||
func UpdateUserProfile(pid uint32, profileData *friends_3ds.MyProfile) {
|
||||
func UpdateUserProfile(pid uint32, profileData *friends_3ds_types.MyProfile) {
|
||||
_, err := database.Postgres.Exec(`
|
||||
INSERT INTO "3ds".user_data (pid, region, area, language)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
|
|
|
@ -6,11 +6,11 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
"github.com/gocql/gocql"
|
||||
)
|
||||
|
||||
func AcceptFriendRequestAndReturnFriendInfo(friendRequestID uint64) *friends_wiiu.FriendInfo {
|
||||
func AcceptFriendRequestAndReturnFriendInfo(friendRequestID uint64) *friends_wiiu_types.FriendInfo {
|
||||
var senderPID uint32
|
||||
var recipientPID uint32
|
||||
|
||||
|
@ -54,7 +54,7 @@ func AcceptFriendRequestAndReturnFriendInfo(friendRequestID uint64) *friends_wii
|
|||
|
||||
SetFriendRequestAccepted(friendRequestID)
|
||||
|
||||
friendInfo := friends_wiiu.NewFriendInfo()
|
||||
friendInfo := friends_wiiu_types.NewFriendInfo()
|
||||
connectedUser := globals.ConnectedUsers[senderPID]
|
||||
var lastOnline *nex.DateTime
|
||||
|
||||
|
@ -68,15 +68,15 @@ func AcceptFriendRequestAndReturnFriendInfo(friendRequestID uint64) *friends_wii
|
|||
} else {
|
||||
// Offline
|
||||
|
||||
friendInfo.NNAInfo = friends_wiiu.NewNNAInfo()
|
||||
friendInfo.NNAInfo = friends_wiiu_types.NewNNAInfo()
|
||||
friendInfo.NNAInfo.PrincipalBasicInfo = GetUserInfoByPID(senderPID)
|
||||
friendInfo.NNAInfo.Unknown1 = 0
|
||||
friendInfo.NNAInfo.Unknown2 = 0
|
||||
|
||||
friendInfo.Presence = friends_wiiu.NewNintendoPresenceV2()
|
||||
friendInfo.Presence = friends_wiiu_types.NewNintendoPresenceV2()
|
||||
friendInfo.Presence.ChangedFlags = 0
|
||||
friendInfo.Presence.Online = false
|
||||
friendInfo.Presence.GameKey = friends_wiiu.NewGameKey()
|
||||
friendInfo.Presence.GameKey = friends_wiiu_types.NewGameKey()
|
||||
friendInfo.Presence.GameKey.TitleID = 0
|
||||
friendInfo.Presence.GameKey.TitleVersion = 0
|
||||
friendInfo.Presence.Unknown1 = 0
|
||||
|
|
|
@ -4,12 +4,12 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
)
|
||||
|
||||
// Get a users blacklist
|
||||
func GetUserBlockList(pid uint32) []*friends_wiiu.BlacklistedPrincipal {
|
||||
blockList := make([]*friends_wiiu.BlacklistedPrincipal, 0)
|
||||
func GetUserBlockList(pid uint32) []*friends_wiiu_types.BlacklistedPrincipal {
|
||||
blockList := make([]*friends_wiiu_types.BlacklistedPrincipal, 0)
|
||||
|
||||
rows, err := database.Postgres.Query(`SELECT blocked_pid, title_id, title_version, date FROM wiiu.blocks WHERE blocker_pid=$1`, pid)
|
||||
if err != nil {
|
||||
|
@ -24,11 +24,11 @@ func GetUserBlockList(pid uint32) []*friends_wiiu.BlacklistedPrincipal {
|
|||
var date *nex.DateTime
|
||||
rows.Scan(&pid, &titleId, &titleVersion, &date)
|
||||
|
||||
blacklistPrincipal := friends_wiiu.NewBlacklistedPrincipal()
|
||||
blacklistPrincipal := friends_wiiu_types.NewBlacklistedPrincipal()
|
||||
|
||||
blacklistPrincipal.PrincipalBasicInfo = GetUserInfoByPID(pid)
|
||||
|
||||
blacklistPrincipal.GameKey = friends_wiiu.NewGameKey()
|
||||
blacklistPrincipal.GameKey = friends_wiiu_types.NewGameKey()
|
||||
blacklistPrincipal.GameKey.TitleID = titleId
|
||||
blacklistPrincipal.GameKey.TitleVersion = titleVersion
|
||||
blacklistPrincipal.BlackListedSince = date
|
||||
|
|
|
@ -6,12 +6,12 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
)
|
||||
|
||||
// Get a users comment
|
||||
func GetUserComment(pid uint32) *friends_wiiu.Comment {
|
||||
comment := friends_wiiu.NewComment()
|
||||
func GetUserComment(pid uint32) *friends_wiiu_types.Comment {
|
||||
comment := friends_wiiu_types.NewComment()
|
||||
comment.Unknown = 0
|
||||
|
||||
var changed uint64 = 0
|
||||
|
|
|
@ -7,13 +7,13 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
"github.com/gocql/gocql"
|
||||
)
|
||||
|
||||
// Get a users friend list
|
||||
func GetUserFriendList(pid uint32) []*friends_wiiu.FriendInfo {
|
||||
friendList := make([]*friends_wiiu.FriendInfo, 0)
|
||||
func GetUserFriendList(pid uint32) []*friends_wiiu_types.FriendInfo {
|
||||
friendList := make([]*friends_wiiu_types.FriendInfo, 0)
|
||||
|
||||
rows, err := database.Postgres.Query(`SELECT user2_pid, date FROM wiiu.friendships WHERE user1_pid=$1 AND active=true LIMIT 100`, pid)
|
||||
if err != nil {
|
||||
|
@ -26,7 +26,7 @@ func GetUserFriendList(pid uint32) []*friends_wiiu.FriendInfo {
|
|||
var date uint64
|
||||
rows.Scan(&friendPID, &date)
|
||||
|
||||
friendInfo := friends_wiiu.NewFriendInfo()
|
||||
friendInfo := friends_wiiu_types.NewFriendInfo()
|
||||
connectedUser := globals.ConnectedUsers[friendPID]
|
||||
var lastOnline *nex.DateTime
|
||||
|
||||
|
@ -52,15 +52,15 @@ func GetUserFriendList(pid uint32) []*friends_wiiu.FriendInfo {
|
|||
} else {
|
||||
// Offline
|
||||
|
||||
friendInfo.NNAInfo = friends_wiiu.NewNNAInfo()
|
||||
friendInfo.NNAInfo = friends_wiiu_types.NewNNAInfo()
|
||||
friendInfo.NNAInfo.PrincipalBasicInfo = GetUserInfoByPID(friendPID)
|
||||
friendInfo.NNAInfo.Unknown1 = 0
|
||||
friendInfo.NNAInfo.Unknown2 = 0
|
||||
|
||||
friendInfo.Presence = friends_wiiu.NewNintendoPresenceV2()
|
||||
friendInfo.Presence = friends_wiiu_types.NewNintendoPresenceV2()
|
||||
friendInfo.Presence.ChangedFlags = 0
|
||||
friendInfo.Presence.Online = false
|
||||
friendInfo.Presence.GameKey = friends_wiiu.NewGameKey()
|
||||
friendInfo.Presence.GameKey = friends_wiiu_types.NewGameKey()
|
||||
friendInfo.Presence.GameKey.TitleID = 0
|
||||
friendInfo.Presence.GameKey.TitleVersion = 0
|
||||
friendInfo.Presence.Unknown1 = 0
|
||||
|
|
|
@ -6,12 +6,12 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
)
|
||||
|
||||
// Get a users received friend requests
|
||||
func GetUserFriendRequestsIn(pid uint32) []*friends_wiiu.FriendRequest {
|
||||
friendRequestsIn := make([]*friends_wiiu.FriendRequest, 0)
|
||||
func GetUserFriendRequestsIn(pid uint32) []*friends_wiiu_types.FriendRequest {
|
||||
friendRequestsIn := make([]*friends_wiiu_types.FriendRequest, 0)
|
||||
|
||||
rows, err := database.Postgres.Query(`SELECT id, sender_pid, sent_on, expires_on, message, received FROM wiiu.friend_requests WHERE recipient_pid=$1 AND accepted=false AND denied=false`, pid)
|
||||
if err != nil {
|
||||
|
@ -28,18 +28,18 @@ func GetUserFriendRequestsIn(pid uint32) []*friends_wiiu.FriendRequest {
|
|||
var received bool
|
||||
rows.Scan(&id, &senderPID, &sentOn, &expiresOn, &message, &received)
|
||||
|
||||
friendRequest := friends_wiiu.NewFriendRequest()
|
||||
friendRequest := friends_wiiu_types.NewFriendRequest()
|
||||
|
||||
friendRequest.PrincipalInfo = GetUserInfoByPID(senderPID)
|
||||
|
||||
friendRequest.Message = friends_wiiu.NewFriendRequestMessage()
|
||||
friendRequest.Message = friends_wiiu_types.NewFriendRequestMessage()
|
||||
friendRequest.Message.FriendRequestID = id
|
||||
friendRequest.Message.Received = received
|
||||
friendRequest.Message.Unknown2 = 1
|
||||
friendRequest.Message.Message = message
|
||||
friendRequest.Message.Unknown3 = 0
|
||||
friendRequest.Message.Unknown4 = ""
|
||||
friendRequest.Message.GameKey = friends_wiiu.NewGameKey()
|
||||
friendRequest.Message.GameKey = friends_wiiu_types.NewGameKey()
|
||||
friendRequest.Message.GameKey.TitleID = 0
|
||||
friendRequest.Message.GameKey.TitleVersion = 0
|
||||
friendRequest.Message.Unknown5 = nex.NewDateTime(134222053376) // idk what this value means but its always this
|
||||
|
|
|
@ -4,12 +4,12 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
)
|
||||
|
||||
// Get a users sent friend requests
|
||||
func GetUserFriendRequestsOut(pid uint32) []*friends_wiiu.FriendRequest {
|
||||
friendRequestsOut := make([]*friends_wiiu.FriendRequest, 0)
|
||||
func GetUserFriendRequestsOut(pid uint32) []*friends_wiiu_types.FriendRequest {
|
||||
friendRequestsOut := make([]*friends_wiiu_types.FriendRequest, 0)
|
||||
|
||||
rows, err := database.Postgres.Query(`SELECT id, recipient_pid, sent_on, expires_on, message, received FROM wiiu.friend_requests WHERE sender_pid=$1 AND accepted=false`, pid)
|
||||
if err != nil {
|
||||
|
@ -26,18 +26,18 @@ func GetUserFriendRequestsOut(pid uint32) []*friends_wiiu.FriendRequest {
|
|||
var received bool
|
||||
rows.Scan(&id, &recipientPID, &sentOn, &expiresOn, &message, &received)
|
||||
|
||||
friendRequest := friends_wiiu.NewFriendRequest()
|
||||
friendRequest := friends_wiiu_types.NewFriendRequest()
|
||||
|
||||
friendRequest.PrincipalInfo = GetUserInfoByPID(recipientPID)
|
||||
|
||||
friendRequest.Message = friends_wiiu.NewFriendRequestMessage()
|
||||
friendRequest.Message = friends_wiiu_types.NewFriendRequestMessage()
|
||||
friendRequest.Message.FriendRequestID = id
|
||||
friendRequest.Message.Received = received
|
||||
friendRequest.Message.Unknown2 = 1
|
||||
friendRequest.Message.Message = message
|
||||
friendRequest.Message.Unknown3 = 0
|
||||
friendRequest.Message.Unknown4 = ""
|
||||
friendRequest.Message.GameKey = friends_wiiu.NewGameKey()
|
||||
friendRequest.Message.GameKey = friends_wiiu_types.NewGameKey()
|
||||
friendRequest.Message.GameKey.TitleID = 0
|
||||
friendRequest.Message.GameKey.TitleVersion = 0
|
||||
friendRequest.Message.Unknown5 = nex.NewDateTime(134222053376) // idk what this value means but its always this
|
||||
|
|
|
@ -7,13 +7,13 @@ import (
|
|||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
)
|
||||
|
||||
func GetUserInfoByPID(pid uint32) *friends_wiiu.PrincipalBasicInfo {
|
||||
func GetUserInfoByPID(pid uint32) *friends_wiiu_types.PrincipalBasicInfo {
|
||||
var result bson.M
|
||||
|
||||
err := database.MongoCollection.FindOne(context.TODO(), bson.D{{Key: "pid", Value: pid}}, options.FindOne()).Decode(&result)
|
||||
|
@ -26,10 +26,10 @@ func GetUserInfoByPID(pid uint32) *friends_wiiu.PrincipalBasicInfo {
|
|||
globals.Logger.Critical(err.Error())
|
||||
}
|
||||
|
||||
info := friends_wiiu.NewPrincipalBasicInfo()
|
||||
info := friends_wiiu_types.NewPrincipalBasicInfo()
|
||||
info.PID = pid
|
||||
info.NNID = result["username"].(string)
|
||||
info.Mii = friends_wiiu.NewMiiV2()
|
||||
info.Mii = friends_wiiu_types.NewMiiV2()
|
||||
info.Unknown = 2
|
||||
|
||||
encodedMiiData := result["mii"].(bson.M)["data"].(string)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package database_wiiu
|
||||
|
||||
import friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
import friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
|
||||
// Get notifications for a user
|
||||
func GetUserNotifications(pid uint32) []*friends_wiiu.PersistentNotification {
|
||||
return make([]*friends_wiiu.PersistentNotification, 0)
|
||||
func GetUserNotifications(pid uint32) []*friends_wiiu_types.PersistentNotification {
|
||||
return make([]*friends_wiiu_types.PersistentNotification, 0)
|
||||
}
|
||||
|
|
|
@ -5,11 +5,11 @@ import (
|
|||
|
||||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
)
|
||||
|
||||
func GetUserPrincipalPreference(pid uint32) *friends_wiiu.PrincipalPreference {
|
||||
preference := friends_wiiu.NewPrincipalPreference()
|
||||
func GetUserPrincipalPreference(pid uint32) *friends_wiiu_types.PrincipalPreference {
|
||||
preference := friends_wiiu_types.NewPrincipalPreference()
|
||||
|
||||
err := database.Postgres.QueryRow(`SELECT show_online, show_current_game, block_friend_requests FROM wiiu.user_data WHERE pid=$1`, pid).Scan(&preference.ShowOnlinePresence, &preference.ShowCurrentTitle, &preference.BlockFriendRequests)
|
||||
if err != nil {
|
||||
|
|
|
@ -3,10 +3,10 @@ package database_wiiu
|
|||
import (
|
||||
"github.com/PretendoNetwork/friends-secure/database"
|
||||
"github.com/PretendoNetwork/friends-secure/globals"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
)
|
||||
|
||||
func UpdateUserPrincipalPreference(pid uint32, principalPreference *friends_wiiu.PrincipalPreference) {
|
||||
func UpdateUserPrincipalPreference(pid uint32, principalPreference *friends_wiiu_types.PrincipalPreference) {
|
||||
_, err := database.Postgres.Exec(`
|
||||
INSERT INTO wiiu.user_data (pid, show_online, show_current_game, block_friend_requests)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
|
|
|
@ -2,17 +2,17 @@ package types
|
|||
|
||||
import (
|
||||
"github.com/PretendoNetwork/nex-go"
|
||||
friends_3ds "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_3ds_types "github.com/PretendoNetwork/nex-protocols-go/friends-3ds/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
)
|
||||
|
||||
type ConnectedUser struct {
|
||||
PID uint32
|
||||
Platform Platform
|
||||
Client *nex.Client
|
||||
NNAInfo *friends_wiiu.NNAInfo
|
||||
Presence *friends_3ds.NintendoPresence
|
||||
PresenceV2 *friends_wiiu.NintendoPresenceV2
|
||||
NNAInfo *friends_wiiu_types.NNAInfo
|
||||
Presence *friends_3ds_types.NintendoPresence
|
||||
PresenceV2 *friends_wiiu_types.NintendoPresenceV2
|
||||
}
|
||||
|
||||
func NewConnectedUser() *ConnectedUser {
|
||||
|
|
|
@ -2,7 +2,7 @@ package types
|
|||
|
||||
import (
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
friends_wiiu "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
friends_wiiu_types "github.com/PretendoNetwork/nex-protocols-go/friends-wiiu/types"
|
||||
)
|
||||
|
||||
// FriendUser represents a user connected to the friends server
|
||||
|
@ -10,13 +10,13 @@ import (
|
|||
type FriendUser struct {
|
||||
NNID string
|
||||
PID uint32
|
||||
Comment *friends_wiiu.Comment
|
||||
FriendRequestsOut []*friends_wiiu.FriendRequest
|
||||
FriendRequestsIn []*friends_wiiu.FriendRequest
|
||||
BlockedUsers []*friends_wiiu.BlacklistedPrincipal
|
||||
Comment *friends_wiiu_types.Comment
|
||||
FriendRequestsOut []*friends_wiiu_types.FriendRequest
|
||||
FriendRequestsIn []*friends_wiiu_types.FriendRequest
|
||||
BlockedUsers []*friends_wiiu_types.BlacklistedPrincipal
|
||||
LastOnline *nex.DateTime
|
||||
ActiveTitle *friends_wiiu.GameKey
|
||||
Notifications []*friends_wiiu.PersistentNotification
|
||||
ActiveTitle *friends_wiiu_types.GameKey
|
||||
Notifications []*friends_wiiu_types.PersistentNotification
|
||||
}
|
||||
|
||||
func (friendUser *FriendUser) FromPID(pid uint32) {
|
||||
|
|
Loading…
Reference in a new issue