结构大修改,改成朴实无华的结构,不过度架构。能跑就行
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network;
|
||||
using Fantasy.Network.Interface;
|
||||
using NBC;
|
||||
using Log = NBC.Log;
|
||||
|
||||
namespace NBF.Fishing2
|
||||
{
|
||||
public class Map2C_RoleExitMapNotifyHandler : Message<Map2C_RoleExitRoomNotify>
|
||||
{
|
||||
protected override async FTask Run(Session session, Map2C_RoleExitRoomNotify message)
|
||||
{
|
||||
Log.Info($"收到离开房间推送 id={message.Id} ");
|
||||
var map = App.Main.GetComponent<Map>();
|
||||
if (map == null)
|
||||
{
|
||||
Log.Info("地图不存在,不处理退出请求");
|
||||
return;
|
||||
}
|
||||
if (map.Units.Remove(message.Id, out var unit))
|
||||
{
|
||||
unit.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user