Effects packets (#308)
- [X] Changes effect packets - [X] Updates playing sounds - [X] Updates Effects class to have more options so there are less direct calls to building the packets - [X] Changes bonding status packet
This commit is contained in:
parent
1c9439e4fd
commit
361ec4dba4
53 changed files with 958 additions and 833 deletions
|
|
@ -377,7 +377,34 @@ namespace Server.Network
|
|||
return !(result.IsClosed || result.Length <= 0);
|
||||
}
|
||||
|
||||
public virtual void Send(ref CircularBuffer<byte> buffer, int length)
|
||||
public void Send(ReadOnlySpan<byte> span)
|
||||
{
|
||||
var length = span.Length;
|
||||
if (Connection == null || BlockAllPackets || length <= 0 || !GetSendBuffer(out var buffer))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
buffer.CopyFrom(span);
|
||||
_packetEncoder?.Invoke(ref buffer, ref length);
|
||||
SendPipe.Writer.Advance((uint)length);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
#if DEBUG
|
||||
Console.WriteLine(ex);
|
||||
TraceException(ex);
|
||||
#endif
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send data using a circular buffer from SendPipe
|
||||
*/
|
||||
public void Send(ref CircularBuffer<byte> buffer, int length)
|
||||
{
|
||||
if (Connection == null || BlockAllPackets || length <= 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue