协议定义

This commit is contained in:
bob
2025-08-12 17:28:22 +08:00
parent 15723850c0
commit f8b876ca2f
19 changed files with 1150 additions and 329 deletions

View File

@@ -24,22 +24,22 @@ public class
if (oldChannelId > 0)
{
//退出旧的频道
if (channelCenter.TryGet(oldChannelId, out var oldChannel) && oldChannel != null)
var oldChannel = await channelCenter.Get(oldChannelId);
if (oldChannel != null)
{
oldChannel.Exit(entity);
}
}
//加入新频道
if (channelCenter.TryGet(request.Target, out var channel) && channel != null)
var newChannel = await channelCenter.Get(request.Target);
if (newChannel != null)
{
channel.Enter(entity);
newChannel.Enter(entity);
}
else
{
response.ErrorCode = ErrorCode.ChatNotChannel;
}
await FTask.CompletedTask;
}
}