收到房间数据后不再判断slot信息是否改变,全量推送

This commit is contained in:
ALIENJACK\alien 2025-01-26 14:50:33 +08:00
parent 34fccd457a
commit 7ed40210fd

View File

@ -331,7 +331,6 @@ namespace AxibugEmuOnline.Client.Manager
Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, newJoin); Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, newJoin);
} }
bool bChangeSlot = false;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
var oldSlot = oldslotArr[i]; var oldSlot = oldslotArr[i];
@ -344,68 +343,65 @@ namespace AxibugEmuOnline.Client.Manager
oldSlot.PlayerLocalJoyIdx != newSlot.PlayerLocalJoyIdx oldSlot.PlayerLocalJoyIdx != newSlot.PlayerLocalJoyIdx
) )
{ {
bChangeSlot = true;
if (newSlot.PlayerUID > 0) if (newSlot.PlayerUID > 0)
{ {
OverlayManager.PopTip($"[{newSlot.PlayerNickName}]使用:P{i}"); OverlayManager.PopTip($"[{newSlot.PlayerNickName}]使用:P{i}");
} }
} }
} }
if (bChangeSlot) Eventer.Instance.PostEvent(EEvent.OnRoomSlotDataChanged);
{
Eventer.Instance.PostEvent(EEvent.OnRoomSlotDataChanged);
} //for (int i = 0; i < 4; i++)
//{
//for (int i = 0; i < 4; i++) // long OldPlayer = oldRoomPlayer[i];
//{ // long NewPlayer = newRoomPlayer[i];
// long OldPlayer = oldRoomPlayer[i]; // if (OldPlayer == NewPlayer)
// long NewPlayer = newRoomPlayer[i]; // continue;
// if (OldPlayer == NewPlayer)
// continue; // //位置之前有人,但是离开了
// if (OldPlayer > 0)
// //位置之前有人,但是离开了 // {
// if (OldPlayer > 0) // Eventer.Instance.PostEvent(EEvent.OnOtherPlayerLeavnRoom, i, OldPlayer);
// { // UserDataBase oldplayer = App.user.GetUserByUid(OldPlayer);
// Eventer.Instance.PostEvent(EEvent.OnOtherPlayerLeavnRoom, i, OldPlayer); // string oldPlayName = oldplayer != null ? oldplayer.NickName : "Player";
// UserDataBase oldplayer = App.user.GetUserByUid(OldPlayer); // OverlayManager.PopTip($"[{oldPlayName}]离开房间,手柄位:P{i}");
// string oldPlayName = oldplayer != null ? oldplayer.NickName : "Player"; // if (NewPlayer > 0)//而且害换了一个玩家
// OverlayManager.PopTip($"[{oldPlayName}]离开房间,手柄位:P{i}"); // {
// if (NewPlayer > 0)//而且害换了一个玩家 // Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer);
// { // mineRoomMiniInfo.GetPlayerNameByPlayerIdx((uint)i, out string PlayerName);
// Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer); // OverlayManager.PopTip($"[{PlayerName}]进入房间,手柄位:P{i}");
// mineRoomMiniInfo.GetPlayerNameByPlayerIdx((uint)i, out string PlayerName); // }
// OverlayManager.PopTip($"[{PlayerName}]进入房间,手柄位:P{i}"); // }
// } // else //之前没人
// } // {
// else //之前没人 // Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer);
// { // mineRoomMiniInfo.GetPlayerNameByPlayerIdx((uint)i, out string PlayerName);
// Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer); // OverlayManager.PopTip($"[{PlayerName}]进入房间,手柄位:P{i}");
// mineRoomMiniInfo.GetPlayerNameByPlayerIdx((uint)i, out string PlayerName); // }
// OverlayManager.PopTip($"[{PlayerName}]进入房间,手柄位:P{i}");
// } // //位置之前有人,但是离开了
// if (OldPlayer > 0)
// //位置之前有人,但是离开了 // {
// if (OldPlayer > 0) // Eventer.Instance.PostEvent(EEvent.OnOtherPlayerLeavnRoom, i, OldPlayer);
// { // UserDataBase oldplayer = App.user.GetUserByUid(OldPlayer);
// Eventer.Instance.PostEvent(EEvent.OnOtherPlayerLeavnRoom, i, OldPlayer); // string oldPlayName = oldplayer != null ? oldplayer.NickName : "Player";
// UserDataBase oldplayer = App.user.GetUserByUid(OldPlayer); // OverlayManager.PopTip($"[{oldPlayName}]离开房间,手柄位:P{i}");
// string oldPlayName = oldplayer != null ? oldplayer.NickName : "Player"; // if (NewPlayer > 0)//而且害换了一个玩家
// OverlayManager.PopTip($"[{oldPlayName}]离开房间,手柄位:P{i}"); // {
// if (NewPlayer > 0)//而且害换了一个玩家 // Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer);
// { // mineRoomMiniInfo.GetPlayerNameByPlayerIdx((uint)i, out string PlayerName);
// Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer); // OverlayManager.PopTip($"[{PlayerName}]进入房间,手柄位:P{i}");
// mineRoomMiniInfo.GetPlayerNameByPlayerIdx((uint)i, out string PlayerName); // }
// OverlayManager.PopTip($"[{PlayerName}]进入房间,手柄位:P{i}"); // }
// } // else //之前没人
// } // {
// else //之前没人 // Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer);
// { // mineRoomMiniInfo.GetPlayerNameByPlayerIdx((uint)i, out string PlayerName);
// Eventer.Instance.PostEvent(EEvent.OnOtherPlayerJoinRoom, i, NewPlayer); // OverlayManager.PopTip($"[{PlayerName}]进入房间,手柄位:P{i}");
// mineRoomMiniInfo.GetPlayerNameByPlayerIdx((uint)i, out string PlayerName); // }
// OverlayManager.PopTip($"[{PlayerName}]进入房间,手柄位:P{i}"); //}
// }
//}
} }
/// <summary> /// <summary>