From 5b9cb9bc5ed964e3f66aa4a13d07db12cfeb075f Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Wed, 11 Dec 2024 11:12:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E9=97=B4=E5=AE=8C=E5=96=84=EF=BC=8C?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=88=97=E8=A1=A8=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AxibugEmuOnline.Client/Assets/Script/App.cs | 9 ++++++--- AxibugEmuOnline.Client/Assets/Script/Initer.cs | 9 +++++++++ .../Assets/Script/Manager/AppRoom.cs | 1 + .../Assets/Script/NesEmulator/NesEmulator.cs | 2 +- .../Script/NesEmulator/NesEmulator_Screen.mat | 10 ++++++++-- AxibugEmuOnline.Server/Manager/RoomManager.cs | 15 ++++++--------- .../PublishProfiles/FolderProfile.pubxml.user | 2 +- 7 files changed, 32 insertions(+), 16 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/App.cs b/AxibugEmuOnline.Client/Assets/Script/App.cs index efb607a..8ac773e 100644 --- a/AxibugEmuOnline.Client/Assets/Script/App.cs +++ b/AxibugEmuOnline.Client/Assets/Script/App.cs @@ -29,6 +29,8 @@ namespace AxibugEmuOnline.Client.ClientCore public static AppSettings settings; public static FilterManager filter; public static AppShare share; + static bool bTest; + static string mTestSrvIP; #region Mono public static TickLoop tickLoop; private static CoroutineRunner coRunner; @@ -39,7 +41,7 @@ namespace AxibugEmuOnline.Client.ClientCore #else public static string PersistentDataPath => Application.persistentDataPath; #endif - public static void Init(Initer initer) + public static void Init(Initer initer,bool isTest = false,string testSrvIP = "") { settings = new AppSettings(); @@ -57,6 +59,8 @@ namespace AxibugEmuOnline.Client.ClientCore roomMgr = new AppRoom(); share = new AppShare(); filter = new FilterManager(initer.m_filterVolume, initer.m_filterPreview, initer.m_xmbBg); + bTest = isTest; + mTestSrvIP = testSrvIP; var go = new GameObject("[AppAxibugEmuOnline]"); GameObject.DontDestroyOnLoad(go); tickLoop = go.AddComponent(); @@ -103,11 +107,10 @@ namespace AxibugEmuOnline.Client.ClientCore yield break; int platform = 0; - bool bTest = false; if (bTest) { yield return null; - Connect("192.168.0.47", 10492); + Connect(mTestSrvIP, 10492); yield break; } diff --git a/AxibugEmuOnline.Client/Assets/Script/Initer.cs b/AxibugEmuOnline.Client/Assets/Script/Initer.cs index a47d647..2112d11 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Initer.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Initer.cs @@ -11,9 +11,18 @@ namespace AxibugEmuOnline.Client public CanvasGroup m_xmbBg; public static string dev_UUID; +#if UNITY_EDITOR + public bool bTest = false; + public string mTestSrvIP = "192.168.0.47"; +#endif + private void Awake() { +#if UNITY_EDITOR + App.Init(this, bTest, mTestSrvIP); +#else App.Init(this); +#endif dev_UUID = SystemInfo.deviceUniqueIdentifier; } } diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs index 3f4b9e3..9e8bee9 100644 --- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs +++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs @@ -189,6 +189,7 @@ namespace AxibugEmuOnline.Client.Manager { App.log.Info("取得完整房间列表"); Protobuf_Room_List_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + dictRoomListID2Info.Clear(); for (int i = 0; i < msg.RoomMiniInfoList.Count; i++) AddOrUpdateRoomList(msg.RoomMiniInfoList[i]); Eventer.Instance.PostEvent(EEvent.OnRoomListAllUpdate); diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs index f32f151..a79f2ca 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator.cs @@ -86,7 +86,7 @@ namespace AxibugEmuOnline.Client } } - //Ƿ֡Ч + //Ƿ֡Чa private void FixEmulatorFrame() { var skipFrameCount = App.roomMgr.netReplay.GetSkipFrameCount(); diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.mat b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.mat index eed7c2b..d581fae 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.mat +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/NesEmulator_Screen.mat @@ -2,20 +2,24 @@ %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: NesEmulator_Screen m_Shader: {fileID: 4800000, guid: b351396ff606116478d7f4412abe4e2e, type: 3} - m_ShaderKeywords: + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] m_LightmapFlags: 4 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -59,6 +63,7 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + m_Ints: [] m_Floats: - _BumpScale: 1 - _ColorMask: 15 @@ -87,3 +92,4 @@ Material: - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/AxibugEmuOnline.Server/Manager/RoomManager.cs b/AxibugEmuOnline.Server/Manager/RoomManager.cs index c5f4acf..7c9b8db 100644 --- a/AxibugEmuOnline.Server/Manager/RoomManager.cs +++ b/AxibugEmuOnline.Server/Manager/RoomManager.cs @@ -105,8 +105,6 @@ namespace AxibugEmuOnline.Server } public void RoomLog(long uid, int platform, int RoomID, int RomID, RoomLogType state) { - - return; MySqlConnection conn = Haoyue_SQLPoolManager.DequeueSQLConn("RoomLog"); try { @@ -122,7 +120,7 @@ namespace AxibugEmuOnline.Server command.ExecuteNonQuery(); } - if (state == RoomLogType.Join) + if (state == RoomLogType.Create) { query = "update romlist_nes set playcount = playcount + 1 where id = ?romid"; using (var command = new MySqlCommand(query, conn)) @@ -210,9 +208,8 @@ namespace AxibugEmuOnline.Server /// /// /// //[0] 更新或新增 [1] 删除 - public void SendRoomUpdateToAll(int RoomID, int type) + public void SendRoomUpdateToAll(Data_RoomData room, int type) { - Data_RoomData room = GetRoomData(RoomID); if (room == null) return; @@ -247,7 +244,7 @@ namespace AxibugEmuOnline.Server if (joinErrcode == ErrorCode.ErrorOk && bHadRoomStateChange) SendRoomStepChange(newRoom); - SendRoomUpdateToAll(newRoom.RoomID, 0); + SendRoomUpdateToAll(newRoom, 0); RoomLog(_c.UID, 1, newRoom.RoomID, newRoom.GameRomID, RoomLogType.Create); } @@ -285,7 +282,7 @@ namespace AxibugEmuOnline.Server if (room != null) { - SendRoomUpdateToAll(room.RoomID, 0); + SendRoomUpdateToAll(room, 0); } } RoomLog(_c.UID, 1, room.RoomID, room.GameRomID, RoomLogType.Join); @@ -348,11 +345,11 @@ namespace AxibugEmuOnline.Server if (room.GetPlayerCount() < 1) { + SendRoomUpdateToAll(room, 1); RemoveRoom(room.RoomID); - SendRoomUpdateToAll(room.RoomID, 1); } else - SendRoomUpdateToAll(room.RoomID, 0); + SendRoomUpdateToAll(room, 0); RoomLog(_c.UID, 1, room.RoomID, room.GameRomID, RoomLogType.Leave); } diff --git a/AxibugEmuOnline.Server/Properties/PublishProfiles/FolderProfile.pubxml.user b/AxibugEmuOnline.Server/Properties/PublishProfiles/FolderProfile.pubxml.user index 8658353..3ac9d7b 100644 --- a/AxibugEmuOnline.Server/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/AxibugEmuOnline.Server/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - True|2024-12-04T14:26:53.2238425Z||;True|2024-12-04T22:26:10.9572308+08:00||;True|2024-12-04T21:24:20.1913809+08:00||;True|2024-12-04T21:24:02.9590471+08:00||;True|2024-12-04T01:43:54.7646411+08:00||;True|2024-12-04T01:22:11.8117030+08:00||;True|2024-12-04T01:20:06.5770785+08:00||;True|2024-12-04T01:16:31.6391421+08:00||;True|2024-12-04T01:12:43.4697251+08:00||;True|2024-12-04T01:07:04.8333668+08:00||;True|2024-12-04T00:59:23.6611648+08:00||;True|2024-12-04T00:27:05.0229247+08:00||;True|2024-12-03T23:50:48.5712706+08:00||;True|2024-12-03T23:47:47.1095592+08:00||;True|2024-12-03T20:24:57.4098592+08:00||;True|2024-12-03T20:16:36.9886489+08:00||;True|2024-12-03T20:15:52.5482738+08:00||;True|2024-12-02T20:10:07.8192795+08:00||;True|2024-11-28T19:58:55.3995125+08:00||;True|2024-09-14T16:39:29.4677979+08:00||;True|2024-09-14T16:38:22.2398996+08:00||;True|2024-09-13T13:39:28.9591993+08:00||;True|2024-09-12T17:48:43.1521740+08:00||;True|2024-09-12T17:43:57.0504432+08:00||;True|2024-09-12T17:19:48.6392091+08:00||;True|2024-09-12T13:38:45.0141937+08:00||;False|2024-09-12T13:37:57.6131232+08:00||;True|2024-06-28T16:25:59.3159172+08:00||;True|2024-06-28T15:30:49.8257235+08:00||; + True|2024-12-11T02:52:05.7940446Z||;True|2024-12-04T22:26:53.2238425+08:00||;True|2024-12-04T22:26:10.9572308+08:00||;True|2024-12-04T21:24:20.1913809+08:00||;True|2024-12-04T21:24:02.9590471+08:00||;True|2024-12-04T01:43:54.7646411+08:00||;True|2024-12-04T01:22:11.8117030+08:00||;True|2024-12-04T01:20:06.5770785+08:00||;True|2024-12-04T01:16:31.6391421+08:00||;True|2024-12-04T01:12:43.4697251+08:00||;True|2024-12-04T01:07:04.8333668+08:00||;True|2024-12-04T00:59:23.6611648+08:00||;True|2024-12-04T00:27:05.0229247+08:00||;True|2024-12-03T23:50:48.5712706+08:00||;True|2024-12-03T23:47:47.1095592+08:00||;True|2024-12-03T20:24:57.4098592+08:00||;True|2024-12-03T20:16:36.9886489+08:00||;True|2024-12-03T20:15:52.5482738+08:00||;True|2024-12-02T20:10:07.8192795+08:00||;True|2024-11-28T19:58:55.3995125+08:00||;True|2024-09-14T16:39:29.4677979+08:00||;True|2024-09-14T16:38:22.2398996+08:00||;True|2024-09-13T13:39:28.9591993+08:00||;True|2024-09-12T17:48:43.1521740+08:00||;True|2024-09-12T17:43:57.0504432+08:00||;True|2024-09-12T17:19:48.6392091+08:00||;True|2024-09-12T13:38:45.0141937+08:00||;False|2024-09-12T13:37:57.6131232+08:00||;True|2024-06-28T16:25:59.3159172+08:00||;True|2024-06-28T15:30:49.8257235+08:00||; \ No newline at end of file