mirror of
https://github.com/milimoe/FunGame-Testing.git
synced 2025-12-05 08:09:04 +00:00
update plugin
This commit is contained in:
parent
51ae626168
commit
f443601745
@ -27,7 +27,7 @@ ds.Tables.Add(table);
|
||||
JsonTool JsonTool = new();
|
||||
JsonTool.AddConverters(new System.Text.Json.Serialization.JsonConverter[] { new UserConverter(), new RoomConverter(), new PersonConverter(), new AddressConverter() });
|
||||
|
||||
Room r = Factory.GetRoom(1294367, "w5rtvh8".ToUpper(), DateTime.Now, Factory.GetUser(), Milimoe.FunGame.Core.Library.Constant.RoomType.Mix, Milimoe.FunGame.Core.Library.Constant.RoomState.Created);
|
||||
Room r = Factory.GetRoom(1294367, "w5rtvh8".ToUpper(), DateTime.Now, Factory.GetUser(), Milimoe.FunGame.Core.Library.Constant.RoomType.Mix, "", "", Milimoe.FunGame.Core.Library.Constant.RoomState.Created);
|
||||
User u = Factory.GetUser(1, "LUOLI", DateTime.Now, DateTime.Now, "LUOLI@66.COM", "QWQAQW");
|
||||
|
||||
Hashtable hashtable = new()
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
using Milimoe.FunGame.Core.Api.Transmittal;
|
||||
using Milimoe.FunGame.Core.Interface;
|
||||
using Milimoe.FunGame.Core.Library.Common.Event;
|
||||
using Milimoe.FunGame.Core.Library.Common.Plugin;
|
||||
using Milimoe.FunGame.Core.Library.Common.Addon;
|
||||
|
||||
namespace FunGame.Testing.Solutions
|
||||
{
|
||||
public class MyPlugin : BasePlugin, ILoginEvent, IConnectEvent, IIntoRoomEvent
|
||||
public class MyPlugin : Plugin, ILoginEvent, IConnectEvent, IIntoRoomEvent
|
||||
{
|
||||
public override string Name => "测试插件";
|
||||
|
||||
@ -22,42 +22,42 @@ namespace FunGame.Testing.Solutions
|
||||
|
||||
public void AfterLoginEvent(object sender, LoginEventArgs e)
|
||||
{
|
||||
WritelnSystemInfo("[" + Name + "] 触发AfterLoginEvent! ");
|
||||
Controller.WriteLine("[" + Name + "] 触发AfterLoginEvent! ");
|
||||
}
|
||||
|
||||
public void BeforeLoginEvent(object sender, LoginEventArgs e)
|
||||
{
|
||||
WritelnSystemInfo("[" + Name + "] 试图登录!账号" + e.Username + "密码" + e.Password);
|
||||
Controller.WriteLine("[" + Name + "] 试图登录!账号" + e.Username + "密码" + e.Password);
|
||||
}
|
||||
|
||||
public void FailedLoginEvent(object sender, LoginEventArgs e)
|
||||
{
|
||||
WritelnSystemInfo("[" + Name + "] 登录失败~~");
|
||||
Controller.WriteLine("[" + Name + "] 登录失败~~");
|
||||
}
|
||||
|
||||
public void SucceedLoginEvent(object sender, LoginEventArgs e)
|
||||
{
|
||||
WritelnSystemInfo("[" + Name + "] 检测到登录成功?? ");
|
||||
Controller.WriteLine("[" + Name + "] 检测到登录成功?? ");
|
||||
}
|
||||
|
||||
public void BeforeConnectEvent(object sender, ConnectEventArgs e)
|
||||
{
|
||||
WritelnSystemInfo("[" + Name + "] 试图连接服务器!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
||||
Controller.WriteLine("[" + Name + "] 试图连接服务器!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
||||
}
|
||||
|
||||
public void AfterConnectEvent(object sender, ConnectEventArgs e)
|
||||
{
|
||||
WritelnSystemInfo("[" + Name + "] 结果:" + e.ConnectResult);
|
||||
Controller.WriteLine("[" + Name + "] 结果:" + e.ConnectResult);
|
||||
}
|
||||
|
||||
public void SucceedConnectEvent(object sender, ConnectEventArgs e)
|
||||
{
|
||||
WritelnSystemInfo("[" + Name + "] 连接服务器成功!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
||||
Controller.WriteLine("[" + Name + "] 连接服务器成功!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
||||
}
|
||||
|
||||
public void FailedConnectEvent(object sender, ConnectEventArgs e)
|
||||
{
|
||||
WritelnSystemInfo("[" + Name + "] 连接服务器失败!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
||||
Controller.WriteLine("[" + Name + "] 连接服务器失败!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
||||
}
|
||||
|
||||
public void BeforeIntoRoomEvent(object sender, RoomEventArgs e)
|
||||
@ -72,12 +72,12 @@ namespace FunGame.Testing.Solutions
|
||||
|
||||
public void SucceedIntoRoomEvent(object sender, RoomEventArgs e)
|
||||
{
|
||||
DataRequest request = NewDataRequest(Milimoe.FunGame.Core.Library.Constant.DataRequestType.Room_GetRoomPlayerCount);
|
||||
DataRequest request = Controller.NewDataRequest(Milimoe.FunGame.Core.Library.Constant.DataRequestType.Room_GetRoomPlayerCount);
|
||||
request.AddRequestData("roomid", e.RoomID);
|
||||
request.SendRequest();
|
||||
if (request.Result == Milimoe.FunGame.Core.Library.Constant.RequestResult.Success)
|
||||
{
|
||||
WritelnSystemInfo("[" + Name + "] " + e.RoomID + " 的玩家数量为: " + request.GetResult<int>("count"));
|
||||
Controller.WriteLine("[" + Name + "] " + e.RoomID + " 的玩家数量为: " + request.GetResult<int>("count"));
|
||||
}
|
||||
request.Dispose();
|
||||
}
|
||||
|
||||
7
Library/Solutions/TestText.cs
Normal file
7
Library/Solutions/TestText.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace FunGame.Testing.Solutions
|
||||
{
|
||||
internal class TestText
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user