mirror of
https://github.com/PretendoNetwork/friends.git
synced 2026-04-25 23:37:46 -05:00
Added debug logs for common errors
This commit is contained in:
parent
bf3e38ec49
commit
4b9d45849b
13
database.go
13
database.go
|
|
@ -206,6 +206,19 @@ func getUserFriendList(pid uint32) []*nexproto.FriendInfo {
|
|||
friendInfo.NNAInfo = connectedUser.NNAInfo
|
||||
friendInfo.Presence = connectedUser.Presence
|
||||
|
||||
if friendInfo.NNAInfo == nil || friendInfo.NNAInfo.PrincipalBasicInfo == nil {
|
||||
// TODO: Fix this
|
||||
fmt.Printf("\nPID %d has friend with bad presence data database.go line 211\n", pid)
|
||||
if friendInfo.NNAInfo == nil {
|
||||
fmt.Println("friendInfo.NNAInfo is nil")
|
||||
} else {
|
||||
fmt.Println("friendInfo.NNAInfo.PrincipalBasicInfo is nil")
|
||||
}
|
||||
fmt.Printf("Bad friend PID: %d\n\n", friendPID)
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
lastOnline = nex.NewDateTime(0)
|
||||
lastOnline.FromTimestamp(time.Now())
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
nex "github.com/PretendoNetwork/nex-go"
|
||||
nexproto "github.com/PretendoNetwork/nex-protocols-go"
|
||||
)
|
||||
|
|
@ -55,6 +57,26 @@ func sendUpdatePresenceWiiUNotifications(presence *nexproto.NintendoPresenceV2)
|
|||
friendList := getUserFriendList(presence.PID)
|
||||
|
||||
for i := 0; i < len(friendList); i++ {
|
||||
if friendList[i] == nil || friendList[i].NNAInfo == nil || friendList[i].NNAInfo.PrincipalBasicInfo == nil {
|
||||
// TODO: Fix this
|
||||
fmt.Printf("\nPID %d has friend with bad presence data update_presence_wiiu.go line 62\n", presence.PID)
|
||||
if friendList[i] == nil {
|
||||
fmt.Println("FriendInfo is nil")
|
||||
} else if friendList[i].NNAInfo.PrincipalBasicInfo == nil {
|
||||
fmt.Println("friendList[i].NNAInfo is nil?")
|
||||
} else {
|
||||
fmt.Println("friendList[i].NNAInfo.PrincipalBasicInfo is nil")
|
||||
}
|
||||
|
||||
if friendList[i].Presence != nil {
|
||||
fmt.Printf("Bad friend PID: %d\n\n", friendList[i].Presence.PID)
|
||||
} else {
|
||||
fmt.Printf("Bad friend PID unknown...\n\n")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
friendPID := friendList[i].NNAInfo.PrincipalBasicInfo.PID
|
||||
connectedUser := connectedUsers[friendPID]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user