Skip to content

Commit

Permalink
chore: Fixup WriteTo in structures to contentWritable
Browse files Browse the repository at this point in the history
This fixes a regression on how structures were written in NEX 3.5+ due
to overriding the contentWritable and messing up the structure headers
  • Loading branch information
DaniElectra committed Apr 18, 2024
1 parent 5327b8e commit 186b30a
Show file tree
Hide file tree
Showing 296 changed files with 1,219 additions and 1,219 deletions.
4 changes: 2 additions & 2 deletions aa-user/types/application_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func (ai *ApplicationInfo) WriteTo(writable types.Writable) {

contentWritable := writable.CopyNew()

ai.TitleID.WriteTo(writable)
ai.TitleVersion.WriteTo(writable)
ai.TitleID.WriteTo(contentWritable)
ai.TitleVersion.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
18 changes: 9 additions & 9 deletions account-management/types/account_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ type AccountData struct {
func (ad *AccountData) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

ad.PID.WriteTo(writable)
ad.StrName.WriteTo(writable)
ad.UIGroups.WriteTo(writable)
ad.StrEmail.WriteTo(writable)
ad.DTCreationDate.WriteTo(writable)
ad.DTEffectiveDate.WriteTo(writable)
ad.StrNotEffectiveMsg.WriteTo(writable)
ad.DTExpiryDate.WriteTo(writable)
ad.StrExpiredMsg.WriteTo(writable)
ad.PID.WriteTo(contentWritable)
ad.StrName.WriteTo(contentWritable)
ad.UIGroups.WriteTo(contentWritable)
ad.StrEmail.WriteTo(contentWritable)
ad.DTCreationDate.WriteTo(contentWritable)
ad.DTEffectiveDate.WriteTo(contentWritable)
ad.StrNotEffectiveMsg.WriteTo(contentWritable)
ad.DTExpiryDate.WriteTo(contentWritable)
ad.StrExpiredMsg.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
8 changes: 4 additions & 4 deletions account-management/types/account_extra_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ type AccountExtraInfo struct {
func (aei *AccountExtraInfo) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

aei.Unknown.WriteTo(writable)
aei.Unknown2.WriteTo(writable)
aei.Unknown3.WriteTo(writable)
aei.NEXToken.WriteTo(writable)
aei.Unknown.WriteTo(contentWritable)
aei.Unknown2.WriteTo(contentWritable)
aei.Unknown3.WriteTo(contentWritable)
aei.NEXToken.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
4 changes: 2 additions & 2 deletions account-management/types/basic_account_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type BasicAccountInfo struct {
func (bai *BasicAccountInfo) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

bai.PIDOwner.WriteTo(writable)
bai.StrName.WriteTo(writable)
bai.PIDOwner.WriteTo(contentWritable)
bai.StrName.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
8 changes: 4 additions & 4 deletions account-management/types/nintendo_create_account_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ type NintendoCreateAccountData struct {
func (ncad *NintendoCreateAccountData) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

ncad.NNAInfo.WriteTo(writable)
ncad.Token.WriteTo(writable)
ncad.Birthday.WriteTo(writable)
ncad.Unknown.WriteTo(writable)
ncad.NNAInfo.WriteTo(contentWritable)
ncad.Token.WriteTo(contentWritable)
ncad.Birthday.WriteTo(contentWritable)
ncad.Unknown.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ type DataStoreGetMetaByOwnerIDParam struct {
func (dsgmboidp *DataStoreGetMetaByOwnerIDParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

dsgmboidp.OwnerIDs.WriteTo(writable)
dsgmboidp.DataTypes.WriteTo(writable)
dsgmboidp.ResultOption.WriteTo(writable)
dsgmboidp.ResultRange.WriteTo(writable)
dsgmboidp.OwnerIDs.WriteTo(contentWritable)
dsgmboidp.DataTypes.WriteTo(contentWritable)
dsgmboidp.ResultOption.WriteTo(contentWritable)
dsgmboidp.ResultRange.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
4 changes: 2 additions & 2 deletions datastore/pokemon-bank/types/bank_migration_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type BankMigrationInfo struct {
func (bmi *BankMigrationInfo) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

bmi.MigrationStatus.WriteTo(writable)
bmi.UpdatedTime.WriteTo(writable)
bmi.MigrationStatus.WriteTo(contentWritable)
bmi.UpdatedTime.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
10 changes: 5 additions & 5 deletions datastore/pokemon-bank/types/bank_transaction_param.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ type BankTransactionParam struct {
func (btp *BankTransactionParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

btp.DataID.WriteTo(writable)
btp.CurVersion.WriteTo(writable)
btp.UpdateVersion.WriteTo(writable)
btp.Size.WriteTo(writable)
btp.TransactionPassword.WriteTo(writable)
btp.DataID.WriteTo(contentWritable)
btp.CurVersion.WriteTo(contentWritable)
btp.UpdateVersion.WriteTo(contentWritable)
btp.Size.WriteTo(contentWritable)
btp.TransactionPassword.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
10 changes: 5 additions & 5 deletions datastore/pokemon-bank/types/global_trade_station_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ type GlobalTradeStationData struct {
func (gtsd *GlobalTradeStationData) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsd.DataID.WriteTo(writable)
gtsd.OwnerID.WriteTo(writable)
gtsd.UpdatedTime.WriteTo(writable)
gtsd.IndexData.WriteTo(writable)
gtsd.Version.WriteTo(writable)
gtsd.DataID.WriteTo(contentWritable)
gtsd.OwnerID.WriteTo(contentWritable)
gtsd.UpdatedTime.WriteTo(contentWritable)
gtsd.IndexData.WriteTo(contentWritable)
gtsd.Version.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationDeletePokemonParam struct {
func (gtsdpp *GlobalTradeStationDeletePokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdpp.PrepareUploadKey.WriteTo(writable)
gtsdpp.DeleteFlag.WriteTo(writable)
gtsdpp.PrepareUploadKey.WriteTo(contentWritable)
gtsdpp.DeleteFlag.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type GlobalTradeStationDownloadMyPokemonParam struct {
func (gtsdmpp *GlobalTradeStationDownloadMyPokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdmpp.PrepareUploadKey.WriteTo(writable)
gtsdmpp.PrepareUploadKey.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationDownloadMyPokemonResult struct {
func (gtsdmpr *GlobalTradeStationDownloadMyPokemonResult) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdmpr.Result.WriteTo(writable)
gtsdmpr.IsTraded.WriteTo(writable)
gtsdmpr.Result.WriteTo(contentWritable)
gtsdmpr.IsTraded.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type GlobalTradeStationDownloadOtherPokemonParam struct {
func (gtsdopp *GlobalTradeStationDownloadOtherPokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdopp.PrepareUploadKey.WriteTo(writable)
gtsdopp.PrepareUploadKey.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ type GlobalTradeStationDownloadPokemonResult struct {
func (gtsdpr *GlobalTradeStationDownloadPokemonResult) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdpr.DataID.WriteTo(writable)
gtsdpr.IndexData.WriteTo(writable)
gtsdpr.PokemonData.WriteTo(writable)
gtsdpr.DataID.WriteTo(contentWritable)
gtsdpr.IndexData.WriteTo(contentWritable)
gtsdpr.PokemonData.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationPrepareTradePokemonParam struct {
func (gtsptpp *GlobalTradeStationPrepareTradePokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsptpp.TradeKey.WriteTo(writable)
gtsptpp.PrepareUploadKey.WriteTo(writable)
gtsptpp.TradeKey.WriteTo(contentWritable)
gtsptpp.PrepareUploadKey.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationPrepareTradePokemonResult struct {
func (gtsptpr *GlobalTradeStationPrepareTradePokemonResult) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsptpr.Result.WriteTo(writable)
gtsptpr.PrepareTradeKey.WriteTo(writable)
gtsptpr.Result.WriteTo(contentWritable)
gtsptpr.PrepareTradeKey.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationRecordKey struct {
func (gtsrk *GlobalTradeStationRecordKey) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsrk.DataID.WriteTo(writable)
gtsrk.Password.WriteTo(writable)
gtsrk.DataID.WriteTo(contentWritable)
gtsrk.Password.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ type GlobalTradeStationSearchPokemonParam struct {
func (gtsspp *GlobalTradeStationSearchPokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsspp.PrepareUploadKey.WriteTo(writable)
gtsspp.Conditions.WriteTo(writable)
gtsspp.ResultOrderColumn.WriteTo(writable)
gtsspp.ResultOrder.WriteTo(writable)
gtsspp.UploadedAfter.WriteTo(writable)
gtsspp.UploadedBefore.WriteTo(writable)
gtsspp.ResultRange.WriteTo(writable)
gtsspp.PrepareUploadKey.WriteTo(contentWritable)
gtsspp.Conditions.WriteTo(contentWritable)
gtsspp.ResultOrderColumn.WriteTo(contentWritable)
gtsspp.ResultOrder.WriteTo(contentWritable)
gtsspp.UploadedAfter.WriteTo(contentWritable)
gtsspp.UploadedBefore.WriteTo(contentWritable)
gtsspp.ResultRange.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ type GlobalTradeStationSearchPokemonResult struct {
func (gtsspr *GlobalTradeStationSearchPokemonResult) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsspr.TotalCount.WriteTo(writable)
gtsspr.Result.WriteTo(writable)
gtsspr.TotalCountType.WriteTo(writable)
gtsspr.TotalCount.WriteTo(contentWritable)
gtsspr.Result.WriteTo(contentWritable)
gtsspr.TotalCountType.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationTradeKey struct {
func (gtstk *GlobalTradeStationTradeKey) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtstk.DataID.WriteTo(writable)
gtstk.Version.WriteTo(writable)
gtstk.DataID.WriteTo(contentWritable)
gtstk.Version.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ type GlobalTradeStationTradePokemonParam struct {
func (gtstpp *GlobalTradeStationTradePokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtstpp.TradeKey.WriteTo(writable)
gtstpp.PrepareTradeKey.WriteTo(writable)
gtstpp.PrepareUploadKey.WriteTo(writable)
gtstpp.Period.WriteTo(writable)
gtstpp.IndexData.WriteTo(writable)
gtstpp.PokemonData.WriteTo(writable)
gtstpp.Signature.WriteTo(writable)
gtstpp.NeedData.WriteTo(writable)
gtstpp.TradeKey.WriteTo(contentWritable)
gtstpp.PrepareTradeKey.WriteTo(contentWritable)
gtstpp.PrepareUploadKey.WriteTo(contentWritable)
gtstpp.Period.WriteTo(contentWritable)
gtstpp.IndexData.WriteTo(contentWritable)
gtstpp.PokemonData.WriteTo(contentWritable)
gtstpp.Signature.WriteTo(contentWritable)
gtstpp.NeedData.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationTradePokemonResult struct {
func (gtstpr *GlobalTradeStationTradePokemonResult) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtstpr.Result.WriteTo(writable)
gtstpr.MyDataID.WriteTo(writable)
gtstpr.Result.WriteTo(contentWritable)
gtstpr.MyDataID.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ type GlobalTradeStationUploadPokemonParam struct {
func (gtsupp *GlobalTradeStationUploadPokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsupp.PrepareUploadKey.WriteTo(writable)
gtsupp.Period.WriteTo(writable)
gtsupp.IndexData.WriteTo(writable)
gtsupp.PokemonData.WriteTo(writable)
gtsupp.Signature.WriteTo(writable)
gtsupp.PrepareUploadKey.WriteTo(contentWritable)
gtsupp.Period.WriteTo(contentWritable)
gtsupp.IndexData.WriteTo(contentWritable)
gtsupp.PokemonData.WriteTo(contentWritable)
gtsupp.Signature.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
10 changes: 5 additions & 5 deletions datastore/pokemon-gen6/types/global_trade_station_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ type GlobalTradeStationData struct {
func (gtsd *GlobalTradeStationData) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsd.DataID.WriteTo(writable)
gtsd.OwnerID.WriteTo(writable)
gtsd.UpdatedTime.WriteTo(writable)
gtsd.IndexData.WriteTo(writable)
gtsd.Version.WriteTo(writable)
gtsd.DataID.WriteTo(contentWritable)
gtsd.OwnerID.WriteTo(contentWritable)
gtsd.UpdatedTime.WriteTo(contentWritable)
gtsd.IndexData.WriteTo(contentWritable)
gtsd.Version.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationDeletePokemonParam struct {
func (gtsdpp *GlobalTradeStationDeletePokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdpp.PrepareUploadKey.WriteTo(writable)
gtsdpp.DeleteFlag.WriteTo(writable)
gtsdpp.PrepareUploadKey.WriteTo(contentWritable)
gtsdpp.DeleteFlag.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type GlobalTradeStationDownloadMyPokemonParam struct {
func (gtsdmpp *GlobalTradeStationDownloadMyPokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdmpp.PrepareUploadKey.WriteTo(writable)
gtsdmpp.PrepareUploadKey.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationDownloadMyPokemonResult struct {
func (gtsdmpr *GlobalTradeStationDownloadMyPokemonResult) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdmpr.Result.WriteTo(writable)
gtsdmpr.IsTraded.WriteTo(writable)
gtsdmpr.Result.WriteTo(contentWritable)
gtsdmpr.IsTraded.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type GlobalTradeStationDownloadOtherPokemonParam struct {
func (gtsdopp *GlobalTradeStationDownloadOtherPokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdopp.PrepareUploadKey.WriteTo(writable)
gtsdopp.PrepareUploadKey.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ type GlobalTradeStationDownloadPokemonResult struct {
func (gtsdpr *GlobalTradeStationDownloadPokemonResult) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsdpr.DataID.WriteTo(writable)
gtsdpr.IndexData.WriteTo(writable)
gtsdpr.PokemonData.WriteTo(writable)
gtsdpr.DataID.WriteTo(contentWritable)
gtsdpr.IndexData.WriteTo(contentWritable)
gtsdpr.PokemonData.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ type GlobalTradeStationPrepareTradePokemonParam struct {
func (gtsptpp *GlobalTradeStationPrepareTradePokemonParam) WriteTo(writable types.Writable) {
contentWritable := writable.CopyNew()

gtsptpp.TradeKey.WriteTo(writable)
gtsptpp.PrepareUploadKey.WriteTo(writable)
gtsptpp.TradeKey.WriteTo(contentWritable)
gtsptpp.PrepareUploadKey.WriteTo(contentWritable)

content := contentWritable.Bytes()

Expand Down
Loading

0 comments on commit 186b30a

Please sign in to comment.