mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-21 20:25:51 +12:00
Improve command system, add HELP command,
This commit is contained in:
parent
a2782fd35e
commit
9e69492e46
39 changed files with 1865 additions and 1620 deletions
55
HorseIsleServer/LibHISP/Server/Network/NullSocket.cs
Normal file
55
HorseIsleServer/LibHISP/Server/Network/NullSocket.cs
Normal file
|
@ -0,0 +1,55 @@
|
|||
// A transport that does absolutely nothing.
|
||||
// only use this for testing.
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace HISP.Server.Network
|
||||
{
|
||||
public class NullSocket : ITransport
|
||||
{
|
||||
private bool disconnected = false;
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "NullSocket";
|
||||
}
|
||||
}
|
||||
public bool Disconnected
|
||||
{
|
||||
get
|
||||
{
|
||||
return disconnected;
|
||||
}
|
||||
set
|
||||
{
|
||||
disconnected = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Ip
|
||||
{
|
||||
get
|
||||
{
|
||||
return IPAddress.Loopback.MapToIPv4().ToString();
|
||||
}
|
||||
}
|
||||
public void Accept(Socket socket, Action<byte[]> onReceive, Action onDisconnect)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public void Disconnect()
|
||||
{
|
||||
disconnected = true;
|
||||
return;
|
||||
}
|
||||
|
||||
public void Send(byte[] data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue