mirror of
https://github.com/milimoe/FunGame-Testing.git
synced 2025-04-23 04:39:34 +08:00
t
This commit is contained in:
parent
820e182b78
commit
9571ba9664
@ -24,7 +24,7 @@ FunGameSimulation.InitFunGameSimulation();
|
|||||||
|
|
||||||
//_ = new Milimoe.FunGame.Testing.Tests.ActivityExample();
|
//_ = new Milimoe.FunGame.Testing.Tests.ActivityExample();
|
||||||
|
|
||||||
//List<string> strings = FunGameSimulation.StartGame(true, false, true);
|
//List<string> strings = FunGameSimulation.StartSimulationGame(true, false, true);
|
||||||
//strings.ForEach(Console.WriteLine);
|
//strings.ForEach(Console.WriteLine);
|
||||||
|
|
||||||
//Character testc = new CustomCharacter(1, "1");
|
//Character testc = new CustomCharacter(1, "1");
|
||||||
|
@ -23,6 +23,14 @@ namespace FunGame.Testing.Solutions
|
|||||||
public void AfterLoginEvent(object sender, LoginEventArgs e)
|
public void AfterLoginEvent(object sender, LoginEventArgs e)
|
||||||
{
|
{
|
||||||
Controller.WriteLine("[" + Name + "] 触发AfterLoginEvent! ");
|
Controller.WriteLine("[" + Name + "] 触发AfterLoginEvent! ");
|
||||||
|
if (e.Success)
|
||||||
|
{
|
||||||
|
Controller.WriteLine("[" + Name + "] 检测到登录成功?? ");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Controller.WriteLine("[" + Name + "] 登录失败~~");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BeforeLoginEvent(object sender, LoginEventArgs e)
|
public void BeforeLoginEvent(object sender, LoginEventArgs e)
|
||||||
@ -30,16 +38,6 @@ namespace FunGame.Testing.Solutions
|
|||||||
Controller.WriteLine("[" + Name + "] 试图登录!账号" + e.Username + "密码" + e.Password);
|
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)
|
public void BeforeConnectEvent(object sender, ConnectEventArgs e)
|
||||||
{
|
{
|
||||||
Controller.WriteLine("[" + Name + "] 试图连接服务器!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
Controller.WriteLine("[" + Name + "] 试图连接服务器!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
||||||
@ -48,16 +46,14 @@ namespace FunGame.Testing.Solutions
|
|||||||
public void AfterConnectEvent(object sender, ConnectEventArgs e)
|
public void AfterConnectEvent(object sender, ConnectEventArgs e)
|
||||||
{
|
{
|
||||||
Controller.WriteLine("[" + Name + "] 结果:" + e.ConnectResult);
|
Controller.WriteLine("[" + Name + "] 结果:" + e.ConnectResult);
|
||||||
}
|
if (e.Success)
|
||||||
|
{
|
||||||
public void SucceedConnectEvent(object sender, ConnectEventArgs e)
|
Controller.WriteLine("[" + Name + "] 连接服务器成功!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
||||||
{
|
}
|
||||||
Controller.WriteLine("[" + Name + "] 连接服务器成功!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
else
|
||||||
}
|
{
|
||||||
|
Controller.WriteLine("[" + Name + "] 连接服务器失败!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
||||||
public void FailedConnectEvent(object sender, ConnectEventArgs e)
|
}
|
||||||
{
|
|
||||||
Controller.WriteLine("[" + Name + "] 连接服务器失败!!服务器IP" + e.ServerIP + ":" + e.ServerPort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BeforeIntoRoomEvent(object sender, RoomEventArgs e)
|
public void BeforeIntoRoomEvent(object sender, RoomEventArgs e)
|
||||||
@ -67,24 +63,17 @@ namespace FunGame.Testing.Solutions
|
|||||||
|
|
||||||
public void AfterIntoRoomEvent(object sender, RoomEventArgs e)
|
public void AfterIntoRoomEvent(object sender, RoomEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (e.Success)
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
Controller.WriteLine("[" + Name + "] " + e.RoomID + " 的玩家数量为: " + request.GetResult<int>("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<int>("count"));
|
||||||
|
}
|
||||||
|
request.Dispose();
|
||||||
}
|
}
|
||||||
request.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void FailedIntoRoomEvent(object sender, RoomEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,15 +71,5 @@ namespace Addons
|
|||||||
// 如果这里设置Cancel = true,将终止登录
|
// 如果这里设置Cancel = true,将终止登录
|
||||||
e.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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,6 @@ namespace Milimoe.FunGame.Testing.Tests
|
|||||||
|
|
||||||
LoginEventArgs e = new();
|
LoginEventArgs e = new();
|
||||||
plugins.OnBeforeLoginEvent(plugins, e);
|
plugins.OnBeforeLoginEvent(plugins, e);
|
||||||
if (!e.Cancel)
|
|
||||||
{
|
|
||||||
plugins.OnSucceedLoginEvent(plugins, e);
|
|
||||||
plugins.OnFailedLoginEvent(plugins, e);
|
|
||||||
}
|
|
||||||
plugins.OnAfterLoginEvent(plugins, e);
|
plugins.OnAfterLoginEvent(plugins, e);
|
||||||
|
|
||||||
List<Character> list = [];
|
List<Character> list = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user