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