fix: Use the latest number for the next serial after world load. (#1171)

This commit is contained in:
Kamron Batman 2022-09-13 21:25:21 -07:00 • committed by GitHub
parent fe94aa050a
commit 906ec095b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using Server.Logging;
@ -86,6 +87,12 @@ namespace Server.Accounting
IIndexInfo<Serial> indexInfo = new EntityTypeIndex("Accounts");
_accountsById = EntityPersistence.LoadIndex(path, indexInfo, out List<EntityIndex<Account>> accounts);
if (_accountsById.Count > 0)
{
_lastAccount = _accountsById.Keys.Max();
}
EntityPersistence.LoadData(path, indexInfo, accounts);
foreach (var a in _accountsById.Values)