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);