mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
* adding @netstats admin command * trying to figure out the issue * fixing bug causing AcknowledgeSequence packets to increment the lastReceivedFragmentSequence variable, causing the Sequence to break and never recover for that session fixing bug causing RequestTransmit packets to be ignored fixing bug causing the server to crash when a C2S packet is corrupt or malformed changing the C2S RequestForTransmit packet count to be per request packet instead of per requested sequence adding Developer commands junk, junk_s2c, junk_c2s, trash_s2c, and trash_c2s to simulate bad connections and manually corrupt packets * updating changelog.md * Update changelog.md fixed incorrect variable name referred to in change log * Update changelog.md fix formatting * adding preprocessor definition NETDIAG and directives to ACE.Common and ACE.Server to help development by preserving troubleshooting tools without interference with the optimal solution * Apply suggestions from code review set accessor only needed for NETDIAG functionality minor change log addition * reverting some unnecessary source syntax and formatting changes. removing an unused exception variable * reverting some unnecessary source syntax and formatting changes * minor optimization of a duplicate prevention check
65 lines
1.4 KiB
C#
65 lines
1.4 KiB
C#
using ACE.Server.Network.GameMessages;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ACE.Server.Network
|
|
{
|
|
|
|
internal class NetworkBundle
|
|
{
|
|
private bool propChanged;
|
|
|
|
public bool NeedsSending => propChanged || messages.Count > 0;
|
|
|
|
public bool HasMoreMessages => messages.Count > 0;
|
|
|
|
private Queue<GameMessage> messages = new Queue<GameMessage>();
|
|
|
|
private float clientTime = -1f;
|
|
public float ClientTime
|
|
{
|
|
get => clientTime;
|
|
set
|
|
{
|
|
clientTime = value;
|
|
propChanged = true;
|
|
}
|
|
}
|
|
|
|
private bool timeSync;
|
|
public bool TimeSync
|
|
{
|
|
get => timeSync;
|
|
set
|
|
{
|
|
timeSync = value;
|
|
propChanged = true;
|
|
}
|
|
}
|
|
|
|
private bool ackSeq;
|
|
public bool SendAck
|
|
{
|
|
get => ackSeq;
|
|
set
|
|
{
|
|
ackSeq = value;
|
|
propChanged = true;
|
|
}
|
|
}
|
|
|
|
public bool EncryptedChecksum { get; set; }
|
|
|
|
public int CurrentSize { get; private set; }
|
|
|
|
public void Enqueue(GameMessage message)
|
|
{
|
|
CurrentSize += (int)message.Data.Length;
|
|
messages.Enqueue(message);
|
|
}
|
|
|
|
public GameMessage Dequeue()
|
|
{
|
|
return messages.Dequeue();
|
|
}
|
|
}
|
|
}
|