房间完善,游戏列表统计

This commit is contained in:
sin365 2024-12-11 11:12:14 +08:00
parent 54cf6e695b
commit 5b9cb9bc5e
7 changed files with 32 additions and 16 deletions

View File

@ -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<TickLoop>();
@ -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;
}

View File

@ -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;
}
}

View File

@ -189,6 +189,7 @@ namespace AxibugEmuOnline.Client.Manager
{
App.log.Info("取得完整房间列表");
Protobuf_Room_List_RESP msg = ProtoBufHelper.DeSerizlize<Protobuf_Room_List_RESP>(reqData);
dictRoomListID2Info.Clear();
for (int i = 0; i < msg.RoomMiniInfoList.Count; i++)
AddOrUpdateRoomList(msg.RoomMiniInfoList[i]);
Eventer.Instance.PostEvent(EEvent.OnRoomListAllUpdate);

View File

@ -86,7 +86,7 @@ namespace AxibugEmuOnline.Client
}
}
//是否跳帧,单机无效
//是否跳帧,单机无效a
private void FixEmulatorFrame()
{
var skipFrameCount = App.roomMgr.netReplay.GetSkipFrameCount();

View File

@ -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

View File

@ -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
/// </summary>
/// <param name="RoomID"></param>
/// <param name="type">//[0] 更新或新增 [1] 删除</param>
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);
}

View File

@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>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||;</History>
<History>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||;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>