forked from sin365/AxibugEmuOnline
修复联机流程bug
This commit is contained in:
parent
1f8f5c2773
commit
d87d2da55a
@ -214,7 +214,7 @@ namespace AxibugEmuOnline.Client.Event
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
App.log.Error(e.InnerException.ToString());
|
||||
App.log.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -369,13 +369,13 @@ namespace AxibugEmuOnline.Client.Manager
|
||||
if (WaitStep != msg.WaitStep)
|
||||
{
|
||||
WaitStep = msg.WaitStep;
|
||||
Eventer.Instance.PostEvent(EEvent.OnRoomWaitStepChange, WaitStep);
|
||||
if (WaitStep == 1)
|
||||
{
|
||||
byte[] decompressRawData = Helper.DecompressByteArray(msg.LoadStateRaw.ToByteArray());
|
||||
App.log.Info($"收到即时存档数据 解压后;{decompressRawData.Length}");
|
||||
RawData = decompressRawData;
|
||||
}
|
||||
Eventer.Instance.PostEvent(EEvent.OnRoomWaitStepChange, WaitStep);
|
||||
}
|
||||
}
|
||||
|
||||
@ -435,7 +435,7 @@ namespace AxibugEmuOnline.Client.Manager
|
||||
/// <param name="roomMiniInfo"></param>
|
||||
/// <param name="freeSlots"></param>
|
||||
/// <returns></returns>
|
||||
public static bool GetFreeSlot(this Protobuf_Room_MiniInfo roomMiniInfo,out int[] freeSlots)
|
||||
public static bool GetFreeSlot(this Protobuf_Room_MiniInfo roomMiniInfo, out int[] freeSlots)
|
||||
{
|
||||
List<int> temp = new List<int>();
|
||||
if (roomMiniInfo.Player1UID > 0) temp.Add(0);
|
||||
|
@ -47,6 +47,8 @@ namespace AxibugEmuOnline.Client
|
||||
return romFile;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary> 清除所有下载的Rom文件 </summary>
|
||||
public void ClearRomFile()
|
||||
{
|
||||
@ -119,5 +121,10 @@ namespace AxibugEmuOnline.Client
|
||||
{
|
||||
return Helper.FileMD5Hash(data);
|
||||
}
|
||||
|
||||
public void AddRomFile(RomFile rom)
|
||||
{
|
||||
nesRomFileNameMapper[rom.FileName] = rom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ namespace AxibugEmuOnline.Client
|
||||
Supporter.Setup(new CoreSupporter());
|
||||
Debuger.Setup(new CoreDebuger());
|
||||
|
||||
App.nesRomLib.AddRomFile(rom);
|
||||
|
||||
try
|
||||
{
|
||||
NesCore = new NES(rom.FileName);
|
||||
|
@ -86,7 +86,7 @@ namespace AxibugEmuOnline.Client.Network
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
App.log.Error(e.Message);
|
||||
App.log.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
using AxibugEmuOnline.Client.ClientCore;
|
||||
using System;
|
||||
using VirtualNes.Core;
|
||||
|
||||
namespace AxibugEmuOnline.Client
|
||||
{
|
||||
|
@ -10,7 +10,7 @@ namespace AxibugEmuOnline.Client
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
Eventer.Instance.RegisterEvent<int>(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll);
|
||||
Eventer.Instance.RegisterEvent(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll);
|
||||
Eventer.Instance.RegisterEvent<int>(EEvent.OnRoomListSingleClose, OnRoomClosed);
|
||||
Eventer.Instance.RegisterEvent<int>(EEvent.OnRoomListSingleAdd, OnRoomSingleAdd);
|
||||
base.Awake();
|
||||
@ -19,7 +19,7 @@ namespace AxibugEmuOnline.Client
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
Eventer.Instance.UnregisterEvent<int>(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll);
|
||||
Eventer.Instance.UnregisterEvent(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll);
|
||||
Eventer.Instance.UnregisterEvent<int>(EEvent.OnRoomListSingleUpdate, OnRoomSingleAdd);
|
||||
Eventer.Instance.UnregisterEvent<int>(EEvent.OnRoomListSingleClose, OnRoomClosed);
|
||||
}
|
||||
@ -46,7 +46,7 @@ namespace AxibugEmuOnline.Client
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRoomListUpdateAll(int obj)
|
||||
private void OnRoomListUpdateAll()
|
||||
{
|
||||
if (m_entering)
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ namespace AxibugEmuOnline.Client
|
||||
RomFile romFile = new RomFile(EnumPlatform.NES, 0, 0);
|
||||
romFile.SetWebData(romWebData);
|
||||
s_RomFileCahcesInRoomInfo[roomInfo.GameRomID] = romFile;
|
||||
|
||||
|
||||
callback.Invoke(roomInfo,romFile);
|
||||
}));
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user