forked from sin365/AxibugEmuOnline
收藏fixed,协议更新 部分即时存档
This commit is contained in:
parent
327570e031
commit
d05d69735d
@ -29,6 +29,7 @@ namespace AxibugEmuOnline.Client.ClientCore
|
|||||||
public static AppRoom roomMgr;
|
public static AppRoom roomMgr;
|
||||||
public static AppSettings settings;
|
public static AppSettings settings;
|
||||||
public static AppShare share;
|
public static AppShare share;
|
||||||
|
private static object gameSavMgr;
|
||||||
static bool bTest;
|
static bool bTest;
|
||||||
static string mTestSrvIP;
|
static string mTestSrvIP;
|
||||||
#region Mono
|
#region Mono
|
||||||
@ -70,6 +71,7 @@ namespace AxibugEmuOnline.Client.ClientCore
|
|||||||
CacheMgr = new CacheManager();
|
CacheMgr = new CacheManager();
|
||||||
roomMgr = new AppRoom();
|
roomMgr = new AppRoom();
|
||||||
share = new AppShare();
|
share = new AppShare();
|
||||||
|
gameSavMgr = new AppGameSavMgr();
|
||||||
bTest = isTest;
|
bTest = isTest;
|
||||||
mTestSrvIP = testSrvIP;
|
mTestSrvIP = testSrvIP;
|
||||||
var go = new GameObject("[AppAxibugEmuOnline]");
|
var go = new GameObject("[AppAxibugEmuOnline]");
|
||||||
|
@ -90,5 +90,9 @@
|
|||||||
/// <para><see cref="int"/>RomID</para>
|
/// <para><see cref="int"/>RomID</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
OnRomStarStateChanged, //TODO 实现这个事件
|
OnRomStarStateChanged, //TODO 实现这个事件
|
||||||
|
/// <summary>
|
||||||
|
/// 网络即时存档列表更新
|
||||||
|
/// </summary>
|
||||||
|
OnNetGameSavListUpdate,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,133 @@
|
|||||||
|
using AxibugEmuOnline.Client.ClientCore;
|
||||||
|
using AxibugEmuOnline.Client.Common;
|
||||||
|
using AxibugEmuOnline.Client.Event;
|
||||||
|
using AxibugEmuOnline.Client.Network;
|
||||||
|
using AxibugProtobuf;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace AxibugEmuOnline.Client.Manager
|
||||||
|
{
|
||||||
|
public class AppGameSavMgr
|
||||||
|
{
|
||||||
|
Dictionary<int, Protobuf_Mine_GameSavInfo[]> dictRomId2SavInfo = new Dictionary<int, Protobuf_Mine_GameSavInfo[]>();
|
||||||
|
public AppGameSavMgr()
|
||||||
|
{
|
||||||
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdGamesavGetGameSavList, RecvGetGameSavList);
|
||||||
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdGamesavDelGameSav, RecvDelGameSavList);
|
||||||
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdGamesavUploadGameSav, RecvUpLoadGameSav);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从数据层取存档列表数据(一般是OnNetGameSavListUpdate事件来了之后来取数据)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RomID"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Protobuf_Mine_GameSavInfo[] GetRomSaveIDList(int RomID)
|
||||||
|
{
|
||||||
|
if (!dictRomId2SavInfo.ContainsKey(RomID))
|
||||||
|
{
|
||||||
|
dictRomId2SavInfo[RomID] = null;
|
||||||
|
}
|
||||||
|
return dictRomId2SavInfo[RomID];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发送请求即时存档列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RomID"></param>
|
||||||
|
public void SendGetGameSavList(int RomID)
|
||||||
|
{
|
||||||
|
Protobuf_Mine_GetGameSavList req = new Protobuf_Mine_GetGameSavList()
|
||||||
|
{
|
||||||
|
RomID = RomID,
|
||||||
|
};
|
||||||
|
App.log.Info($"SendGetGameSavList");
|
||||||
|
App.network.SendToServer((int)CommandID.CmdGamesavGetGameSavList, ProtoBufHelper.Serizlize(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RecvGetGameSavList(byte[] reqData)
|
||||||
|
{
|
||||||
|
Protobuf_Mine_GetGameSavList_RESP msg = ProtoBufHelper.DeSerizlize<Protobuf_Mine_GetGameSavList_RESP>(reqData);
|
||||||
|
|
||||||
|
Protobuf_Mine_GameSavInfo[] savArr = GetRomSaveIDList(msg.RomID);
|
||||||
|
for (int i = 0; i < savArr.Length; i++)
|
||||||
|
{
|
||||||
|
Protobuf_Mine_GameSavInfo info = msg.SavDataList.FirstOrDefault(w => w.SavDataIdx == i);
|
||||||
|
savArr[i] = info;
|
||||||
|
}
|
||||||
|
Eventer.Instance.PostEvent(EEvent.OnNetGameSavListUpdate, msg.RomID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发送删除即时存档
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RomID"></param>
|
||||||
|
/// <param name="SavDataIdx"></param>
|
||||||
|
public void SendDelGameSavList(int RomID,int SavDataIdx)
|
||||||
|
{
|
||||||
|
Protobuf_Mine_DelGameSav req = new Protobuf_Mine_DelGameSav()
|
||||||
|
{
|
||||||
|
RomID = RomID,
|
||||||
|
SavDataIdx = SavDataIdx
|
||||||
|
};
|
||||||
|
App.log.Info($"SendDelGameSavList");
|
||||||
|
App.network.SendToServer((int)CommandID.CmdGamesavGetGameSavList, ProtoBufHelper.Serizlize(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RecvDelGameSavList(byte[] reqData)
|
||||||
|
{
|
||||||
|
Protobuf_Mine_DelGameSav_RESP msg = ProtoBufHelper.DeSerizlize<Protobuf_Mine_DelGameSav_RESP>(reqData);
|
||||||
|
|
||||||
|
Protobuf_Mine_GameSavInfo[] savArr = GetRomSaveIDList(msg.RomID);
|
||||||
|
savArr[msg.SavDataIdx] = null;
|
||||||
|
Eventer.Instance.PostEvent(EEvent.OnNetGameSavListUpdate, msg.RomID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 上传即时存档
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="RomID"></param>
|
||||||
|
/// <param name="SavDataIdx"></param>
|
||||||
|
public void SendUpLoadGameSav(int RomID,int SavDataIdx, byte[] RawData, byte[] SavImgData)
|
||||||
|
{
|
||||||
|
//压缩
|
||||||
|
byte[] compressRawData = Helper.CompressByteArray(RawData);
|
||||||
|
|
||||||
|
//压缩
|
||||||
|
byte[] compressImgData = Helper.CompressByteArray(SavImgData);
|
||||||
|
|
||||||
|
Protobuf_Mine_UpLoadGameSav req = new Protobuf_Mine_UpLoadGameSav()
|
||||||
|
{
|
||||||
|
RomID = RomID,
|
||||||
|
SavDataIdx = SavDataIdx,
|
||||||
|
StateRaw = Google.Protobuf.ByteString.CopyFrom(compressRawData),
|
||||||
|
SavImg = Google.Protobuf.ByteString.CopyFrom(compressImgData),
|
||||||
|
};
|
||||||
|
|
||||||
|
App.log.Info($"SendDelGameSavList");
|
||||||
|
App.log.Info($"上传即时存档数据 原数据大小:{RawData.Length},压缩后;{compressRawData.Length}");
|
||||||
|
App.log.Info($"上传截图 原数据大小:{SavImgData.Length},压缩后;{compressImgData.Length}");
|
||||||
|
|
||||||
|
App.network.SendToServer((int)CommandID.CmdGamesavGetGameSavList, ProtoBufHelper.Serizlize(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
void RecvUpLoadGameSav(byte[] reqData)
|
||||||
|
{
|
||||||
|
Protobuf_Mine_UpLoadGameSav_RESP msg = ProtoBufHelper.DeSerizlize<Protobuf_Mine_UpLoadGameSav_RESP>(reqData);
|
||||||
|
|
||||||
|
Protobuf_Mine_GameSavInfo[] savArr = GetRomSaveIDList(msg.RomID);
|
||||||
|
savArr[msg.UploadSevInfo.SavDataIdx] = msg.UploadSevInfo;
|
||||||
|
Eventer.Instance.PostEvent(EEvent.OnNetGameSavListUpdate, msg.RomID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 即时存档或网络截图下载完成之后,需要先解压再使用
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public byte[] UnGzipData(byte[] data)
|
||||||
|
{
|
||||||
|
return Helper.DecompressByteArray(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c83a305f1221ec543930b06c37d80328
|
@ -494,9 +494,17 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 即时存档加载完毕
|
/// 即时存档加载完毕
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendRoomPlayerReady()
|
/// <param name="PushFrameNeedTimeUs">push帧所需平均时间(微秒)</param>
|
||||||
|
/// <param name="LoadStateNeedTimeUs">加载即时存档所需平均时间(微秒)</param>
|
||||||
|
/// <param name="VideoFrameShowNeedTimeUs">视频一帧所需时间(微秒)</param>
|
||||||
|
/// <param name="AudioFramePlayNeedTimeUs">音频处理一帧所需时间(微秒)</param>
|
||||||
|
public void SendRoomPlayerReady(float PushFrameNeedTimeUs,float LoadStateNeedTimeUs,float VideoFrameShowNeedTimeUs,float AudioFramePlayNeedTimeUs)
|
||||||
{
|
{
|
||||||
App.log.Debug("上报准备完毕");
|
App.log.Debug("上报准备完毕");
|
||||||
|
_Protobuf_Room_Player_Ready.PushFrameNeedTimeUs = PushFrameNeedTimeUs;
|
||||||
|
_Protobuf_Room_Player_Ready.LoadStateNeedTimeUs = LoadStateNeedTimeUs;
|
||||||
|
_Protobuf_Room_Player_Ready.VideoFrameShowNeedTimeUs = VideoFrameShowNeedTimeUs;
|
||||||
|
_Protobuf_Room_Player_Ready.AudioFramePlayNeedTimeUs = AudioFramePlayNeedTimeUs;
|
||||||
App.network.SendToServer((int)CommandID.CmdRoomPlayerReady, ProtoBufHelper.Serizlize(_Protobuf_Room_Player_Ready));
|
App.network.SendToServer((int)CommandID.CmdRoomPlayerReady, ProtoBufHelper.Serizlize(_Protobuf_Room_Player_Ready));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
Motion = Motion,
|
Motion = Motion,
|
||||||
RomID = RomID,
|
RomID = RomID,
|
||||||
};
|
};
|
||||||
App.log.Info($"LeavnRoom");
|
App.log.Info($"SendGameStar");
|
||||||
App.network.SendToServer((int)CommandID.CmdGameMark, ProtoBufHelper.Serizlize(req));
|
App.network.SendToServer((int)CommandID.CmdGameMark, ProtoBufHelper.Serizlize(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -35,7 +35,8 @@ namespace AxibugEmuOnline.Client
|
|||||||
PauseCore();
|
PauseCore();
|
||||||
Debug.Log($"快照加载:{Helper.FileMD5Hash(App.roomMgr.RawData)}");
|
Debug.Log($"快照加载:{Helper.FileMD5Hash(App.roomMgr.RawData)}");
|
||||||
m_inGameUI.Core.LoadStateFromBytes(App.roomMgr.RawData);
|
m_inGameUI.Core.LoadStateFromBytes(App.roomMgr.RawData);
|
||||||
App.roomMgr.SendRoomPlayerReady();
|
//TODO ready时上报性能指标
|
||||||
|
App.roomMgr.SendRoomPlayerReady(0,0,0,0);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
m_step = -1;
|
m_step = -1;
|
||||||
|
@ -21,6 +21,7 @@ namespace AxibugEmuOnline.Server.Common
|
|||||||
public string ClientVersion { get; set; }
|
public string ClientVersion { get; set; }
|
||||||
public string AesKey { get; set; }
|
public string AesKey { get; set; }
|
||||||
public string AesIv { get; set; }
|
public string AesIv { get; set; }
|
||||||
|
public string savDataPath { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
6
AxibugEmuOnline.Server/Common/GameScreenConvet.cs
Normal file
6
AxibugEmuOnline.Server/Common/GameScreenConvet.cs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
namespace AxibugEmuOnline.Server.Common
|
||||||
|
{
|
||||||
|
internal class GameScreenConvet
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -16,6 +16,7 @@ namespace AxibugEmuOnline.Server.Manager
|
|||||||
|
|
||||||
public void RecvGameMark(Socket _socket, byte[] reqData)
|
public void RecvGameMark(Socket _socket, byte[] reqData)
|
||||||
{
|
{
|
||||||
|
AppSrv.g_Log.DebugCmd("RecvGameMark");
|
||||||
Protobuf_Game_Mark msg = ProtoBufHelper.DeSerizlize<Protobuf_Game_Mark>(reqData);
|
Protobuf_Game_Mark msg = ProtoBufHelper.DeSerizlize<Protobuf_Game_Mark>(reqData);
|
||||||
ClientInfo _c = AppSrv.g_ClientMgr.GetClientForSocket(_socket);
|
ClientInfo _c = AppSrv.g_ClientMgr.GetClientForSocket(_socket);
|
||||||
Protobuf_Game_Mark_RESP respData = new Protobuf_Game_Mark_RESP();
|
Protobuf_Game_Mark_RESP respData = new Protobuf_Game_Mark_RESP();
|
||||||
@ -34,7 +35,8 @@ namespace AxibugEmuOnline.Server.Manager
|
|||||||
{
|
{
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
reader.GetInt32(0);
|
bHad = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -134,7 +136,7 @@ namespace AxibugEmuOnline.Server.Manager
|
|||||||
MySqlConnection conn = SQLPool.DequeueSQLConn("CheckIsRomStart");
|
MySqlConnection conn = SQLPool.DequeueSQLConn("CheckIsRomStart");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string query = $"SELECT count(0) from rom_stars where uid = ?uid and = ?romid";
|
string query = $"SELECT count(id) from rom_stars where uid = ?uid and = ?romid";
|
||||||
using (var command = new MySqlCommand(query, conn))
|
using (var command = new MySqlCommand(query, conn))
|
||||||
{
|
{
|
||||||
// 设置参数值
|
// 设置参数值
|
||||||
@ -152,7 +154,7 @@ namespace AxibugEmuOnline.Server.Manager
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
AppSrv.g_Log.Error(e);
|
AppSrv.g_Log.Error("CheckIsRomStar:"+e);
|
||||||
}
|
}
|
||||||
SQLPool.EnqueueSQLConn(conn);
|
SQLPool.EnqueueSQLConn(conn);
|
||||||
return bhad;
|
return bhad;
|
||||||
|
@ -3,10 +3,6 @@ using AxibugEmuOnline.Server.Event;
|
|||||||
using AxibugEmuOnline.Server.NetWork;
|
using AxibugEmuOnline.Server.NetWork;
|
||||||
using AxibugProtobuf;
|
using AxibugProtobuf;
|
||||||
using MySql.Data.MySqlClient;
|
using MySql.Data.MySqlClient;
|
||||||
using Mysqlx;
|
|
||||||
using Org.BouncyCastle.Asn1.X9;
|
|
||||||
using Org.BouncyCastle.Ocsp;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
|
|
||||||
namespace AxibugEmuOnline.Server.Manager
|
namespace AxibugEmuOnline.Server.Manager
|
||||||
|
154
AxibugEmuOnline.Server/Manager/SavDataManager.cs
Normal file
154
AxibugEmuOnline.Server/Manager/SavDataManager.cs
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
using AxibugEmuOnline.Server.Common;
|
||||||
|
using AxibugEmuOnline.Server.NetWork;
|
||||||
|
using AxibugProtobuf;
|
||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
|
||||||
|
namespace AxibugEmuOnline.Server.Manager
|
||||||
|
{
|
||||||
|
public class SavDataManager
|
||||||
|
{
|
||||||
|
public SavDataManager()
|
||||||
|
{
|
||||||
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdGamesavGetGameSavList, RecvGetGameSavList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RecvGetGameSavList(Socket _socket, byte[] reqData)
|
||||||
|
{
|
||||||
|
AppSrv.g_Log.DebugCmd("RecvGetGameSavList");
|
||||||
|
Protobuf_Mine_GetGameSavList msg = ProtoBufHelper.DeSerizlize<Protobuf_Mine_GetGameSavList>(reqData);
|
||||||
|
ClientInfo _c = AppSrv.g_ClientMgr.GetClientForSocket(_socket);
|
||||||
|
Protobuf_Mine_GetGameSavList_RESP respData = new Protobuf_Mine_GetGameSavList_RESP();
|
||||||
|
|
||||||
|
respData.RomID = msg.RomID;
|
||||||
|
Protobuf_Mine_GameSavInfo nulldata = null;
|
||||||
|
respData.SavDataList.Add(nulldata);
|
||||||
|
respData.SavDataList.Add(nulldata);
|
||||||
|
respData.SavDataList.Add(nulldata);
|
||||||
|
respData.SavDataList.Add(nulldata);
|
||||||
|
MySqlConnection conn = SQLPool.DequeueSQLConn("RecvGameMark");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string query = "SELECT `romid`, `savidx`, `savName`,`savNote`, `savUrl`,`savImgUrl`, `savDate` from user_gamesavedata where uid = ?uid and romid = ?romid";
|
||||||
|
bool bHad = false;
|
||||||
|
using (var command = new MySqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
// 设置参数值
|
||||||
|
command.Parameters.AddWithValue("?uid", _c.UID);
|
||||||
|
command.Parameters.AddWithValue("?romid", msg.RomID);
|
||||||
|
using (var reader = command.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
Protobuf_Mine_GameSavInfo resp = new Protobuf_Mine_GameSavInfo()
|
||||||
|
{
|
||||||
|
BHadSaveData = true,
|
||||||
|
RomID = reader.GetInt32(0),
|
||||||
|
SavDataIdx = reader.GetInt32(1),
|
||||||
|
SavName = reader.GetString(2),
|
||||||
|
Note = reader.GetString(3),
|
||||||
|
SavUrl = reader.GetString(4),
|
||||||
|
SavImgUrl = reader.GetString(5),
|
||||||
|
SavDate = reader.GetDateTime(6).ToString()
|
||||||
|
};
|
||||||
|
respData.SavDataList[resp.SavDataIdx] = resp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
SQLPool.EnqueueSQLConn(conn);
|
||||||
|
|
||||||
|
respData.RomID = msg.RomID;
|
||||||
|
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdGamesavGetGameSavList, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(respData));
|
||||||
|
}
|
||||||
|
public void RecvDelGameSav(Socket _socket, byte[] reqData)
|
||||||
|
{
|
||||||
|
Protobuf_Mine_DelGameSav msg = ProtoBufHelper.DeSerizlize<Protobuf_Mine_DelGameSav>(reqData);
|
||||||
|
ClientInfo _c = AppSrv.g_ClientMgr.GetClientForSocket(_socket);
|
||||||
|
Protobuf_Mine_DelGameSav_RESP respData = new Protobuf_Mine_DelGameSav_RESP();
|
||||||
|
ErrorCode errCode = ErrorCode.ErrorOk;
|
||||||
|
respData.RomID = msg.RomID;
|
||||||
|
bool bHad = false; string SavUrl = null; string SavImgUrl = null;
|
||||||
|
MySqlConnection conn = SQLPool.DequeueSQLConn("RecvGameMark");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string query = "SELECT `savUrl`,`savImgUrl`, `savDate` from user_gamesavedata where uid = ?uid and romid = ?romid and savidx = ?savidx";
|
||||||
|
using (var command = new MySqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
// 设置参数值
|
||||||
|
command.Parameters.AddWithValue("?uid", _c.UID);
|
||||||
|
command.Parameters.AddWithValue("?romid", msg.RomID);
|
||||||
|
using (var reader = command.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
bHad = true;
|
||||||
|
SavUrl = reader.GetString(0);
|
||||||
|
SavImgUrl = reader.GetString(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!bHad)
|
||||||
|
{
|
||||||
|
errCode = ErrorCode.ErrorRomDontHadSavedata;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bool bDelSav = FileDelete(Path.Combine(Config.cfg.savDataPath, SavUrl));
|
||||||
|
bool bDelImg = FileDelete(Path.Combine(Config.cfg.savDataPath, SavImgUrl));
|
||||||
|
if (bDelSav || !bDelImg)
|
||||||
|
{
|
||||||
|
errCode = ErrorCode.ErrorRomDontHadSavedata;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SQLPool.EnqueueSQLConn(conn);
|
||||||
|
|
||||||
|
respData.RomID = msg.RomID;
|
||||||
|
AppSrv.g_ClientMgr.ClientSend(_c, (int)CommandID.CmdGamesavGetGameSavList, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(respData));
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool FileDelete(string path)
|
||||||
|
{
|
||||||
|
if (!File.Exists(path))
|
||||||
|
return false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.Delete(path);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool FileDelete(string path, byte[] data)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.WriteAllBytes(path, data);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -82,6 +82,11 @@ namespace AxibugEmuOnline.Server
|
|||||||
AESHelper.GenAesKeyIV();
|
AESHelper.GenAesKeyIV();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "t1":
|
||||||
|
{
|
||||||
|
AppSrv.g_GameShareMgr.RecvGameMark(null, null);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Console.WriteLine("未知命令" + CommandStr);
|
Console.WriteLine("未知命令" + CommandStr);
|
||||||
break;
|
break;
|
||||||
|
@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||||||
-->
|
-->
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<History>True|2025-01-07T05:54:02.0272718Z||;True|2025-01-07T10:47:36.6196477+08:00||;True|2025-01-07T01:21:34.5863249+08:00||;False|2025-01-07T01:20:39.5344134+08:00||;True|2025-01-07T00:21:47.4863058+08:00||;True|2025-01-07T00:16:42.7998249+08:00||;False|2025-01-07T00:16:02.8107509+08:00||;False|2025-01-02T15:36:18.1906464+08:00||;False|2025-01-02T15:36:06.5622643+08:00||;True|2024-12-27T18:24:49.7554320+08:00||;</History>
|
<History>True|2025-01-08T15:13:47.7309044Z||;True|2025-01-08T13:32:52.0590130+08:00||;True|2025-01-08T13:31:56.8589678+08:00||;True|2025-01-07T13:54:02.0272718+08:00||;True|2025-01-07T10:47:36.6196477+08:00||;True|2025-01-07T01:21:34.5863249+08:00||;False|2025-01-07T01:20:39.5344134+08:00||;True|2025-01-07T00:21:47.4863058+08:00||;True|2025-01-07T00:16:42.7998249+08:00||;False|2025-01-07T00:16:02.8107509+08:00||;False|2025-01-02T15:36:18.1906464+08:00||;False|2025-01-02T15:36:06.5622643+08:00||;True|2024-12-27T18:24:49.7554320+08:00||;</History>
|
||||||
<LastFailureDetails />
|
<LastFailureDetails />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<_PublishTargetUrl>G:\Sin365\AxibugEmuOnline\AxibugEmuOnline.Web\bin\Release\net8.0\publish\</_PublishTargetUrl>
|
<_PublishTargetUrl>G:\Sin365\AxibugEmuOnline\AxibugEmuOnline.Web\bin\Release\net8.0\publish\</_PublishTargetUrl>
|
||||||
<History>True|2025-01-07T02:37:18.6461694Z||;True|2024-09-12T14:18:38.6992653+08:00||;True|2024-09-12T14:08:58.4526827+08:00||;True|2024-08-22T14:13:06.3067002+08:00||;True|2024-08-14T10:33:10.9180984+08:00||;True|2024-08-13T18:28:27.5050523+08:00||;True|2024-08-13T18:25:47.6591234+08:00||;True|2024-08-13T18:25:17.5344107+08:00||;True|2024-08-13T17:46:23.4523329+08:00||;</History>
|
<History>True|2025-01-08T05:35:26.6793825Z||;True|2025-01-07T10:37:18.6461694+08:00||;True|2024-09-12T14:18:38.6992653+08:00||;True|2024-09-12T14:08:58.4526827+08:00||;True|2024-08-22T14:13:06.3067002+08:00||;True|2024-08-14T10:33:10.9180984+08:00||;True|2024-08-13T18:28:27.5050523+08:00||;True|2024-08-13T18:25:47.6591234+08:00||;True|2024-08-13T18:25:17.5344107+08:00||;True|2024-08-13T17:46:23.4523329+08:00||;</History>
|
||||||
<LastFailureDetails />
|
<LastFailureDetails />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
File diff suppressed because it is too large
Load Diff
@ -66,7 +66,12 @@ enum CommandID
|
|||||||
//画面采集
|
//画面采集
|
||||||
CMD_Screen = 7001; //画面采集 | 同步广播 对应 Protobuf_Screnn_Frame
|
CMD_Screen = 7001; //画面采集 | 同步广播 对应 Protobuf_Screnn_Frame
|
||||||
|
|
||||||
CMD_GAME_MARK = 10101; //房间列表 上行 | 下行 对应 Protobuf_Game_Mark | Protobuf_Game_Mark_RESP
|
//即时存档
|
||||||
|
CMD_GAMESAV_GetGameSavList = 8001;//玩家即时存档列表获取 上行 | 下行 对应 Protobuf_Mine_GetGameSavList | Protobuf_Mine_GetGameSavList_RESP
|
||||||
|
CMD_GAMESAV_DelGameSav = 8005;//玩家删除即时存档 上行 | 下行 对应 Protobuf_Mine_DelGameSavList | Protobuf_Mine_DelGameSavList_RESP
|
||||||
|
CMD_GAMESAV_UploadGameSav = 8010;//玩家上传即时存档 上行 | 下行 对应 Protobuf_Mine_UpLoadGameSavList | Protobuf_Mine_UpLoadGameSavList_RESP
|
||||||
|
|
||||||
|
CMD_GAME_MARK = 10101; //获取即时存档列表 上行 | 下行 对应 Protobuf_Game_Mark | Protobuf_Game_Mark_RESP
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ErrorCode
|
enum ErrorCode
|
||||||
@ -79,8 +84,11 @@ enum ErrorCode
|
|||||||
|
|
||||||
ERROR_ROOM_CANT_DO_CURR_STATE =50;//当前房间状态不允许本操作
|
ERROR_ROOM_CANT_DO_CURR_STATE =50;//当前房间状态不允许本操作
|
||||||
|
|
||||||
|
ERROR_ROM_DONT_HAD_SAVEDATA = 80;//即时存档不存在
|
||||||
|
|
||||||
ERROR_ROM_ALREADY_HAD_STAR =403;//已经收藏
|
ERROR_ROM_ALREADY_HAD_STAR =403;//已经收藏
|
||||||
ERROR_ROM_DONT_HAD_STAR =404;//并没有收藏
|
ERROR_ROM_DONT_HAD_STAR =404;//并没有收藏
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum LoginType
|
enum LoginType
|
||||||
@ -442,3 +450,54 @@ message Protobuf_Game_Mark_RESP
|
|||||||
int32 IsStar = 2;//当前状态 [0]未收藏[1]已收藏
|
int32 IsStar = 2;//当前状态 [0]未收藏[1]已收藏
|
||||||
int32 stars = 3;//当前收藏计数
|
int32 stars = 3;//当前收藏计数
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
message Protobuf_Mine_GetGameSavList
|
||||||
|
{
|
||||||
|
int32 RomID = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Mine_GetGameSavList_RESP
|
||||||
|
{
|
||||||
|
int32 RomID = 1;
|
||||||
|
repeated Protobuf_Mine_GameSavInfo SavDataList = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Mine_GameSavInfo
|
||||||
|
{
|
||||||
|
bool bHadSaveData = 1;//是否有存档
|
||||||
|
int32 SavDataIdx = 2;//即时存档下标(其中第0个是自动存档位置)
|
||||||
|
int32 RomID = 3;
|
||||||
|
RomPlatformType GamePlatformType = 4;
|
||||||
|
string SavDate = 5;//存档时间
|
||||||
|
string SavName = 6;
|
||||||
|
string Note = 7;//备注
|
||||||
|
string SavImgUrl = 8;//即时存档截图Url
|
||||||
|
string SavUrl = 9;//即时存档下载Url
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Mine_DelGameSav
|
||||||
|
{
|
||||||
|
int32 RomID = 1;//RomID
|
||||||
|
int32 SavDataIdx = 2;//即时存档下标(其中第0个是自动存档位置)
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Mine_DelGameSav_RESP
|
||||||
|
{
|
||||||
|
int32 RomID = 1;//RomID
|
||||||
|
int32 SavDataIdx = 2;//删除的即时存档下标
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Mine_UpLoadGameSav
|
||||||
|
{
|
||||||
|
int32 RomID = 1;//RomID
|
||||||
|
int32 SavDataIdx = 2;//即时存档下标(其中第0个是自动存档位置)
|
||||||
|
bytes SavImg = 3;//即时存档截图模拟器原生数据
|
||||||
|
bytes StateRaw = 4;//即时存档byte数据
|
||||||
|
}
|
||||||
|
|
||||||
|
message Protobuf_Mine_UpLoadGameSav_RESP
|
||||||
|
{
|
||||||
|
int32 RomID = 1;//RomID
|
||||||
|
Protobuf_Mine_GameSavInfo UploadSevInfo = 2;//上传成功的存档详情
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user