完成离线消息发送和上线获取离线消息
This commit is contained in:
@@ -9,7 +9,7 @@ namespace NB.Gate;
|
||||
|
||||
public static class GateUnitManageComponentSystem
|
||||
{
|
||||
public static GateUnit Add(this GateUnitManageComponent self, Session session, long accountId)
|
||||
public static GateUnit Online(this GateUnitManageComponent self, Session session, long accountId)
|
||||
{
|
||||
if (self.Units.TryGetValue(accountId, out var unit))
|
||||
{
|
||||
@@ -34,11 +34,12 @@ public static class GateUnitManageComponentSystem
|
||||
return self.Units.TryGetValue(accountId, out unit);
|
||||
}
|
||||
|
||||
public static async FTask Remove(this GateUnitManageComponent self, long accountId, bool isDispose = true)
|
||||
public static async FTask Offline(this GateUnitManageComponent self, long accountId, long sessionId,
|
||||
bool isDispose = true)
|
||||
{
|
||||
if (!self.Units.TryGetValue(accountId, out var unit)) return;
|
||||
//通知其他服务器下线
|
||||
var result = await GateLoginHelper.Offline(unit);
|
||||
var result = await GateLoginHelper.Offline(unit, sessionId);
|
||||
if (result != 0)
|
||||
{
|
||||
Log.Error($"通知其他服务器下线失败,错误码:{result}");
|
||||
@@ -52,9 +53,10 @@ public static class GateUnitManageComponentSystem
|
||||
unit.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 回话迭代器
|
||||
/// 会话迭代器
|
||||
/// </summary>
|
||||
/// <param name="self"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
Reference in New Issue
Block a user