Improved buffering slightly.
Disconnect messages are no longer buffered. (Fixes disconnect messages not being received)
This commit is contained in:
parent
7b58100546
commit
dcadec30de
6 changed files with 123 additions and 21 deletions
27
TShockAPI/Net/DisconnectMsg.cs
Normal file
27
TShockAPI/Net/DisconnectMsg.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.Xna.Framework;
|
||||
using TerrariaAPI;
|
||||
using XNAHelpers;
|
||||
|
||||
namespace TShockAPI.Net
|
||||
{
|
||||
class DisconnectMsg : BaseMsg
|
||||
{
|
||||
public override PacketTypes ID
|
||||
{
|
||||
get
|
||||
{
|
||||
return PacketTypes.Disconnect;
|
||||
}
|
||||
}
|
||||
public string Reason {get;set;}
|
||||
public override void Pack(Stream stream)
|
||||
{
|
||||
stream.WriteBytes(Encoding.ASCII.GetBytes(Reason));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue