From 43d8e9ed1ad132277ce5d0ce79b3187e2ec126cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= Date: Sun, 8 Oct 2023 18:33:29 +0100 Subject: [PATCH] Update FriendPersistentInfo on 3DS One of the DateTimes doesn't represent the date of the friendship, but when the friend has updated their Mii. I noticed this when playing with the friend servers researching information about the data stored in the FRD sysmodule. After a new release is made, I will make the PR on friends. --- friends-3ds/types/friend_persistent_info.go | 16 ++++++++-------- go.mod | 6 +++--- go.sum | 12 ++++++------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/friends-3ds/types/friend_persistent_info.go b/friends-3ds/types/friend_persistent_info.go index e789b2de..99247c68 100644 --- a/friends-3ds/types/friend_persistent_info.go +++ b/friends-3ds/types/friend_persistent_info.go @@ -20,8 +20,8 @@ type FriendPersistentInfo struct { Platform uint8 GameKey *GameKey Message string - MessageUpdatedAt *nex.DateTime //appears to be correct, but not 100% sure. - FriendedAt *nex.DateTime + MessageUpdatedAt *nex.DateTime + MiiModifiedAt *nex.DateTime LastOnline *nex.DateTime } @@ -36,7 +36,7 @@ func (friendPersistentInfo *FriendPersistentInfo) Bytes(stream *nex.StreamOut) [ stream.WriteStructure(friendPersistentInfo.GameKey) stream.WriteString(friendPersistentInfo.Message) stream.WriteDateTime(friendPersistentInfo.MessageUpdatedAt) - stream.WriteDateTime(friendPersistentInfo.FriendedAt) + stream.WriteDateTime(friendPersistentInfo.MiiModifiedAt) stream.WriteDateTime(friendPersistentInfo.LastOnline) return stream.Bytes() @@ -60,7 +60,7 @@ func (friendPersistentInfo *FriendPersistentInfo) Copy() nex.StructureInterface copied.GameKey = friendPersistentInfo.GameKey.Copy().(*GameKey) copied.Message = friendPersistentInfo.Message copied.MessageUpdatedAt = friendPersistentInfo.MessageUpdatedAt.Copy() - copied.FriendedAt = friendPersistentInfo.FriendedAt.Copy() + copied.MiiModifiedAt = friendPersistentInfo.MiiModifiedAt.Copy() copied.LastOnline = friendPersistentInfo.LastOnline.Copy() return copied @@ -114,7 +114,7 @@ func (friendPersistentInfo *FriendPersistentInfo) Equals(structure nex.Structure return false } - if !friendPersistentInfo.FriendedAt.Equals(other.FriendedAt) { + if !friendPersistentInfo.MiiModifiedAt.Equals(other.MiiModifiedAt) { return false } @@ -160,10 +160,10 @@ func (friendPersistentInfo *FriendPersistentInfo) FormatToString(indentationLeve b.WriteString(fmt.Sprintf("%sMessageUpdatedAt: nil,\n", indentationValues)) } - if friendPersistentInfo.FriendedAt != nil { - b.WriteString(fmt.Sprintf("%sFriendedAt: %s,\n", indentationValues, friendPersistentInfo.FriendedAt.FormatToString(indentationLevel+1))) + if friendPersistentInfo.MiiModifiedAt != nil { + b.WriteString(fmt.Sprintf("%sMiiModifiedAt: %s,\n", indentationValues, friendPersistentInfo.MiiModifiedAt.FormatToString(indentationLevel+1))) } else { - b.WriteString(fmt.Sprintf("%sFriendedAt: nil,\n", indentationValues)) + b.WriteString(fmt.Sprintf("%sMiiModifiedAt: nil,\n", indentationValues)) } if friendPersistentInfo.LastOnline != nil { diff --git a/go.mod b/go.mod index fe5c7d0f..48663577 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/PretendoNetwork/nex-protocols-go go 1.19 require ( - github.com/PretendoNetwork/nex-go v1.0.38 + github.com/PretendoNetwork/nex-go v1.0.41 github.com/PretendoNetwork/plogger-go v1.0.4 ) @@ -15,7 +15,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect github.com/superwhiskers/crunch/v3 v3.5.7 // indirect - golang.org/x/exp v0.0.0-20230321023759-10a507213a29 - golang.org/x/sys v0.11.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 + golang.org/x/sys v0.12.0 // indirect golang.org/x/term v0.11.0 // indirect ) diff --git a/go.sum b/go.sum index f8f4700d..0df57ddc 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/PretendoNetwork/nex-go v1.0.38 h1:R9Ok53MtOXmideqC3Pd0YLtLXFwz/1r3EqBVwF43tJc= -github.com/PretendoNetwork/nex-go v1.0.38/go.mod h1:QepeB2ImpmIuAAYMyAsARGdfLntTBROEnBXfxpJ6FQg= +github.com/PretendoNetwork/nex-go v1.0.41 h1:TcBb1Bpe2KAB+AXaGX1K9NVQBRtZJIoy4yCvRde2xbI= +github.com/PretendoNetwork/nex-go v1.0.41/go.mod h1:QwHEa165DeVd0xIuthrgc3j6NWXT8lyPSG6t5kC/Shk= github.com/PretendoNetwork/plogger-go v1.0.4 h1:PF7xHw9eDRHH+RsAP9tmAE7fG0N0p6H4iPwHKnsoXwc= github.com/PretendoNetwork/plogger-go v1.0.4/go.mod h1:7kD6M4vPq1JL4LTuPg6kuB1OvUBOwQOtAvTaUwMbwvU= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= @@ -14,16 +14,16 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/superwhiskers/crunch/v3 v3.5.7 h1:N9RLxaR65C36i26BUIpzPXGy2f6pQ7wisu2bawbKNqg= github.com/superwhiskers/crunch/v3 v3.5.7/go.mod h1:4ub2EKgF1MAhTjoOCTU4b9uLMsAweHEa89aRrfAypXA= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=