forked from project-redbud/FunGame-Core
DataRequest、GameModule相关优化 (#82)
* 使基于HTTPClient的DataRequest能够收到回复;添加了适用于Gaming的DataRequest;优化了加载器的加载逻辑;依赖集合的优化 * 执行代理清理;优化模组模板 * 删除GamingEvent无用的事件;删除result哈希表;删除无用的Item/Skill类;GameModuleLoader优化
This commit is contained in:
parent
c51b7c50fa
commit
b73b37c45e
@ -12,16 +12,13 @@ namespace Milimoe.FunGame.Core.Api.Factory
|
|||||||
|
|
||||||
public Item Create(ItemType type = ItemType.Passive)
|
public Item Create(ItemType type = ItemType.Passive)
|
||||||
{
|
{
|
||||||
switch (type)
|
_EntityType = typeof(Item);
|
||||||
|
return type switch
|
||||||
{
|
{
|
||||||
case ItemType.Passive:
|
ItemType.Passive => new(false),
|
||||||
_EntityType = typeof(PassiveItem);
|
ItemType.Active => new(true),
|
||||||
return PassiveItem.GetInstance();
|
_ => new(false)
|
||||||
case ItemType.Active:
|
};
|
||||||
default:
|
|
||||||
_EntityType = typeof(ActiveItem);
|
|
||||||
return PassiveItem.GetInstance();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Item Create()
|
public Item Create()
|
||||||
|
|||||||
@ -12,16 +12,13 @@ namespace Milimoe.FunGame.Core.Api.Factory
|
|||||||
|
|
||||||
internal Skill Create(SkillType type = SkillType.Passive)
|
internal Skill Create(SkillType type = SkillType.Passive)
|
||||||
{
|
{
|
||||||
switch (type)
|
_EntityType = typeof(Skill);
|
||||||
|
return type switch
|
||||||
{
|
{
|
||||||
case SkillType.Passive:
|
SkillType.Passive => new(false),
|
||||||
_EntityType = typeof(PassiveSkill);
|
SkillType.Active => new(true),
|
||||||
return PassiveSkill.GetInstance();
|
_ => new(false)
|
||||||
case SkillType.Active:
|
};
|
||||||
default:
|
|
||||||
_EntityType = typeof(ActiveSkill);
|
|
||||||
return ActiveSkill.GetInstance();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Skill Create()
|
public Skill Create()
|
||||||
|
|||||||
@ -7,7 +7,8 @@ using Milimoe.FunGame.Core.Library.Exception;
|
|||||||
namespace Milimoe.FunGame.Core.Api.Transmittal
|
namespace Milimoe.FunGame.Core.Api.Transmittal
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 需要配合Milimoe.FunGame.Core.Library.Constant.DataRequestType使用
|
/// 需要配合 <see cref="DataRequestType"/> 使用<para/>
|
||||||
|
/// 如果是 <see cref="Model.Gaming"/> 的数据请求,则配合 <see cref="GamingType"/> 使用<para/>
|
||||||
/// 确保已添加对应的枚举
|
/// 确保已添加对应的枚举
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DataRequest
|
public class DataRequest
|
||||||
@ -15,12 +16,12 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 数据请求结果
|
/// 数据请求结果
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RequestResult Result => Worker.Result;
|
public RequestResult Result => Worker != null ? Worker.Result : (GamingWorker != null ? GamingWorker.Result : RequestResult.Missing);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 详细错误信息
|
/// 详细错误信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Error => Worker.Error;
|
public string Error => Worker != null ? Worker.Error : (GamingWorker != null ? GamingWorker.Error : "");
|
||||||
|
|
||||||
// 获取ResultData中key值对应的Json字符串
|
// 获取ResultData中key值对应的Json字符串
|
||||||
// -- 此索引器仅返回Json字符串,对象类型请使用反序列化方法GetResult<T>() --
|
// -- 此索引器仅返回Json字符串,对象类型请使用反序列化方法GetResult<T>() --
|
||||||
@ -30,7 +31,9 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return Worker.ResultData[key];
|
if (Worker != null) return Worker.ResultData[key];
|
||||||
|
else if (GamingWorker != null) return GamingWorker.ResultData[key];
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@ -41,11 +44,16 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 私有的实现类
|
/// 私有的实现类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly SocketRequest Worker;
|
private readonly SocketRequest? Worker;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 私有的实现类(这是局内请求的)
|
||||||
|
/// </summary>
|
||||||
|
private readonly GamingRequest? GamingWorker;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 基于本地已连接的 <see cref="Socket"/> 创建新的数据请求<para/>
|
/// 基于本地已连接的 <see cref="Socket"/> 创建新的数据请求<para/>
|
||||||
/// 使用 <see cref="RunTimeController"/> 中的 <see cref="RunTimeController.NewDataRequest"/> 创建一个新的请求
|
/// 使用 <see cref="RunTimeController"/> 中的 <see cref="RunTimeController.NewDataRequest(DataRequestType)"/> 创建一个新的请求
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Socket"></param>
|
/// <param name="Socket"></param>
|
||||||
/// <param name="RequestType"></param>
|
/// <param name="RequestType"></param>
|
||||||
@ -55,6 +63,46 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
Worker = new(Socket, RequestType, Guid.NewGuid(), IsLongRunning);
|
Worker = new(Socket, RequestType, Guid.NewGuid(), IsLongRunning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基于本地已连接的 <see cref="HTTPClient"/> 创建新的数据请求<para/>
|
||||||
|
/// 使用 <see cref="RunTimeController"/> 中的 <see cref="RunTimeController.NewDataRequest(DataRequestType)"/> 创建一个新的请求<para/>
|
||||||
|
/// 此数据请求只能调用异步方法 <see cref="SendRequestAsync"/> 请求数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="WebSocket"></param>
|
||||||
|
/// <param name="RequestType"></param>
|
||||||
|
/// <param name="IsLongRunning"></param>
|
||||||
|
internal DataRequest(HTTPClient WebSocket, DataRequestType RequestType, bool IsLongRunning = false)
|
||||||
|
{
|
||||||
|
Worker = new(WebSocket, RequestType, Guid.NewGuid(), IsLongRunning);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基于本地已连接的 <see cref="Socket"/> 创建新的局内(<see cref="Model.Gaming"/>)数据请求<para/>
|
||||||
|
/// 使用 <see cref="RunTimeController"/> 中的 <see cref="RunTimeController.NewDataRequest(GamingType)"/> 创建一个新的请求<para/>
|
||||||
|
/// 此构造方法是给 <see cref="Library.Common.Addon.GameModule"/> 提供的
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="Socket"></param>
|
||||||
|
/// <param name="GamingType"></param>
|
||||||
|
/// <param name="IsLongRunning"></param>
|
||||||
|
internal DataRequest(Socket Socket, GamingType GamingType, bool IsLongRunning = false)
|
||||||
|
{
|
||||||
|
GamingWorker = new(Socket, GamingType, Guid.NewGuid(), IsLongRunning);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基于本地已连接的 <see cref="HTTPClient"/> 创建新的局内(<see cref="Model.Gaming"/>)数据请求<para/>
|
||||||
|
/// 使用 <see cref="RunTimeController"/> 中的 <see cref="RunTimeController.NewDataRequest(GamingType)"/> 创建一个新的请求<para/>
|
||||||
|
/// 此构造方法是给 <see cref="Library.Common.Addon.GameModule"/> 提供的<para/>
|
||||||
|
/// 此数据请求只能调用异步方法 <see cref="SendRequestAsync"/> 请求数据
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="WebSocket"></param>
|
||||||
|
/// <param name="GamingType"></param>
|
||||||
|
/// <param name="IsLongRunning"></param>
|
||||||
|
internal DataRequest(HTTPClient WebSocket, GamingType GamingType, bool IsLongRunning = false)
|
||||||
|
{
|
||||||
|
GamingWorker = new(WebSocket, GamingType, Guid.NewGuid(), IsLongRunning);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加数据
|
/// 添加数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -62,8 +110,16 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
/// <param name="value"></param>
|
/// <param name="value"></param>
|
||||||
public void AddRequestData(string key, object? value)
|
public void AddRequestData(string key, object? value)
|
||||||
{
|
{
|
||||||
if (Worker.RequestData.ContainsKey(key)) Worker.RequestData[key] = value;
|
if (Worker != null)
|
||||||
else Worker.RequestData.Add(key, value);
|
{
|
||||||
|
if (Worker.RequestData.ContainsKey(key)) Worker.RequestData[key] = value;
|
||||||
|
else Worker.RequestData.Add(key, value);
|
||||||
|
}
|
||||||
|
else if (GamingWorker != null)
|
||||||
|
{
|
||||||
|
if (GamingWorker.RequestData.ContainsKey(key)) GamingWorker.RequestData[key] = value;
|
||||||
|
else GamingWorker.RequestData.Add(key, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -71,16 +127,20 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Worker.Dispose();
|
Worker?.Dispose();
|
||||||
|
GamingWorker?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 向服务器发送数据请求
|
/// 向服务器发送数据请求
|
||||||
|
/// <para/>警告:<see cref="HTTPClient"/> 调用此方法将抛出异常。请调用并等待 <see cref="SendRequestAsync"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
/// <exception cref="AsyncRequestException"></exception>
|
||||||
public RequestResult SendRequest()
|
public RequestResult SendRequest()
|
||||||
{
|
{
|
||||||
Worker.SendRequest();
|
Worker?.SendRequest();
|
||||||
|
GamingWorker?.SendRequest();
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +150,14 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<RequestResult> SendRequestAsync()
|
public async Task<RequestResult> SendRequestAsync()
|
||||||
{
|
{
|
||||||
await Worker.SendRequestAsync();
|
if (Worker != null)
|
||||||
|
{
|
||||||
|
await Worker.SendRequestAsync();
|
||||||
|
}
|
||||||
|
else if (GamingWorker != null)
|
||||||
|
{
|
||||||
|
await GamingWorker.SendRequestAsync();
|
||||||
|
}
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,33 +169,65 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public T? GetResult<T>(string key)
|
public T? GetResult<T>(string key)
|
||||||
{
|
{
|
||||||
return GetHashtableJsonObject<T>(Worker.ResultData, key);
|
if (Worker != null)
|
||||||
|
{
|
||||||
|
return GetHashtableJsonObject<T>(Worker.ResultData, key);
|
||||||
|
}
|
||||||
|
else if (GamingWorker != null)
|
||||||
|
{
|
||||||
|
return GetHashtableJsonObject<T>(GamingWorker.ResultData, key);
|
||||||
|
}
|
||||||
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class SocketRequest(Socket? Socket, DataRequestType RequestType, Guid RequestID, bool IsLongRunning = false) : SocketHandlerController(Socket)
|
/// <summary>
|
||||||
|
/// 常规数据请求
|
||||||
|
/// </summary>
|
||||||
|
private class SocketRequest : SocketHandlerController
|
||||||
{
|
{
|
||||||
public Hashtable RequestData { get; } = [];
|
public Hashtable RequestData { get; } = [];
|
||||||
public Hashtable ResultData => _ResultData;
|
public Hashtable ResultData => _ResultData;
|
||||||
public RequestResult Result => _Result;
|
public RequestResult Result => _Result;
|
||||||
public string Error => _Error;
|
public string Error => _Error;
|
||||||
|
|
||||||
private readonly Socket? Socket = Socket;
|
private readonly Socket? Socket = null;
|
||||||
private readonly DataRequestType RequestType = RequestType;
|
private readonly HTTPClient? WebSocket = null;
|
||||||
private readonly Guid RequestID = RequestID;
|
private readonly DataRequestType RequestType = DataRequestType.UnKnown;
|
||||||
private readonly bool _IsLongRunning = IsLongRunning;
|
private readonly Guid RequestID = Guid.Empty;
|
||||||
|
private readonly bool IsLongRunning = false;
|
||||||
private Hashtable _ResultData = [];
|
private Hashtable _ResultData = [];
|
||||||
private RequestResult _Result = RequestResult.Missing;
|
private RequestResult _Result = RequestResult.Missing;
|
||||||
private string _Error = "";
|
private string _Error = "";
|
||||||
|
|
||||||
|
public SocketRequest(Socket? Socket, DataRequestType RequestType, Guid RequestID, bool IsLongRunning = false) : base(Socket)
|
||||||
|
{
|
||||||
|
this.Socket = Socket;
|
||||||
|
this.RequestType = RequestType;
|
||||||
|
this.RequestID = RequestID;
|
||||||
|
this.IsLongRunning = IsLongRunning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SocketRequest(HTTPClient? WebSocket, DataRequestType RequestType, Guid RequestID, bool IsLongRunning = false) : base(WebSocket)
|
||||||
|
{
|
||||||
|
this.WebSocket = WebSocket;
|
||||||
|
this.RequestType = RequestType;
|
||||||
|
this.RequestID = RequestID;
|
||||||
|
this.IsLongRunning = IsLongRunning;
|
||||||
|
}
|
||||||
|
|
||||||
public void SendRequest()
|
public void SendRequest()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SetWorking();
|
SetWorking();
|
||||||
if (Socket?.Send(SocketMessageType.DataRequest, RequestType, RequestID, RequestData) == SocketResult.Success)
|
if (Socket != null && Socket.Send(SocketMessageType.DataRequest, RequestType, RequestID, RequestData) == SocketResult.Success)
|
||||||
{
|
{
|
||||||
WaitForWorkDone();
|
WaitForWorkDone();
|
||||||
}
|
}
|
||||||
|
else if (WebSocket != null)
|
||||||
|
{
|
||||||
|
throw new AsyncRequestException();
|
||||||
|
}
|
||||||
else throw new ConnectFailedException();
|
else throw new ConnectFailedException();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
@ -144,7 +243,11 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
SetWorking();
|
SetWorking();
|
||||||
if (Socket?.Send(SocketMessageType.DataRequest, RequestType, RequestID, RequestData) == SocketResult.Success)
|
if (Socket != null && Socket.Send(SocketMessageType.DataRequest, RequestType, RequestID, RequestData) == SocketResult.Success)
|
||||||
|
{
|
||||||
|
await WaitForWorkDoneAsync();
|
||||||
|
}
|
||||||
|
else if (WebSocket != null && await WebSocket.Send(SocketMessageType.DataRequest, RequestType, RequestID, RequestData) == SocketResult.Success)
|
||||||
{
|
{
|
||||||
await WaitForWorkDoneAsync();
|
await WaitForWorkDoneAsync();
|
||||||
}
|
}
|
||||||
@ -168,7 +271,115 @@ namespace Milimoe.FunGame.Core.Api.Transmittal
|
|||||||
Guid id = SocketObject.GetParam<Guid>(1);
|
Guid id = SocketObject.GetParam<Guid>(1);
|
||||||
if (type == RequestType && id == RequestID)
|
if (type == RequestType && id == RequestID)
|
||||||
{
|
{
|
||||||
if (!_IsLongRunning) Dispose();
|
if (!IsLongRunning) Dispose();
|
||||||
|
Work = SocketObject;
|
||||||
|
Working = false;
|
||||||
|
_ResultData = SocketObject.GetParam<Hashtable>(2) ?? [];
|
||||||
|
_Result = RequestResult.Success;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Working = false;
|
||||||
|
_Result = RequestResult.Fail;
|
||||||
|
_Error = e.GetErrorInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 游戏局内请求
|
||||||
|
/// </summary>
|
||||||
|
private class GamingRequest : SocketHandlerController
|
||||||
|
{
|
||||||
|
public Hashtable RequestData { get; } = [];
|
||||||
|
public Hashtable ResultData => _ResultData;
|
||||||
|
public RequestResult Result => _Result;
|
||||||
|
public string Error => _Error;
|
||||||
|
|
||||||
|
private readonly Socket? Socket = null;
|
||||||
|
private readonly HTTPClient? WebSocket = null;
|
||||||
|
private readonly GamingType GamingType = GamingType.None;
|
||||||
|
private readonly Guid RequestID = Guid.Empty;
|
||||||
|
private readonly bool IsLongRunning = false;
|
||||||
|
private Hashtable _ResultData = [];
|
||||||
|
private RequestResult _Result = RequestResult.Missing;
|
||||||
|
private string _Error = "";
|
||||||
|
|
||||||
|
public GamingRequest(Socket? Socket, GamingType GamingType, Guid RequestID, bool IsLongRunning = false) : base(Socket)
|
||||||
|
{
|
||||||
|
this.Socket = Socket;
|
||||||
|
this.GamingType = GamingType;
|
||||||
|
this.RequestID = RequestID;
|
||||||
|
this.IsLongRunning = IsLongRunning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GamingRequest(HTTPClient? WebSocket, GamingType GamingType, Guid RequestID, bool IsLongRunning = false) : base(WebSocket)
|
||||||
|
{
|
||||||
|
this.WebSocket = WebSocket;
|
||||||
|
this.GamingType = GamingType;
|
||||||
|
this.RequestID = RequestID;
|
||||||
|
this.IsLongRunning = IsLongRunning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendRequest()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SetWorking();
|
||||||
|
if (Socket != null && Socket.Send(SocketMessageType.DataRequest, GamingType, RequestID, RequestData) == SocketResult.Success)
|
||||||
|
{
|
||||||
|
WaitForWorkDone();
|
||||||
|
}
|
||||||
|
else if (WebSocket != null)
|
||||||
|
{
|
||||||
|
throw new AsyncRequestException();
|
||||||
|
}
|
||||||
|
else throw new ConnectFailedException();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Working = false;
|
||||||
|
_Result = RequestResult.Fail;
|
||||||
|
_Error = e.GetErrorInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SendRequestAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
SetWorking();
|
||||||
|
if (Socket != null && Socket.Send(SocketMessageType.DataRequest, GamingType, RequestID, RequestData) == SocketResult.Success)
|
||||||
|
{
|
||||||
|
await WaitForWorkDoneAsync();
|
||||||
|
}
|
||||||
|
else if (WebSocket != null && await WebSocket.Send(SocketMessageType.DataRequest, GamingType, RequestID, RequestData) == SocketResult.Success)
|
||||||
|
{
|
||||||
|
await WaitForWorkDoneAsync();
|
||||||
|
}
|
||||||
|
else throw new ConnectFailedException();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Working = false;
|
||||||
|
_Result = RequestResult.Fail;
|
||||||
|
_Error = e.GetErrorInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SocketHandler(SocketObject SocketObject)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (SocketObject.SocketType == SocketMessageType.DataRequest)
|
||||||
|
{
|
||||||
|
GamingType type = SocketObject.GetParam<GamingType>(0);
|
||||||
|
Guid id = SocketObject.GetParam<Guid>(1);
|
||||||
|
if (type == GamingType && id == RequestID)
|
||||||
|
{
|
||||||
|
if (!IsLongRunning) Dispose();
|
||||||
Work = SocketObject;
|
Work = SocketObject;
|
||||||
Working = false;
|
Working = false;
|
||||||
_ResultData = SocketObject.GetParam<Hashtable>(2) ?? [];
|
_ResultData = SocketObject.GetParam<Hashtable>(2) ?? [];
|
||||||
|
|||||||
@ -1,137 +0,0 @@
|
|||||||
using System.Collections;
|
|
||||||
using Milimoe.FunGame.Core.Library.Common.Network;
|
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
|
||||||
using Milimoe.FunGame.Core.Library.Exception;
|
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Api.Transmittal
|
|
||||||
{
|
|
||||||
public class WebDataRequest
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 数据请求结果
|
|
||||||
/// </summary>
|
|
||||||
public RequestResult Result => Worker.Result;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 详细错误信息
|
|
||||||
/// </summary>
|
|
||||||
public string Error => Worker.Error;
|
|
||||||
|
|
||||||
// 获取ResultData中key值对应的Json字符串
|
|
||||||
// -- 此索引器仅返回Json字符串,对象类型请使用反序列化方法GetResult<T>() --
|
|
||||||
// -- 当然也可以自己反序列化 --
|
|
||||||
// -- 基本类型可能有效,但仍建议使用反序列化方法 --
|
|
||||||
public object? this[string key]
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Worker.ResultData[key];
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
AddRequestData(key, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 私有的实现类
|
|
||||||
/// </summary>
|
|
||||||
private readonly WebSocketRequest Worker;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 基于本地已连接的 <see cref="HTTPClient"/> 创建新的数据请求<para/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="Socket"></param>
|
|
||||||
/// <param name="RequestType"></param>
|
|
||||||
internal WebDataRequest(HTTPClient Socket, DataRequestType RequestType)
|
|
||||||
{
|
|
||||||
Worker = new(Socket, RequestType, Guid.NewGuid());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 添加数据
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
public void AddRequestData(string key, object? value)
|
|
||||||
{
|
|
||||||
if (Worker.RequestData.ContainsKey(key)) Worker.RequestData[key] = value;
|
|
||||||
else Worker.RequestData.Add(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 向服务器发送数据请求
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<RequestResult> SendRequest()
|
|
||||||
{
|
|
||||||
await Worker.SendRequestAsync();
|
|
||||||
return Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 异步向服务器发送数据请求
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<RequestResult> SendRequestAsync()
|
|
||||||
{
|
|
||||||
await Worker.SendRequestAsync();
|
|
||||||
return Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取指定key对应的反序列化对象
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T"></typeparam>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public T? GetResult<T>(string key)
|
|
||||||
{
|
|
||||||
return GetHashtableJsonObject<T>(Worker.ResultData, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class WebSocketRequest(HTTPClient? Socket, DataRequestType RequestType, Guid RequestID)
|
|
||||||
{
|
|
||||||
public Hashtable RequestData { get; } = [];
|
|
||||||
public Hashtable ResultData => _ResultData;
|
|
||||||
public RequestResult Result => _Result;
|
|
||||||
public string Error => _Error;
|
|
||||||
|
|
||||||
private readonly HTTPClient? Socket = Socket;
|
|
||||||
private readonly DataRequestType RequestType = RequestType;
|
|
||||||
private readonly Guid RequestID = RequestID;
|
|
||||||
private readonly Hashtable _ResultData = [];
|
|
||||||
private RequestResult _Result = RequestResult.Missing;
|
|
||||||
private string _Error = "";
|
|
||||||
|
|
||||||
public async Task SendRequestAsync()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (Socket != null)
|
|
||||||
{
|
|
||||||
await Socket.Send(SocketMessageType.DataRequest, RequestType, RequestID, RequestData);
|
|
||||||
}
|
|
||||||
else throw new ConnectFailedException();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
_Result = RequestResult.Fail;
|
|
||||||
_Error = e.GetErrorInfo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 反序列化Hashtable中的Json对象
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T"></typeparam>
|
|
||||||
/// <param name="hashtable"></param>
|
|
||||||
/// <param name="key"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static T? GetHashtableJsonObject<T>(Hashtable hashtable, string key)
|
|
||||||
{
|
|
||||||
return Service.JsonManager.GetObject<T>(hashtable, key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -34,7 +34,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取物品实例,默认返回Passiveitem 被动物品 需要强制转换
|
/// 获取物品实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type">Item类型 主动 或 被动</param>
|
/// <param name="type">Item类型 主动 或 被动</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
@ -43,24 +43,6 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
return ItemFactory.Create(type);
|
return ItemFactory.Create(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取主动物品实例
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static ActiveItem GetActiveItem()
|
|
||||||
{
|
|
||||||
return (ActiveItem)ItemFactory.Create(ItemType.Active);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取被动物品实例
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static PassiveItem GetPassiveItem()
|
|
||||||
{
|
|
||||||
return (PassiveItem)ItemFactory.Create(ItemType.Passive);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取房间实例
|
/// 获取房间实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -156,7 +138,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取技能实例,默认返回PassiveSkill 被动技能 需要强制转换
|
/// 获取技能实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type">Skill类型 主动 或 被动</param>
|
/// <param name="type">Skill类型 主动 或 被动</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
@ -165,24 +147,6 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
return SkillFactory.Create(type);
|
return SkillFactory.Create(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取主动技能实例
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static ActiveSkill GetActiveSkill()
|
|
||||||
{
|
|
||||||
return (ActiveSkill)SkillFactory.Create(SkillType.Active);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取被动技能实例
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static PassiveSkill GetPassiveSkill()
|
|
||||||
{
|
|
||||||
return (PassiveSkill)SkillFactory.Create(SkillType.Passive);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取用户实例
|
/// 获取用户实例
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using Milimoe.FunGame.Core.Entity;
|
|
||||||
using Milimoe.FunGame.Core.Library.Common.Addon;
|
using Milimoe.FunGame.Core.Library.Common.Addon;
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
using Milimoe.FunGame.Core.Service;
|
using Milimoe.FunGame.Core.Service;
|
||||||
@ -11,12 +10,12 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 适用于客户端的模组集
|
/// 适用于客户端的模组集
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, GameModule> Modes { get; } = [];
|
public Dictionary<string, GameModule> Modules { get; } = [];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 适用于服务器的模组集
|
/// 适用于服务器的模组集
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, GameModuleServer> ServerModes { get; } = [];
|
public Dictionary<string, GameModuleServer> ServerModules { get; } = [];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 游戏地图集
|
/// 游戏地图集
|
||||||
@ -26,27 +25,24 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 角色表
|
/// 角色表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Character> Characters { get; } = [];
|
public Dictionary<string, CharacterModule> Characters { get; } = [];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 技能表
|
/// 技能表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Skill> Skills { get; } = [];
|
public Dictionary<string, SkillModule> Skills { get; } = [];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 物品表
|
/// 物品表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<Item> Items { get; } = [];
|
public Dictionary<string, ItemModule> Items { get; } = [];
|
||||||
|
|
||||||
private GameModuleLoader()
|
private GameModuleLoader() { }
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 传入 <see cref="FunGameInfo.FunGame"/> 类型来创建指定端的模组读取器
|
/// 传入 <see cref="FunGameInfo.FunGame"/> 类型来创建指定端的模组读取器
|
||||||
/// <para>runtime = <see cref="FunGameInfo.FunGame.FunGame_Desktop"/> 时,仅读取 <seealso cref="Modes"/></para>
|
/// <para>runtime = <see cref="FunGameInfo.FunGame.FunGame_Desktop"/> 时,仅读取 <seealso cref="Modules"/></para>
|
||||||
/// <para>runtime = <see cref="FunGameInfo.FunGame.FunGame_Server"/> 时,仅读取 <seealso cref="ServerModes"/></para>
|
/// <para>runtime = <see cref="FunGameInfo.FunGame.FunGame_Server"/> 时,仅读取 <seealso cref="ServerModules"/></para>
|
||||||
/// <seealso cref="Maps"/> 都会读取
|
/// <seealso cref="Maps"/> 都会读取
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="runtime">传入 <see cref="FunGameInfo.FunGame"/> 类型来创建指定端的模组读取器</param>
|
/// <param name="runtime">传入 <see cref="FunGameInfo.FunGame"/> 类型来创建指定端的模组读取器</param>
|
||||||
@ -58,12 +54,12 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
GameModuleLoader loader = new();
|
GameModuleLoader loader = new();
|
||||||
if (runtime == FunGameInfo.FunGame.FunGame_Desktop)
|
if (runtime == FunGameInfo.FunGame.FunGame_Desktop)
|
||||||
{
|
{
|
||||||
AddonManager.LoadGameModules(loader.Modes, loader.Characters, loader.Skills, loader.Items, delegates, otherobjs);
|
AddonManager.LoadGameModules(loader.Modules, loader.Characters, loader.Skills, loader.Items, delegates, otherobjs);
|
||||||
AddonManager.LoadGameMaps(loader.Maps, otherobjs);
|
AddonManager.LoadGameMaps(loader.Maps, otherobjs);
|
||||||
}
|
}
|
||||||
else if (runtime == FunGameInfo.FunGame.FunGame_Server)
|
else if (runtime == FunGameInfo.FunGame.FunGame_Server)
|
||||||
{
|
{
|
||||||
AddonManager.LoadGameModulesForServer(loader.ServerModes, loader.Characters, loader.Skills, loader.Items, delegates, otherobjs);
|
AddonManager.LoadGameModulesForServer(loader.ServerModules, loader.Characters, loader.Skills, loader.Items, delegates, otherobjs);
|
||||||
AddonManager.LoadGameMaps(loader.Maps, otherobjs);
|
AddonManager.LoadGameMaps(loader.Maps, otherobjs);
|
||||||
}
|
}
|
||||||
return loader;
|
return loader;
|
||||||
@ -79,11 +75,11 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return Modes[name];
|
return Modules[name];
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Modes.TryAdd(name, value);
|
Modules.TryAdd(name, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +90,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public GameModuleServer GetServerMode(string name)
|
public GameModuleServer GetServerMode(string name)
|
||||||
{
|
{
|
||||||
return ServerModes[name];
|
return ServerModules[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -328,7 +328,7 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
#region 加密服务
|
#region 加密服务
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 使用HMACSHA512算法加密
|
/// 加密服务工具箱
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Encryption
|
public class Encryption
|
||||||
{
|
{
|
||||||
@ -380,6 +380,9 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 为字符串(string)添加扩展方法
|
||||||
|
/// </summary>
|
||||||
public static class StringExtension
|
public static class StringExtension
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -398,6 +401,9 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
|
|
||||||
#region 验证服务
|
#region 验证服务
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 验证码服务工具箱
|
||||||
|
/// </summary>
|
||||||
public class Verification
|
public class Verification
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -503,6 +509,9 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
|
|
||||||
#region 多线程服务
|
#region 多线程服务
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 多线程服务工具箱
|
||||||
|
/// </summary>
|
||||||
public class TaskUtility
|
public class TaskUtility
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -22,35 +22,83 @@ namespace Milimoe.FunGame.Core.Controller
|
|||||||
private Func<DataRequestType, DataRequest> MaskMethod_NewLongRunningDataRequest { get; set; }
|
private Func<DataRequestType, DataRequest> MaskMethod_NewLongRunningDataRequest { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 基于本地已连接的Socket创建新的数据请求
|
/// 基于本地已连接的Socket创建新的局内数据请求
|
||||||
|
/// </summary>
|
||||||
|
private Func<GamingType, DataRequest> MaskMethod_NewGamingRequest { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基于本地已连接的Socket创建长时间运行的局内数据请求
|
||||||
|
/// </summary>
|
||||||
|
private Func<GamingType, DataRequest> MaskMethod_NewLongRunningGamingRequest { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基于本地已连接的Socket创建新的数据请求<para/>
|
||||||
|
/// 此方法只允许插件调用,如果是模组和模组服务器调用此方法将抛出异常
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="ModuleServerNewDataRequestException"></exception>
|
/// <exception cref="InvalidNewDataRequestException"></exception>
|
||||||
public DataRequest NewDataRequest(DataRequestType type)
|
public DataRequest NewDataRequest(DataRequestType type)
|
||||||
{
|
{
|
||||||
if (typeof(T).IsAssignableFrom(typeof(IGameModuleServer)))
|
if (typeof(IGameModule).IsAssignableFrom(typeof(T)) || typeof(IGameModuleServer).IsAssignableFrom(typeof(T)))
|
||||||
{
|
{
|
||||||
throw new ModuleServerNewDataRequestException();
|
throw new InvalidNewDataRequestException();
|
||||||
}
|
}
|
||||||
return MaskMethod_NewDataRequest(type);
|
return MaskMethod_NewDataRequest(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 基于本地已连接的Socket创建长时间运行的数据请求
|
/// 基于本地已连接的Socket创建长时间运行的数据请求<para/>
|
||||||
|
/// 此方法只允许插件调用,如果是模组和模组服务器调用此方法将抛出异常
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="ModuleServerNewDataRequestException"></exception>
|
/// <exception cref="InvalidNewDataRequestException"></exception>
|
||||||
public DataRequest NewLongRunningDataRequest(DataRequestType type)
|
public DataRequest NewLongRunningDataRequest(DataRequestType type)
|
||||||
{
|
{
|
||||||
if (typeof(T).IsAssignableFrom(typeof(IGameModuleServer)))
|
if (typeof(IGameModule).IsAssignableFrom(typeof(T)) || typeof(IGameModuleServer).IsAssignableFrom(typeof(T)))
|
||||||
{
|
{
|
||||||
throw new ModuleServerNewDataRequestException();
|
throw new InvalidNewDataRequestException();
|
||||||
}
|
}
|
||||||
return MaskMethod_NewLongRunningDataRequest(type);
|
return MaskMethod_NewLongRunningDataRequest(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基于本地已连接的Socket创建新的局内(<see cref="Model.Gaming"/>)数据请求<para/>
|
||||||
|
/// 此方法是给 <see cref="Library.Common.Addon.GameModule"/> 提供的,但是 <see cref="Library.Common.Addon.Plugin"/> 也能调用<para/>
|
||||||
|
/// 模组服务器调用此方法将抛出异常
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="ConnectFailedException"></exception>
|
||||||
|
/// <exception cref="InvalidNewDataRequestException"></exception>
|
||||||
|
public DataRequest NewDataRequest(GamingType type)
|
||||||
|
{
|
||||||
|
if (typeof(IGameModuleServer).IsAssignableFrom(typeof(T)))
|
||||||
|
{
|
||||||
|
throw new InvalidNewDataRequestException();
|
||||||
|
}
|
||||||
|
return MaskMethod_NewGamingRequest(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基于本地已连接的Socket创建长时间运行的局内(<see cref="Model.Gaming"/>)数据请求<para/>
|
||||||
|
/// 此方法是给 <see cref="Library.Common.Addon.GameModule"/> 提供的,但是 <see cref="Library.Common.Addon.Plugin"/> 也能调用<para/>
|
||||||
|
/// 模组服务器调用此方法将抛出异常
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="ConnectFailedException"></exception>
|
||||||
|
/// <exception cref="InvalidNewDataRequestException"></exception>
|
||||||
|
public DataRequest NewLongRunningDataRequest(GamingType type)
|
||||||
|
{
|
||||||
|
if (typeof(IGameModuleServer).IsAssignableFrom(typeof(T)))
|
||||||
|
{
|
||||||
|
throw new InvalidNewDataRequestException();
|
||||||
|
}
|
||||||
|
return MaskMethod_NewLongRunningGamingRequest(type);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 新建一个AddonController
|
/// 新建一个AddonController
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -60,10 +108,16 @@ namespace Milimoe.FunGame.Core.Controller
|
|||||||
{
|
{
|
||||||
if (delegates.ContainsKey("NewDataRequest")) MaskMethod_NewDataRequest = delegates["NewDataRequest"] != null ? (Func<DataRequestType, DataRequest>)delegates["NewDataRequest"]! : new(DefaultNewDataRequest);
|
if (delegates.ContainsKey("NewDataRequest")) MaskMethod_NewDataRequest = delegates["NewDataRequest"] != null ? (Func<DataRequestType, DataRequest>)delegates["NewDataRequest"]! : new(DefaultNewDataRequest);
|
||||||
if (delegates.ContainsKey("NewLongRunningDataRequest")) MaskMethod_NewLongRunningDataRequest = delegates["NewLongRunningDataRequest"] != null ? (Func<DataRequestType, DataRequest>)delegates["NewLongRunningDataRequest"]! : new(DefaultNewDataRequest);
|
if (delegates.ContainsKey("NewLongRunningDataRequest")) MaskMethod_NewLongRunningDataRequest = delegates["NewLongRunningDataRequest"] != null ? (Func<DataRequestType, DataRequest>)delegates["NewLongRunningDataRequest"]! : new(DefaultNewDataRequest);
|
||||||
|
if (delegates.ContainsKey("NewGamingRequest")) MaskMethod_NewDataRequest = delegates["NewGamingRequest"] != null ? (Func<DataRequestType, DataRequest>)delegates["NewGamingRequest"]! : new(DefaultNewDataRequest);
|
||||||
|
if (delegates.ContainsKey("NewLongRunningGamingRequest")) MaskMethod_NewLongRunningDataRequest = delegates["NewLongRunningGamingRequest"] != null ? (Func<DataRequestType, DataRequest>)delegates["NewLongRunningGamingRequest"]! : new(DefaultNewDataRequest);
|
||||||
MaskMethod_NewDataRequest ??= new(DefaultNewDataRequest);
|
MaskMethod_NewDataRequest ??= new(DefaultNewDataRequest);
|
||||||
MaskMethod_NewLongRunningDataRequest ??= new(DefaultNewDataRequest);
|
MaskMethod_NewLongRunningDataRequest ??= new(DefaultNewDataRequest);
|
||||||
|
MaskMethod_NewGamingRequest ??= new(DefaultNewDataRequest);
|
||||||
|
MaskMethod_NewLongRunningGamingRequest ??= new(DefaultNewDataRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DataRequest DefaultNewDataRequest(DataRequestType type) => throw new ConnectFailedException();
|
private DataRequest DefaultNewDataRequest(DataRequestType type) => throw new InvalidNewDataRequestException();
|
||||||
|
|
||||||
|
private DataRequest DefaultNewDataRequest(GamingType type) => throw new InvalidNewDataRequestException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -286,6 +286,40 @@ namespace Milimoe.FunGame.Core.Controller
|
|||||||
throw new ConnectFailedException();
|
throw new ConnectFailedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基于本地已连接的Socket创建新的局内(<see cref="Model.Gaming"/>)数据请求<para/>
|
||||||
|
/// 此方法是给 <see cref="Library.Common.Addon.GameModule"/> 提供的
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="GamingType"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="ConnectFailedException"></exception>
|
||||||
|
public DataRequest NewDataRequest(GamingType GamingType)
|
||||||
|
{
|
||||||
|
if (_Socket != null)
|
||||||
|
{
|
||||||
|
DataRequest request = new(_Socket, GamingType);
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
throw new ConnectFailedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基于本地已连接的Socket创建长时间运行的局内(<see cref="Model.Gaming"/>)数据请求<para/>
|
||||||
|
/// 此方法是给 <see cref="Library.Common.Addon.GameModule"/> 提供的
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="GamingType"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
/// <exception cref="ConnectFailedException"></exception>
|
||||||
|
public DataRequest NewLongRunningDataRequest(GamingType GamingType)
|
||||||
|
{
|
||||||
|
if (_Socket != null)
|
||||||
|
{
|
||||||
|
DataRequest request = new(_Socket, GamingType, true);
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
throw new ConnectFailedException();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始接收服务器信息
|
/// 开始接收服务器信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -21,7 +21,12 @@ namespace Milimoe.FunGame.Core.Controller
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Socket
|
/// Socket
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly Socket _Socket;
|
private readonly Socket? _Socket;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// WebSocket
|
||||||
|
/// </summary>
|
||||||
|
private readonly HTTPClient? _WebSocket;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 继承请调用base构造
|
/// 继承请调用base构造
|
||||||
@ -37,6 +42,20 @@ namespace Milimoe.FunGame.Core.Controller
|
|||||||
else throw new SocketCreateReceivingException();
|
else throw new SocketCreateReceivingException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 继承请调用base构造
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="websocket">Socket</param>
|
||||||
|
public SocketHandlerController(HTTPClient? websocket)
|
||||||
|
{
|
||||||
|
if (websocket != null)
|
||||||
|
{
|
||||||
|
_WebSocket = websocket;
|
||||||
|
websocket.BindEvent(new SocketManager.SocketReceiveHandler(SocketHandler));
|
||||||
|
}
|
||||||
|
else throw new SocketCreateReceivingException();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 继承请重写此方法
|
/// 继承请重写此方法
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -71,7 +90,8 @@ namespace Milimoe.FunGame.Core.Controller
|
|||||||
{
|
{
|
||||||
if (Disposing)
|
if (Disposing)
|
||||||
{
|
{
|
||||||
_Socket.BindEvent(new SocketManager.SocketReceiveHandler(SocketHandler), true);
|
_Socket?.BindEvent(new SocketManager.SocketReceiveHandler(SocketHandler), true);
|
||||||
|
_WebSocket?.BindEvent(new SocketManager.SocketReceiveHandler(SocketHandler), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IsDisposed = true;
|
IsDisposed = true;
|
||||||
|
|||||||
@ -6,7 +6,8 @@
|
|||||||
<members>
|
<members>
|
||||||
<member name="T:Milimoe.FunGame.Core.Api.Transmittal.DataRequest">
|
<member name="T:Milimoe.FunGame.Core.Api.Transmittal.DataRequest">
|
||||||
<summary>
|
<summary>
|
||||||
需要配合Milimoe.FunGame.Core.Library.Constant.DataRequestType使用
|
需要配合 <see cref="T:Milimoe.FunGame.Core.Library.Constant.DataRequestType"/> 使用<para/>
|
||||||
|
如果是 <see cref="T:Milimoe.FunGame.Core.Model.Gaming"/> 的数据请求,则配合 <see cref="T:Milimoe.FunGame.Core.Library.Constant.GamingType"/> 使用<para/>
|
||||||
确保已添加对应的枚举
|
确保已添加对应的枚举
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
@ -25,6 +26,11 @@
|
|||||||
私有的实现类
|
私有的实现类
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.GamingWorker">
|
||||||
|
<summary>
|
||||||
|
私有的实现类(这是局内请求的)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.#ctor(Milimoe.FunGame.Core.Library.Common.Network.Socket,Milimoe.FunGame.Core.Library.Constant.DataRequestType,System.Boolean)">
|
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.#ctor(Milimoe.FunGame.Core.Library.Common.Network.Socket,Milimoe.FunGame.Core.Library.Constant.DataRequestType,System.Boolean)">
|
||||||
<summary>
|
<summary>
|
||||||
基于本地已连接的 <see cref="T:Milimoe.FunGame.Core.Library.Common.Network.Socket"/> 创建新的数据请求<para/>
|
基于本地已连接的 <see cref="T:Milimoe.FunGame.Core.Library.Common.Network.Socket"/> 创建新的数据请求<para/>
|
||||||
@ -34,6 +40,37 @@
|
|||||||
<param name="RequestType"></param>
|
<param name="RequestType"></param>
|
||||||
<param name="IsLongRunning"></param>
|
<param name="IsLongRunning"></param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.#ctor(Milimoe.FunGame.Core.Library.Common.Network.HTTPClient,Milimoe.FunGame.Core.Library.Constant.DataRequestType,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
基于本地已连接的 <see cref="T:Milimoe.FunGame.Core.Library.Common.Network.HTTPClient"/> 创建新的数据请求<para/>
|
||||||
|
使用 <see cref="T:Milimoe.FunGame.Core.Controller.RunTimeController"/> 中的 <see cref="M:Milimoe.FunGame.Core.Controller.RunTimeController.NewDataRequest(Milimoe.FunGame.Core.Library.Constant.DataRequestType)"/> 创建一个新的请求<para/>
|
||||||
|
此数据请求只能调用异步方法 <see cref="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.SendRequestAsync"/> 请求数据
|
||||||
|
</summary>
|
||||||
|
<param name="WebSocket"></param>
|
||||||
|
<param name="RequestType"></param>
|
||||||
|
<param name="IsLongRunning"></param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.#ctor(Milimoe.FunGame.Core.Library.Common.Network.Socket,Milimoe.FunGame.Core.Library.Constant.GamingType,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
基于本地已连接的 <see cref="T:Milimoe.FunGame.Core.Library.Common.Network.Socket"/> 创建新的局内(<see cref="T:Milimoe.FunGame.Core.Model.Gaming"/>)数据请求<para/>
|
||||||
|
使用 <see cref="T:Milimoe.FunGame.Core.Controller.RunTimeController"/> 中的 <see cref="M:Milimoe.FunGame.Core.Controller.RunTimeController.NewDataRequest(Milimoe.FunGame.Core.Library.Constant.GamingType)"/> 创建一个新的请求<para/>
|
||||||
|
此构造方法是给 <see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModule"/> 提供的
|
||||||
|
</summary>
|
||||||
|
<param name="Socket"></param>
|
||||||
|
<param name="GamingType"></param>
|
||||||
|
<param name="IsLongRunning"></param>
|
||||||
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.#ctor(Milimoe.FunGame.Core.Library.Common.Network.HTTPClient,Milimoe.FunGame.Core.Library.Constant.GamingType,System.Boolean)">
|
||||||
|
<summary>
|
||||||
|
基于本地已连接的 <see cref="T:Milimoe.FunGame.Core.Library.Common.Network.HTTPClient"/> 创建新的局内(<see cref="T:Milimoe.FunGame.Core.Model.Gaming"/>)数据请求<para/>
|
||||||
|
使用 <see cref="T:Milimoe.FunGame.Core.Controller.RunTimeController"/> 中的 <see cref="M:Milimoe.FunGame.Core.Controller.RunTimeController.NewDataRequest(Milimoe.FunGame.Core.Library.Constant.GamingType)"/> 创建一个新的请求<para/>
|
||||||
|
此构造方法是给 <see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModule"/> 提供的<para/>
|
||||||
|
此数据请求只能调用异步方法 <see cref="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.SendRequestAsync"/> 请求数据
|
||||||
|
</summary>
|
||||||
|
<param name="WebSocket"></param>
|
||||||
|
<param name="GamingType"></param>
|
||||||
|
<param name="IsLongRunning"></param>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.AddRequestData(System.String,System.Object)">
|
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.AddRequestData(System.String,System.Object)">
|
||||||
<summary>
|
<summary>
|
||||||
添加数据
|
添加数据
|
||||||
@ -49,8 +86,10 @@
|
|||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.SendRequest">
|
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.SendRequest">
|
||||||
<summary>
|
<summary>
|
||||||
向服务器发送数据请求
|
向服务器发送数据请求
|
||||||
|
<para/>警告:<see cref="T:Milimoe.FunGame.Core.Library.Common.Network.HTTPClient"/> 调用此方法将抛出异常。请调用并等待 <see cref="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.SendRequestAsync"/>
|
||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
|
<exception cref="T:Milimoe.FunGame.AsyncRequestException"></exception>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.SendRequestAsync">
|
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.SendRequestAsync">
|
||||||
<summary>
|
<summary>
|
||||||
@ -66,6 +105,16 @@
|
|||||||
<param name="key"></param>
|
<param name="key"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.SocketRequest">
|
||||||
|
<summary>
|
||||||
|
常规数据请求
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.GamingRequest">
|
||||||
|
<summary>
|
||||||
|
游戏局内请求
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.GetHashtableJsonObject``1(System.Collections.Hashtable,System.String)">
|
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.DataRequest.GetHashtableJsonObject``1(System.Collections.Hashtable,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
反序列化Hashtable中的Json对象
|
反序列化Hashtable中的Json对象
|
||||||
@ -204,64 +253,6 @@
|
|||||||
回滚事务
|
回滚事务
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Milimoe.FunGame.Core.Api.Transmittal.WebDataRequest.Result">
|
|
||||||
<summary>
|
|
||||||
数据请求结果
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="P:Milimoe.FunGame.Core.Api.Transmittal.WebDataRequest.Error">
|
|
||||||
<summary>
|
|
||||||
详细错误信息
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="F:Milimoe.FunGame.Core.Api.Transmittal.WebDataRequest.Worker">
|
|
||||||
<summary>
|
|
||||||
私有的实现类
|
|
||||||
</summary>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.WebDataRequest.#ctor(Milimoe.FunGame.Core.Library.Common.Network.HTTPClient,Milimoe.FunGame.Core.Library.Constant.DataRequestType)">
|
|
||||||
<summary>
|
|
||||||
基于本地已连接的 <see cref="T:Milimoe.FunGame.Core.Library.Common.Network.HTTPClient"/> 创建新的数据请求<para/>
|
|
||||||
</summary>
|
|
||||||
<param name="Socket"></param>
|
|
||||||
<param name="RequestType"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.WebDataRequest.AddRequestData(System.String,System.Object)">
|
|
||||||
<summary>
|
|
||||||
添加数据
|
|
||||||
</summary>
|
|
||||||
<param name="key"></param>
|
|
||||||
<param name="value"></param>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.WebDataRequest.SendRequest">
|
|
||||||
<summary>
|
|
||||||
向服务器发送数据请求
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.WebDataRequest.SendRequestAsync">
|
|
||||||
<summary>
|
|
||||||
异步向服务器发送数据请求
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.WebDataRequest.GetResult``1(System.String)">
|
|
||||||
<summary>
|
|
||||||
获取指定key对应的反序列化对象
|
|
||||||
</summary>
|
|
||||||
<typeparam name="T"></typeparam>
|
|
||||||
<param name="key"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Transmittal.WebDataRequest.GetHashtableJsonObject``1(System.Collections.Hashtable,System.String)">
|
|
||||||
<summary>
|
|
||||||
反序列化Hashtable中的Json对象
|
|
||||||
</summary>
|
|
||||||
<typeparam name="T"></typeparam>
|
|
||||||
<param name="hashtable"></param>
|
|
||||||
<param name="key"></param>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetCharacter">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetCharacter">
|
||||||
<summary>
|
<summary>
|
||||||
获取角色实例
|
获取角色实例
|
||||||
@ -276,23 +267,11 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetItem(Milimoe.FunGame.Core.Library.Constant.ItemType)">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetItem(Milimoe.FunGame.Core.Library.Constant.ItemType)">
|
||||||
<summary>
|
<summary>
|
||||||
获取物品实例,默认返回Passiveitem 被动物品 需要强制转换
|
获取物品实例
|
||||||
</summary>
|
</summary>
|
||||||
<param name="type">Item类型 主动 或 被动</param>
|
<param name="type">Item类型 主动 或 被动</param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetActiveItem">
|
|
||||||
<summary>
|
|
||||||
获取主动物品实例
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetPassiveItem">
|
|
||||||
<summary>
|
|
||||||
获取被动物品实例
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetRoom(System.Int64,System.String,System.Nullable{System.DateTime},Milimoe.FunGame.Core.Entity.User,Milimoe.FunGame.Core.Library.Constant.RoomType,System.String,System.String,Milimoe.FunGame.Core.Library.Constant.RoomState,System.Boolean,System.String)">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetRoom(System.Int64,System.String,System.Nullable{System.DateTime},Milimoe.FunGame.Core.Entity.User,Milimoe.FunGame.Core.Library.Constant.RoomType,System.String,System.String,Milimoe.FunGame.Core.Library.Constant.RoomState,System.Boolean,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
获取房间实例
|
获取房间实例
|
||||||
@ -333,23 +312,11 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetSkill(Milimoe.FunGame.Core.Library.Constant.SkillType)">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetSkill(Milimoe.FunGame.Core.Library.Constant.SkillType)">
|
||||||
<summary>
|
<summary>
|
||||||
获取技能实例,默认返回PassiveSkill 被动技能 需要强制转换
|
获取技能实例
|
||||||
</summary>
|
</summary>
|
||||||
<param name="type">Skill类型 主动 或 被动</param>
|
<param name="type">Skill类型 主动 或 被动</param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetActiveSkill">
|
|
||||||
<summary>
|
|
||||||
获取主动技能实例
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetPassiveSkill">
|
|
||||||
<summary>
|
|
||||||
获取被动技能实例
|
|
||||||
</summary>
|
|
||||||
<returns></returns>
|
|
||||||
</member>
|
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetUser">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.Factory.GetUser">
|
||||||
<summary>
|
<summary>
|
||||||
获取用户实例
|
获取用户实例
|
||||||
@ -389,12 +356,12 @@
|
|||||||
<param name="dr"></param>
|
<param name="dr"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.Modes">
|
<member name="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.Modules">
|
||||||
<summary>
|
<summary>
|
||||||
适用于客户端的模组集
|
适用于客户端的模组集
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.ServerModes">
|
<member name="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.ServerModules">
|
||||||
<summary>
|
<summary>
|
||||||
适用于服务器的模组集
|
适用于服务器的模组集
|
||||||
</summary>
|
</summary>
|
||||||
@ -422,8 +389,8 @@
|
|||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.LoadGameModules(Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame,System.Collections.Hashtable,System.Object[])">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.LoadGameModules(Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame,System.Collections.Hashtable,System.Object[])">
|
||||||
<summary>
|
<summary>
|
||||||
传入 <see cref="T:Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame"/> 类型来创建指定端的模组读取器
|
传入 <see cref="T:Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame"/> 类型来创建指定端的模组读取器
|
||||||
<para>runtime = <see cref="F:Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame.FunGame_Desktop"/> 时,仅读取 <seealso cref="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.Modes"/></para>
|
<para>runtime = <see cref="F:Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame.FunGame_Desktop"/> 时,仅读取 <seealso cref="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.Modules"/></para>
|
||||||
<para>runtime = <see cref="F:Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame.FunGame_Server"/> 时,仅读取 <seealso cref="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.ServerModes"/></para>
|
<para>runtime = <see cref="F:Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame.FunGame_Server"/> 时,仅读取 <seealso cref="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.ServerModules"/></para>
|
||||||
<seealso cref="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.Maps"/> 都会读取
|
<seealso cref="P:Milimoe.FunGame.Core.Api.Utility.GameModuleLoader.Maps"/> 都会读取
|
||||||
</summary>
|
</summary>
|
||||||
<param name="runtime">传入 <see cref="T:Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame"/> 类型来创建指定端的模组读取器</param>
|
<param name="runtime">传入 <see cref="T:Milimoe.FunGame.Core.Library.Constant.FunGameInfo.FunGame"/> 类型来创建指定端的模组读取器</param>
|
||||||
@ -638,7 +605,7 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="T:Milimoe.FunGame.Core.Api.Utility.Encryption">
|
<member name="T:Milimoe.FunGame.Core.Api.Utility.Encryption">
|
||||||
<summary>
|
<summary>
|
||||||
使用HMACSHA512算法加密
|
加密服务工具箱
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Encryption.HmacSha512(System.String,System.String)">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.Encryption.HmacSha512(System.String,System.String)">
|
||||||
@ -665,6 +632,11 @@
|
|||||||
<param name="PrivateKey">私钥</param>
|
<param name="PrivateKey">私钥</param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:Milimoe.FunGame.Core.Api.Utility.StringExtension">
|
||||||
|
<summary>
|
||||||
|
为字符串(string)添加扩展方法
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.StringExtension.Encrypt(System.String,System.String)">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.StringExtension.Encrypt(System.String,System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
使用HMACSHA512算法加密
|
使用HMACSHA512算法加密
|
||||||
@ -673,6 +645,11 @@
|
|||||||
<param name="key">秘钥</param>
|
<param name="key">秘钥</param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:Milimoe.FunGame.Core.Api.Utility.Verification">
|
||||||
|
<summary>
|
||||||
|
验证码服务工具箱
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.Verification.CreateVerifyCode(Milimoe.FunGame.Core.Library.Constant.VerifyCodeType,System.Int32)">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.Verification.CreateVerifyCode(Milimoe.FunGame.Core.Library.Constant.VerifyCodeType,System.Int32)">
|
||||||
<summary>
|
<summary>
|
||||||
生成验证码
|
生成验证码
|
||||||
@ -702,6 +679,11 @@
|
|||||||
<param name="length"></param>
|
<param name="length"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:Milimoe.FunGame.Core.Api.Utility.TaskUtility">
|
||||||
|
<summary>
|
||||||
|
多线程服务工具箱
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.TaskUtility.NewTask(System.Action)">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.TaskUtility.NewTask(System.Action)">
|
||||||
<summary>
|
<summary>
|
||||||
开启一个任务:调用返回对象的OnCompleted()方法可以执行后续操作,支持异步
|
开启一个任务:调用返回对象的OnCompleted()方法可以执行后续操作,支持异步
|
||||||
@ -1162,21 +1144,55 @@
|
|||||||
基于本地已连接的Socket创建长时间运行的数据请求
|
基于本地已连接的Socket创建长时间运行的数据请求
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Controller.AddonController`1.MaskMethod_NewGamingRequest">
|
||||||
|
<summary>
|
||||||
|
基于本地已连接的Socket创建新的局内数据请求
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Controller.AddonController`1.MaskMethod_NewLongRunningGamingRequest">
|
||||||
|
<summary>
|
||||||
|
基于本地已连接的Socket创建长时间运行的局内数据请求
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Controller.AddonController`1.NewDataRequest(Milimoe.FunGame.Core.Library.Constant.DataRequestType)">
|
<member name="M:Milimoe.FunGame.Core.Controller.AddonController`1.NewDataRequest(Milimoe.FunGame.Core.Library.Constant.DataRequestType)">
|
||||||
<summary>
|
<summary>
|
||||||
基于本地已连接的Socket创建新的数据请求
|
基于本地已连接的Socket创建新的数据请求<para/>
|
||||||
|
此方法只允许插件调用,如果是模组和模组服务器调用此方法将抛出异常
|
||||||
</summary>
|
</summary>
|
||||||
<param name="type"></param>
|
<param name="type"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
<exception cref="T:Milimoe.FunGame.ModuleServerNewDataRequestException"></exception>
|
<exception cref="T:Milimoe.FunGame.InvalidNewDataRequestException"></exception>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Controller.AddonController`1.NewLongRunningDataRequest(Milimoe.FunGame.Core.Library.Constant.DataRequestType)">
|
<member name="M:Milimoe.FunGame.Core.Controller.AddonController`1.NewLongRunningDataRequest(Milimoe.FunGame.Core.Library.Constant.DataRequestType)">
|
||||||
<summary>
|
<summary>
|
||||||
基于本地已连接的Socket创建长时间运行的数据请求
|
基于本地已连接的Socket创建长时间运行的数据请求<para/>
|
||||||
|
此方法只允许插件调用,如果是模组和模组服务器调用此方法将抛出异常
|
||||||
</summary>
|
</summary>
|
||||||
<param name="type"></param>
|
<param name="type"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
<exception cref="T:Milimoe.FunGame.ModuleServerNewDataRequestException"></exception>
|
<exception cref="T:Milimoe.FunGame.InvalidNewDataRequestException"></exception>
|
||||||
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Controller.AddonController`1.NewDataRequest(Milimoe.FunGame.Core.Library.Constant.GamingType)">
|
||||||
|
<summary>
|
||||||
|
基于本地已连接的Socket创建新的局内(<see cref="T:Milimoe.FunGame.Core.Model.Gaming"/>)数据请求<para/>
|
||||||
|
此方法是给 <see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModule"/> 提供的,但是 <see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.Plugin"/> 也能调用<para/>
|
||||||
|
模组服务器调用此方法将抛出异常
|
||||||
|
</summary>
|
||||||
|
<param name="type"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:Milimoe.FunGame.ConnectFailedException"></exception>
|
||||||
|
<exception cref="T:Milimoe.FunGame.InvalidNewDataRequestException"></exception>
|
||||||
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Controller.AddonController`1.NewLongRunningDataRequest(Milimoe.FunGame.Core.Library.Constant.GamingType)">
|
||||||
|
<summary>
|
||||||
|
基于本地已连接的Socket创建长时间运行的局内(<see cref="T:Milimoe.FunGame.Core.Model.Gaming"/>)数据请求<para/>
|
||||||
|
此方法是给 <see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModule"/> 提供的,但是 <see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.Plugin"/> 也能调用<para/>
|
||||||
|
模组服务器调用此方法将抛出异常
|
||||||
|
</summary>
|
||||||
|
<param name="type"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:Milimoe.FunGame.ConnectFailedException"></exception>
|
||||||
|
<exception cref="T:Milimoe.FunGame.InvalidNewDataRequestException"></exception>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Controller.AddonController`1.#ctor(Milimoe.FunGame.Core.Interface.Addons.IAddon,System.Collections.Hashtable)">
|
<member name="M:Milimoe.FunGame.Core.Controller.AddonController`1.#ctor(Milimoe.FunGame.Core.Interface.Addons.IAddon,System.Collections.Hashtable)">
|
||||||
<summary>
|
<summary>
|
||||||
@ -1357,6 +1373,24 @@
|
|||||||
<returns></returns>
|
<returns></returns>
|
||||||
<exception cref="T:Milimoe.FunGame.ConnectFailedException"></exception>
|
<exception cref="T:Milimoe.FunGame.ConnectFailedException"></exception>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Controller.RunTimeController.NewDataRequest(Milimoe.FunGame.Core.Library.Constant.GamingType)">
|
||||||
|
<summary>
|
||||||
|
基于本地已连接的Socket创建新的局内(<see cref="T:Milimoe.FunGame.Core.Model.Gaming"/>)数据请求<para/>
|
||||||
|
此方法是给 <see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModule"/> 提供的
|
||||||
|
</summary>
|
||||||
|
<param name="GamingType"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:Milimoe.FunGame.ConnectFailedException"></exception>
|
||||||
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Controller.RunTimeController.NewLongRunningDataRequest(Milimoe.FunGame.Core.Library.Constant.GamingType)">
|
||||||
|
<summary>
|
||||||
|
基于本地已连接的Socket创建长时间运行的局内(<see cref="T:Milimoe.FunGame.Core.Model.Gaming"/>)数据请求<para/>
|
||||||
|
此方法是给 <see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModule"/> 提供的
|
||||||
|
</summary>
|
||||||
|
<param name="GamingType"></param>
|
||||||
|
<returns></returns>
|
||||||
|
<exception cref="T:Milimoe.FunGame.ConnectFailedException"></exception>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Controller.RunTimeController.StartReceiving">
|
<member name="M:Milimoe.FunGame.Core.Controller.RunTimeController.StartReceiving">
|
||||||
<summary>
|
<summary>
|
||||||
开始接收服务器信息
|
开始接收服务器信息
|
||||||
@ -1452,12 +1486,23 @@
|
|||||||
Socket
|
Socket
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="F:Milimoe.FunGame.Core.Controller.SocketHandlerController._WebSocket">
|
||||||
|
<summary>
|
||||||
|
WebSocket
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Controller.SocketHandlerController.#ctor(Milimoe.FunGame.Core.Library.Common.Network.Socket)">
|
<member name="M:Milimoe.FunGame.Core.Controller.SocketHandlerController.#ctor(Milimoe.FunGame.Core.Library.Common.Network.Socket)">
|
||||||
<summary>
|
<summary>
|
||||||
继承请调用base构造
|
继承请调用base构造
|
||||||
</summary>
|
</summary>
|
||||||
<param name="socket">Socket</param>
|
<param name="socket">Socket</param>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Controller.SocketHandlerController.#ctor(Milimoe.FunGame.Core.Library.Common.Network.HTTPClient)">
|
||||||
|
<summary>
|
||||||
|
继承请调用base构造
|
||||||
|
</summary>
|
||||||
|
<param name="websocket">Socket</param>
|
||||||
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Controller.SocketHandlerController.SocketHandler(Milimoe.FunGame.Core.Library.Common.Network.SocketObject)">
|
<member name="M:Milimoe.FunGame.Core.Controller.SocketHandlerController.SocketHandler(Milimoe.FunGame.Core.Library.Common.Network.SocketObject)">
|
||||||
<summary>
|
<summary>
|
||||||
继承请重写此方法
|
继承请重写此方法
|
||||||
@ -1497,6 +1542,251 @@
|
|||||||
触发关闭事件
|
触发关闭事件
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.BaseEntity.Id">
|
||||||
|
<summary>
|
||||||
|
实体的数字ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.BaseEntity.Guid">
|
||||||
|
<summary>
|
||||||
|
实体的唯一ID
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.BaseEntity.Name">
|
||||||
|
<summary>
|
||||||
|
实体的名称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.FirstName">
|
||||||
|
<summary>
|
||||||
|
角色的名字
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.NickName">
|
||||||
|
<summary>
|
||||||
|
角色的昵称
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.User">
|
||||||
|
<summary>
|
||||||
|
角色所属的玩家
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.Statistics">
|
||||||
|
<summary>
|
||||||
|
角色统计数据
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.MagicType">
|
||||||
|
<summary>
|
||||||
|
魔法属性
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.FirstRoleType">
|
||||||
|
<summary>
|
||||||
|
角色定位1
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.SecondRoleType">
|
||||||
|
<summary>
|
||||||
|
角色定位2
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.ThirdRoleType">
|
||||||
|
<summary>
|
||||||
|
角色定位3
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.RoleRating">
|
||||||
|
<summary>
|
||||||
|
角色评级
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.Promotion">
|
||||||
|
<summary>
|
||||||
|
晋升点数
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.Level">
|
||||||
|
<summary>
|
||||||
|
等级
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.EXP">
|
||||||
|
<summary>
|
||||||
|
经验值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.BaseHP">
|
||||||
|
<summary>
|
||||||
|
基础生命值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.HP">
|
||||||
|
<summary>
|
||||||
|
生命值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.BaseMP">
|
||||||
|
<summary>
|
||||||
|
基础魔法值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.MP">
|
||||||
|
<summary>
|
||||||
|
魔法值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.EP">
|
||||||
|
<summary>
|
||||||
|
能量
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.BaseATK">
|
||||||
|
<summary>
|
||||||
|
基础攻击力
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.ATK">
|
||||||
|
<summary>
|
||||||
|
攻击力
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.BaseDEF">
|
||||||
|
<summary>
|
||||||
|
基础物理护甲
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.DEF">
|
||||||
|
<summary>
|
||||||
|
物理护甲
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.PDR">
|
||||||
|
<summary>
|
||||||
|
物理伤害减免(%)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.MDF">
|
||||||
|
<summary>
|
||||||
|
魔法抗性(%)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.PhysicalPenetration">
|
||||||
|
<summary>
|
||||||
|
物理穿透(%)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.MagicalPenetration">
|
||||||
|
<summary>
|
||||||
|
魔法穿透(%)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.HR">
|
||||||
|
<summary>
|
||||||
|
生命回复力
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.MR">
|
||||||
|
<summary>
|
||||||
|
魔法回复力
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.ER">
|
||||||
|
<summary>
|
||||||
|
能量回复力
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.BaseSTR">
|
||||||
|
<summary>
|
||||||
|
基础力量
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.BaseAGI">
|
||||||
|
<summary>
|
||||||
|
基础敏捷
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.BaseINT">
|
||||||
|
<summary>
|
||||||
|
基础智力
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.STR">
|
||||||
|
<summary>
|
||||||
|
力量
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.AGI">
|
||||||
|
<summary>
|
||||||
|
敏捷
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.INT">
|
||||||
|
<summary>
|
||||||
|
智力
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.STRGrowth">
|
||||||
|
<summary>
|
||||||
|
力量成长值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.AGIGrowth">
|
||||||
|
<summary>
|
||||||
|
敏捷成长值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.INTGrowth">
|
||||||
|
<summary>
|
||||||
|
智力成长值
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.SPD">
|
||||||
|
<summary>
|
||||||
|
速度
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.ActionCoefficient">
|
||||||
|
<summary>
|
||||||
|
行动系数(%)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.AccelerationCoefficient">
|
||||||
|
<summary>
|
||||||
|
加速系数(%)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.ATR">
|
||||||
|
<summary>
|
||||||
|
攻击距离
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.CritRate">
|
||||||
|
<summary>
|
||||||
|
暴击率(%)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.CritDMG">
|
||||||
|
<summary>
|
||||||
|
暴击伤害
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.EvadeRate">
|
||||||
|
<summary>
|
||||||
|
闪避率(%)
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.Skills">
|
||||||
|
<summary>
|
||||||
|
角色的技能组
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Entity.Character.Items">
|
||||||
|
<summary>
|
||||||
|
角色携带的物品
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Milimoe.FunGame.Core.Entity.UserStatistics">
|
<member name="T:Milimoe.FunGame.Core.Entity.UserStatistics">
|
||||||
<summary>
|
<summary>
|
||||||
记录 <see cref="T:Milimoe.FunGame.Core.Entity.User"/> 的生涯、赛季统计数据<para/>
|
记录 <see cref="T:Milimoe.FunGame.Core.Entity.User"/> 的生涯、赛季统计数据<para/>
|
||||||
@ -1641,7 +1931,7 @@
|
|||||||
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.Example.ExampleGameModule">
|
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.Example.ExampleGameModule">
|
||||||
<summary>
|
<summary>
|
||||||
模组:必须继承基类:<see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModule"/><para/>
|
模组:必须继承基类:<see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModule"/><para/>
|
||||||
继承事件接口并实现其方法来使模组生效。例如继承:<seealso cref="T:Milimoe.FunGame.Core.Interface.IGamingConnectEvent"/><para/>
|
继承事件接口并实现其方法来使模组生效。例如继承:<seealso cref="T:Milimoe.FunGame.Core.Interface.IGamingUpdateInfoEvent"/><para/>
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.Example.ExampleGameModuleServer">
|
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.Example.ExampleGameModuleServer">
|
||||||
@ -1655,6 +1945,21 @@
|
|||||||
地图:必须继承基类:<see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameMap"/><para/>
|
地图:必须继承基类:<see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.GameMap"/><para/>
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.Example.ExampleCharacterModule">
|
||||||
|
<summary>
|
||||||
|
角色:必须继承基类:<see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.CharacterModule"/><para/>
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.Example.ExampleSkillModule">
|
||||||
|
<summary>
|
||||||
|
技能:必须继承基类:<see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.SkillModule"/><para/>
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.Example.ExampleItemModule">
|
||||||
|
<summary>
|
||||||
|
物品:必须继承基类:<see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.ItemModule"/><para/>
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.Example.ExamplePlugin">
|
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.Example.ExamplePlugin">
|
||||||
<summary>
|
<summary>
|
||||||
必须继承基类:<see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.Plugin"/><para/>
|
必须继承基类:<see cref="T:Milimoe.FunGame.Core.Library.Common.Addon.Plugin"/><para/>
|
||||||
@ -1772,7 +2077,7 @@
|
|||||||
<member name="M:Milimoe.FunGame.Core.Library.Common.Addon.GameModule.StartGame(Milimoe.FunGame.Core.Model.Gaming,System.Object[])">
|
<member name="M:Milimoe.FunGame.Core.Library.Common.Addon.GameModule.StartGame(Milimoe.FunGame.Core.Model.Gaming,System.Object[])">
|
||||||
<summary>
|
<summary>
|
||||||
必须重写此方法,游戏的主要逻辑写在这里面<para/>
|
必须重写此方法,游戏的主要逻辑写在这里面<para/>
|
||||||
此方法会在 <see cref="M:Milimoe.FunGame.Core.Model.Gaming.StartGame(Milimoe.FunGame.Core.Library.Common.Addon.GameModule,Milimoe.FunGame.Core.Entity.Room,System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.User},System.Object[])"/> 时调用<para/>
|
此方法会在 <see cref="M:Milimoe.FunGame.Core.Model.Gaming.StartGame(Milimoe.FunGame.Core.Library.Common.Addon.GameModule,Milimoe.FunGame.Core.Entity.Room,Milimoe.FunGame.Core.Entity.User,System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.User},Milimoe.FunGame.Core.Api.Utility.GameModuleLoader,System.Object[])"/> 时调用<para/>
|
||||||
</summary>
|
</summary>
|
||||||
<param name="instance"></param>
|
<param name="instance"></param>
|
||||||
<param name="args"></param>
|
<param name="args"></param>
|
||||||
@ -1828,32 +2133,70 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend">
|
<member name="T:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend">
|
||||||
<summary>
|
<summary>
|
||||||
模组的依赖集合
|
模组的依赖集合<para/>
|
||||||
|
<paramref name="maps"></paramref>(地图名称(<see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.GameMap.Name"/>)的数组)<para/>
|
||||||
|
<paramref name="characters"></paramref>(角色模组名称(<see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.CharacterModule.Name"/>)的数组)<para/>
|
||||||
|
<paramref name="skills"></paramref>(技能模组名称(<see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.SkillModule.Name"/>)的数组)<para/>
|
||||||
|
<paramref name="items"></paramref>(物品模组名称(<see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.ItemModule.Name"/>)的数组)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.#ctor(System.String[],System.String[],System.String[],System.String[])">
|
<member name="M:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.#ctor(System.String[],System.String[],System.String[],System.String[])">
|
||||||
<summary>
|
<summary>
|
||||||
模组的依赖集合
|
模组的依赖集合<para/>
|
||||||
|
<paramref name="maps"></paramref>(地图名称(<see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.GameMap.Name"/>)的数组)<para/>
|
||||||
|
<paramref name="characters"></paramref>(角色模组名称(<see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.CharacterModule.Name"/>)的数组)<para/>
|
||||||
|
<paramref name="skills"></paramref>(技能模组名称(<see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.SkillModule.Name"/>)的数组)<para/>
|
||||||
|
<paramref name="items"></paramref>(物品模组名称(<see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.ItemModule.Name"/>)的数组)
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Maps">
|
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.MapsDepend">
|
||||||
<summary>
|
<summary>
|
||||||
模组所使用的地图组
|
模组所使用的地图组
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Characters">
|
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.CharactersDepend">
|
||||||
<summary>
|
<summary>
|
||||||
模组所使用的角色组
|
模组所使用的角色组
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Items">
|
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.SkillsDepend">
|
||||||
|
<summary>
|
||||||
|
模组所使用的技能组
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.ItemsDepend">
|
||||||
<summary>
|
<summary>
|
||||||
模组所使用的物品组
|
模组所使用的物品组
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Maps">
|
||||||
|
<summary>
|
||||||
|
实际使用的地图组对象<para/>
|
||||||
|
请使用 <see cref="M:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.GetDependencies(Milimoe.FunGame.Core.Api.Utility.GameModuleLoader)"/> 自动填充,不要自己添加
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Characters">
|
||||||
|
<summary>
|
||||||
|
实际使用的角色组对象<para/>
|
||||||
|
请使用 <see cref="M:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.GetDependencies(Milimoe.FunGame.Core.Api.Utility.GameModuleLoader)"/> 自动填充,不要自己添加
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Skills">
|
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Skills">
|
||||||
<summary>
|
<summary>
|
||||||
模组所使用的技能组
|
实际使用的技能组对象<para/>
|
||||||
|
请使用 <see cref="M:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.GetDependencies(Milimoe.FunGame.Core.Api.Utility.GameModuleLoader)"/> 自动填充,不要自己添加
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Items">
|
||||||
|
<summary>
|
||||||
|
实际使用的物品组对象<para/>
|
||||||
|
请使用 <see cref="M:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.GetDependencies(Milimoe.FunGame.Core.Api.Utility.GameModuleLoader)"/> 自动填充,不要自己添加
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.GetDependencies(Milimoe.FunGame.Core.Api.Utility.GameModuleLoader)">
|
||||||
|
<summary>
|
||||||
|
获得所有的依赖项<para/>
|
||||||
|
此方法会自动填充 <see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Maps"/> <see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Characters"/> <see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Skills"/> <see cref="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleDepend.Items"/>
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleServer.Name">
|
<member name="P:Milimoe.FunGame.Core.Library.Common.Addon.GameModuleServer.Name">
|
||||||
@ -1904,7 +2247,7 @@
|
|||||||
<param name="Room"></param>
|
<param name="Room"></param>
|
||||||
<param name="Users"></param>
|
<param name="Users"></param>
|
||||||
<param name="RoomMasterServerModel"></param>
|
<param name="RoomMasterServerModel"></param>
|
||||||
<param name="OthersServerModel"></param>
|
<param name="ServerModels"></param>
|
||||||
<param name="Args"></param>
|
<param name="Args"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
@ -2586,13 +2929,20 @@
|
|||||||
游戏的参数
|
游戏的参数
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Model.Gaming.StartGame(Milimoe.FunGame.Core.Library.Common.Addon.GameModule,Milimoe.FunGame.Core.Entity.Room,System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.User},System.Object[])">
|
<member name="P:Milimoe.FunGame.Core.Model.Gaming.CurrentUser">
|
||||||
|
<summary>
|
||||||
|
此实例所属的玩家
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Model.Gaming.StartGame(Milimoe.FunGame.Core.Library.Common.Addon.GameModule,Milimoe.FunGame.Core.Entity.Room,Milimoe.FunGame.Core.Entity.User,System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.User},Milimoe.FunGame.Core.Api.Utility.GameModuleLoader,System.Object[])">
|
||||||
<summary>
|
<summary>
|
||||||
传入游戏所需的参数,构造一个Gaming实例
|
传入游戏所需的参数,构造一个Gaming实例
|
||||||
</summary>
|
</summary>
|
||||||
<param name="module"></param>
|
<param name="module"></param>
|
||||||
<param name="room"></param>
|
<param name="room"></param>
|
||||||
|
<param name="user"></param>
|
||||||
<param name="users"></param>
|
<param name="users"></param>
|
||||||
|
<param name="loader"></param>
|
||||||
<param name="args"></param>
|
<param name="args"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
@ -2604,7 +2954,6 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<param name="type">消息类型</param>
|
<param name="type">消息类型</param>
|
||||||
<param name="data">接收到的数据</param>
|
<param name="data">接收到的数据</param>
|
||||||
<returns>底层会将哈希表中的数据发送给服务器</returns>
|
|
||||||
</member>
|
</member>
|
||||||
<member name="P:Milimoe.FunGame.Core.Model.Session.Server_Address">
|
<member name="P:Milimoe.FunGame.Core.Model.Session.Server_Address">
|
||||||
<summary>
|
<summary>
|
||||||
@ -2650,7 +2999,7 @@
|
|||||||
<param name="otherobjs"></param>
|
<param name="otherobjs"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Service.AddonManager.LoadGameModules(System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.GameModule},System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.Character},System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.Skill},System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.Item},System.Collections.Hashtable,System.Object[])">
|
<member name="M:Milimoe.FunGame.Core.Service.AddonManager.LoadGameModules(System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.GameModule},System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.CharacterModule},System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.SkillModule},System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.ItemModule},System.Collections.Hashtable,System.Object[])">
|
||||||
<summary>
|
<summary>
|
||||||
从modules目录加载所有模组
|
从modules目录加载所有模组
|
||||||
</summary>
|
</summary>
|
||||||
@ -2662,7 +3011,7 @@
|
|||||||
<param name="otherobjs"></param>
|
<param name="otherobjs"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:Milimoe.FunGame.Core.Service.AddonManager.LoadGameModulesForServer(System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.GameModuleServer},System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.Character},System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.Skill},System.Collections.Generic.List{Milimoe.FunGame.Core.Entity.Item},System.Collections.Hashtable,System.Object[])">
|
<member name="M:Milimoe.FunGame.Core.Service.AddonManager.LoadGameModulesForServer(System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.GameModuleServer},System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.CharacterModule},System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.SkillModule},System.Collections.Generic.Dictionary{System.String,Milimoe.FunGame.Core.Library.Common.Addon.ItemModule},System.Collections.Hashtable,System.Object[])">
|
||||||
<summary>
|
<summary>
|
||||||
从modules目录加载所有适用于服务器的模组
|
从modules目录加载所有适用于服务器的模组
|
||||||
</summary>
|
</summary>
|
||||||
@ -2682,6 +3031,15 @@
|
|||||||
<param name="objs"></param>
|
<param name="objs"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Milimoe.FunGame.Core.Service.AddonManager.AddAddonInstances``1(System.Type,System.Collections.Generic.Dictionary{System.String,``0},System.Func{``0,System.Boolean})">
|
||||||
|
<summary>
|
||||||
|
添加构造好的模组类实例到字典中
|
||||||
|
</summary>
|
||||||
|
<typeparam name="T">加载的类型</typeparam>
|
||||||
|
<param name="type">循环程序集的类型</param>
|
||||||
|
<param name="dictionary">实例的字典</param>
|
||||||
|
<param name="isadd">加载时触发的检查方法,返回false不添加</param>
|
||||||
|
</member>
|
||||||
<member name="F:Milimoe.FunGame.Core.Service.JsonManager.GeneralOptions">
|
<member name="F:Milimoe.FunGame.Core.Service.JsonManager.GeneralOptions">
|
||||||
<summary>
|
<summary>
|
||||||
默认的序列化选项
|
默认的序列化选项
|
||||||
|
|||||||
@ -4,8 +4,19 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
{
|
{
|
||||||
public abstract class BaseEntity : IBaseEntity
|
public abstract class BaseEntity : IBaseEntity
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 实体的数字ID
|
||||||
|
/// </summary>
|
||||||
public virtual long Id { get; set; } = 0;
|
public virtual long Id { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 实体的唯一ID
|
||||||
|
/// </summary>
|
||||||
public virtual Guid Guid { get; set; } = Guid.Empty;
|
public virtual Guid Guid { get; set; } = Guid.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 实体的名称
|
||||||
|
/// </summary>
|
||||||
public virtual string Name { get; set; } = "";
|
public virtual string Name { get; set; } = "";
|
||||||
|
|
||||||
public abstract bool Equals(IBaseEntity? other);
|
public abstract bool Equals(IBaseEntity? other);
|
||||||
|
|||||||
@ -1,56 +1,239 @@
|
|||||||
using System.Collections;
|
using Milimoe.FunGame.Core.Interface.Entity;
|
||||||
using Milimoe.FunGame.Core.Interface.Entity;
|
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Entity
|
namespace Milimoe.FunGame.Core.Entity
|
||||||
{
|
{
|
||||||
public class Character : BaseEntity
|
public class Character : BaseEntity, ICopyable<Character>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 角色的名字
|
||||||
|
/// </summary>
|
||||||
public string FirstName { get; set; } = "";
|
public string FirstName { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色的昵称
|
||||||
|
/// </summary>
|
||||||
public string NickName { get; set; } = "";
|
public string NickName { get; set; } = "";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色所属的玩家
|
||||||
|
/// </summary>
|
||||||
public User? User { get; set; } = null;
|
public User? User { get; set; } = null;
|
||||||
public CharacterStatistics? Statistics { get; set; } = null; // 角色统计数据
|
|
||||||
public MagicType MagicType { get; set; } // 魔法属性
|
/// <summary>
|
||||||
public RoleType FirstRoleType { get; set; } // 角色定位1
|
/// 角色统计数据
|
||||||
public RoleType SecondRoleType { get; set; } // 角色定位2
|
/// </summary>
|
||||||
public RoleType ThirdRoleType { get; set; } // 角色定位3
|
public CharacterStatistics? Statistics { get; set; } = null;
|
||||||
public RoleRating RoleRating { get; set; } // 角色评级
|
|
||||||
public int Promotion { get; set; } // 晋升点数
|
/// <summary>
|
||||||
|
/// 魔法属性
|
||||||
|
/// </summary>
|
||||||
|
public MagicType MagicType { get; set; } = MagicType.Particle;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色定位1
|
||||||
|
/// </summary>
|
||||||
|
public RoleType FirstRoleType { get; set; } = RoleType.Core;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色定位2
|
||||||
|
/// </summary>
|
||||||
|
public RoleType SecondRoleType { get; set; } = RoleType.Guardian;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色定位3
|
||||||
|
/// </summary>
|
||||||
|
public RoleType ThirdRoleType { get; set; } = RoleType.Vanguard;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色评级
|
||||||
|
/// </summary>
|
||||||
|
public RoleRating RoleRating { get; set; } = RoleRating.E;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 晋升点数
|
||||||
|
/// </summary>
|
||||||
|
public int Promotion { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 等级
|
||||||
|
/// </summary>
|
||||||
public int Level { get; set; } = 1;
|
public int Level { get; set; } = 1;
|
||||||
public decimal EXP { get; set; } // 经验值
|
|
||||||
public decimal BaseHP { get; set; } // 基础生命值
|
/// <summary>
|
||||||
public decimal HP { get; set; }
|
/// 经验值
|
||||||
public decimal BaseMP { get; set; } // 基础魔法值
|
/// </summary>
|
||||||
public decimal MP { get; set; }
|
public decimal EXP { get; set; } = 0;
|
||||||
public decimal EP { get; set; }
|
|
||||||
public decimal BaseATK { get; set; } // 基础攻击力
|
/// <summary>
|
||||||
public decimal ATK { get; set; }
|
/// 基础生命值
|
||||||
public decimal DEF { get; set; } // Defence 物理护甲
|
/// </summary>
|
||||||
public decimal PDR { get; set; } // Physical Damage Reduction 物理伤害减免
|
public decimal BaseHP { get; set; } = 0;
|
||||||
public decimal MDF { get; set; } // Magical Defence 魔法抗性
|
|
||||||
public decimal PhysicalPenetration { get; set; } // Physical Penetration 物理穿透
|
/// <summary>
|
||||||
public decimal MagicalPenetration { get; set; } // Magical Penetration 魔法穿透
|
/// 生命值
|
||||||
public decimal HR { get; set; } = 0; // Health Regeneration 生命回复力
|
/// </summary>
|
||||||
public decimal MR { get; set; } = 0; // Mana Regeneration 魔法回复力
|
public decimal HP { get; set; } = 0;
|
||||||
public decimal ER { get; set; } = 0; // Eenergy Regeneration 能量回复力
|
|
||||||
public decimal BaseSTR { get; set; } // 基础力量
|
/// <summary>
|
||||||
public decimal BaseAGI { get; set; } // 基础敏捷
|
/// 基础魔法值
|
||||||
public decimal BaseINT { get; set; } // 基础智力
|
/// </summary>
|
||||||
public decimal STR { get; set; } // Strength 力量
|
public decimal BaseMP { get; set; } = 0;
|
||||||
public decimal AGI { get; set; } // Agility 敏捷
|
|
||||||
public decimal INT { get; set; } // Intelligence 智力
|
/// <summary>
|
||||||
public decimal STRGrowth { get; set; } // Strength Growth 力量成长值
|
/// 魔法值
|
||||||
public decimal AGIGrowth { get; set; } // Agility Growth 敏捷成长值
|
/// </summary>
|
||||||
public decimal INTGrowth { get; set; } // Intelligence Growth 智力成长值
|
public decimal MP { get; set; } = 0;
|
||||||
public decimal SPD { get; set; } // Speed 速度
|
|
||||||
public decimal ActionCoefficient { get; set; } // Action Coefficient 行动系数
|
/// <summary>
|
||||||
public decimal AccelerationCoefficient { get; set; } // Acceleration Coefficient 加速系数
|
/// 能量
|
||||||
public decimal ATR { get; set; } // Attack Range 攻击距离
|
/// </summary>
|
||||||
public decimal CritRate { get; set; } = 0.05M; // 暴击率
|
public decimal EP { get; set; } = 0;
|
||||||
public decimal CritDMG { get; set; } = 1.25M; // 暴击伤害
|
|
||||||
public decimal EvadeRate { get; set; } = 0.05M; // 闪避率
|
/// <summary>
|
||||||
public Hashtable Skills { get; set; } = [];
|
/// 基础攻击力
|
||||||
public Hashtable Items { get; set; } = [];
|
/// </summary>
|
||||||
|
public decimal BaseATK { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 攻击力
|
||||||
|
/// </summary>
|
||||||
|
public decimal ATK { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础物理护甲
|
||||||
|
/// </summary>
|
||||||
|
public decimal BaseDEF { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物理护甲
|
||||||
|
/// </summary>
|
||||||
|
public decimal DEF { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物理伤害减免(%)
|
||||||
|
/// </summary>
|
||||||
|
public decimal PDR { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 魔法抗性(%)
|
||||||
|
/// </summary>
|
||||||
|
public decimal MDF { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物理穿透(%)
|
||||||
|
/// </summary>
|
||||||
|
public decimal PhysicalPenetration { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 魔法穿透(%)
|
||||||
|
/// </summary>
|
||||||
|
public decimal MagicalPenetration { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 生命回复力
|
||||||
|
/// </summary>
|
||||||
|
public decimal HR { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 魔法回复力
|
||||||
|
/// </summary>
|
||||||
|
public decimal MR { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 能量回复力
|
||||||
|
/// </summary>
|
||||||
|
public decimal ER { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础力量
|
||||||
|
/// </summary>
|
||||||
|
public decimal BaseSTR { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础敏捷
|
||||||
|
/// </summary>
|
||||||
|
public decimal BaseAGI { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 基础智力
|
||||||
|
/// </summary>
|
||||||
|
public decimal BaseINT { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 力量
|
||||||
|
/// </summary>
|
||||||
|
public decimal STR { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 敏捷
|
||||||
|
/// </summary>
|
||||||
|
public decimal AGI { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 智力
|
||||||
|
/// </summary>
|
||||||
|
public decimal INT { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 力量成长值
|
||||||
|
/// </summary>
|
||||||
|
public decimal STRGrowth { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 敏捷成长值
|
||||||
|
/// </summary>
|
||||||
|
public decimal AGIGrowth { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 智力成长值
|
||||||
|
/// </summary>
|
||||||
|
public decimal INTGrowth { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 速度
|
||||||
|
/// </summary>
|
||||||
|
public decimal SPD { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 行动系数(%)
|
||||||
|
/// </summary>
|
||||||
|
public decimal ActionCoefficient { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 加速系数(%)
|
||||||
|
/// </summary>
|
||||||
|
public decimal AccelerationCoefficient { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 攻击距离
|
||||||
|
/// </summary>
|
||||||
|
public decimal ATR { get; set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 暴击率(%)
|
||||||
|
/// </summary>
|
||||||
|
public decimal CritRate { get; set; } = 0.05M;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 暴击伤害
|
||||||
|
/// </summary>
|
||||||
|
public decimal CritDMG { get; set; } = 1.25M;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 闪避率(%)
|
||||||
|
/// </summary>
|
||||||
|
public decimal EvadeRate { get; set; } = 0.05M;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色的技能组
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, Skill> Skills { get; set; } = [];
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色携带的物品
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, Item> Items { get; set; } = [];
|
||||||
|
|
||||||
protected Character()
|
protected Character()
|
||||||
{
|
{
|
||||||
@ -62,9 +245,89 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetDefaultBase()
|
||||||
|
{
|
||||||
|
HP = BaseHP;
|
||||||
|
MP = BaseMP;
|
||||||
|
ATK = BaseATK;
|
||||||
|
DEF = BaseDEF;
|
||||||
|
STR = BaseSTR;
|
||||||
|
AGI = BaseAGI;
|
||||||
|
INT = BaseINT;
|
||||||
|
}
|
||||||
|
|
||||||
public override bool Equals(IBaseEntity? other)
|
public override bool Equals(IBaseEntity? other)
|
||||||
{
|
{
|
||||||
return other is Character c && c.Name == Name;
|
return other is Character c && c.Name == Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
string str = (Name + " " + FirstName).Trim();
|
||||||
|
if (NickName != "")
|
||||||
|
{
|
||||||
|
if (str != "") str += ", ";
|
||||||
|
str += NickName;
|
||||||
|
}
|
||||||
|
if (User != null && User.Username != "")
|
||||||
|
{
|
||||||
|
str += "(" + User.Username + ")";
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Character Copy()
|
||||||
|
{
|
||||||
|
Character c = new()
|
||||||
|
{
|
||||||
|
Name = Name,
|
||||||
|
FirstName = FirstName,
|
||||||
|
NickName = NickName,
|
||||||
|
Statistics = Statistics,
|
||||||
|
MagicType = MagicType,
|
||||||
|
FirstRoleType = FirstRoleType,
|
||||||
|
SecondRoleType = SecondRoleType,
|
||||||
|
ThirdRoleType = ThirdRoleType,
|
||||||
|
RoleRating = RoleRating,
|
||||||
|
Promotion = Promotion,
|
||||||
|
Level = Level,
|
||||||
|
EXP = EXP,
|
||||||
|
BaseHP = BaseHP,
|
||||||
|
HP = HP,
|
||||||
|
BaseMP = BaseMP,
|
||||||
|
MP = MP,
|
||||||
|
EP = EP,
|
||||||
|
BaseATK = BaseATK,
|
||||||
|
ATK = ATK,
|
||||||
|
BaseDEF = BaseDEF,
|
||||||
|
DEF = DEF,
|
||||||
|
PDR = PDR,
|
||||||
|
MDF = MDF,
|
||||||
|
PhysicalPenetration = PhysicalPenetration,
|
||||||
|
MagicalPenetration = MagicalPenetration,
|
||||||
|
HR = HR,
|
||||||
|
MR = MR,
|
||||||
|
ER = ER,
|
||||||
|
BaseSTR = BaseSTR,
|
||||||
|
BaseAGI = BaseAGI,
|
||||||
|
BaseINT = BaseINT,
|
||||||
|
STR = STR,
|
||||||
|
AGI = AGI,
|
||||||
|
INT = INT,
|
||||||
|
STRGrowth = STRGrowth,
|
||||||
|
AGIGrowth = AGIGrowth,
|
||||||
|
INTGrowth = INTGrowth,
|
||||||
|
SPD = SPD,
|
||||||
|
ActionCoefficient = ActionCoefficient,
|
||||||
|
AccelerationCoefficient = AccelerationCoefficient,
|
||||||
|
ATR = ATR,
|
||||||
|
CritRate = CritRate,
|
||||||
|
CritDMG = CritDMG,
|
||||||
|
EvadeRate = EvadeRate,
|
||||||
|
Skills = Skills,
|
||||||
|
Items = Items,
|
||||||
|
};
|
||||||
|
return c;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,36 +0,0 @@
|
|||||||
using Milimoe.FunGame.Core.Interface.Entity;
|
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Entity
|
|
||||||
{
|
|
||||||
public class ActiveItem : Item
|
|
||||||
{
|
|
||||||
public ActiveSkill? Skill { get; set; } = null;
|
|
||||||
|
|
||||||
protected ActiveItem()
|
|
||||||
{
|
|
||||||
Active = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected ActiveItem(int id, string name)
|
|
||||||
{
|
|
||||||
Active = true;
|
|
||||||
Id = id;
|
|
||||||
Name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static ActiveItem GetInstance()
|
|
||||||
{
|
|
||||||
return new();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static ActiveItem GetInstance(int id, string name)
|
|
||||||
{
|
|
||||||
return new(id, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(IBaseEntity? other)
|
|
||||||
{
|
|
||||||
return other is ActiveItem i && i.Name == Name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,8 +1,9 @@
|
|||||||
using Milimoe.FunGame.Core.Interface.Entity;
|
using System;
|
||||||
|
using Milimoe.FunGame.Core.Interface.Entity;
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Entity
|
namespace Milimoe.FunGame.Core.Entity
|
||||||
{
|
{
|
||||||
public abstract class Item : BaseEntity, IItem
|
public class Item : BaseEntity, IItem
|
||||||
{
|
{
|
||||||
public string Describe { get; set; } = "";
|
public string Describe { get; set; } = "";
|
||||||
public decimal Price { get; set; }
|
public decimal Price { get; set; }
|
||||||
@ -10,5 +11,16 @@ namespace Milimoe.FunGame.Core.Entity
|
|||||||
public bool Active { get; set; }
|
public bool Active { get; set; }
|
||||||
public bool Enable { get; set; }
|
public bool Enable { get; set; }
|
||||||
public Character? Character { get; set; } = null;
|
public Character? Character { get; set; } = null;
|
||||||
|
public Skill? Skill { get; set; } = null;
|
||||||
|
|
||||||
|
internal Item(bool active = false)
|
||||||
|
{
|
||||||
|
Active = active;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(IBaseEntity? other)
|
||||||
|
{
|
||||||
|
return other is Item c && c.Name == Name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,36 +0,0 @@
|
|||||||
using Milimoe.FunGame.Core.Interface.Entity;
|
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Entity
|
|
||||||
{
|
|
||||||
public class PassiveItem : Item
|
|
||||||
{
|
|
||||||
public PassiveSkill? Skill { get; set; } = null;
|
|
||||||
|
|
||||||
protected PassiveItem()
|
|
||||||
{
|
|
||||||
Active = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected PassiveItem(int id, string name)
|
|
||||||
{
|
|
||||||
Active = false;
|
|
||||||
Id = id;
|
|
||||||
Name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static PassiveItem GetInstance()
|
|
||||||
{
|
|
||||||
return new();
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static PassiveItem GetInstance(int id, string name)
|
|
||||||
{
|
|
||||||
return new(id, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(IBaseEntity? other)
|
|
||||||
{
|
|
||||||
return other is PassiveItem i && i.Name == Name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
using Milimoe.FunGame.Core.Interface.Entity;
|
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Entity
|
|
||||||
{
|
|
||||||
public class ActiveSkill : Skill
|
|
||||||
{
|
|
||||||
public decimal MP { get; set; } = 0;
|
|
||||||
public decimal EP { get; set; } = 0;
|
|
||||||
public decimal Reference1 { get; set; } = 0;
|
|
||||||
public decimal Reference2 { get; set; } = 0;
|
|
||||||
public decimal Reference3 { get; set; } = 0;
|
|
||||||
public decimal Reference4 { get; set; } = 0;
|
|
||||||
public decimal Reference5 { get; set; } = 0;
|
|
||||||
public decimal Reference6 { get; set; } = 0;
|
|
||||||
public decimal Reference7 { get; set; } = 0;
|
|
||||||
public decimal Reference8 { get; set; } = 0;
|
|
||||||
public decimal Reference9 { get; set; } = 0;
|
|
||||||
public decimal Reference10 { get; set; } = 0;
|
|
||||||
|
|
||||||
protected ActiveSkill()
|
|
||||||
{
|
|
||||||
Active = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static ActiveSkill GetInstance()
|
|
||||||
{
|
|
||||||
return new();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(IBaseEntity? other)
|
|
||||||
{
|
|
||||||
return other is ActiveSkill s && s.Name == Name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
using Milimoe.FunGame.Core.Interface.Entity;
|
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Entity
|
|
||||||
{
|
|
||||||
public class PassiveSkill : Skill
|
|
||||||
{
|
|
||||||
public decimal Reference1 { get; set; } = 0;
|
|
||||||
public decimal Reference2 { get; set; } = 0;
|
|
||||||
public decimal Reference3 { get; set; } = 0;
|
|
||||||
public decimal Reference4 { get; set; } = 0;
|
|
||||||
public decimal Reference5 { get; set; } = 0;
|
|
||||||
public decimal Reference6 { get; set; } = 0;
|
|
||||||
public decimal Reference7 { get; set; } = 0;
|
|
||||||
public decimal Reference8 { get; set; } = 0;
|
|
||||||
public decimal Reference9 { get; set; } = 0;
|
|
||||||
public decimal Reference10 { get; set; } = 0;
|
|
||||||
|
|
||||||
protected PassiveSkill()
|
|
||||||
{
|
|
||||||
Active = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static PassiveSkill GetInstance()
|
|
||||||
{
|
|
||||||
return new();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool Equals(IBaseEntity? other)
|
|
||||||
{
|
|
||||||
return other is PassiveSkill s && s.Name == Name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +1,24 @@
|
|||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using Milimoe.FunGame.Core.Interface.Entity;
|
||||||
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
|
||||||
namespace Milimoe.FunGame.Core.Entity
|
namespace Milimoe.FunGame.Core.Entity
|
||||||
{
|
{
|
||||||
public abstract class Skill : BaseEntity
|
public class Skill : BaseEntity, IActiveEnable
|
||||||
{
|
{
|
||||||
public string Describe { get; set; } = "";
|
public string Describe { get; set; } = "";
|
||||||
public char Key { get; set; }
|
public char Key { get; set; }
|
||||||
public bool Active { get; set; }
|
public bool Active { get; set; }
|
||||||
public bool Enable { get; set; }
|
public bool Enable { get; set; }
|
||||||
public MagicType MagicType { get; set; }
|
public MagicType MagicType { get; set; }
|
||||||
|
|
||||||
|
internal Skill(bool active = false)
|
||||||
|
{
|
||||||
|
Active = active;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(IBaseEntity? other)
|
||||||
|
{
|
||||||
|
return other is Skill c && c.Name == Name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ namespace Milimoe.FunGame.Core.Interface.Addons
|
|||||||
{
|
{
|
||||||
public interface IGameModuleServer : IAddon, IAddonController<IGameModuleServer>, IGameModuleDepend
|
public interface IGameModuleServer : IAddon, IAddonController<IGameModuleServer>, IGameModuleDepend
|
||||||
{
|
{
|
||||||
public bool StartServer(string GameModule, Room Room, List<User> Users, IServerModel RoomMasterServerModel, Dictionary<string, IServerModel> OthersServerModel, params object[] args);
|
public bool StartServer(string GameModule, Room Room, List<User> Users, IServerModel RoomMasterServerModel, Dictionary<string, IServerModel> ServerModels, params object[] args);
|
||||||
|
|
||||||
public Hashtable GamingMessageHandler(string username, GamingType type, Hashtable data);
|
public Hashtable GamingMessageHandler(string username, GamingType type, Hashtable data);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,5 +8,6 @@ namespace Milimoe.FunGame.Core.Interface.HTTP
|
|||||||
{
|
{
|
||||||
public Task<SocketResult> Send(SocketMessageType type, params object[] objs);
|
public Task<SocketResult> Send(SocketMessageType type, params object[] objs);
|
||||||
public SocketObject SocketObject_Handler(SocketObject objs);
|
public SocketObject SocketObject_Handler(SocketObject objs);
|
||||||
|
public void BindEvent(Delegate method, bool remove = false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using Milimoe.FunGame.Core.Entity;
|
using Milimoe.FunGame.Core.Entity;
|
||||||
using Milimoe.FunGame.Core.Library.Common.Addon;
|
|
||||||
using Milimoe.FunGame.Core.Library.Common.Network;
|
using Milimoe.FunGame.Core.Library.Common.Network;
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ namespace Milimoe.FunGame.Core.Interface.Base
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始接收客户端消息
|
/// 开始接收客户端消息
|
||||||
/// <para>请勿在 <see cref="GameModuleServer"/> 中调用此方法</para>
|
/// <para>请勿在 <see cref="Library.Common.Addon.GameModuleServer"/> 中调用此方法</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="socket"></param>
|
/// <param name="socket"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
@ -67,7 +66,7 @@ namespace Milimoe.FunGame.Core.Interface.Base
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 启动对客户端的监听
|
/// 启动对客户端的监听
|
||||||
/// <para>请勿在 <see cref="GameModuleServer"/> 中调用此方法</para>
|
/// <para>请勿在 <see cref="Library.Common.Addon.GameModuleServer"/> 中调用此方法</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Start();
|
public void Start();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,6 @@ namespace Milimoe.FunGame.Core.Interface.Sockets
|
|||||||
public void StartReceiving(Task t);
|
public void StartReceiving(Task t);
|
||||||
public SocketResult Send(SocketMessageType type, params object[] objs);
|
public SocketResult Send(SocketMessageType type, params object[] objs);
|
||||||
public Library.Common.Network.SocketObject[] Receive();
|
public Library.Common.Network.SocketObject[] Receive();
|
||||||
public void BindEvent(Delegate Method, bool Remove = false);
|
public void BindEvent(Delegate method, bool remove = false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
Interface/Entity/Base/ICopyable.cs
Normal file
7
Interface/Entity/Base/ICopyable.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace Milimoe.FunGame.Core.Interface.Entity
|
||||||
|
{
|
||||||
|
public interface ICopyable<T>
|
||||||
|
{
|
||||||
|
public T Copy();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -9,269 +9,146 @@ namespace Milimoe.FunGame.Core.Interface
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IGamingEventHandler
|
public interface IGamingEventHandler
|
||||||
{
|
{
|
||||||
public delegate void BeforeEventHandler(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public delegate void GamingEventHandler(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public delegate void AfterEventHandler(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public delegate void SucceedEventHandler(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public delegate void FailedEventHandler(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingConnectEventHandler : IGamingEventHandler
|
public interface IGamingConnectEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingConnect;
|
public event GamingEventHandler? GamingConnect;
|
||||||
public event AfterEventHandler? AfterGamingConnect;
|
|
||||||
public event SucceedEventHandler? SucceedGamingConnect;
|
|
||||||
public event FailedEventHandler? FailedGamingConnect;
|
|
||||||
|
|
||||||
public void OnBeforeGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingDisconnectEventHandler : IGamingEventHandler
|
public interface IGamingDisconnectEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingDisconnect;
|
public event GamingEventHandler? GamingDisconnect;
|
||||||
public event AfterEventHandler? AfterGamingDisconnect;
|
|
||||||
public event SucceedEventHandler? SucceedGamingDisconnect;
|
|
||||||
public event FailedEventHandler? FailedGamingDisconnect;
|
|
||||||
|
|
||||||
public void OnBeforeGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingReconnectEventHandler : IGamingEventHandler
|
public interface IGamingReconnectEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingReconnect;
|
public event GamingEventHandler? GamingReconnect;
|
||||||
public event AfterEventHandler? AfterGamingReconnect;
|
|
||||||
public event SucceedEventHandler? SucceedGamingReconnect;
|
|
||||||
public event FailedEventHandler? FailedGamingReconnect;
|
|
||||||
|
|
||||||
public void OnBeforeGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingBanCharacterEventHandler : IGamingEventHandler
|
public interface IGamingBanCharacterEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingBanCharacter;
|
public event GamingEventHandler? GamingBanCharacter;
|
||||||
public event AfterEventHandler? AfterGamingBanCharacter;
|
|
||||||
public event SucceedEventHandler? SucceedGamingBanCharacter;
|
|
||||||
public event FailedEventHandler? FailedGamingBanCharacter;
|
|
||||||
|
|
||||||
public void OnBeforeGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingPickCharacterEventHandler : IGamingEventHandler
|
public interface IGamingPickCharacterEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingPickCharacter;
|
public event GamingEventHandler? GamingPickCharacter;
|
||||||
public event AfterEventHandler? AfterGamingPickCharacter;
|
|
||||||
public event SucceedEventHandler? SucceedGamingPickCharacter;
|
|
||||||
public event FailedEventHandler? FailedGamingPickCharacter;
|
|
||||||
|
|
||||||
public void OnBeforeGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingRandomEventHandler : IGamingEventHandler
|
public interface IGamingRandomEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingRandom;
|
public event GamingEventHandler? GamingRandom;
|
||||||
public event AfterEventHandler? AfterGamingRandom;
|
|
||||||
public event SucceedEventHandler? SucceedGamingRandom;
|
|
||||||
public event FailedEventHandler? FailedGamingRandom;
|
|
||||||
|
|
||||||
public void OnBeforeGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingRoundEventHandler : IGamingEventHandler
|
public interface IGamingRoundEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingRound;
|
public event GamingEventHandler? GamingRound;
|
||||||
public event AfterEventHandler? AfterGamingRound;
|
|
||||||
public event SucceedEventHandler? SucceedGamingRound;
|
|
||||||
public event FailedEventHandler? FailedGamingRound;
|
|
||||||
|
|
||||||
public void OnBeforeGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingLevelUpEventHandler : IGamingEventHandler
|
public interface IGamingLevelUpEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingLevelUp;
|
public event GamingEventHandler? GamingLevelUp;
|
||||||
public event AfterEventHandler? AfterGamingLevelUp;
|
|
||||||
public event SucceedEventHandler? SucceedGamingLevelUp;
|
|
||||||
public event FailedEventHandler? FailedGamingLevelUp;
|
|
||||||
|
|
||||||
public void OnBeforeGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingMoveEventHandler : IGamingEventHandler
|
public interface IGamingMoveEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingMove;
|
public event GamingEventHandler? GamingMove;
|
||||||
public event AfterEventHandler? AfterGamingMove;
|
|
||||||
public event SucceedEventHandler? SucceedGamingMove;
|
|
||||||
public event FailedEventHandler? FailedGamingMove;
|
|
||||||
|
|
||||||
public void OnBeforeGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingAttackEventHandler : IGamingEventHandler
|
public interface IGamingAttackEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingAttack;
|
public event GamingEventHandler? GamingAttack;
|
||||||
public event AfterEventHandler? AfterGamingAttack;
|
|
||||||
public event SucceedEventHandler? SucceedGamingAttack;
|
|
||||||
public event FailedEventHandler? FailedGamingAttack;
|
|
||||||
|
|
||||||
public void OnBeforeGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingSkillEventHandler : IGamingEventHandler
|
public interface IGamingSkillEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingSkill;
|
public event GamingEventHandler? GamingSkill;
|
||||||
public event AfterEventHandler? AfterGamingSkill;
|
|
||||||
public event SucceedEventHandler? SucceedGamingSkill;
|
|
||||||
public event FailedEventHandler? FailedGamingSkill;
|
|
||||||
|
|
||||||
public void OnBeforeGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingItemEventHandler : IGamingEventHandler
|
public interface IGamingItemEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingItem;
|
public event GamingEventHandler? GamingItem;
|
||||||
public event AfterEventHandler? AfterGamingItem;
|
|
||||||
public event SucceedEventHandler? SucceedGamingItem;
|
|
||||||
public event FailedEventHandler? FailedGamingItem;
|
|
||||||
|
|
||||||
public void OnBeforeGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingItemEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingMagicEventHandler : IGamingEventHandler
|
public interface IGamingMagicEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingMagic;
|
public event GamingEventHandler? GamingMagic;
|
||||||
public event AfterEventHandler? AfterGamingMagic;
|
|
||||||
public event SucceedEventHandler? SucceedGamingMagic;
|
|
||||||
public event FailedEventHandler? FailedGamingMagic;
|
|
||||||
|
|
||||||
public void OnBeforeGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingBuyEventHandler : IGamingEventHandler
|
public interface IGamingBuyEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingBuy;
|
public event GamingEventHandler? GamingBuy;
|
||||||
public event AfterEventHandler? AfterGamingBuy;
|
|
||||||
public event SucceedEventHandler? SucceedGamingBuy;
|
|
||||||
public event FailedEventHandler? FailedGamingBuy;
|
|
||||||
|
|
||||||
public void OnBeforeGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingSuperSkillEventHandler : IGamingEventHandler
|
public interface IGamingSuperSkillEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingSuperSkill;
|
public event GamingEventHandler? GamingSuperSkill;
|
||||||
public event AfterEventHandler? AfterGamingSuperSkill;
|
|
||||||
public event SucceedEventHandler? SucceedGamingSuperSkill;
|
|
||||||
public event FailedEventHandler? FailedGamingSuperSkill;
|
|
||||||
|
|
||||||
public void OnBeforeGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingPauseEventHandler : IGamingEventHandler
|
public interface IGamingPauseEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingPause;
|
public event GamingEventHandler? GamingPause;
|
||||||
public event AfterEventHandler? AfterGamingPause;
|
|
||||||
public event SucceedEventHandler? SucceedGamingPause;
|
|
||||||
public event FailedEventHandler? FailedGamingPause;
|
|
||||||
|
|
||||||
public void OnBeforeGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingUnpauseEventHandler : IGamingEventHandler
|
public interface IGamingUnpauseEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingUnpause;
|
public event GamingEventHandler? GamingUnpause;
|
||||||
public event AfterEventHandler? AfterGamingUnpause;
|
|
||||||
public event SucceedEventHandler? SucceedGamingUnpause;
|
|
||||||
public event FailedEventHandler? FailedGamingUnpause;
|
|
||||||
|
|
||||||
public void OnBeforeGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingSurrenderEventHandler : IGamingEventHandler
|
public interface IGamingSurrenderEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingSurrender;
|
public event GamingEventHandler? GamingSurrender;
|
||||||
public event AfterEventHandler? AfterGamingSurrender;
|
|
||||||
public event SucceedEventHandler? SucceedGamingSurrender;
|
|
||||||
public event FailedEventHandler? FailedGamingSurrender;
|
|
||||||
|
|
||||||
public void OnBeforeGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingUpdateInfoEventHandler : IGamingEventHandler
|
public interface IGamingUpdateInfoEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingUpdateInfo;
|
public event GamingEventHandler? GamingUpdateInfo;
|
||||||
public event AfterEventHandler? AfterGamingUpdateInfo;
|
|
||||||
public event SucceedEventHandler? SucceedGamingUpdateInfo;
|
|
||||||
public event FailedEventHandler? FailedGamingUpdateInfo;
|
|
||||||
|
|
||||||
public void OnBeforeGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingPunishEventHandler : IGamingEventHandler
|
public interface IGamingPunishEventHandler : IGamingEventHandler
|
||||||
{
|
{
|
||||||
public event BeforeEventHandler? BeforeGamingPunish;
|
public event GamingEventHandler? GamingPunish;
|
||||||
public event AfterEventHandler? AfterGamingPunish;
|
|
||||||
public event SucceedEventHandler? SucceedGamingPunish;
|
|
||||||
public event FailedEventHandler? FailedGamingPunish;
|
|
||||||
|
|
||||||
public void OnBeforeGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void OnGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void OnAfterGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnSucceedGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void OnFailedGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,161 +6,101 @@ namespace Milimoe.FunGame.Core.Interface
|
|||||||
{
|
{
|
||||||
public interface IGamingConnectEvent
|
public interface IGamingConnectEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingConnectEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingDisconnectEvent
|
public interface IGamingDisconnectEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingReconnectEvent
|
public interface IGamingReconnectEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingBanCharacterEvent
|
public interface IGamingBanCharacterEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingPickCharacterEvent
|
public interface IGamingPickCharacterEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingRandomEvent
|
public interface IGamingRandomEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingRandomEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingRoundEvent
|
public interface IGamingRoundEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingRoundEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingLevelUpEvent
|
public interface IGamingLevelUpEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingMoveEvent
|
public interface IGamingMoveEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingMoveEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingAttackEvent
|
public interface IGamingAttackEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingAttackEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingSkillEvent
|
public interface IGamingSkillEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingSkillEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingItemEvent
|
public interface IGamingItemEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingItemEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingMagicEvent
|
public interface IGamingMagicEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingMagicEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingBuyEvent
|
public interface IGamingBuyEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingBuyEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingSuperSkillEvent
|
public interface IGamingSuperSkillEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingPauseEvent
|
public interface IGamingPauseEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingPauseEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingUnpauseEvent
|
public interface IGamingUnpauseEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingSurrenderEvent
|
public interface IGamingSurrenderEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingUpdateInfoEvent
|
public interface IGamingUpdateInfoEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IGamingPunishEvent
|
public interface IGamingPunishEvent
|
||||||
{
|
{
|
||||||
public void BeforeGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
public void GamingPunishEvent(object sender, GamingEventArgs e, Hashtable data);
|
||||||
public void AfterGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void SucceedGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
public void FailedGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Milimoe.FunGame.Core.Api.Transmittal;
|
||||||
using Milimoe.FunGame.Core.Api.Utility;
|
using Milimoe.FunGame.Core.Api.Utility;
|
||||||
using Milimoe.FunGame.Core.Entity;
|
using Milimoe.FunGame.Core.Entity;
|
||||||
using Milimoe.FunGame.Core.Interface;
|
using Milimoe.FunGame.Core.Interface;
|
||||||
@ -7,7 +8,6 @@ using Milimoe.FunGame.Core.Library.Common.Event;
|
|||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
using Milimoe.FunGame.Core.Model;
|
using Milimoe.FunGame.Core.Model;
|
||||||
|
|
||||||
// 此演示包含GameModule、GameModuleServer、GameMap
|
|
||||||
namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
|
namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -18,17 +18,17 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
|
|||||||
public static GameModuleDepend GameModuleDepend => _depends;
|
public static GameModuleDepend GameModuleDepend => _depends;
|
||||||
|
|
||||||
private static readonly string[] Maps = ["Example GameMap"];
|
private static readonly string[] Maps = ["Example GameMap"];
|
||||||
private static readonly string[] Characters = [];
|
private static readonly string[] Characters = ["Example CharacterModule"];
|
||||||
private static readonly string[] Items = [];
|
private static readonly string[] Skills = ["Example SkillModule"];
|
||||||
private static readonly string[] Skills = [];
|
private static readonly string[] Items = ["Example ItemModule"];
|
||||||
private static readonly GameModuleDepend _depends = new(Maps, Characters, Items, Skills);
|
private static readonly GameModuleDepend _depends = new(Maps, Characters, Skills, Items);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模组:必须继承基类:<see cref="GameModule"/><para/>
|
/// 模组:必须继承基类:<see cref="GameModule"/><para/>
|
||||||
/// 继承事件接口并实现其方法来使模组生效。例如继承:<seealso cref="IGamingConnectEvent"/><para/>
|
/// 继承事件接口并实现其方法来使模组生效。例如继承:<seealso cref="IGamingUpdateInfoEvent"/><para/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ExampleGameModule : GameModule, IGamingConnectEvent
|
public class ExampleGameModule : GameModule, IGamingUpdateInfoEvent
|
||||||
{
|
{
|
||||||
public override string Name => "FunGame Example GameModule";
|
public override string Name => "FunGame Example GameModule";
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
|
|||||||
|
|
||||||
public override string Author => "FunGamer";
|
public override string Author => "FunGamer";
|
||||||
|
|
||||||
public override string DefaultMap => GameModuleDepend.Maps.Length > 0 ? GameModuleDepend.Maps[0] : "";
|
public override string DefaultMap => GameModuleDepend.MapsDepend.Length > 0 ? GameModuleDepend.MapsDepend[0] : "";
|
||||||
|
|
||||||
public override GameModuleDepend GameModuleDepend => ExampleGameModuleConstant.GameModuleDepend;
|
public override GameModuleDepend GameModuleDepend => ExampleGameModuleConstant.GameModuleDepend;
|
||||||
|
|
||||||
@ -66,37 +66,28 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
|
|||||||
// 如果没有,则不需要重写此方法
|
// 如果没有,则不需要重写此方法
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BeforeGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void GamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
// 此方法预处理攻击消息
|
// 在下方的Server示例中,服务器发来的data中,包含check字符串,因此客户端要主动发起确认连接的请求。
|
||||||
// 如果这里将Cancel设置为true,那么这个方法结束后,后续的事件就会终止
|
if (data.ContainsKey("info_type"))
|
||||||
e.Cancel = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AfterGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SucceedGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FailedGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
_ = DiscountGameModuleServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task DiscountGameModuleServer()
|
|
||||||
{
|
|
||||||
// 这是一个主动请求服务器的示例:
|
|
||||||
Api.Transmittal.DataRequest request = Controller.NewDataRequest(DataRequestType.Gaming);
|
|
||||||
request.AddRequestData("type", GamingType.Disconnect);
|
|
||||||
if (await request.SendRequestAsync() == RequestResult.Success)
|
|
||||||
{
|
{
|
||||||
string msg = request.GetResult<string>("msg") ?? string.Empty;
|
// 反序列化得到指定key的值
|
||||||
Controller.WriteLine(msg);
|
string info_type = DataRequest.GetHashtableJsonObject<string>(data, "info_type") ?? "";
|
||||||
|
if (info_type == "check")
|
||||||
|
{
|
||||||
|
Guid token = DataRequest.GetHashtableJsonObject<Guid>(data, "connect_token");
|
||||||
|
// 发起连接确认请求
|
||||||
|
DataRequest request = Controller.NewDataRequest(GamingType.Connect);
|
||||||
|
// 传递参数
|
||||||
|
request.AddRequestData("username", ((Gaming)sender).CurrentUser.Username);
|
||||||
|
request.AddRequestData("connect_token", token);
|
||||||
|
if (request.SendRequest() == RequestResult.Success)
|
||||||
|
{
|
||||||
|
string msg = request.GetResult<string>("msg") ?? "";
|
||||||
|
Controller.WriteLine(msg);
|
||||||
|
}
|
||||||
|
request.Dispose();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -115,41 +106,61 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
|
|||||||
|
|
||||||
public override string Author => "FunGamer";
|
public override string Author => "FunGamer";
|
||||||
|
|
||||||
public override string DefaultMap => GameModuleDepend.Maps.Length > 0 ? GameModuleDepend.Maps.First() : "";
|
public override string DefaultMap => GameModuleDepend.MapsDepend.Length > 0 ? GameModuleDepend.MapsDepend.First() : "";
|
||||||
|
|
||||||
public override GameModuleDepend GameModuleDepend => ExampleGameModuleConstant.GameModuleDepend;
|
public override GameModuleDepend GameModuleDepend => ExampleGameModuleConstant.GameModuleDepend;
|
||||||
|
|
||||||
protected Room Room = General.HallInstance;
|
protected Room Room = General.HallInstance;
|
||||||
protected List<User> Users = [];
|
protected List<User> Users = [];
|
||||||
protected IServerModel? RoomMaster;
|
protected IServerModel? RoomMaster;
|
||||||
protected Dictionary<string, IServerModel> Others = [];
|
|
||||||
protected Dictionary<string, IServerModel> All = [];
|
protected Dictionary<string, IServerModel> All = [];
|
||||||
|
|
||||||
public override bool StartServer(string GameModule, Room Room, List<User> Users, IServerModel RoomMasterServerModel, Dictionary<string, IServerModel> OthersServerModel, params object[] Args)
|
public override bool StartServer(string GameModule, Room Room, List<User> Users, IServerModel RoomMasterServerModel, Dictionary<string, IServerModel> ServerModels, params object[] Args)
|
||||||
{
|
{
|
||||||
// 将参数转为本地属性
|
// 将参数转为本地属性
|
||||||
this.Room = Room;
|
this.Room = Room;
|
||||||
this.Users = Users;
|
this.Users = Users;
|
||||||
RoomMaster = RoomMasterServerModel;
|
RoomMaster = RoomMasterServerModel;
|
||||||
Others = OthersServerModel;
|
All = ServerModels;
|
||||||
if (RoomMaster != null)
|
|
||||||
{
|
|
||||||
// 这里获得了每名玩家的服务线程,保存为一个字典
|
|
||||||
All = OthersServerModel.ToDictionary(k => k.Key, v => v.Value);
|
|
||||||
All.Add(RoomMaster.User.Username, RoomMaster);
|
|
||||||
}
|
|
||||||
// 创建一个线程执行Test()
|
// 创建一个线程执行Test()
|
||||||
TaskUtility.NewTask(Test).OnError(Controller.Error);
|
TaskUtility.NewTask(Test).OnError(Controller.Error);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly List<User> ConnectedUser = [];
|
private readonly List<User> ConnectedUser = [];
|
||||||
|
private readonly Dictionary<string, Hashtable> UserData = [];
|
||||||
|
|
||||||
private async Task Test()
|
private async Task Test()
|
||||||
{
|
{
|
||||||
// 通常,我们可以对客户端的连接状态进行确认,此方法展示如何确认客户端的连接
|
|
||||||
Controller.WriteLine("欢迎各位玩家进入房间 " + Room.Roomid + " 。");
|
Controller.WriteLine("欢迎各位玩家进入房间 " + Room.Roomid + " 。");
|
||||||
SendAll(SocketMessageType.Gaming, GamingType.Connect);
|
|
||||||
|
// 通常,我们可以对客户端的连接状态进行确认,此方法展示如何确认客户端的连接
|
||||||
|
// 有两种确认的方式,1是服务器主动确认,2是客户端发起确认
|
||||||
|
// 在FunGame项目中,建议永远使用客户端主动发起请求,因为服务器主动发起的实现难度较高
|
||||||
|
// 下面的演示基于综合的两种情况:服务器主动发送通知,客户端收到后,发起确认
|
||||||
|
// UpdateInfo是一个灵活的类型。如果发送check字符串,意味着服务器要求客户端发送确认
|
||||||
|
Hashtable data = [];
|
||||||
|
data.Add("info_type", "check");
|
||||||
|
|
||||||
|
// 进阶示例:传递一个token,让客户端返回
|
||||||
|
Guid token = Guid.NewGuid();
|
||||||
|
data.Add("connect_token", token);
|
||||||
|
|
||||||
|
// 我们保存到字典UserData中,这样可以方便跨方法检查变量
|
||||||
|
foreach (string username in Users.Select(u => u.Username).Distinct())
|
||||||
|
{
|
||||||
|
if (UserData.TryGetValue(username, out Hashtable? value))
|
||||||
|
{
|
||||||
|
value.Add("connect_token", token);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UserData.Add(username, []);
|
||||||
|
UserData[username].Add("connect_token", token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SendAllGamingMessage(GamingType.UpdateInfo, data);
|
||||||
|
|
||||||
// 新建一个线程等待所有玩家确认
|
// 新建一个线程等待所有玩家确认
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@ -168,15 +179,46 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
|
|||||||
{
|
{
|
||||||
case GamingType.Connect:
|
case GamingType.Connect:
|
||||||
// 编写处理“连接”命令的逻辑
|
// 编写处理“连接”命令的逻辑
|
||||||
ConnectedUser.Add(Users.Where(u => u.Username == username).First());
|
// 如果需要处理客户端传递的参数:获取与客户端约定好的参数key对应的值
|
||||||
Controller.WriteLine(username + "已经连接。");
|
string un = NetworkUtility.JsonDeserializeFromHashtable<string>(data, "username") ?? "";
|
||||||
|
Guid token = NetworkUtility.JsonDeserializeFromHashtable<Guid>(data, "connect_token");
|
||||||
|
if (un == username && UserData.TryGetValue(username, out Hashtable? value) && value != null && (value["connect_token"]?.Equals(token) ?? false))
|
||||||
|
{
|
||||||
|
ConnectedUser.Add(Users.Where(u => u.Username == username).First());
|
||||||
|
Controller.WriteLine(username + " 已经连接。");
|
||||||
|
}
|
||||||
|
else Controller.WriteLine(username + " 确认连接失败!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SendAll(SocketMessageType type, params object[] args)
|
// === 下面是一些常用的工具方法,用于服务器给客户端发送消息,可以直接添加到你的项目中 === //
|
||||||
|
|
||||||
|
protected void SendAllGamingMessage(GamingType type, Hashtable data)
|
||||||
|
{
|
||||||
|
// 循环服务线程,向所有玩家发送局内消息
|
||||||
|
foreach (IServerModel s in All.Values)
|
||||||
|
{
|
||||||
|
if (s != null && s.Socket != null)
|
||||||
|
{
|
||||||
|
s.Send(s.Socket, SocketMessageType.Gaming, type, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SendGamingMessage(string username, GamingType type, Hashtable data)
|
||||||
|
{
|
||||||
|
// 向指定玩家发送局内消息
|
||||||
|
IServerModel s = All[username];
|
||||||
|
if (s != null && s.Socket != null)
|
||||||
|
{
|
||||||
|
s.Send(s.Socket, SocketMessageType.Gaming, type, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SendAll(SocketMessageType type, params object[] args)
|
||||||
{
|
{
|
||||||
// 循环服务线程,向所有玩家发送消息
|
// 循环服务线程,向所有玩家发送消息
|
||||||
foreach (IServerModel s in All.Values)
|
foreach (IServerModel s in All.Values)
|
||||||
@ -187,6 +229,16 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void Send(string username, SocketMessageType type, params object[] args)
|
||||||
|
{
|
||||||
|
// 向指定玩家发送消息
|
||||||
|
IServerModel s = All[username];
|
||||||
|
if (s != null && s.Socket != null)
|
||||||
|
{
|
||||||
|
s.Send(s.Socket, type, args);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -208,4 +260,94 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon.Example
|
|||||||
|
|
||||||
public override float Size => 4.0f;
|
public override float Size => 4.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 角色:必须继承基类:<see cref="CharacterModule"/><para/>
|
||||||
|
/// </summary>
|
||||||
|
public class ExampleCharacterModule : CharacterModule
|
||||||
|
{
|
||||||
|
public override string Name => "Example CharacterModule";
|
||||||
|
|
||||||
|
public override string Description => "My First CharacterModule";
|
||||||
|
|
||||||
|
public override string Version => "1.0.0";
|
||||||
|
|
||||||
|
public override string Author => "FunGamer";
|
||||||
|
|
||||||
|
public override List<Character> Characters
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
List<Character> list = [];
|
||||||
|
// 构建一个你想要的角色
|
||||||
|
Character c = Factory.GetCharacter();
|
||||||
|
c.Name = "Oshima";
|
||||||
|
c.FirstName = "Shiya";
|
||||||
|
c.NickName = "OSM";
|
||||||
|
c.MagicType = MagicType.PurityNatural;
|
||||||
|
c.BaseHP = 30;
|
||||||
|
c.BaseSTR = 20;
|
||||||
|
c.BaseAGI = 10;
|
||||||
|
c.BaseINT = 5;
|
||||||
|
c.BaseATK = 100;
|
||||||
|
c.BaseDEF = 10;
|
||||||
|
list.Add(c);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 技能:必须继承基类:<see cref="SkillModule"/><para/>
|
||||||
|
/// </summary>
|
||||||
|
public class ExampleSkillModule : SkillModule
|
||||||
|
{
|
||||||
|
public override string Name => "Example SkillModule";
|
||||||
|
|
||||||
|
public override string Description => "My First SkillModule";
|
||||||
|
|
||||||
|
public override string Version => "1.0.0";
|
||||||
|
|
||||||
|
public override string Author => "FunGamer";
|
||||||
|
|
||||||
|
public override List<Skill> Skills
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
List<Skill> list = [];
|
||||||
|
Skill s = Factory.GetSkill();
|
||||||
|
s.Name = "Example Skill";
|
||||||
|
s.MagicType = MagicType.PurityNatural;
|
||||||
|
list.Add(s);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物品:必须继承基类:<see cref="ItemModule"/><para/>
|
||||||
|
/// </summary>
|
||||||
|
public class ExampleItemModule : ItemModule
|
||||||
|
{
|
||||||
|
public override string Name => "Example ItemModule";
|
||||||
|
|
||||||
|
public override string Description => "My First ItemModule";
|
||||||
|
|
||||||
|
public override string Version => "1.0.0";
|
||||||
|
|
||||||
|
public override string Author => "FunGamer";
|
||||||
|
|
||||||
|
public override List<Item> Items
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
List<Item> list = [];
|
||||||
|
Item i = Factory.GetItem();
|
||||||
|
i.Name = "Example Item";
|
||||||
|
i.Price = 20;
|
||||||
|
list.Add(i);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -160,663 +160,243 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon
|
|||||||
if (this is IGamingConnectEvent)
|
if (this is IGamingConnectEvent)
|
||||||
{
|
{
|
||||||
IGamingConnectEvent bind = (IGamingConnectEvent)this;
|
IGamingConnectEvent bind = (IGamingConnectEvent)this;
|
||||||
BeforeGamingConnect += bind.BeforeGamingConnectEvent;
|
GamingConnect += bind.GamingConnectEvent;
|
||||||
AfterGamingConnect += bind.AfterGamingConnectEvent;
|
|
||||||
SucceedGamingConnect += bind.SucceedGamingConnectEvent;
|
|
||||||
FailedGamingConnect += bind.FailedGamingConnectEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingDisconnectEvent)
|
if (this is IGamingDisconnectEvent)
|
||||||
{
|
{
|
||||||
IGamingDisconnectEvent bind = (IGamingDisconnectEvent)this;
|
IGamingDisconnectEvent bind = (IGamingDisconnectEvent)this;
|
||||||
BeforeGamingDisconnect += bind.BeforeGamingDisconnectEvent;
|
GamingDisconnect += bind.GamingDisconnectEvent;
|
||||||
AfterGamingDisconnect += bind.AfterGamingDisconnectEvent;
|
|
||||||
SucceedGamingDisconnect += bind.SucceedGamingDisconnectEvent;
|
|
||||||
FailedGamingDisconnect += bind.FailedGamingDisconnectEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingReconnectEvent)
|
if (this is IGamingReconnectEvent)
|
||||||
{
|
{
|
||||||
IGamingReconnectEvent bind = (IGamingReconnectEvent)this;
|
IGamingReconnectEvent bind = (IGamingReconnectEvent)this;
|
||||||
BeforeGamingReconnect += bind.BeforeGamingReconnectEvent;
|
GamingReconnect += bind.GamingReconnectEvent;
|
||||||
AfterGamingReconnect += bind.AfterGamingReconnectEvent;
|
|
||||||
SucceedGamingReconnect += bind.SucceedGamingReconnectEvent;
|
|
||||||
FailedGamingReconnect += bind.FailedGamingReconnectEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingBanCharacterEvent)
|
if (this is IGamingBanCharacterEvent)
|
||||||
{
|
{
|
||||||
IGamingBanCharacterEvent bind = (IGamingBanCharacterEvent)this;
|
IGamingBanCharacterEvent bind = (IGamingBanCharacterEvent)this;
|
||||||
BeforeGamingBanCharacter += bind.BeforeGamingBanCharacterEvent;
|
GamingBanCharacter += bind.GamingBanCharacterEvent;
|
||||||
AfterGamingBanCharacter += bind.AfterGamingBanCharacterEvent;
|
|
||||||
SucceedGamingBanCharacter += bind.SucceedGamingBanCharacterEvent;
|
|
||||||
FailedGamingBanCharacter += bind.FailedGamingBanCharacterEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingPickCharacterEvent)
|
if (this is IGamingPickCharacterEvent)
|
||||||
{
|
{
|
||||||
IGamingPickCharacterEvent bind = (IGamingPickCharacterEvent)this;
|
IGamingPickCharacterEvent bind = (IGamingPickCharacterEvent)this;
|
||||||
BeforeGamingPickCharacter += bind.BeforeGamingPickCharacterEvent;
|
GamingPickCharacter += bind.GamingPickCharacterEvent;
|
||||||
AfterGamingPickCharacter += bind.AfterGamingPickCharacterEvent;
|
|
||||||
SucceedGamingPickCharacter += bind.SucceedGamingPickCharacterEvent;
|
|
||||||
FailedGamingPickCharacter += bind.FailedGamingPickCharacterEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingRandomEvent)
|
if (this is IGamingRandomEvent)
|
||||||
{
|
{
|
||||||
IGamingRandomEvent bind = (IGamingRandomEvent)this;
|
IGamingRandomEvent bind = (IGamingRandomEvent)this;
|
||||||
BeforeGamingRandom += bind.BeforeGamingRandomEvent;
|
GamingRandom += bind.GamingRandomEvent;
|
||||||
AfterGamingRandom += bind.AfterGamingRandomEvent;
|
|
||||||
SucceedGamingRandom += bind.SucceedGamingRandomEvent;
|
|
||||||
FailedGamingRandom += bind.FailedGamingRandomEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingRoundEvent)
|
if (this is IGamingRoundEvent)
|
||||||
{
|
{
|
||||||
IGamingRoundEvent bind = (IGamingRoundEvent)this;
|
IGamingRoundEvent bind = (IGamingRoundEvent)this;
|
||||||
BeforeGamingRound += bind.BeforeGamingRoundEvent;
|
GamingRound += bind.GamingRoundEvent;
|
||||||
AfterGamingRound += bind.AfterGamingRoundEvent;
|
|
||||||
SucceedGamingRound += bind.SucceedGamingRoundEvent;
|
|
||||||
FailedGamingRound += bind.FailedGamingRoundEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingLevelUpEvent)
|
if (this is IGamingLevelUpEvent)
|
||||||
{
|
{
|
||||||
IGamingLevelUpEvent bind = (IGamingLevelUpEvent)this;
|
IGamingLevelUpEvent bind = (IGamingLevelUpEvent)this;
|
||||||
BeforeGamingLevelUp += bind.BeforeGamingLevelUpEvent;
|
GamingLevelUp += bind.GamingLevelUpEvent;
|
||||||
AfterGamingLevelUp += bind.AfterGamingLevelUpEvent;
|
|
||||||
SucceedGamingLevelUp += bind.SucceedGamingLevelUpEvent;
|
|
||||||
FailedGamingLevelUp += bind.FailedGamingLevelUpEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingMoveEvent)
|
if (this is IGamingMoveEvent)
|
||||||
{
|
{
|
||||||
IGamingMoveEvent bind = (IGamingMoveEvent)this;
|
IGamingMoveEvent bind = (IGamingMoveEvent)this;
|
||||||
BeforeGamingMove += bind.BeforeGamingMoveEvent;
|
GamingMove += bind.GamingMoveEvent;
|
||||||
AfterGamingMove += bind.AfterGamingMoveEvent;
|
|
||||||
SucceedGamingMove += bind.SucceedGamingMoveEvent;
|
|
||||||
FailedGamingMove += bind.FailedGamingMoveEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingAttackEvent)
|
if (this is IGamingAttackEvent)
|
||||||
{
|
{
|
||||||
IGamingAttackEvent bind = (IGamingAttackEvent)this;
|
IGamingAttackEvent bind = (IGamingAttackEvent)this;
|
||||||
BeforeGamingAttack += bind.BeforeGamingAttackEvent;
|
GamingAttack += bind.GamingAttackEvent;
|
||||||
AfterGamingAttack += bind.AfterGamingAttackEvent;
|
|
||||||
SucceedGamingAttack += bind.SucceedGamingAttackEvent;
|
|
||||||
FailedGamingAttack += bind.FailedGamingAttackEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingSkillEvent)
|
if (this is IGamingSkillEvent)
|
||||||
{
|
{
|
||||||
IGamingSkillEvent bind = (IGamingSkillEvent)this;
|
IGamingSkillEvent bind = (IGamingSkillEvent)this;
|
||||||
BeforeGamingSkill += bind.BeforeGamingSkillEvent;
|
GamingSkill += bind.GamingSkillEvent;
|
||||||
AfterGamingSkill += bind.AfterGamingSkillEvent;
|
|
||||||
SucceedGamingSkill += bind.SucceedGamingSkillEvent;
|
|
||||||
FailedGamingSkill += bind.FailedGamingSkillEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingItemEvent)
|
if (this is IGamingItemEvent)
|
||||||
{
|
{
|
||||||
IGamingItemEvent bind = (IGamingItemEvent)this;
|
IGamingItemEvent bind = (IGamingItemEvent)this;
|
||||||
BeforeGamingItem += bind.BeforeGamingItemEvent;
|
GamingItem += bind.GamingItemEvent;
|
||||||
AfterGamingItem += bind.AfterGamingItemEvent;
|
|
||||||
SucceedGamingItem += bind.SucceedGamingItemEvent;
|
|
||||||
FailedGamingItem += bind.FailedGamingItemEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingMagicEvent)
|
if (this is IGamingMagicEvent)
|
||||||
{
|
{
|
||||||
IGamingMagicEvent bind = (IGamingMagicEvent)this;
|
IGamingMagicEvent bind = (IGamingMagicEvent)this;
|
||||||
BeforeGamingMagic += bind.BeforeGamingMagicEvent;
|
GamingMagic += bind.GamingMagicEvent;
|
||||||
AfterGamingMagic += bind.AfterGamingMagicEvent;
|
|
||||||
SucceedGamingMagic += bind.SucceedGamingMagicEvent;
|
|
||||||
FailedGamingMagic += bind.FailedGamingMagicEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingBuyEvent)
|
if (this is IGamingBuyEvent)
|
||||||
{
|
{
|
||||||
IGamingBuyEvent bind = (IGamingBuyEvent)this;
|
IGamingBuyEvent bind = (IGamingBuyEvent)this;
|
||||||
BeforeGamingBuy += bind.BeforeGamingBuyEvent;
|
GamingBuy += bind.GamingBuyEvent;
|
||||||
AfterGamingBuy += bind.AfterGamingBuyEvent;
|
|
||||||
SucceedGamingBuy += bind.SucceedGamingBuyEvent;
|
|
||||||
FailedGamingBuy += bind.FailedGamingBuyEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingSuperSkillEvent)
|
if (this is IGamingSuperSkillEvent)
|
||||||
{
|
{
|
||||||
IGamingSuperSkillEvent bind = (IGamingSuperSkillEvent)this;
|
IGamingSuperSkillEvent bind = (IGamingSuperSkillEvent)this;
|
||||||
BeforeGamingSuperSkill += bind.BeforeGamingSuperSkillEvent;
|
GamingSuperSkill += bind.GamingSuperSkillEvent;
|
||||||
AfterGamingSuperSkill += bind.AfterGamingSuperSkillEvent;
|
|
||||||
SucceedGamingSuperSkill += bind.SucceedGamingSuperSkillEvent;
|
|
||||||
FailedGamingSuperSkill += bind.FailedGamingSuperSkillEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingPauseEvent)
|
if (this is IGamingPauseEvent)
|
||||||
{
|
{
|
||||||
IGamingPauseEvent bind = (IGamingPauseEvent)this;
|
IGamingPauseEvent bind = (IGamingPauseEvent)this;
|
||||||
BeforeGamingPause += bind.BeforeGamingPauseEvent;
|
GamingPause += bind.GamingPauseEvent;
|
||||||
AfterGamingPause += bind.AfterGamingPauseEvent;
|
|
||||||
SucceedGamingPause += bind.SucceedGamingPauseEvent;
|
|
||||||
FailedGamingPause += bind.FailedGamingPauseEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingUnpauseEvent)
|
if (this is IGamingUnpauseEvent)
|
||||||
{
|
{
|
||||||
IGamingUnpauseEvent bind = (IGamingUnpauseEvent)this;
|
IGamingUnpauseEvent bind = (IGamingUnpauseEvent)this;
|
||||||
BeforeGamingUnpause += bind.BeforeGamingUnpauseEvent;
|
GamingUnpause += bind.GamingUnpauseEvent;
|
||||||
AfterGamingUnpause += bind.AfterGamingUnpauseEvent;
|
|
||||||
SucceedGamingUnpause += bind.SucceedGamingUnpauseEvent;
|
|
||||||
FailedGamingUnpause += bind.FailedGamingUnpauseEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingSurrenderEvent)
|
if (this is IGamingSurrenderEvent)
|
||||||
{
|
{
|
||||||
IGamingSurrenderEvent bind = (IGamingSurrenderEvent)this;
|
IGamingSurrenderEvent bind = (IGamingSurrenderEvent)this;
|
||||||
BeforeGamingSurrender += bind.BeforeGamingSurrenderEvent;
|
GamingSurrender += bind.GamingSurrenderEvent;
|
||||||
AfterGamingSurrender += bind.AfterGamingSurrenderEvent;
|
|
||||||
SucceedGamingSurrender += bind.SucceedGamingSurrenderEvent;
|
|
||||||
FailedGamingSurrender += bind.FailedGamingSurrenderEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingUpdateInfoEvent)
|
if (this is IGamingUpdateInfoEvent)
|
||||||
{
|
{
|
||||||
IGamingUpdateInfoEvent bind = (IGamingUpdateInfoEvent)this;
|
IGamingUpdateInfoEvent bind = (IGamingUpdateInfoEvent)this;
|
||||||
BeforeGamingUpdateInfo += bind.BeforeGamingUpdateInfoEvent;
|
GamingUpdateInfo += bind.GamingUpdateInfoEvent;
|
||||||
AfterGamingUpdateInfo += bind.AfterGamingUpdateInfoEvent;
|
|
||||||
SucceedGamingUpdateInfo += bind.SucceedGamingUpdateInfoEvent;
|
|
||||||
FailedGamingUpdateInfo += bind.FailedGamingUpdateInfoEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this is IGamingPunishEvent)
|
if (this is IGamingPunishEvent)
|
||||||
{
|
{
|
||||||
IGamingPunishEvent bind = (IGamingPunishEvent)this;
|
IGamingPunishEvent bind = (IGamingPunishEvent)this;
|
||||||
BeforeGamingPunish += bind.BeforeGamingPunishEvent;
|
GamingPunish += bind.GamingPunishEvent;
|
||||||
AfterGamingPunish += bind.AfterGamingPunishEvent;
|
|
||||||
SucceedGamingPunish += bind.SucceedGamingPunishEvent;
|
|
||||||
FailedGamingPunish += bind.FailedGamingPunishEvent;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingConnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingConnect;
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingConnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingDisconnect;
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingConnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingReconnect;
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingConnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingBanCharacter;
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingDisconnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingPickCharacter;
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingDisconnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingRandom;
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingDisconnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingRound;
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingDisconnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingLevelUp;
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingReconnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingMove;
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingReconnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingAttack;
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingReconnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingSkill;
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingReconnect;
|
public event IGamingEventHandler.GamingEventHandler? GamingItem;
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingBanCharacter;
|
public event IGamingEventHandler.GamingEventHandler? GamingMagic;
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingBanCharacter;
|
public event IGamingEventHandler.GamingEventHandler? GamingBuy;
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingBanCharacter;
|
public event IGamingEventHandler.GamingEventHandler? GamingSuperSkill;
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingBanCharacter;
|
public event IGamingEventHandler.GamingEventHandler? GamingPause;
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingPickCharacter;
|
public event IGamingEventHandler.GamingEventHandler? GamingUnpause;
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingPickCharacter;
|
public event IGamingEventHandler.GamingEventHandler? GamingSurrender;
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingPickCharacter;
|
public event IGamingEventHandler.GamingEventHandler? GamingUpdateInfo;
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingPickCharacter;
|
public event IGamingEventHandler.GamingEventHandler? GamingPunish;
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingRandom;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingRandom;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingRandom;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingRandom;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingRound;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingRound;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingRound;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingRound;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingLevelUp;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingLevelUp;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingLevelUp;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingLevelUp;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingMove;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingMove;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingMove;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingMove;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingAttack;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingAttack;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingAttack;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingAttack;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingSkill;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingSkill;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingSkill;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingSkill;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingItem;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingItem;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingItem;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingItem;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingMagic;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingMagic;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingMagic;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingMagic;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingBuy;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingBuy;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingBuy;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingBuy;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingSuperSkill;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingSuperSkill;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingSuperSkill;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingSuperSkill;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingPause;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingPause;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingPause;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingPause;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingUnpause;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingUnpause;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingUnpause;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingUnpause;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingSurrender;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingSurrender;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingSurrender;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingSurrender;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingUpdateInfo;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingUpdateInfo;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingUpdateInfo;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingUpdateInfo;
|
|
||||||
public event IGamingEventHandler.BeforeEventHandler? BeforeGamingPunish;
|
|
||||||
public event IGamingEventHandler.AfterEventHandler? AfterGamingPunish;
|
|
||||||
public event IGamingEventHandler.SucceedEventHandler? SucceedGamingPunish;
|
|
||||||
public event IGamingEventHandler.FailedEventHandler? FailedGamingPunish;
|
|
||||||
|
|
||||||
public void OnBeforeGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
BeforeGamingConnect?.Invoke(sender, e, data, result);
|
GamingConnect?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnAfterGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
AfterGamingConnect?.Invoke(sender, e, data, result);
|
GamingDisconnect?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSucceedGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
SucceedGamingConnect?.Invoke(sender, e, data, result);
|
GamingReconnect?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFailedGamingConnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
FailedGamingConnect?.Invoke(sender, e, data, result);
|
GamingBanCharacter?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnBeforeGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
BeforeGamingDisconnect?.Invoke(sender, e, data, result);
|
GamingPickCharacter?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnAfterGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
AfterGamingDisconnect?.Invoke(sender, e, data, result);
|
GamingRandom?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSucceedGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
SucceedGamingDisconnect?.Invoke(sender, e, data, result);
|
GamingRound?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFailedGamingDisconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
FailedGamingDisconnect?.Invoke(sender, e, data, result);
|
GamingLevelUp?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnBeforeGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
BeforeGamingReconnect?.Invoke(sender, e, data, result);
|
GamingMove?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnAfterGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
AfterGamingReconnect?.Invoke(sender, e, data, result);
|
GamingAttack?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSucceedGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
SucceedGamingReconnect?.Invoke(sender, e, data, result);
|
GamingSkill?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFailedGamingReconnectEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingItemEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
FailedGamingReconnect?.Invoke(sender, e, data, result);
|
GamingItem?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnBeforeGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
BeforeGamingBanCharacter?.Invoke(sender, e, data, result);
|
GamingMagic?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnAfterGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
AfterGamingBanCharacter?.Invoke(sender, e, data, result);
|
GamingBuy?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSucceedGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
SucceedGamingBanCharacter?.Invoke(sender, e, data, result);
|
GamingSuperSkill?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFailedGamingBanCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
FailedGamingBanCharacter?.Invoke(sender, e, data, result);
|
GamingPause?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnBeforeGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
BeforeGamingPickCharacter?.Invoke(sender, e, data, result);
|
GamingUnpause?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnAfterGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
AfterGamingPickCharacter?.Invoke(sender, e, data, result);
|
GamingSurrender?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnSucceedGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
SucceedGamingPickCharacter?.Invoke(sender, e, data, result);
|
GamingUpdateInfo?.Invoke(sender, e, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFailedGamingPickCharacterEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
public void OnGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data)
|
||||||
{
|
{
|
||||||
FailedGamingPickCharacter?.Invoke(sender, e, data, result);
|
GamingPunish?.Invoke(sender, e, data);
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingRandom?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingRandom?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingRandom?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingRandomEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingRandom?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingRound?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingRound?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingRound?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingRoundEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingRound?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingLevelUp?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingLevelUp?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingLevelUp?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingLevelUpEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingLevelUp?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingMove?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingMove?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingMove?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingMoveEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingMove?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingAttack?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingAttack?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingAttack?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingAttackEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingAttack?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingSkill?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingSkill?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingSkill?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingSkill?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingItem?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingItem?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingItem?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingItemEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingItem?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingMagic?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingMagic?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingMagic?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingMagicEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingMagic?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingBuy?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingBuy?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingBuy?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingBuyEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingBuy?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingSuperSkill?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingSuperSkill?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingSuperSkill?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingSuperSkillEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingSuperSkill?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingPause?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingPause?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingPause?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingPauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingPause?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingUnpause?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingUnpause?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingUnpause?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingUnpauseEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingUnpause?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingSurrender?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingSurrender?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingSurrender?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingSurrenderEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingSurrender?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingUpdateInfo?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingUpdateInfo?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingUpdateInfo?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingUpdateInfoEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingUpdateInfo?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
BeforeGamingPunish?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnAfterGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
AfterGamingPunish?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnSucceedGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
SucceedGamingPunish?.Invoke(sender, e, data, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnFailedGamingPunishEvent(object sender, GamingEventArgs e, Hashtable data, Hashtable result)
|
|
||||||
{
|
|
||||||
FailedGamingPunish?.Invoke(sender, e, data, result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,28 +1,84 @@
|
|||||||
namespace Milimoe.FunGame.Core.Library.Common.Addon
|
using Milimoe.FunGame.Core.Api.Utility;
|
||||||
|
using Milimoe.FunGame.Core.Entity;
|
||||||
|
|
||||||
|
namespace Milimoe.FunGame.Core.Library.Common.Addon
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模组的依赖集合
|
/// 模组的依赖集合<para/>
|
||||||
|
/// <paramref name="maps"></paramref>(地图名称(<see cref="GameMap.Name"/>)的数组)<para/>
|
||||||
|
/// <paramref name="characters"></paramref>(角色模组名称(<see cref="CharacterModule.Name"/>)的数组)<para/>
|
||||||
|
/// <paramref name="skills"></paramref>(技能模组名称(<see cref="SkillModule.Name"/>)的数组)<para/>
|
||||||
|
/// <paramref name="items"></paramref>(物品模组名称(<see cref="ItemModule.Name"/>)的数组)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly struct GameModuleDepend(string[] Maps, string[] Characters, string[] Items, string[] Skills)
|
public readonly struct GameModuleDepend(string[] maps, string[] characters, string[] skills, string[] items)
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模组所使用的地图组
|
/// 模组所使用的地图组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string[] Maps { get; } = Maps;
|
public string[] MapsDepend { get; } = maps;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模组所使用的角色组
|
/// 模组所使用的角色组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string[] Characters { get; } = Characters;
|
public string[] CharactersDepend { get; } = characters;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 模组所使用的物品组
|
|
||||||
/// </summary>
|
|
||||||
public string[] Items { get; } = Items;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 模组所使用的技能组
|
/// 模组所使用的技能组
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string[] Skills { get; } = Skills;
|
public string[] SkillsDepend { get; } = skills;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 模组所使用的物品组
|
||||||
|
/// </summary>
|
||||||
|
public string[] ItemsDepend { get; } = items;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 实际使用的地图组对象<para/>
|
||||||
|
/// 请使用 <see cref="GetDependencies"/> 自动填充,不要自己添加
|
||||||
|
/// </summary>
|
||||||
|
public List<GameMap> Maps { get; } = [];
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 实际使用的角色组对象<para/>
|
||||||
|
/// 请使用 <see cref="GetDependencies"/> 自动填充,不要自己添加
|
||||||
|
/// </summary>
|
||||||
|
public List<Character> Characters { get; } = [];
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 实际使用的技能组对象<para/>
|
||||||
|
/// 请使用 <see cref="GetDependencies"/> 自动填充,不要自己添加
|
||||||
|
/// </summary>
|
||||||
|
public List<Skill> Skills { get; } = [];
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 实际使用的物品组对象<para/>
|
||||||
|
/// 请使用 <see cref="GetDependencies"/> 自动填充,不要自己添加
|
||||||
|
/// </summary>
|
||||||
|
public List<Item> Items { get; } = [];
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获得所有的依赖项<para/>
|
||||||
|
/// 此方法会自动填充 <see cref="Maps"/> <see cref="Characters"/> <see cref="Skills"/> <see cref="Items"/>
|
||||||
|
/// </summary>
|
||||||
|
public void GetDependencies(GameModuleLoader loader)
|
||||||
|
{
|
||||||
|
Maps.Clear();
|
||||||
|
Characters.Clear();
|
||||||
|
Skills.Clear();
|
||||||
|
Items.Clear();
|
||||||
|
Maps.AddRange(loader.Maps.Keys.Where(MapsDepend.Contains).Select(str => loader.Maps[str]));
|
||||||
|
foreach (CharacterModule modules in loader.Characters.Keys.Where(CharactersDepend.Contains).Select(str => loader.Characters[str]))
|
||||||
|
{
|
||||||
|
Characters.AddRange(modules.Characters);
|
||||||
|
}
|
||||||
|
foreach (SkillModule modules in loader.Skills.Keys.Where(SkillsDepend.Contains).Select(str => loader.Skills[str]))
|
||||||
|
{
|
||||||
|
Skills.AddRange(modules.Skills);
|
||||||
|
}
|
||||||
|
foreach (ItemModule modules in loader.Items.Keys.Where(ItemsDepend.Contains).Select(str => loader.Items[str]))
|
||||||
|
{
|
||||||
|
Items.AddRange(modules.Items);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,10 +60,10 @@ namespace Milimoe.FunGame.Core.Library.Common.Addon
|
|||||||
/// <param name="Room"></param>
|
/// <param name="Room"></param>
|
||||||
/// <param name="Users"></param>
|
/// <param name="Users"></param>
|
||||||
/// <param name="RoomMasterServerModel"></param>
|
/// <param name="RoomMasterServerModel"></param>
|
||||||
/// <param name="OthersServerModel"></param>
|
/// <param name="ServerModels"></param>
|
||||||
/// <param name="Args"></param>
|
/// <param name="Args"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public abstract bool StartServer(string GameModule, Room Room, List<User> Users, IServerModel RoomMasterServerModel, Dictionary<string, IServerModel> OthersServerModel, params object[] Args);
|
public abstract bool StartServer(string GameModule, Room Room, List<User> Users, IServerModel RoomMasterServerModel, Dictionary<string, IServerModel> ServerModels, params object[] Args);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 接收并处理GamingMessage
|
/// 接收并处理GamingMessage
|
||||||
|
|||||||
@ -54,15 +54,15 @@ namespace Milimoe.FunGame.Core.Library.Common.Network
|
|||||||
return SocketResult.NotSent;
|
return SocketResult.NotSent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BindEvent(Delegate Method, bool Remove = false)
|
public void BindEvent(Delegate method, bool remove = false)
|
||||||
{
|
{
|
||||||
if (!Remove)
|
if (!remove)
|
||||||
{
|
{
|
||||||
SocketManager.SocketReceive += (SocketManager.SocketReceiveHandler)Method;
|
SocketManager.SocketReceive += (SocketManager.SocketReceiveHandler)method;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SocketManager.SocketReceive -= (SocketManager.SocketReceiveHandler)Method;
|
SocketManager.SocketReceive -= (SocketManager.SocketReceiveHandler)method;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -86,6 +86,18 @@ namespace Milimoe.FunGame.Core.Library.Common.Network
|
|||||||
return new(SocketMessageType.Unknown, Guid.Empty);
|
return new(SocketMessageType.Unknown, Guid.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void BindEvent(Delegate method, bool remove = false)
|
||||||
|
{
|
||||||
|
if (!remove)
|
||||||
|
{
|
||||||
|
SocketManager.SocketReceive += (SocketManager.SocketReceiveHandler)method;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SocketManager.SocketReceive -= (SocketManager.SocketReceiveHandler)method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
_Listening = false;
|
_Listening = false;
|
||||||
|
|||||||
@ -65,15 +65,15 @@ namespace Milimoe.FunGame.Core.Library.Common.Network
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BindEvent(Delegate Method, bool Remove = false)
|
public void BindEvent(Delegate method, bool remove = false)
|
||||||
{
|
{
|
||||||
if (!Remove)
|
if (!remove)
|
||||||
{
|
{
|
||||||
SocketManager.SocketReceive += (SocketManager.SocketReceiveHandler)Method;
|
SocketManager.SocketReceive += (SocketManager.SocketReceiveHandler)method;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SocketManager.SocketReceive -= (SocketManager.SocketReceiveHandler)Method;
|
SocketManager.SocketReceive -= (SocketManager.SocketReceiveHandler)method;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -160,8 +160,13 @@
|
|||||||
public override string Message => "构造对象实例遇到错误 (#10032)";
|
public override string Message => "构造对象实例遇到错误 (#10032)";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ModuleServerNewDataRequestException : Exception
|
public class InvalidNewDataRequestException : Exception
|
||||||
{
|
{
|
||||||
public override string Message => "试图在GameModuleServer类中创建数据请求 (#10033)";
|
public override string Message => "试图在不支持的类中创建数据请求 (#10033)";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AsyncRequestException : Exception
|
||||||
|
{
|
||||||
|
public override string Message => "数据请求必须以异步方式发送 (#10034)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
401
Model/Gaming.cs
401
Model/Gaming.cs
@ -23,10 +23,16 @@ namespace Milimoe.FunGame.Core.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public GamingEventArgs EventArgs { get; }
|
public GamingEventArgs EventArgs { get; }
|
||||||
|
|
||||||
private Gaming(GameModule module, Room room, List<User> users)
|
/// <summary>
|
||||||
|
/// 此实例所属的玩家
|
||||||
|
/// </summary>
|
||||||
|
public User CurrentUser { get; }
|
||||||
|
|
||||||
|
private Gaming(GameModule module, Room room, User user, List<User> users)
|
||||||
{
|
{
|
||||||
GameModule = module;
|
GameModule = module;
|
||||||
EventArgs = new(room, users);
|
EventArgs = new(room, users);
|
||||||
|
CurrentUser = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -34,12 +40,16 @@ namespace Milimoe.FunGame.Core.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="module"></param>
|
/// <param name="module"></param>
|
||||||
/// <param name="room"></param>
|
/// <param name="room"></param>
|
||||||
|
/// <param name="user"></param>
|
||||||
/// <param name="users"></param>
|
/// <param name="users"></param>
|
||||||
|
/// <param name="loader"></param>
|
||||||
/// <param name="args"></param>
|
/// <param name="args"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Gaming StartGame(GameModule module, Room room, List<User> users, params object[] args)
|
public static Gaming StartGame(GameModule module, Room room, User user, List<User> users, GameModuleLoader loader, params object[] args)
|
||||||
{
|
{
|
||||||
Gaming instance = new(module, room, users);
|
Gaming instance = new(module, room, user, users);
|
||||||
|
// 读取模组的依赖集合
|
||||||
|
module.GameModuleDepend.GetDependencies(loader);
|
||||||
// 新建线程来启动模组的界面
|
// 新建线程来启动模组的界面
|
||||||
TaskUtility.NewTask(() =>
|
TaskUtility.NewTask(() =>
|
||||||
{
|
{
|
||||||
@ -57,437 +67,174 @@ namespace Milimoe.FunGame.Core.Model
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type">消息类型</param>
|
/// <param name="type">消息类型</param>
|
||||||
/// <param name="data">接收到的数据</param>
|
/// <param name="data">接收到的数据</param>
|
||||||
/// <returns>底层会将哈希表中的数据发送给服务器</returns>
|
public void GamingHandler(GamingType type, Hashtable data)
|
||||||
public Hashtable GamingHandler(GamingType type, Hashtable data)
|
|
||||||
{
|
{
|
||||||
Hashtable result = [];
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case GamingType.Connect:
|
case GamingType.Connect:
|
||||||
Connect(data, result);
|
Connect(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Disconnect:
|
case GamingType.Disconnect:
|
||||||
Disconnect(data, result);
|
Disconnect(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Reconnect:
|
case GamingType.Reconnect:
|
||||||
Reconnect(data, result);
|
Reconnect(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.BanCharacter:
|
case GamingType.BanCharacter:
|
||||||
BanCharacter(data, result);
|
BanCharacter(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.PickCharacter:
|
case GamingType.PickCharacter:
|
||||||
PickCharacter(data, result);
|
PickCharacter(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Random:
|
case GamingType.Random:
|
||||||
Random(data, result);
|
Random(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Round:
|
case GamingType.Round:
|
||||||
Round(data, result);
|
Round(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.LevelUp:
|
case GamingType.LevelUp:
|
||||||
LevelUp(data, result);
|
LevelUp(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Move:
|
case GamingType.Move:
|
||||||
Move(data, result);
|
Move(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Attack:
|
case GamingType.Attack:
|
||||||
Attack(data, result);
|
Attack(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Skill:
|
case GamingType.Skill:
|
||||||
Skill(data, result);
|
Skill(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Item:
|
case GamingType.Item:
|
||||||
Item(data, result);
|
Item(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Magic:
|
case GamingType.Magic:
|
||||||
Magic(data, result);
|
Magic(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Buy:
|
case GamingType.Buy:
|
||||||
Buy(data, result);
|
Buy(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.SuperSkill:
|
case GamingType.SuperSkill:
|
||||||
SuperSkill(data, result);
|
SuperSkill(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Pause:
|
case GamingType.Pause:
|
||||||
Pause(data, result);
|
Pause(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Unpause:
|
case GamingType.Unpause:
|
||||||
Unpause(data, result);
|
Unpause(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Surrender:
|
case GamingType.Surrender:
|
||||||
Surrender(data, result);
|
Surrender(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.UpdateInfo:
|
case GamingType.UpdateInfo:
|
||||||
UpdateInfo(data, result);
|
UpdateInfo(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.Punish:
|
case GamingType.Punish:
|
||||||
Punish(data, result);
|
Punish(data);
|
||||||
break;
|
break;
|
||||||
case GamingType.None:
|
case GamingType.None:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Connect(Hashtable data, Hashtable result)
|
private void Connect(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingConnectEvent(this, EventArgs, data, result);
|
GameModule.OnGamingConnectEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingConnectEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingConnectEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingConnectEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Disconnect(Hashtable data, Hashtable result)
|
private void Disconnect(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingDisconnectEvent(this, EventArgs, data, result);
|
GameModule.OnGamingDisconnectEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingDisconnectEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingDisconnectEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingDisconnectEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Reconnect(Hashtable data, Hashtable result)
|
private void Reconnect(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingReconnectEvent(this, EventArgs, data, result);
|
GameModule.OnGamingReconnectEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingReconnectEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingReconnectEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingReconnectEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BanCharacter(Hashtable data, Hashtable result)
|
private void BanCharacter(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingBanCharacterEvent(this, EventArgs, data, result);
|
GameModule.OnGamingBanCharacterEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingBanCharacterEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingBanCharacterEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingBanCharacterEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PickCharacter(Hashtable data, Hashtable result)
|
private void PickCharacter(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingPickCharacterEvent(this, EventArgs, data, result);
|
GameModule.OnGamingPickCharacterEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingPickCharacterEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingPickCharacterEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingPickCharacterEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Random(Hashtable data, Hashtable result)
|
private void Random(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingRandomEvent(this, EventArgs, data, result);
|
GameModule.OnGamingRandomEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingRandomEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingRandomEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingRandomEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Round(Hashtable data, Hashtable result)
|
private void Round(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingRoundEvent(this, EventArgs, data, result);
|
GameModule.OnGamingRoundEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingRoundEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingRoundEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingRoundEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LevelUp(Hashtable data, Hashtable result)
|
private void LevelUp(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingLevelUpEvent(this, EventArgs, data, result);
|
GameModule.OnGamingLevelUpEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingLevelUpEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingLevelUpEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingLevelUpEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Move(Hashtable data, Hashtable result)
|
private void Move(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingMoveEvent(this, EventArgs, data, result);
|
GameModule.OnGamingMoveEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingMoveEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingMoveEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingMoveEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Attack(Hashtable data, Hashtable result)
|
private void Attack(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingAttackEvent(this, EventArgs, data, result);
|
GameModule.OnGamingAttackEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingAttackEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingAttackEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingAttackEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Skill(Hashtable data, Hashtable result)
|
private void Skill(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingSkillEvent(this, EventArgs, data, result);
|
GameModule.OnGamingSkillEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingSkillEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingSkillEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingSkillEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Item(Hashtable data, Hashtable result)
|
private void Item(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingItemEvent(this, EventArgs, data, result);
|
GameModule.OnGamingItemEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingItemEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingItemEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingItemEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Magic(Hashtable data, Hashtable result)
|
private void Magic(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingMagicEvent(this, EventArgs, data, result);
|
GameModule.OnGamingMagicEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingMagicEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingMagicEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingMagicEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Buy(Hashtable data, Hashtable result)
|
private void Buy(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingBuyEvent(this, EventArgs, data, result);
|
GameModule.OnGamingBuyEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingBuyEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingBuyEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingBuyEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SuperSkill(Hashtable data, Hashtable result)
|
private void SuperSkill(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingSuperSkillEvent(this, EventArgs, data, result);
|
GameModule.OnGamingSuperSkillEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingSuperSkillEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingSuperSkillEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingSuperSkillEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Pause(Hashtable data, Hashtable result)
|
private void Pause(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingPauseEvent(this, EventArgs, data, result);
|
GameModule.OnGamingPauseEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingPauseEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingPauseEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingPauseEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Unpause(Hashtable data, Hashtable result)
|
private void Unpause(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingUnpauseEvent(this, EventArgs, data, result);
|
GameModule.OnGamingUnpauseEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingUnpauseEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingUnpauseEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingUnpauseEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Surrender(Hashtable data, Hashtable result)
|
private void Surrender(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingSurrenderEvent(this, EventArgs, data, result);
|
GameModule.OnGamingSurrenderEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingSurrenderEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingSurrenderEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingSurrenderEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateInfo(Hashtable data, Hashtable result)
|
private void UpdateInfo(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingUpdateInfoEvent(this, EventArgs, data, result);
|
GameModule.OnGamingUpdateInfoEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingUpdateInfoEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingUpdateInfoEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingUpdateInfoEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Punish(Hashtable data, Hashtable result)
|
private void Punish(Hashtable data)
|
||||||
{
|
{
|
||||||
GameModule.OnBeforeGamingPunishEvent(this, EventArgs, data, result);
|
GameModule.OnGamingPunishEvent(this, EventArgs, data);
|
||||||
if (EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!EventArgs.Cancel)
|
|
||||||
{
|
|
||||||
GameModule.OnSucceedGamingPunishEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GameModule.OnFailedGamingPunishEvent(this, EventArgs, data, result);
|
|
||||||
}
|
|
||||||
GameModule.OnAfterGamingPunishEvent(this, EventArgs, data, result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Milimoe.FunGame.Core.Entity;
|
using Milimoe.FunGame.Core.Interface.Addons;
|
||||||
using Milimoe.FunGame.Core.Library.Common.Addon;
|
using Milimoe.FunGame.Core.Library.Common.Addon;
|
||||||
using Milimoe.FunGame.Core.Library.Constant;
|
using Milimoe.FunGame.Core.Library.Constant;
|
||||||
|
|
||||||
@ -26,15 +26,17 @@ namespace Milimoe.FunGame.Core.Service
|
|||||||
// 加载目录下所有的DLL
|
// 加载目录下所有的DLL
|
||||||
Assembly assembly = Assembly.LoadFrom(dll);
|
Assembly assembly = Assembly.LoadFrom(dll);
|
||||||
|
|
||||||
// 遍历DLL中继承了Plugin的类型
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Plugin))))
|
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Plugin))))
|
||||||
{
|
{
|
||||||
Plugin? instance = (Plugin?)Activator.CreateInstance(type);
|
AddAddonInstances(type, plugins, (instance) =>
|
||||||
if (instance != null && instance.Load(otherobjs) && instance.Name.Trim() != "")
|
|
||||||
{
|
{
|
||||||
instance.Controller = new(instance, delegates);
|
if (instance.Load(otherobjs))
|
||||||
plugins.TryAdd(instance.Name, instance);
|
{
|
||||||
}
|
instance.Controller = new(instance, delegates);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +53,7 @@ namespace Milimoe.FunGame.Core.Service
|
|||||||
/// <param name="delegates"></param>
|
/// <param name="delegates"></param>
|
||||||
/// <param name="otherobjs"></param>
|
/// <param name="otherobjs"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal static Dictionary<string, GameModule> LoadGameModules(Dictionary<string, GameModule> modules, List<Character> characters, List<Skill> skills, List<Item> items, Hashtable delegates, params object[] otherobjs)
|
internal static Dictionary<string, GameModule> LoadGameModules(Dictionary<string, GameModule> modules, Dictionary<string, CharacterModule> characters, Dictionary<string, SkillModule> skills, Dictionary<string, ItemModule> items, Hashtable delegates, params object[] otherobjs)
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(ReflectionSet.GameModuleFolderPath)) return modules;
|
if (!Directory.Exists(ReflectionSet.GameModuleFolderPath)) return modules;
|
||||||
|
|
||||||
@ -61,40 +63,31 @@ namespace Milimoe.FunGame.Core.Service
|
|||||||
{
|
{
|
||||||
Assembly assembly = Assembly.LoadFrom(dll);
|
Assembly assembly = Assembly.LoadFrom(dll);
|
||||||
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(GameModule))))
|
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => typeof(IAddon).IsAssignableFrom(type)))
|
||||||
{
|
{
|
||||||
GameModule? instance = (GameModule?)Activator.CreateInstance(type);
|
if (type.IsSubclassOf(typeof(GameModule)))
|
||||||
if (instance != null && instance.Load(otherobjs) && instance.Name.Trim() != "")
|
|
||||||
{
|
{
|
||||||
instance.Controller = new(instance, delegates);
|
AddAddonInstances(type, modules, (instance) =>
|
||||||
modules.TryAdd(instance.Name, instance);
|
{
|
||||||
|
if (instance.Load(otherobjs))
|
||||||
|
{
|
||||||
|
instance.Controller = new(instance, delegates);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
else if (type.IsSubclassOf(typeof(CharacterModule)))
|
||||||
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Character))))
|
|
||||||
{
|
|
||||||
Character? instance = (Character?)Activator.CreateInstance(type);
|
|
||||||
if (instance != null && instance.Name.Trim() != "" && !characters.Contains(instance))
|
|
||||||
{
|
{
|
||||||
characters.Add(instance);
|
AddAddonInstances(type, characters, (instance) => instance.Load(otherobjs));
|
||||||
}
|
}
|
||||||
}
|
else if (type.IsSubclassOf(typeof(SkillModule)))
|
||||||
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Skill))))
|
|
||||||
{
|
|
||||||
Skill? instance = (Skill?)Activator.CreateInstance(type);
|
|
||||||
if (instance != null && instance.Name.Trim() != "" && !skills.Contains(instance))
|
|
||||||
{
|
{
|
||||||
skills.Add(instance);
|
AddAddonInstances(type, skills, (instance) => instance.Load(otherobjs));
|
||||||
}
|
}
|
||||||
}
|
else if (type.IsSubclassOf(typeof(ItemModule)))
|
||||||
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Item))))
|
|
||||||
{
|
|
||||||
Item? instance = (Item?)Activator.CreateInstance(type);
|
|
||||||
if (instance != null && instance.Name.Trim() != "" && !items.Contains(instance))
|
|
||||||
{
|
{
|
||||||
items.Add(instance);
|
AddAddonInstances(type, items, (instance) => instance.Load(otherobjs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,7 +105,7 @@ namespace Milimoe.FunGame.Core.Service
|
|||||||
/// <param name="delegates"></param>
|
/// <param name="delegates"></param>
|
||||||
/// <param name="otherobjs"></param>
|
/// <param name="otherobjs"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal static Dictionary<string, GameModuleServer> LoadGameModulesForServer(Dictionary<string, GameModuleServer> modules, List<Character> characters, List<Skill> skills, List<Item> items, Hashtable delegates, params object[] otherobjs)
|
internal static Dictionary<string, GameModuleServer> LoadGameModulesForServer(Dictionary<string, GameModuleServer> modules, Dictionary<string, CharacterModule> characters, Dictionary<string, SkillModule> skills, Dictionary<string, ItemModule> items, Hashtable delegates, params object[] otherobjs)
|
||||||
{
|
{
|
||||||
if (!Directory.Exists(ReflectionSet.GameModuleFolderPath)) return modules;
|
if (!Directory.Exists(ReflectionSet.GameModuleFolderPath)) return modules;
|
||||||
|
|
||||||
@ -122,40 +115,31 @@ namespace Milimoe.FunGame.Core.Service
|
|||||||
{
|
{
|
||||||
Assembly assembly = Assembly.LoadFrom(dll);
|
Assembly assembly = Assembly.LoadFrom(dll);
|
||||||
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(GameModuleServer))))
|
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => typeof(IAddon).IsAssignableFrom(type)))
|
||||||
{
|
{
|
||||||
GameModuleServer? instance = (GameModuleServer?)Activator.CreateInstance(type);
|
if (type.IsSubclassOf(typeof(GameModuleServer)))
|
||||||
if (instance != null && instance.Load(otherobjs) && instance.Name.Trim() != "")
|
|
||||||
{
|
{
|
||||||
instance.Controller = new(instance, delegates);
|
AddAddonInstances(type, modules, (instance) =>
|
||||||
modules.TryAdd(instance.Name, instance);
|
{
|
||||||
|
if (instance.Load(otherobjs))
|
||||||
|
{
|
||||||
|
instance.Controller = new(instance, delegates);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
else if (type.IsSubclassOf(typeof(CharacterModule)))
|
||||||
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Character))))
|
|
||||||
{
|
|
||||||
Character? instance = (Character?)Activator.CreateInstance(type);
|
|
||||||
if (instance != null && instance.Name.Trim() != "" && !characters.Contains(instance))
|
|
||||||
{
|
{
|
||||||
characters.Add(instance);
|
AddAddonInstances(type, characters, (instance) => instance.Load(otherobjs));
|
||||||
}
|
}
|
||||||
}
|
else if (type.IsSubclassOf(typeof(SkillModule)))
|
||||||
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Skill))))
|
|
||||||
{
|
|
||||||
Skill? instance = (Skill?)Activator.CreateInstance(type);
|
|
||||||
if (instance != null && instance.Name.Trim() != "" && !skills.Contains(instance))
|
|
||||||
{
|
{
|
||||||
skills.Add(instance);
|
AddAddonInstances(type, skills, (instance) => instance.Load(otherobjs));
|
||||||
}
|
}
|
||||||
}
|
else if (type.IsSubclassOf(typeof(ItemModule)))
|
||||||
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Item))))
|
|
||||||
{
|
|
||||||
Item? instance = (Item?)Activator.CreateInstance(type);
|
|
||||||
if (instance != null && instance.Name.Trim() != "" && !items.Contains(instance))
|
|
||||||
{
|
{
|
||||||
items.Add(instance);
|
AddAddonInstances(type, items, (instance) => instance.Load(otherobjs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -181,15 +165,31 @@ namespace Milimoe.FunGame.Core.Service
|
|||||||
|
|
||||||
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(GameMap))))
|
foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(GameMap))))
|
||||||
{
|
{
|
||||||
GameMap? instance = (GameMap?)Activator.CreateInstance(type);
|
AddAddonInstances(type, maps, (instance) => instance.Load(objs));
|
||||||
if (instance != null && instance.Load(objs) && instance.Name.Trim() != "")
|
|
||||||
{
|
|
||||||
maps.TryAdd(instance.Name, instance);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return maps;
|
return maps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加构造好的模组类实例到字典中
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">加载的类型</typeparam>
|
||||||
|
/// <param name="type">循环程序集的类型</param>
|
||||||
|
/// <param name="dictionary">实例的字典</param>
|
||||||
|
/// <param name="isadd">加载时触发的检查方法,返回false不添加</param>
|
||||||
|
private static void AddAddonInstances<T>(Type type, Dictionary<string, T> dictionary, Func<T, bool>? isadd = null) where T : IAddon
|
||||||
|
{
|
||||||
|
T? instance = (T?)Activator.CreateInstance(type);
|
||||||
|
if (instance != null)
|
||||||
|
{
|
||||||
|
string name = instance.Name;
|
||||||
|
if (!string.IsNullOrWhiteSpace(name) && (isadd == null || isadd(instance)))
|
||||||
|
{
|
||||||
|
dictionary.TryAdd(name.Trim(), instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user