@@ -132,6 +132,59 @@ public Player(EntityBaseData baseData, ByteString archiveData) : base(baseData,
132
132
_gameplayOptions . SetOwner ( this ) ;
133
133
}
134
134
135
+ public override bool Serialize ( Archive archive )
136
+ {
137
+ bool success = base . Serialize ( archive ) ;
138
+
139
+ success &= Serializer . Transfer ( archive , ref _missionManager ) ;
140
+ success &= Serializer . Transfer ( archive , ref _avatarProperties ) ;
141
+
142
+ // archive.IsTransient
143
+ success &= Serializer . Transfer ( archive , ref _shardId ) ;
144
+ success &= Serializer . Transfer ( archive , ref _playerName ) ;
145
+ success &= Serializer . Transfer ( archive , ref _consoleAccountIds [ 0 ] ) ;
146
+ success &= Serializer . Transfer ( archive , ref _consoleAccountIds [ 1 ] ) ;
147
+ success &= Serializer . Transfer ( archive , ref _secondaryPlayerName ) ;
148
+ success &= Serializer . Transfer ( archive , ref _matchQueueStatus ) ;
149
+ success &= Serializer . Transfer ( archive , ref _emailVerified ) ;
150
+ success &= Serializer . Transfer ( archive , ref _accountCreationTimestamp ) ;
151
+
152
+ // archive.IsReplication
153
+ success &= Serializer . Transfer ( archive , ref _partyId ) ;
154
+ success &= GuildMember . SerializeReplicationRuntimeInfo ( archive , ref _guildId , ref _guildName , ref _guildMembership ) ;
155
+
156
+ // There is a string here that is always empty and is immediately discarded after reading, purpose unknown
157
+ string emptyString = string . Empty ;
158
+ success &= Serializer . Transfer ( archive , ref emptyString ) ;
159
+ if ( emptyString != string . Empty ) Logger . Warn ( $ "Serialize(): emptyString is not empty!") ;
160
+
161
+ //bool hasCommunityData = archive.IsPersistent || archive.IsMigration
162
+ // || (archive.IsReplication && ((AOINetworkPolicyValues)archive.ReplicationPolicy).HasFlag(AOINetworkPolicyValues.AOIChannelOwner));
163
+ bool hasCommunityData = true ;
164
+ success &= Serializer . Transfer ( archive , ref hasCommunityData ) ;
165
+ if ( hasCommunityData )
166
+ success &= Serializer . Transfer ( archive , ref _community ) ;
167
+
168
+ // Unknown bool, always false
169
+ bool unkBool = false ;
170
+ success &= Serializer . Transfer ( archive , ref unkBool ) ;
171
+ if ( unkBool ) Logger . Warn ( $ "Serialize(): unkBool is true!") ;
172
+
173
+ success &= Serializer . Transfer ( archive , ref _unlockedInventoryList ) ;
174
+
175
+ //if (archive.IsMigration || (archive.IsReplication && ((AOINetworkPolicyValues)archive.ReplicationPolicy).HasFlag(AOINetworkPolicyValues.AOIChannelOwner)))
176
+ success &= Serializer . Transfer ( archive , ref _badges ) ;
177
+
178
+ success &= Serializer . Transfer ( archive , ref _gameplayOptions ) ;
179
+
180
+ //if (archive.IsMigration || (archive.IsReplication && ((AOINetworkPolicyValues)archive.ReplicationPolicy).HasFlag(AOINetworkPolicyValues.AOIChannelOwner)))
181
+ success &= Serializer . Transfer ( archive , ref _achievementState ) ;
182
+
183
+ success &= Serializer . Transfer ( archive , ref _stashTabOptionsDict ) ;
184
+
185
+ return success ;
186
+ }
187
+
135
188
protected override void Decode ( CodedInputStream stream )
136
189
{
137
190
base . Decode ( stream ) ;
@@ -189,7 +242,9 @@ protected override void Decode(CodedInputStream stream)
189
242
for ( ulong i = 0 ; i < numStashTabOptions ; i ++ )
190
243
{
191
244
PrototypeId stashTabRef = stream . ReadPrototypeRef < Prototype > ( ) ;
192
- _stashTabOptionsDict . Add ( stashTabRef , new ( stream ) ) ;
245
+ StashTabOptions options = new ( ) ;
246
+ options . Decode ( stream ) ;
247
+ _stashTabOptionsDict . Add ( stashTabRef , options ) ;
193
248
}
194
249
}
195
250
0 commit comments