进入房间create rom

This commit is contained in:
ALIENJACK\alien 2024-09-14 15:56:15 +08:00
parent 3aa6f7a951
commit fa8c642a69
3 changed files with 12 additions and 3 deletions

View File

@ -254,9 +254,11 @@ namespace AxibugEmuOnline.Client.Manager
/// 离开房间 /// 离开房间
/// </summary> /// </summary>
/// <param name="RoomID"></param> /// <param name="RoomID"></param>
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.log.Info($"创建房间");
App.network.SendToServer((int)CommandID.CmdRoomLeave, ProtoBufHelper.Serizlize(_Protobuf_Room_Leave)); App.network.SendToServer((int)CommandID.CmdRoomLeave, ProtoBufHelper.Serizlize(_Protobuf_Room_Leave));
} }

View File

@ -41,6 +41,7 @@ namespace AxibugEmuOnline.Client
public int Index { get; private set; } public int Index { get; private set; }
/// <summary> 在查询结果中的所在页 </summary> /// <summary> 在查询结果中的所在页 </summary>
public int Page { 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 OnDownloadOver;
public event Action OnInfoFilled; public event Action OnInfoFilled;

View File

@ -13,7 +13,7 @@ namespace AxibugEmuOnline.Client
public override bool Enable => gameObject.activeInHierarchy; public override bool Enable => gameObject.activeInHierarchy;
/// <summary> 指示该游戏实例是否处于联网模式 </summary> /// <summary> 指示该游戏实例是否处于联网模式 </summary>
public bool IsOnline { get; private set; } public bool IsOnline => App.roomMgr.RoomState <= AxibugProtobuf.RoomGameState.OnlyHost;
private RomFile m_rom; private RomFile m_rom;
private object m_core; private object m_core;
@ -74,6 +74,11 @@ namespace AxibugEmuOnline.Client
m_rom = currentRom; m_rom = currentRom;
m_core = core; m_core = core;
if (App.user.IsLoggedIn)
{
App.roomMgr.SendCreateRoom(m_rom.ID, 0, m_rom.Hash);
}
gameObject.SetActiveEx(true); gameObject.SetActiveEx(true);
} }
@ -91,6 +96,7 @@ namespace AxibugEmuOnline.Client
public void QuitGame() public void QuitGame()
{ {
App.roomMgr.SendLeavnRoom();
App.emu.StopGame(); App.emu.StopGame();
} }
} }