diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs
index 3e957630..e737cb6d 100644
--- a/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs
+++ b/AxibugEmuOnline.Client/Assets/Script/Manager/AppRoom.cs
@@ -254,9 +254,11 @@ namespace AxibugEmuOnline.Client.Manager
/// 离开房间
///
///
- public void SendLeavnRoom(int RoomID)
+ public void SendLeavnRoom()
{
- _Protobuf_Room_Leave.RoomID = RoomID;
+ if (!InRoom)
+ return;
+ _Protobuf_Room_Leave.RoomID = mineRoomMiniInfo.RoomID;
App.log.Info($"创建房间");
App.network.SendToServer((int)CommandID.CmdRoomLeave, ProtoBufHelper.Serizlize(_Protobuf_Room_Leave));
}
diff --git a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs b/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs
index bde787d5..5dc30e99 100644
--- a/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs
+++ b/AxibugEmuOnline.Client/Assets/Script/Manager/RomLib/RomFile.cs
@@ -41,6 +41,7 @@ namespace AxibugEmuOnline.Client
public int Index { get; private set; }
/// 在查询结果ä¸çš„所在页
public int Page { get; private set; }
+ public string Hash => webData != null ? webData.hash : string.Empty;
public event Action OnDownloadOver;
public event Action OnInfoFilled;
diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs b/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs
index fa811a59..727efe9f 100644
--- a/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs
+++ b/AxibugEmuOnline.Client/Assets/Script/UI/InGameUI/InGameUI.cs
@@ -13,7 +13,7 @@ namespace AxibugEmuOnline.Client
public override bool Enable => gameObject.activeInHierarchy;
/// ָʾ¸ÃÓÎϷʵÀýÊÇ·ñ´¦ÓÚÁªÍøģʽ
- public bool IsOnline { get; private set; }
+ public bool IsOnline => App.roomMgr.RoomState <= AxibugProtobuf.RoomGameState.OnlyHost;
private RomFile m_rom;
private object m_core;
@@ -74,6 +74,11 @@ namespace AxibugEmuOnline.Client
m_rom = currentRom;
m_core = core;
+ if (App.user.IsLoggedIn)
+ {
+ App.roomMgr.SendCreateRoom(m_rom.ID, 0, m_rom.Hash);
+ }
+
gameObject.SetActiveEx(true);
}
@@ -91,6 +96,7 @@ namespace AxibugEmuOnline.Client
public void QuitGame()
{
+ App.roomMgr.SendLeavnRoom();
App.emu.StopGame();
}
}