using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Common.Network;
using Milimoe.FunGame.Core.Library.Constant;
namespace Milimoe.FunGame.Core.Interface.Base
{
public interface IServerModel
{
///
/// 服务器实例是否在运行
///
public abstract bool Running { get; }
///
/// 客户端的套接字实例
///
public abstract ClientSocket? Socket { get; }
///
/// 客户端的用户实例,在用户登录后有效
///
public abstract User User { get; }
///
/// 客户端的名称,默认是客户端的IP地址
///
public abstract string ClientName { get; }
///
/// 客户端是否启动了开发者模式
///
public bool IsDebugMode { get; }
///
/// 向客户端发送消息
///
///
///
///
///
public bool Send(ClientSocket socket, SocketMessageType type, params object[] objs);
///
/// 向客户端发送系统消息
///
///
///
///
///
///
public void SendSystemMessage(ShowMessageType showtype, string msg, string title, int autoclose, params string[] usernames);
///
/// 获取客户端的名称,通常未登录时显示为客户端的IP地址,登录后显示为账号名
///
///
public string GetClientName();
///
/// 开始接收客户端消息
/// 请勿在 中调用此方法
///
///
///
public bool Read(ClientSocket socket);
///
/// 启动对客户端的监听
/// 请勿在 中调用此方法
///
public void Start();
}
}