ace/Source/ACE.Server/Network/SessionConnectionData.cs
Mag-nus 32c70b7c1e
Centralize ACE Timers (#1030)
* Reimplementation of Timers class.

This centralizes all the timers in ACE to ACE.Server.Entity.Timers.

* Session Tick comment cleanup

* Sessions no longer maintain their own ServerTime

WorldManager.UpdateWorld was sending each ticks ElapsedTime to sessions. Sessions would add this to their own ServerTime value.

This is not needed. The only time Sessions reference this value is from within their TickInParallel functions, which are called from WorldManager.Update.

For now, we just point the existing variable that was being used (SessionConnectionData.ServerTime) to Timers.PortalYearTicks.

I suspect we thought this value might need thread safety at some point which is why we might have had each session maintain their own value.

* DerethDateTime UTCNowToLoreTime to UtcNowToLoreTime
2018-09-28 16:12:10 -05:00

27 lines
886 B
C#

using ACE.Common.Cryptography;
using ACE.Server.Entity;
using ACE.Server.Network.Sequence;
namespace ACE.Server.Network
{
public class SessionConnectionData
{
public UIntSequence PacketSequence { get; set; }
public uint FragmentSequence { get; set; }
public ISAAC IssacClient { get; }
public ISAAC IssacServer { get; }
/// <summary>
/// This is just a wrapper around Timers.PortalYearTicks.<para />
/// In the future, we may want to consider removing this and referencing Timers.PortalYearTicks directly.
/// </summary>
public double ServerTime => Timers.PortalYearTicks;
public SessionConnectionData()
{
IssacClient = new ISAAC(ISAAC.ClientSeed);
IssacServer = new ISAAC(ISAAC.ServerSeed);
PacketSequence = new UIntSequence(false);
}
}
}