From 30dd2ee9aa925c4d173034bd10abd8fc755e9f77 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Fri, 13 Dec 2024 19:19:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E4=BB=96=E7=8E=A9=E5=AE=B6=E4=B8=8B?= =?UTF-8?q?=E7=BA=BF=20=E6=B8=85=E7=90=86=E5=85=B6=E6=89=8B=E6=9F=84?= =?UTF-8?q?=E4=BD=8D=E7=9A=84=E9=94=AE=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Manager/LoginManager.cs | 1 + AxibugEmuOnline.Server/Manager/RoomManager.cs | 19 +++---------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/AxibugEmuOnline.Server/Manager/LoginManager.cs b/AxibugEmuOnline.Server/Manager/LoginManager.cs index 12a325e2..1cb7aa21 100644 --- a/AxibugEmuOnline.Server/Manager/LoginManager.cs +++ b/AxibugEmuOnline.Server/Manager/LoginManager.cs @@ -103,6 +103,7 @@ namespace AxibugEmuOnline.Server.Manager { UserInfo = miniinfo, }; + //回执给自己 AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdUpdateSelfUserInfo, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(infodata)); diff --git a/AxibugEmuOnline.Server/Manager/RoomManager.cs b/AxibugEmuOnline.Server/Manager/RoomManager.cs index 7c9b8db9..69f9467b 100644 --- a/AxibugEmuOnline.Server/Manager/RoomManager.cs +++ b/AxibugEmuOnline.Server/Manager/RoomManager.cs @@ -557,7 +557,6 @@ namespace AxibugEmuOnline.Server public Google.Protobuf.ByteString? NextStateRaw { get; private set; } public Google.Protobuf.ByteString? ScreenRaw { get; private set; } public bool[] PlayerReadyState { get; private set; } - public List SynUIDs; //public RoomPlayerState PlayerState => getPlayerState(); private RoomGameState mGameState; @@ -587,13 +586,10 @@ namespace AxibugEmuOnline.Server } } } - /// /// 服务器提前帧数 /// public uint SrvForwardFrames { get; set; } - - bool IsAllReady() { bool Ready = true; @@ -611,7 +607,6 @@ namespace AxibugEmuOnline.Server } return Ready; } - public void Init(int roomID, int gameRomID, string roomHash, long hostUId, bool bloadState = false) { RoomID = roomID; @@ -630,7 +625,6 @@ namespace AxibugEmuOnline.Server mInputQueue = new Queue<(uint, ServerInputSnapShot)>(); mDictPlayerIdx2SendQueue = new Dictionary>(); } - public void SetPlayerUID(int PlayerIdx, ClientInfo _c) { long oldUID = -1; @@ -647,7 +641,6 @@ namespace AxibugEmuOnline.Server AppSrv.g_Log.Debug($"SetPlayerUID RoomID->{RoomID} _c.UID->{_c.UID} PlayerIdx->{PlayerIdx}"); _c.RoomState.SetRoomData(this.RoomID, PlayerIdx); } - public void RemovePlayer(ClientInfo _c) { int PlayerIdx = GetPlayerIdx(_c); @@ -660,7 +653,6 @@ namespace AxibugEmuOnline.Server } _c.RoomState.ClearRoomData(); } - int GetPlayerIdx(ClientInfo _c) { if (Player1_UID == _c.UID) return 0; @@ -669,7 +661,6 @@ namespace AxibugEmuOnline.Server if (Player4_UID == _c.UID) return 3; return -1; } - public bool GetPlayerUIDByIdx(int Idx, out long UID) { switch (Idx) @@ -693,7 +684,6 @@ namespace AxibugEmuOnline.Server return true; } - public List GetAllPlayerUIDs() { List list = new List(); @@ -703,7 +693,6 @@ namespace AxibugEmuOnline.Server if (Player4_UID > 0) list.Add(Player4_UID); return list; } - public List GetAllPlayerClientList() { List list = new List(); @@ -720,7 +709,6 @@ namespace AxibugEmuOnline.Server return list; } - public void SetPlayerInput(int PlayerIdx, long mFrameID, ServerInputSnapShot allinput) { switch (PlayerIdx) @@ -731,9 +719,9 @@ namespace AxibugEmuOnline.Server case 3: mCurrInputData.p4_byte = allinput.p1_byte; break; } } - - public void ClearPlayerInput(int PlayerIdx) + public void ClearPlayerInput(ClientInfo _c) { + int PlayerIdx = GetPlayerIdx(_c); switch (PlayerIdx) { case 0: mCurrInputData.p1_byte = 0; break; @@ -742,7 +730,6 @@ namespace AxibugEmuOnline.Server case 3: mCurrInputData.p4_byte = 0; break; } } - public int GetPlayerCount() { int count = 0; @@ -752,7 +739,6 @@ namespace AxibugEmuOnline.Server if (Player4_UID > 0) count++; return count; } - void StartNewTick() { mInputQueue.Clear(); @@ -902,6 +888,7 @@ namespace AxibugEmuOnline.Server { int oldPlayerCount = GetPlayerCount(); RemovePlayer(_c); + ClearPlayerInput(_c); int newPlayerCount = GetPlayerCount(); errcode = ErrorCode.ErrorOk; bHadRoomStateChange = CheckRoomStateChange(oldPlayerCount, newPlayerCount);