Skip to content

Commit

Permalink
Merge pull request #34 from DaniElectra/friends-mii
Browse files Browse the repository at this point in the history
Update FriendPersistentInfo on 3DS
  • Loading branch information
jonbarrow authored Oct 8, 2023
2 parents 7e85097 + 43d8e9e commit 6e82153
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions friends-3ds/types/friend_persistent_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand All @@ -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
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand All @@ -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=

0 comments on commit 6e82153

Please sign in to comment.