fix: Use the latest number for the next serial after world load. (#1171)
This commit is contained in:
parent
fe94aa050a
commit
906ec095b9
2 changed files with 22 additions and 0 deletions
|
|
@ -242,6 +242,21 @@ namespace Server
|
||||||
Items = EntityPersistence.LoadIndex(basePath, itemIndexInfo, out List<EntityIndex<Item>> items);
|
Items = EntityPersistence.LoadIndex(basePath, itemIndexInfo, out List<EntityIndex<Item>> items);
|
||||||
Guilds = EntityPersistence.LoadIndex(basePath, guildIndexInfo, out List<EntityIndex<BaseGuild>> guilds);
|
Guilds = EntityPersistence.LoadIndex(basePath, guildIndexInfo, out List<EntityIndex<BaseGuild>> guilds);
|
||||||
|
|
||||||
|
if (Mobiles.Count > 0)
|
||||||
|
{
|
||||||
|
_lastMobile = Mobiles.Keys.Max();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Items.Count > 0)
|
||||||
|
{
|
||||||
|
_lastItem = Items.Keys.Max();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Guilds.Count > 0)
|
||||||
|
{
|
||||||
|
_lastGuild = Guilds.Keys.Max();
|
||||||
|
}
|
||||||
|
|
||||||
EntityPersistence.LoadData(basePath, mobileIndexInfo, mobiles);
|
EntityPersistence.LoadData(basePath, mobileIndexInfo, mobiles);
|
||||||
EntityPersistence.LoadData(basePath, itemIndexInfo, items);
|
EntityPersistence.LoadData(basePath, itemIndexInfo, items);
|
||||||
EntityPersistence.LoadData(basePath, guildIndexInfo, guilds);
|
EntityPersistence.LoadData(basePath, guildIndexInfo, guilds);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using Server.Logging;
|
using Server.Logging;
|
||||||
|
|
||||||
|
|
@ -86,6 +87,12 @@ namespace Server.Accounting
|
||||||
IIndexInfo<Serial> indexInfo = new EntityTypeIndex("Accounts");
|
IIndexInfo<Serial> indexInfo = new EntityTypeIndex("Accounts");
|
||||||
|
|
||||||
_accountsById = EntityPersistence.LoadIndex(path, indexInfo, out List<EntityIndex<Account>> accounts);
|
_accountsById = EntityPersistence.LoadIndex(path, indexInfo, out List<EntityIndex<Account>> accounts);
|
||||||
|
|
||||||
|
if (_accountsById.Count > 0)
|
||||||
|
{
|
||||||
|
_lastAccount = _accountsById.Keys.Max();
|
||||||
|
}
|
||||||
|
|
||||||
EntityPersistence.LoadData(path, indexInfo, accounts);
|
EntityPersistence.LoadData(path, indexInfo, accounts);
|
||||||
|
|
||||||
foreach (var a in _accountsById.Values)
|
foreach (var a in _accountsById.Values)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue