diff --git a/Library/Main.cs b/Library/Main.cs index 87b5b4f..499452a 100644 --- a/Library/Main.cs +++ b/Library/Main.cs @@ -24,7 +24,7 @@ FunGameSimulation.InitFunGameSimulation(); //_ = new Milimoe.FunGame.Testing.Tests.ActivityExample(); -//List strings = FunGameSimulation.StartGame(true, false, true); +//List strings = FunGameSimulation.StartSimulationGame(true, false, true); //strings.ForEach(Console.WriteLine); //Character testc = new CustomCharacter(1, "1"); diff --git a/Library/Solutions/MyPlugin.cs b/Library/Solutions/MyPlugin.cs index a7f53e9..d705bcd 100644 --- a/Library/Solutions/MyPlugin.cs +++ b/Library/Solutions/MyPlugin.cs @@ -23,6 +23,14 @@ namespace FunGame.Testing.Solutions public void AfterLoginEvent(object sender, LoginEventArgs e) { Controller.WriteLine("[" + Name + "] 触发AfterLoginEvent! "); + if (e.Success) + { + Controller.WriteLine("[" + Name + "] 检测到登录成功?? "); + } + else + { + Controller.WriteLine("[" + Name + "] 登录失败~~"); + } } public void BeforeLoginEvent(object sender, LoginEventArgs e) @@ -30,16 +38,6 @@ namespace FunGame.Testing.Solutions Controller.WriteLine("[" + Name + "] 试图登录!账号" + e.Username + "密码" + e.Password); } - public void FailedLoginEvent(object sender, LoginEventArgs e) - { - Controller.WriteLine("[" + Name + "] 登录失败~~"); - } - - public void SucceedLoginEvent(object sender, LoginEventArgs e) - { - Controller.WriteLine("[" + Name + "] 检测到登录成功?? "); - } - public void BeforeConnectEvent(object sender, ConnectEventArgs e) { Controller.WriteLine("[" + Name + "] 试图连接服务器!!服务器IP" + e.ServerIP + ":" + e.ServerPort); @@ -48,16 +46,14 @@ namespace FunGame.Testing.Solutions public void AfterConnectEvent(object sender, ConnectEventArgs e) { Controller.WriteLine("[" + Name + "] 结果:" + e.ConnectResult); - } - - public void SucceedConnectEvent(object sender, ConnectEventArgs e) - { - Controller.WriteLine("[" + Name + "] 连接服务器成功!!服务器IP" + e.ServerIP + ":" + e.ServerPort); - } - - public void FailedConnectEvent(object sender, ConnectEventArgs e) - { - Controller.WriteLine("[" + Name + "] 连接服务器失败!!服务器IP" + e.ServerIP + ":" + e.ServerPort); + if (e.Success) + { + Controller.WriteLine("[" + Name + "] 连接服务器成功!!服务器IP" + e.ServerIP + ":" + e.ServerPort); + } + else + { + Controller.WriteLine("[" + Name + "] 连接服务器失败!!服务器IP" + e.ServerIP + ":" + e.ServerPort); + } } public void BeforeIntoRoomEvent(object sender, RoomEventArgs e) @@ -67,24 +63,17 @@ namespace FunGame.Testing.Solutions public void AfterIntoRoomEvent(object sender, RoomEventArgs e) { - - } - - public void SucceedIntoRoomEvent(object sender, RoomEventArgs e) - { - 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) + if (e.Success) { - Controller.WriteLine("[" + Name + "] " + e.RoomID + " 的玩家数量为: " + request.GetResult("count")); + 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) + { + Controller.WriteLine("[" + Name + "] " + e.RoomID + " 的玩家数量为: " + request.GetResult("count")); + } + request.Dispose(); } - request.Dispose(); - } - - public void FailedIntoRoomEvent(object sender, RoomEventArgs e) - { - } } } diff --git a/Library/Solutions/TestPlugin.cs b/Library/Solutions/TestPlugin.cs index 18d61da..82c5228 100644 --- a/Library/Solutions/TestPlugin.cs +++ b/Library/Solutions/TestPlugin.cs @@ -71,15 +71,5 @@ namespace Addons // 如果这里设置Cancel = true,将终止登录 e.Cancel = true; } - - public void FailedLoginEvent(object sender, LoginEventArgs e) - { - Console.WriteLine("failed"); - } - - public void SucceedLoginEvent(object sender, LoginEventArgs e) - { - Console.WriteLine("succeed"); - } } } diff --git a/Library/Tests/CheckDLL.cs b/Library/Tests/CheckDLL.cs index c0b8fbb..8326f96 100644 --- a/Library/Tests/CheckDLL.cs +++ b/Library/Tests/CheckDLL.cs @@ -26,11 +26,6 @@ namespace Milimoe.FunGame.Testing.Tests LoginEventArgs e = new(); plugins.OnBeforeLoginEvent(plugins, e); - if (!e.Cancel) - { - plugins.OnSucceedLoginEvent(plugins, e); - plugins.OnFailedLoginEvent(plugins, e); - } plugins.OnAfterLoginEvent(plugins, e); List list = [];