房间对战退出房间发送时机微调

This commit is contained in:
lishuo 2024-06-05 13:22:06 +08:00
parent 6e6d3b2050
commit 163eb686f0

View File

@ -148,6 +148,7 @@ namespace OnlineUserPool.ViewModels
case 0:
{
var client = Clients.FirstOrDefault(n => n.Equals(remoteIpEndPoint));
if(client == null) return;
client.LastActiveTime = DateTime.Now;
if (msg.V > 0)
{
@ -159,6 +160,7 @@ namespace OnlineUserPool.ViewModels
case 1:
{
var client = Clients.FirstOrDefault(n => n.Equals(remoteIpEndPoint));
if(client == null) return;
var msg1 = (msg as MsgModel);
client.Competitionid = msg1.CompetitionId;
client.Model = msg1.Model;
@ -542,13 +544,15 @@ namespace OnlineUserPool.ViewModels
{
RoomList.Remove(room);
}
//发送信息给当前房间内的人
SendGameRoomMessage(room);
var mine = Clients.FirstOrDefault(c => c.MemberId == msg1.UserId);
if (mine != null)
{
mine.RoomId = 0;
}
//发送信息给当前房间内的人
SendGameRoomMessage(room);
}
}