Fixed issue with decay erroneously triggering world save warnings.
This commit is contained in:
parent
0c7efa2419
commit
5be90584b6
4 changed files with 32 additions and 20 deletions
|
|
@ -39,6 +39,8 @@ namespace Server {
|
|||
|
||||
public ParallelSaveStrategy( int processorCount ) {
|
||||
this.processorCount = processorCount;
|
||||
|
||||
_decayQueue = new Queue<Item>();
|
||||
}
|
||||
|
||||
private int GetThreadCount() {
|
||||
|
|
@ -51,7 +53,7 @@ namespace Server {
|
|||
private SequentialFileWriter mobileData, mobileIndex;
|
||||
private SequentialFileWriter guildData, guildIndex;
|
||||
|
||||
private List<Item> decaying;
|
||||
private Queue<Item> _decayQueue;
|
||||
|
||||
private Consumer[] consumers;
|
||||
private int cycle;
|
||||
|
|
@ -95,12 +97,14 @@ namespace Server {
|
|||
Commit();
|
||||
|
||||
CloseFiles();
|
||||
}
|
||||
|
||||
if ( decaying != null ) {
|
||||
foreach ( Item item in decaying ) {
|
||||
if ( item.OnDecay() ) {
|
||||
item.Delete();
|
||||
}
|
||||
public override void ProcessDecay() {
|
||||
while ( _decayQueue.Count > 0 ) {
|
||||
Item item = _decayQueue.Dequeue();
|
||||
|
||||
if ( item.OnDecay() ) {
|
||||
item.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -192,11 +196,7 @@ namespace Server {
|
|||
}
|
||||
|
||||
if ( item.Decays && item.Parent == null && item.Map != Map.Internal && DateTime.Now > ( item.LastMoved + item.DecayTime ) ) {
|
||||
if ( decaying == null ) {
|
||||
decaying = new List<Item>();
|
||||
}
|
||||
|
||||
decaying.Add( item );
|
||||
_decayQueue.Enqueue( item );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue