This commit is contained in:
moux23333 2024-01-27 21:08:24 +08:00
parent 22fc0b0848
commit 396cf2de7f
30 changed files with 34183 additions and 1593 deletions

View file

@ -16,6 +16,9 @@
Directory.SetCurrentDirectory(AppContext.BaseDirectory); Directory.SetCurrentDirectory(AppContext.BaseDirectory);
AppDomain.CurrentDomain.UnhandledException += OnFatalException; AppDomain.CurrentDomain.UnhandledException += OnFatalException;
Console.WriteLine("FreeSR is a free and open-source software, if you paid for this, you have been scammed!");
Console.WriteLine("FreeSR是一个免费且开源的软件如果你是花钱买来的则说明你被骗了");
Console.WriteLine("https://git.xeondev.com/Moux23333/FreeSR");
s_log.Info("Initializing..."); s_log.Info("Initializing...");
CommandManager.Instance.Initialize(typeof(AccountCommandCategory)); CommandManager.Instance.Initialize(typeof(AccountCommandCategory));

View file

@ -21,6 +21,10 @@
AppDomain.CurrentDomain.UnhandledException += OnFatalException; AppDomain.CurrentDomain.UnhandledException += OnFatalException;
Console.Title = Title; Console.Title = Title;
Console.WriteLine("FreeSR is a free and open-source software, if you paid for this, you have been scammed!");
Console.WriteLine("FreeSR是一个免费且开源的软件如果你是花钱买来的则说明你被骗了");
Console.WriteLine("https://git.xeondev.com/Moux23333/FreeSR");
s_log.Info("Initializing..."); s_log.Info("Initializing...");
ConfigurationManager<DispatchServerConfiguration>.Instance.Initialize("DispatchServer.json"); ConfigurationManager<DispatchServerConfiguration>.Instance.Initialize("DispatchServer.json");

View file

@ -0,0 +1,21 @@
{
"Network": {
"Host": "0.0.0.0",
"Port": 8888
},
"Database": {
"ConnectionString": "mongodb://127.0.0.1:27017/",
"Name": "FreeSR",
"Entries": [
{
"CollectionName": "accounts",
"Type": "Account"
}
]
},
"Region": {
"Name": "FreeSR",
"EnvType": "2",
"DispatchUrl": "http://dispatch.starrails.com/query_gateway"
}
}

View file

@ -28,7 +28,7 @@
context.Response.StatusCode = HttpStatusCode.OK; context.Response.StatusCode = HttpStatusCode.OK;
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/json";
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(Retcode.RETCODE_RET_SUCC) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", dataObject) .Object("data", dataObject)
.Build()); .Build());

View file

@ -12,7 +12,7 @@
context.Response.StatusCode = HttpStatusCode.OK; context.Response.StatusCode = HttpStatusCode.OK;
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/json";
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(Retcode.RETCODE_RET_SUCC) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", Data) .Object("data", Data)
.Build()); .Build());

View file

@ -11,7 +11,7 @@
context.Response.StatusCode = HttpStatusCode.OK; context.Response.StatusCode = HttpStatusCode.OK;
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/json";
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(Retcode.RETCODE_RET_SUCC) .Retcode((int)RetcodeStatus.RetSucc)
.Boolean("success", true) .Boolean("success", true)
.String("message", "") .String("message", "")
.Build()); .Build());

View file

@ -28,7 +28,7 @@
if (account == null) if (account == null)
{ {
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(Retcode.RETCODE_RET_FAIL) .Retcode((int)RetcodeStatus.RetFail)
.Message("Account not found.") .Message("Account not found.")
.Object("data", null) .Object("data", null)
.Build()); .Build());
@ -38,7 +38,7 @@
// no password check, because client patch is closed-source for now. // no password check, because client patch is closed-source for now.
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(Retcode.RETCODE_RET_SUCC) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", new JObject .Object("data", new JObject
{ {

View file

@ -23,11 +23,11 @@
context.Response.StatusCode = HttpStatusCode.OK; context.Response.StatusCode = HttpStatusCode.OK;
context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/plain";
await context.Response.WriteAllAsync(Convert.ToBase64String(ProtobufUtil.Serialize(new DispatchRegionsData await context.Response.WriteAllAsync(Convert.ToBase64String(ProtobufUtil.Serialize(new RegionList
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc,
TopSeverRegionName = RegionManager.GetTopServerRegionName(), TopServerRegionName = RegionManager.GetTopServerRegionName(),
RegionList = RegionManager.GetRegionList() RegionInfoLists = { RegionManager.GetRegionList() }
}))); })));
return true; return true;

View file

@ -13,19 +13,22 @@
context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/plain";
await context.Response.WriteAllAsync(Convert.ToBase64String(ProtobufUtil.Serialize(new Gateserver await context.Response.WriteAllAsync(Convert.ToBase64String(ProtobufUtil.Serialize(new Gateserver
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = 0,
Msg = "OK", Msg0 = "OK",
Ip = "127.0.0.1", Ip = "127.0.0.1",
RegionName = "FreeSR", RegionName = "FreeSR",
Port = 22301, Port = 22301,
Mljaogdhcki = true, B1 = true,
LoginWhiteMsg = "Access verification failed. Please check if you have logged in to the correct account and server.", B2 = true,
Jcdlppbocpe = true, B3 = true,
Gifijbibiin = true, B4 = true,
Ibplbfhmgkf = true, B5 = true,
MbResVersion = "5335706", B6 = true,
AssetBundleUrl = "https://autopatchos.starrails.com/asb/V1.3Live/output_5355192_0007722cfc", B7 = true,
ExResourceUrl = "https://autopatchos.starrails.com/design_data/V1.3Live/output_5371504_9fdb2fe63e", Gfemaboifee = true,
//MdkResVersion = "5335706",
AssetBundleUrl = "https://autopatchcn.bhsr.com/asb/BetaLive/output_6355877_591cdefefe9b",
ExResourceUrl = "https://autopatchcn.bhsr.com/design_data/BetaLive/output_6367879_26191d7cc23b",
}))); })));
return true; return true;

View file

@ -13,7 +13,7 @@
context.Response.StatusCode = HttpStatusCode.OK; context.Response.StatusCode = HttpStatusCode.OK;
context.Response.ContentType = "application/json"; context.Response.ContentType = "application/json";
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(Retcode.RETCODE_RET_SUCC) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", CaptchaData) .Object("data", CaptchaData)
.Build()); .Build());

View file

@ -24,7 +24,7 @@
if (account == null) if (account == null)
{ {
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(Retcode.RETCODE_RET_FAIL) .Retcode((int)RetcodeStatus.RetFail)
.Message("Account not found.") .Message("Account not found.")
.Object("data", null) .Object("data", null)
.Build()); .Build());
@ -34,7 +34,7 @@
else if (account.Token != token) else if (account.Token != token)
{ {
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(Retcode.RETCODE_RET_FAIL) .Retcode((int)RetcodeStatus.RetFail)
.Message("Invalid user token.") .Message("Invalid user token.")
.Object("data", null) .Object("data", null)
.Build()); .Build());
@ -43,7 +43,7 @@
} }
await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create() await context.Response.WriteAllJsonAsync(DispatchResponseBuilder.Create()
.Retcode(Retcode.RETCODE_RET_SUCC) .Retcode((int)RetcodeStatus.RetSucc)
.Message("OK") .Message("OK")
.Object("data", new JObject .Object("data", new JObject
{ {

View file

@ -12,9 +12,9 @@
s_configuration = configuration; s_configuration = configuration;
} }
public static List<RegionEntry> GetRegionList() public static RegionInfo GetRegionList()
{ {
var region = new RegionEntry var region = new RegionInfo
{ {
EnvType = s_configuration.EnvType, EnvType = s_configuration.EnvType,
DispatchUrl = s_configuration.DispatchUrl, DispatchUrl = s_configuration.DispatchUrl,
@ -23,7 +23,7 @@
Title = s_configuration.Name Title = s_configuration.Name
}; };
return new List<RegionEntry> { region }; return region;
} }
public static string GetTopServerRegionName() => s_configuration.Name; public static string GetTopServerRegionName() => s_configuration.Name;

View file

@ -11,7 +11,7 @@
{ {
{"uid", model.Uid}, {"uid", model.Uid},
{"name", model.Name}, {"name", model.Name},
{"email", ""}, {"email", "reversedrooms"},
{"mobile", ""}, {"mobile", ""},
{"is_email_verify", "0"}, {"is_email_verify", "0"},
{"realname", ""}, {"realname", ""},

View file

@ -9,6 +9,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="DotNetty.Handlers" Version="0.7.5" /> <PackageReference Include="DotNetty.Handlers" Version="0.7.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Nito.AsyncEx.Context" Version="5.1.2" /> <PackageReference Include="Nito.AsyncEx.Context" Version="5.1.2" />
</ItemGroup> </ItemGroup>

View file

@ -17,6 +17,9 @@
AppDomain.CurrentDomain.UnhandledException += OnFatalException; AppDomain.CurrentDomain.UnhandledException += OnFatalException;
Console.Title = Title; Console.Title = Title;
Console.WriteLine("FreeSR is a free and open-source software, if you paid for this, you have been scammed!");
Console.WriteLine("FreeSR是一个免费且开源的软件如果你是花钱买来的则说明你被骗了");
Console.WriteLine("https://git.xeondev.com/Moux23333/FreeSR");
s_log.Info("Initializing..."); s_log.Info("Initializing...");
ConfigurationManager<GateServerConfiguration>.Instance.Initialize("GateServer.json"); ConfigurationManager<GateServerConfiguration>.Instance.Initialize("GateServer.json");

View file

@ -0,0 +1,6 @@
{
"Network": {
"Host": "0.0.0.0",
"Port": 22301
}
}

View file

@ -6,35 +6,44 @@
internal static class AvatarReqGroup internal static class AvatarReqGroup
{ {
[Handler(CmdType.GetAvatarDataCsReq)] [Handler(CmdType.CmdGetAvatarDataCsReq)]
public static void OnGetAvatarDataCsReq(NetSession session, int cmdId, object data) public static void OnGetAvatarDataCsReq(NetSession session, int cmdId, object data)
{ {
var request = data as GetAvatarDataCsReq; var request = data as GetAvatarDataCsReq;
var response = new GetAvatarDataScRsp var response = new GetAvatarDataScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc,
IsAll = request.IsGetAll, IsAll = request.IsGetAll
AvatarList = new List<Avatar>()
}; };
int[] characters = new int[] { 8001, 1005, 1003 }; uint[] characters = new uint[] { 8001, 1307, 1306, 1312 };
foreach (int id in characters) foreach (uint id in characters)
{ {
response.AvatarList.Add(new Avatar var avatarData = new Avatar
{ {
BaseAvatarId = id, BaseAvatarId = id,
Exp = 0, Exp = 0,
Level = 1, Level = 1,
Promotion = 0, Promotion = 0,
Rank = 6, Rank = 6,
SkilltreeList = new List<AvatarSkillTree>(),
EquipmentUniqueId = 0 EquipmentUniqueId = 0
}); };
List<uint> SkillIdEnds = new List<uint> { 1, 2, 3, 4, 7, 101, 102, 103, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210 };
foreach (uint end in SkillIdEnds)
{
avatarData.SkilltreeLists.Add(new AvatarSkillTree
{
PointId = id * 1000 + end,
Level = 1
});
}
response.AvatarLists.Add(avatarData);
} }
session.Send(CmdType.GetAvatarDataScRsp, response); session.Send(CmdType.CmdGetAvatarDataScRsp, response);
} }
} }
} }

View file

@ -1,343 +1,7 @@
namespace FreeSR.Gateserver.Manager.Handlers namespace FreeSR.Gateserver.Manager.Handlers
{ {
using FreeSR.Gateserver.Manager.Handlers.Core;
using FreeSR.Gateserver.Network;
using FreeSR.Proto;
using static System.Net.WebRequestMethods;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.ComponentModel.Design;
internal static class GachaReqGroup internal static class GachaReqGroup
{ {
[Handler(CmdType.GetGachaInfoCsReq)] // GachaReqGroup.
public static void OnGetGachaInfoCsReq(NetSession session, int cmdId, object data)
{
var Gacha1List = new List<int>();
session.Send(CmdType.GetGachaInfoScRsp, new GetGachaInfoScRsp
{
Retcode = Retcode.RETCODE_RET_SUCC,
GachaRandom = 0,
GachaInfoList = new List<GachaInfo>
{
new GachaInfo
{
//ENJHJHKNGOG = "https://webstatic-sea.hoyoverse.com/hkrpg/event/e20211215gacha-v2/index.html?authkey_ver=1&sign_type=2&auth_appid=webview_gacha&win_mode=fullscreen#/log",
Dmdldgldfdj = new List<int>(1208),
//JDMIIMJFAPK = "https://webstatic-sea.hoyoverse.com/hkrpg/event/e20211215gacha-v2/index.html?authkey_ver=1&sign_type=2&auth_appid=webview_gacha&win_mode=fullscreen&gacha_id=ad9815cdf2308104c377aac42c7f0cdd8d&timestamp=1689725163",
Pldioknjpjj = new List<int>{1208, 1110, 1109, 1106},
BeginTime = 1689719400,
EndTime = 4070880000,
GachaId = 2010
}
}
});
}
[Handler(CmdType.DoGachaCsReq)]
public static void OnDoGachaCsReq(NetSession session, int cmdId, object data)
{
var gachaReq = data as DoGachaCsReq;
if (gachaReq.GachaNum == 1)
{
session.Send(CmdType.DoGachaScRsp, new DoGachaScRsp
{
GachaId = gachaReq.GachaId,
Nmaojeiedak = gachaReq.GachaRandom + 1,
GachaNum = gachaReq.GachaNum,
GachaItemList = new List<GachaItem>
{
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1107,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
}
},
});
}
if (gachaReq.GachaNum == 10)
{
session.Send(CmdType.DoGachaScRsp, new DoGachaScRsp
{
GachaId = gachaReq.GachaId,
Nmaojeiedak = gachaReq.GachaRandom + 10,
GachaNum = gachaReq.GachaNum,
GachaItemList = new List<GachaItem>
{
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
},
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
},
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
},
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
},
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
},
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
},
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
},
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
},
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
},
new GachaItem
{
Item = new List<Item>
{
new Item
{
ItemId = 1208,
Num = 1,
}
}[0],
Dpjjnjflnjm = new List<ItemList>
{
new ItemList
{
List = new List<Item>
{
new Item
{
ItemId = 252,
Num = 40,
}
}
}
}[0]
}
},
});
}
}
} }
} }

View file

@ -1,30 +1,7 @@
namespace FreeSR.Gateserver.Manager.Handlers namespace FreeSR.Gateserver.Manager.Handlers
{ {
using FreeSR.Gateserver.Manager.Handlers.Core;
using FreeSR.Gateserver.Network;
using FreeSR.Proto;
internal static class ItemReqGroup internal static class ItemReqGroup
{ {
[Handler(CmdType.GetBagCsReq)] // ItemReqGroup.
public static void OnGetBagCsReq(NetSession session, int cmdId, object _)
{
session.Send(CmdType.GetBagScRsp, new GetBagScRsp
{
Retcode = Retcode.RETCODE_RET_SUCC,
MaterialList = new List<Material>
{
new Material
{
Tid = 101,
Num = 10
},
new Material
{
Tid = 102,
Num = 10
}
}
});
}
} }
} }

View file

@ -6,86 +6,83 @@
internal static class LineupReqGroup internal static class LineupReqGroup
{ {
[Handler(CmdType.GetCurLineupDataCsReq)] [Handler(CmdType.CmdGetCurLineupDataCsReq)]
public static void OnGetCurLineupDataCsReq(NetSession session, int cmdId, object _) public static void OnGetCurLineupDataCsReq(NetSession session, int cmdId, object _)
{ {
var response = new GetCurLineupDataScRsp var response = new GetCurLineupDataScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC Retcode = (uint)RetcodeStatus.RetSucc
}; };
response.Lineup = new LineupInfo response.Lineup = new LineupInfo
{ {
ExtraLineupType = ExtraLineupType.LINEUP_NONE, ExtraLineupType = ExtraLineupType.LineupNone,
Name = "Squad 1", Name = "Squad 1",
AvatarList = new List<LineupAvatar>(), LeaderSlot = 0,
LeaderSlot = 5, Mp = 5
Foafdgjflmc = 5
}; };
var characters = new int[] { 8001, 1005, 1003 }; var characters = new uint[] { 8001, 1307, 1306, 1312 };
foreach (int id in characters) foreach (uint id in characters)
{ {
response.Lineup.AvatarList.Add(new LineupAvatar response.Lineup.AvatarLists.Add(new LineupAvatar
{ {
AvatarType = AvatarType.AVATAR_FORMAL_TYPE, AvatarType = AvatarType.AvatarFormalType,
CurHealth = new HealthBarInfo { CurHp = 10000, MaxHp = 10000 }, Hp = 10000,
Sp = 10000, Sp = new AmountInfo { CurAmount = 10000,MaxAmount = 10000},
Satiety = 100, Satiety = 100,
Id = id, Id = id,
Slot = response.Lineup.AvatarList.Count Slot = (uint)response.Lineup.AvatarLists.Count
}); });
} }
session.Send(CmdType.GetCurLineupDataScRsp, response); session.Send(CmdType.CmdGetCurLineupDataScRsp, response);
} }
[Handler(CmdType.GetAllLineupDataCsReq)] [Handler(CmdType.CmdGetAllLineupDataCsReq)]
public static void OnGetAllLineupDataCsReq(NetSession session, int cmdId, object data) public static void OnGetAllLineupDataCsReq(NetSession session, int cmdId, object data)
{ {
var response = new GetAllLineupDataScRsp var response = new GetAllLineupDataScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc,
CurIndex = 0, CurIndex = 0,
LineupList = new List<LineupInfo>()
}; };
response.LineupList.Add(new LineupInfo response.LineupLists.Add(new LineupInfo
{ {
ExtraLineupType = ExtraLineupType.LINEUP_NONE, ExtraLineupType = ExtraLineupType.LineupNone,
Name = "Squad 1", Name = "Squad 1",
AvatarList = new List<LineupAvatar>(), Mp = 5,
Foafdgjflmc = 5, LeaderSlot = 0
LeaderSlot = 3
}); });
var characters = new int[] { 8001, 1005, 1003 }; var characters = new uint[] { 8001, 1307, 1306, 1312 };
foreach (int id in characters) foreach (uint id in characters)
{ {
response.LineupList[0].AvatarList.Add(new LineupAvatar response.LineupLists[0].AvatarLists.Add(new LineupAvatar
{ {
AvatarType = AvatarType.AVATAR_FORMAL_TYPE, AvatarType = AvatarType.AvatarFormalType,
CurHealth = new HealthBarInfo { CurHp = 10000, MaxHp = 10000 }, Sp = new AmountInfo { CurAmount = 10000, MaxAmount = 10000 },
Sp = 10000, Hp = 10000,
Satiety = 100, Satiety = 100,
Id = id, Id = id,
Slot = response.LineupList[0].AvatarList.Count Slot = (uint)response.LineupLists[0].AvatarLists.Count
}); });
} }
session.Send(CmdType.GetAllLineupDataScRsp, response); session.Send(CmdType.CmdGetAllLineupDataScRsp, response);
} }
[Handler(CmdType.ChangeLineupLeaderCsReq)] [Handler(CmdType.CmdChangeLineupLeaderCsReq)]
public static void OnChangeLineupLeaderCsReq(NetSession session, int cmdId, object data) public static void OnChangeLineupLeaderCsReq(NetSession session, int cmdId, object data)
{ {
var request = data as ChangeLineupLeaderCsReq; var request = data as ChangeLineupLeaderCsReq;
session.Send(CmdType.ChangeLineupLeaderScRsp, new ChangeLineupLeaderScRsp session.Send(CmdType.CmdChangeLineupLeaderScRsp, new ChangeLineupLeaderScRsp
{ {
Slot = request.Slot, Slot = request.Slot,
Retcode = Retcode.RETCODE_RET_SUCC Retcode = (uint)RetcodeStatus.RetSucc
}); });
} }
} }

View file

@ -6,82 +6,47 @@
internal static class MissionReqGroup internal static class MissionReqGroup
{ {
[Handler(CmdType.GetMissionStatusCsReq)] [Handler(CmdType.CmdGetMissionStatusCsReq)]
public static void OnGetMissionStatusCsReq(NetSession session, int cmdId, object data) public static void OnGetMissionStatusCsReq(NetSession session, int cmdId, object data)
{ {
var request = data as GetMissionStatusCsReq; var request = data as GetMissionStatusCsReq;
GetMissionStatusScRsp response = new GetMissionStatusScRsp GetMissionStatusScRsp response = new GetMissionStatusScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc,
DisabledMainMissionIdList = new List<int>(),
FinishedMainMissionIdList = new List<int>(),
MissionEventStatusList = new List<Mission>(),
SubMissionStatusList = new List<Mission>(),
UnfinishedMainMissionIdList = new List<int>()
}; };
response.FinishedMainMissionIdList = new List<int> response.FinishedMainMissionIdLists = new uint[] {
{ 1000101,1000112,1000113,1000201,1000202,1000204,1000301,1000401,1000402,1000410,1000510,1000601,1010301,
1000101, 1010302,1010401,1010403,1010701,1011403,1010202,1010902,1011102,4010101 };
1000112,
1000113,
1000201,
1000202,
1000204,
1000301,
1000401,
1000402,
1000410,
1000510,
1000601,
1010301,
1010302,
1010401,
1010403,
1010701,
1011403,
1010202,
1010902,
1011102,
4010101
};
if (request.MissionEventIdList != null)
{
foreach (int id in request.MissionEventIdList)
{
response.UnfinishedMainMissionIdList.Add(id);
}
}
if (request.SubMissionIdList != null) if (request.SubMissionIdLists != null)
{ {
foreach (int id in request.SubMissionIdList) foreach (uint id in request.SubMissionIdLists)
{ {
response.MissionEventStatusList.Add(new Mission() response.MissionEventStatusLists.Add(new Mission()
{ {
Id = id, Id = id,
Progress = 0, Progress = 0,
Status = MissionStatus.MISSION_FINISH Status = MissionStatus.MissionFinish
}); });
} }
} }
if (request.MainMissionIdList != null) if (request.MainMissionIdLists != null)
{ {
foreach (int id in request.MainMissionIdList) foreach (uint id in request.MainMissionIdLists)
{ {
response.SubMissionStatusList.Add(new Mission() response.SubMissionStatusLists.Add(new Mission()
{ {
Id = id, Id = id,
Progress = 0, Progress = 0,
Status = MissionStatus.MISSION_FINISH Status = MissionStatus.MissionFinish
}); });
} }
} }
session.Send(CmdType.GetMissionStatusScRsp, response); session.Send(CmdType.CmdGetMissionStatusScRsp, response);
} }
} }
} }

View file

@ -8,34 +8,40 @@
internal static class NPCReqGroup internal static class NPCReqGroup
{ {
//maybe useless //maybe useless
[Handler(CmdType.GetNpcTakenRewardCsReq)] [Handler(CmdType.CmdGetNpcTakenRewardCsReq)]
public static void OnGetNpcTakenRewardCsReq(NetSession session, int cmdId, object data) public static void OnGetNpcTakenRewardCsReq(NetSession session, int cmdId, object data)
{ {
var npcRewardReq = data as GetNpcTakenRewardCsReq; var npcRewardReq = data as Eddbhmdjadb;
session.Send(CmdType.GetNpcTakenRewardScRsp, new GetNpcTakenRewardScRsp session.Send(CmdType.CmdGetNpcTakenRewardScRsp, new Nikhfbniagb
{ {
NpcId = npcRewardReq.NpcId, NpcId = npcRewardReq.Okonlennkfb,
Retcode = Retcode.RETCODE_RET_SUCC Retcode = (uint)RetcodeStatus.RetSucc
}); });
} }
[Handler(CmdType.GetFirstTalkByPerformanceNpcCsReq)] [Handler(CmdType.CmdGetFirstTalkByPerformanceNpcCsReq)]
public static void OnGetFirstTalkByPerformanceNpcCsReq(NetSession session, int cmdId, object data) public static void OnGetFirstTalkByPerformanceNpcCsReq(NetSession session, int cmdId, object data)
{ {
session.Send(CmdType.GetFirstTalkByPerformanceNpcScRsp, new GetFirstTalkByPerformanceNpcScRsp var npcPerformanceReq = data as Jknjlicadhe;
var response = new Kpbeklbbihd
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc
NpcMeetStatusList = new List<OCLEPLBNNPA> };
{
new OCLEPLBNNPA foreach(uint id in npcPerformanceReq.Ffgeablhjmms)
{
response.Hhldcbegobcs.Add(new NpcMeetStatusInfo
{ {
IsMeet = true, Jgndlkbohij = true,
Jljhobhmaof = 1 Okonlennkfb = id
}, });
}
}); }
session.Send(CmdType.CmdGetFirstTalkByPerformanceNpcScRsp, response);
} }
} }
} }

View file

@ -5,51 +5,56 @@
using FreeSR.Proto; using FreeSR.Proto;
using NLog; using NLog;
using System;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using Newtonsoft.Json;
internal static class PlayerReqGroup internal static class PlayerReqGroup
{ {
private static readonly Logger s_log = LogManager.GetCurrentClassLogger(); private static readonly Logger s_log = LogManager.GetCurrentClassLogger();
[Handler(CmdType.PlayerHeartBeatCsReq)] [Handler(CmdType.CmdPlayerHeartBeatCsReq)]
public static void OnPlayerHeartBeatCsReq(NetSession session, int cmdId, object data) public static void OnPlayerHeartBeatCsReq(NetSession session, int cmdId, object data)
{ {
var heartbeatReq = data as PlayerHeartBeatCsReq; var heartbeatReq = data as PlayerHeartBeatCsReq;
session.Send(CmdType.PlayerHeartBeatScRsp, new PlayerHeartBeatScRsp session.Send(CmdType.CmdPlayerHeartBeatScRsp, new PlayerHeartBeatScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc,
DownloadData = new ClientDownloadData(), DownloadData = new ClientDownloadData(),
ClientTimeMs = heartbeatReq.ClientTimeMs, ClientTimeMs = heartbeatReq.ClientTimeMs,
ServerTimeMs = DateTimeOffset.Now.ToUnixTimeMilliseconds() ServerTimeMs = (ulong)DateTimeOffset.Now.ToUnixTimeMilliseconds()
}); });
} }
[Handler(CmdType.GetHeroBasicTypeInfoCsReq)] [Handler(CmdType.CmdGetHeroBasicTypeInfoCsReq)]
public static void OnGetHeroBasicTypeInfoCsReq(NetSession session, int cmdId, object _) public static void OnGetHeroBasicTypeInfoCsReq(NetSession session, int cmdId, object _)
{ {
session.Send(CmdType.GetHeroBasicTypeInfoScRsp, new GetHeroBasicTypeInfoScRsp session.Send(CmdType.CmdGetHeroBasicTypeInfoScRsp, new GetHeroBasicTypeInfoScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc,
Gender = Gender.GenderMan, Gender = Gender.GenderMan,
BasicTypeInfoList = new List<HeroBasicTypeInfo> Cdkjkpnjjjas ={
{ new Hlbbodklpbo
new HeroBasicTypeInfo
{ {
BasicType = HeroBasicType.BoyWarrior, Peihhlcchfj = HeroBasicType.BoyWarrior,
Rank = 1, Rank = 1,
SkillTreeList = new List<AvatarSkillTree>() Chmeifanmags = {}
} }
}, },
CurBasicType = HeroBasicType.BoyWarrior, CurBasicType = HeroBasicType.BoyWarrior,
IsPlayerInfoModified = false, Bhepmbpaojp = false,
IsGenderModified = false Cnlbajkmnbn = false
}); });
} }
[Handler(CmdType.GetBasicInfoCsReq)] [Handler(CmdType.CmdGetBasicInfoCsReq)]
public static void OnGetBasicInfoCsReq(NetSession session, int cmdId, object _) public static void OnGetBasicInfoCsReq(NetSession session, int cmdId, object _)
{ {
session.Send(CmdType.GetBasicInfoScRsp, new GetBasicInfoScRsp session.Send(CmdType.CmdGetBasicInfoScRsp, new GetBasicInfoScRsp
{ {
CurDay = 1, CurDay = 1,
ExchangeTimes = 0, ExchangeTimes = 0,
@ -59,55 +64,61 @@
}); });
} }
[Handler(CmdType.PlayerLoginCsReq)] [Handler(CmdType.CmdPlayerLoginCsReq)]
public static void OnPlayerLoginCsReq(NetSession session, int cmdId, object data) public static void OnPlayerLoginCsReq(NetSession session, int cmdId, object data)
{ {
var request = data as PlayerLoginCsReq; var request = data as PlayerLoginCsReq;
session.Send(CmdType.PlayerLoginScRsp, new PlayerLoginScRsp session.Send(CmdType.CmdPlayerLoginScRsp, new PlayerLoginScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc,
IsNewPlayer = false, //IsNewPlayer = false,
LoginRandom = request.LoginRandom, LoginRandom = request.LoginRandom,
Stamina = 100, Stamina = 100,
ServerTimestampMs = DateTimeOffset.Now.ToUnixTimeSeconds() * 1000, ServerTimestampMs = (ulong)DateTimeOffset.Now.ToUnixTimeSeconds() * 1000,
BasicInfo = new PlayerBasicInfo BasicInfo = new PlayerBasicInfo
{ {
Nickname = "xeondev", Nickname = "xeondev",
Level = 30, Level = 70,
Exp = 0, Exp = 0,
Stamina = 100, Stamina = 100,
MCoin = 0, Mcoin = 0,
HCoin = 0, Hcoin = 0,
SCoin = 0, Scoin = 0,
WorldLevel = 0 WorldLevel = 6
} }
}); });
} }
[Handler(CmdType.PlayerGetTokenCsReq)] [Handler(CmdType.CmdPlayerGetTokenCsReq)]
public static void OnPlayerGetTokenCsReq(NetSession session, int cmdId, object data) public static void OnPlayerGetTokenCsReq(NetSession session, int cmdId, object data)
{ {
var request = data as PlayerGetTokenCsReq; session.Send(CmdType.CmdPlayerGetTokenScRsp, new PlayerGetTokenScRsp
session.Send(CmdType.PlayerGetTokenScRsp, new PlayerGetTokenScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc,
Uid = int.Parse(request.AccountUid), Uid = 1337,
BlackInfo = null, //BlackInfo = null,
Msg = null, Msg = "OK",
SecretKeySeed = 0 SecretKeySeed = 0
}); });
session.Send(CmdType.BattlePassInfoNotify, new BattlePassInfoNotify byte[] decodedBytes = Convert.FromBase64String("eyJPcGdpbW5rb2tuanMiOlt7Iklvbm1sb2tjZ25nIjowLCJCZWdpblRpbWUiOjAsIkpvZGlwZ2xkb2hqIjoiIiwiR2djYWFrZ2ZjYm8iOmZhbHNlLCJFbmRUaW1lIjoyMDIxOTc4Nzc0LCJEZWxnam5jaGxwaiI6IiIsIkNvbmZpZ0lkIjowLCJKaGpiZ21tcGNjaiI6IkZyZWVTUiBpcyBhIGZyZWUgYW5kIG9wZW4tc291cmNlIHNvZnR3YXJlLCBpZiB5b3UgcGFpZCBmb3IgdGhpcywgeW91IGhhdmUgYmVlbiBzY2FtbWVkISBGcmVlU1LmmK/kuIDkuKrlhY3otLnkuJTlvIDmupDnmoTova/ku7bvvIzlpoLmnpzkvaDmmK/oirHpkrHkubDmnaXnmoTvvIzor7TmmI7kvaDooqvpqpfkuobvvIFyZXBvc2l0b3J5IGxpbmsg5LuT5bqT5Zyw5Z2AOmh0dHBzOi8vZ2l0Lnhlb25kZXYuY29tL01vdXgyMzMzMy9GcmVlU1IiLCJLcGZmY2hjb2xlZCI6MH1dfQ==");
string decodedJsonData = Encoding.UTF8.GetString(decodedBytes);
ServerAnnounceNotify announceNotify = JsonConvert.DeserializeObject<ServerAnnounceNotify>(decodedJsonData);
session.Send(10, announceNotify);
/*session.Send(10, new ServerAnnounceNotify
{ {
Ibkdaabmege = ILGFODEJBBH.BP_TIER_TYPE_PREMIUM_2, Opgimnkoknjs =
Caajdlolcml = 0, {
Ipneaeepcmk = 4, new AnnounceData
Okffhjicndl = 0, {
Exp = 1000, BeginTime = 0,
Level = 50 EndTime = DateTimeOffset.Now.ToUnixTimeSeconds() + 10,
}); Jhjbgmmpccj = @"FreeSR is a free and open-source software, if you paid for this, you have been scammed! FreeSR是一个免费且开源的软件如果你是花钱买来的说明你被骗了repository link 仓库地址:https://git.xeondev.com/Moux23333/FreeSR"
}
}
});*/
} }
} }
} }

View file

@ -7,23 +7,20 @@
internal static class SceneReqGroup internal static class SceneReqGroup
{ {
[Handler(CmdType.GetCurSceneInfoCsReq)] [Handler(CmdType.CmdGetCurSceneInfoCsReq)]
public static void OnGetCurSceneInfoCsReq(NetSession session, int cmdId, object data) public static void OnGetCurSceneInfoCsReq(NetSession session, int cmdId, object data)
{ {
SceneInfo scene = new SceneInfo SceneInfo scene = new SceneInfo
{ {
GameModeType = 1, GameModeType = 1,
Bkmbkahohif = 1, //Bkmbkahohif = 1,
Admbbnbnibk = 1, //Admbbnbnibk = 1,
EntryId = 1000101, EntryId = 1030101,
PlaneId = 10001, PlaneId = 10301,
FloorId = 10001001, FloorId = 10301001,
EntityList = new List<SceneEntityInfo>(),
EnvBuffList = new List<BuffInfo>(),
LightenSectionList = new List<int>()
}; };
scene.EntityList.Add(new SceneEntityInfo scene.EntityLists.Add(new SceneEntityInfo
{ {
EntityId = 0, EntityId = 0,
GroupId = 0, GroupId = 0,
@ -35,10 +32,10 @@
} }
}); });
session.Send(CmdType.GetCurSceneInfoScRsp, new GetCurSceneInfoScRsp session.Send(CmdType.CmdGetCurSceneInfoScRsp, new GetCurSceneInfoScRsp
{ {
Scene = scene, Scene = scene,
Retcode = Retcode.RETCODE_RET_SUCC Retcode = (uint)RetcodeStatus.RetSucc
}); });
} }
} }

View file

@ -9,36 +9,35 @@
{ {
private static readonly Logger s_log = LogManager.GetCurrentClassLogger(); private static readonly Logger s_log = LogManager.GetCurrentClassLogger();
[Handler(CmdType.GetTutorialGuideCsReq)] [Handler(CmdType.CmdGetTutorialGuideCsReq)]
public static void OnGetTutorialGuideCsReq(NetSession session, int cmdId, object _) public static void OnGetTutorialGuideCsReq(NetSession session, int cmdId, object _)
{ {
var response = new GetTutorialGuideScRsp var response = new GetTutorialGuideScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc
TutorialGuideList = new List<TutorialGuide>()
}; };
int[] guides = new int[] uint[] guides = new uint[]
{ {
1101, 1102, 1104, 1105, 1116, 1117, 2006, 2007, 2101, 2105, 2106, 2107, 3007, 3105, 3106, 4001, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 5101, 5102, 5103, 5104, 5105, 6001, 6002, 6003, 6004, 6005, 6006, 6007, 9101, 9102, 9103, 9104, 9105, 9106, 9107, 9108 1101, 1102, 1104, 1105, 1116, 1117, 2006, 2007, 2101, 2105, 2106, 2107, 3007, 3105, 3106, 4001, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 5101, 5102, 5103, 5104, 5105, 6001, 6002, 6003, 6004, 6005, 6006, 6007, 9101, 9102, 9103, 9104, 9105, 9106, 9107, 9108
}; };
foreach (int id in guides) foreach (uint id in guides)
{ {
response.TutorialGuideList.Add(new TutorialGuide response.TutorialGuideLists.Add(new TutorialGuide
{ {
Id = id, Id = id,
Status = TutorialStatus.TUTORIAL_FINISH Status = TutorialStatus.TutorialFinish
}); });
} }
session.Send(CmdType.GetTutorialGuideScRsp, response); session.Send(CmdType.CmdGetTutorialGuideScRsp, response);
} }
[Handler(CmdType.GetTutorialCsReq)] [Handler(CmdType.CmdGetTutorialCsReq)]
public static void OnGetTutorialCsReq(NetSession session, int cmdId, object _) public static void OnGetTutorialCsReq(NetSession session, int cmdId, object _)
{ {
int[] completedTutorials = new int[] uint[] completedTutorials = new uint[]
{ {
1001, 1002, 1003, 1004, 1005, 1007, 1008, 1010, 1011, 1001, 1002, 1003, 1004, 1005, 1007, 1008, 1010, 1011,
2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2001, 2002, 2003, 2004, 2005, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015,
@ -51,20 +50,19 @@
var response = new GetTutorialScRsp var response = new GetTutorialScRsp
{ {
Retcode = Retcode.RETCODE_RET_SUCC, Retcode = (uint)RetcodeStatus.RetSucc,
TutorialList = new List<Tutorial>()
}; };
foreach (int id in completedTutorials) foreach (uint id in completedTutorials)
{ {
response.TutorialList.Add(new Tutorial response.TutorialLists.Add(new Tutorial
{ {
Id = id, Id = id,
Status = TutorialStatus.TUTORIAL_FINISH Status = TutorialStatus.TutorialFinish
}); });
} }
session.Send(CmdType.GetTutorialScRsp, response); session.Send(CmdType.CmdGetTutorialScRsp, response);
} }
} }
} }

View file

@ -13,30 +13,30 @@
var builder = ImmutableDictionary.CreateBuilder<CmdType, Type>(); var builder = ImmutableDictionary.CreateBuilder<CmdType, Type>();
builder.AddRange(new Dictionary<CmdType, Type>() builder.AddRange(new Dictionary<CmdType, Type>()
{ {
{CmdType.PlayerGetTokenCsReq, typeof(PlayerGetTokenCsReq)}, {CmdType.CmdPlayerGetTokenCsReq, typeof(PlayerGetTokenCsReq)},
{CmdType.PlayerLoginCsReq, typeof(PlayerLoginCsReq)}, {CmdType.CmdPlayerLoginCsReq, typeof(PlayerLoginCsReq)},
{CmdType.GetAvatarDataCsReq, typeof(GetAvatarDataCsReq)}, {CmdType.CmdGetAvatarDataCsReq, typeof(GetAvatarDataCsReq)},
{CmdType.GetAllLineupDataCsReq, typeof(GetAllLineupDataCsReq)}, {CmdType.CmdGetAllLineupDataCsReq, typeof(GetAllLineupDataCsReq)},
{CmdType.GetCurLineupDataCsReq, typeof(GetCurLineupDataCsReq)}, {CmdType.CmdGetCurLineupDataCsReq, typeof(GetCurLineupDataCsReq)},
{CmdType.ChangeLineupLeaderCsReq, typeof(ChangeLineupLeaderCsReq)}, {CmdType.CmdChangeLineupLeaderCsReq, typeof(ChangeLineupLeaderCsReq)},
{CmdType.GetMissionStatusCsReq, typeof(GetMissionStatusCsReq)}, {CmdType.CmdGetMissionStatusCsReq, typeof(GetMissionStatusCsReq)},
{CmdType.GetQuestDataCsReq, typeof(GetQuestDataCsReq)}, //{CmdType.CmdGetQuestDataCsReq, typeof(GetQuestDataCsReq)},
{CmdType.GetChallengeCsReq, typeof(GetChallengeCsReq)}, //{CmdType.CmdGetChallengeCsReq, typeof(GetChallengeCsReq)},
{CmdType.GetCurSceneInfoCsReq, typeof(GetCurSceneInfoCsReq)}, {CmdType.CmdGetCurSceneInfoCsReq, typeof(GetCurSceneInfoCsReq)},
{CmdType.GetBasicInfoCsReq, typeof(GetBasicInfoCsReq)}, {CmdType.CmdGetBasicInfoCsReq, typeof(GetBasicInfoCsReq)},
{CmdType.GetHeroBasicTypeInfoCsReq, typeof(GetHeroBasicTypeInfoCsReq)}, {CmdType.CmdGetHeroBasicTypeInfoCsReq, typeof(Hlbbodklpbo)},
{CmdType.PlayerHeartBeatCsReq, typeof(PlayerHeartBeatCsReq)}, {CmdType.CmdPlayerHeartBeatCsReq, typeof(PlayerHeartBeatCsReq)},
{CmdType.GetGachaInfoCsReq, typeof(GetGachaInfoCsReq)}, //{CmdType.CmdGetGachaInfoCsReq, typeof(GetGachaInfoCsReq)},
{CmdType.DoGachaCsReq, typeof(DoGachaCsReq)}, //{CmdType.CmdDoGachaCsReq, typeof(DoGachaCsReq)},
{CmdType.GetNpcTakenRewardCsReq, typeof(GetNpcTakenRewardCsReq)}, {CmdType.CmdGetNpcTakenRewardCsReq, typeof(Eddbhmdjadb)},
{CmdType.GetFirstTalkByPerformanceNpcCsReq, typeof(GetFirstTalkByPerformanceNpcCsReq)}, {CmdType.CmdGetFirstTalkByPerformanceNpcCsReq, typeof(Jknjlicadhe)},
{CmdType.GetBagCsReq, typeof(GetBagCsReq)} //{CmdType.CmdGetBagCsReq, typeof(GetBagCsReq)}
}); });
s_types = builder.ToImmutable(); s_types = builder.ToImmutable();

View file

@ -45,56 +45,56 @@
private static Dictionary<CmdType, CmdType> s_dummyTable = new Dictionary<CmdType, CmdType> private static Dictionary<CmdType, CmdType> s_dummyTable = new Dictionary<CmdType, CmdType>
{ {
{CmdType.GetLevelRewardTakenListCsReq, CmdType.GetLevelRewardTakenListScRsp}, {CmdType.CmdGetLevelRewardTakenListCsReq, CmdType.CmdGetLevelRewardTakenListScRsp},
{CmdType.GetRogueScoreRewardInfoCsReq, CmdType.GetRogueScoreRewardInfoScRsp}, {CmdType.CmdGetRogueScoreRewardInfoCsReq, CmdType.CmdGetRogueScoreRewardInfoScRsp},
{CmdType.GetGachaInfoCsReq, CmdType.GetGachaInfoScRsp}, {CmdType.CmdGetGachaInfoCsReq, CmdType.CmdGetGachaInfoScRsp},
{CmdType.QueryProductInfoCsReq, CmdType.QueryProductInfoScRsp}, {CmdType.CmdQueryProductInfoCsReq, CmdType.CmdQueryProductInfoScRsp},
{CmdType.GetQuestDataCsReq, CmdType.GetQuestDataScRsp}, {CmdType.CmdGetQuestDataCsReq, CmdType.CmdGetQuestDataScRsp},
{CmdType.GetQuestRecordCsReq, CmdType.GetQuestRecordScRsp}, {CmdType.CmdGetQuestRecordCsReq, CmdType.CmdGetQuestRecordScRsp},
{CmdType.GetFriendListInfoCsReq, CmdType.GetFriendListInfoScRsp}, {CmdType.CmdGetFriendListInfoCsReq, CmdType.CmdGetFriendListInfoScRsp},
{CmdType.GetFriendApplyListInfoCsReq, CmdType.GetFriendApplyListInfoScRsp}, {CmdType.CmdGetFriendApplyListInfoCsReq, CmdType.CmdGetFriendApplyListInfoScRsp},
{CmdType.GetCurAssistCsReq, CmdType.GetCurAssistScRsp}, {CmdType.CmdGetCurAssistCsReq, CmdType.CmdGetCurAssistScRsp},
{CmdType.GetRogueHandbookDataCsReq, CmdType.GetRogueHandbookDataScRsp}, {CmdType.CmdGetRogueHandbookDataCsReq, CmdType.CmdGetRogueHandbookDataScRsp},
{CmdType.GetDailyActiveInfoCsReq, CmdType.GetDailyActiveInfoScRsp}, {CmdType.CmdGetDailyActiveInfoCsReq, CmdType.CmdGetDailyActiveInfoScRsp},
{CmdType.GetFightActivityDataCsReq, CmdType.GetFightActivityDataScRsp}, {CmdType.CmdGetFightActivityDataCsReq, CmdType.CmdGetFightActivityDataScRsp},
{CmdType.GetMultipleDropInfoCsReq, CmdType.GetMultipleDropInfoScRsp}, {CmdType.CmdGetMultipleDropInfoCsReq, CmdType.CmdGetMultipleDropInfoScRsp},
{CmdType.GetPlayerReturnMultiDropInfoCsReq, CmdType.GetPlayerReturnMultiDropInfoScRsp}, {CmdType.CmdGetPlayerReturnMultiDropInfoCsReq, CmdType.CmdGetPlayerReturnMultiDropInfoScRsp},
{CmdType.GetShareDataCsReq, CmdType.GetShareDataScRsp}, {CmdType.CmdGetShareDataCsReq, CmdType.CmdGetShareDataScRsp},
{CmdType.GetTreasureDungeonActivityDataCsReq, CmdType.GetTreasureDungeonActivityDataScRsp}, {CmdType.CmdGetTreasureDungeonActivityDataCsReq, CmdType.CmdGetTreasureDungeonActivityDataScRsp},
{CmdType.PlayerReturnInfoQueryCsReq, CmdType.PlayerReturnInfoQueryScRsp}, {CmdType.CmdPlayerReturnInfoQueryCsReq, CmdType.CmdPlayerReturnInfoQueryScRsp},
{CmdType.GetBasicInfoCsReq, CmdType.GetBasicInfoScRsp}, {CmdType.CmdGetBasicInfoCsReq, CmdType.CmdGetBasicInfoScRsp},
{CmdType.GetHeroBasicTypeInfoCsReq, CmdType.GetHeroBasicTypeInfoScRsp}, {CmdType.CmdGetHeroBasicTypeInfoCsReq, CmdType.CmdGetHeroBasicTypeInfoScRsp},
{CmdType.GetBagCsReq, CmdType.GetBagScRsp}, {CmdType.CmdGetBagCsReq, CmdType.CmdGetBagScRsp},
{CmdType.GetPlayerBoardDataCsReq, CmdType.GetPlayerBoardDataScRsp}, {CmdType.CmdGetPlayerBoardDataCsReq, CmdType.CmdGetPlayerBoardDataScRsp},
{CmdType.GetAvatarDataCsReq, CmdType.GetAvatarDataScRsp}, {CmdType.CmdGetAvatarDataCsReq, CmdType.CmdGetAvatarDataScRsp},
{CmdType.GetAllLineupDataCsReq, CmdType.GetAllLineupDataScRsp}, {CmdType.CmdGetAllLineupDataCsReq, CmdType.CmdGetAllLineupDataScRsp},
{CmdType.GetActivityScheduleConfigCsReq, CmdType.GetActivityScheduleConfigScRsp}, {CmdType.CmdGetActivityScheduleConfigCsReq, CmdType.CmdGetActivityScheduleConfigScRsp},
{CmdType.GetMissionDataCsReq, CmdType.GetMissionDataScRsp}, {CmdType.CmdGetMissionDataCsReq, CmdType.CmdGetMissionDataScRsp},
{CmdType.GetMissionEventDataCsReq, CmdType.GetMissionEventDataScRsp}, {CmdType.CmdGetMissionEventDataCsReq, CmdType.CmdGetMissionEventDataScRsp},
{CmdType.GetChallengeCsReq, CmdType.GetChallengeScRsp}, {CmdType.CmdGetChallengeCsReq, CmdType.CmdGetChallengeScRsp},
{CmdType.GetCurChallengeCsReq, CmdType.GetCurChallengeScRsp}, {CmdType.CmdGetCurChallengeCsReq, CmdType.CmdGetCurChallengeScRsp},
{CmdType.GetRogueInfoCsReq, CmdType.GetRogueInfoScRsp}, {CmdType.CmdGetRogueInfoCsReq, CmdType.CmdGetRogueInfoScRsp},
{CmdType.GetExpeditionDataCsReq, CmdType.GetExpeditionDataScRsp}, {CmdType.CmdGetExpeditionDataCsReq, CmdType.CmdGetExpeditionDataScRsp},
{CmdType.GetRogueDialogueEventDataCsReq, CmdType.GetRogueDialogueEventDataScRsp}, {CmdType.CmdGetRogueDialogueEventDataCsReq, CmdType.CmdGetRogueDialogueEventDataScRsp},
{CmdType.GetJukeboxDataCsReq, CmdType.GetJukeboxDataScRsp}, {CmdType.CmdGetJukeboxDataCsReq, CmdType.CmdGetJukeboxDataScRsp},
{CmdType.SyncClientResVersionCsReq, CmdType.SyncClientResVersionScRsp}, {CmdType.CmdSyncClientResVersionCsReq, CmdType.CmdSyncClientResVersionScRsp},
{CmdType.DailyFirstMeetPamCsReq, CmdType.DailyFirstMeetPamScRsp}, {CmdType.CmdDailyFirstMeetPamCsReq, CmdType.CmdDailyFirstMeetPamScRsp},
{CmdType.GetMuseumInfoCsReq, CmdType.GetMuseumInfoScRsp}, {CmdType.CmdGetMuseumInfoCsReq, CmdType.CmdGetMuseumInfoScRsp},
{CmdType.GetLoginActivityCsReq, CmdType.GetLoginActivityScRsp}, {CmdType.CmdGetLoginActivityCsReq, CmdType.CmdGetLoginActivityScRsp},
{CmdType.GetRaidInfoCsReq, CmdType.GetRaidInfoScRsp}, {CmdType.CmdGetRaidInfoCsReq, CmdType.CmdGetRaidInfoScRsp},
{CmdType.GetTrialActivityDataCsReq, CmdType.GetTrialActivityDataScRsp}, {CmdType.CmdGetTrialActivityDataCsReq, CmdType.CmdGetTrialActivityDataScRsp},
{CmdType.GetBoxingClubInfoCsReq, CmdType.GetBoxingClubInfoScRsp}, {CmdType.CmdGetBoxingClubInfoCsReq, CmdType.CmdGetBoxingClubInfoScRsp},
{CmdType.GetNpcStatusCsReq, CmdType.GetNpcStatusScRsp}, {CmdType.CmdGetNpcStatusCsReq, CmdType.CmdGetNpcStatusScRsp},
{CmdType.TextJoinQueryCsReq, CmdType.TextJoinQueryScRsp}, {CmdType.CmdTextJoinQueryCsReq, CmdType.CmdTextJoinQueryScRsp},
{CmdType.GetSpringRecoverDataCsReq, CmdType.GetSpringRecoverDataScRsp}, {CmdType.CmdGetSpringRecoverDataCsReq, CmdType.CmdGetSpringRecoverDataScRsp},
{CmdType.GetChatFriendHistoryCsReq, CmdType.GetChatFriendHistoryScRsp}, {CmdType.CmdGetChatFriendHistoryCsReq, CmdType.CmdGetChatFriendHistoryScRsp},
{CmdType.GetSecretKeyInfoCsReq, CmdType.GetSecretKeyInfoScRsp}, {CmdType.CmdGetSecretKeyInfoCsReq, CmdType.CmdGetSecretKeyInfoScRsp},
{CmdType.GetVideoVersionKeyCsReq, CmdType.GetVideoVersionKeyScRsp}, {CmdType.CmdGetVideoVersionKeyCsReq, CmdType.CmdGetVideoVersionKeyScRsp},
{CmdType.GetCurLineupDataCsReq, CmdType.GetCurLineupDataScRsp}, {CmdType.CmdGetCurLineupDataCsReq, CmdType.CmdGetCurLineupDataScRsp},
{CmdType.GetCurBattleInfoCsReq, CmdType.GetCurBattleInfoScRsp}, {CmdType.CmdGetCurBattleInfoCsReq, CmdType.CmdGetCurBattleInfoScRsp},
{CmdType.GetCurSceneInfoCsReq, CmdType.GetCurSceneInfoScRsp}, {CmdType.CmdGetCurSceneInfoCsReq, CmdType.CmdGetCurSceneInfoScRsp},
{CmdType.GetPhoneDataCsReq, CmdType.GetPhoneDataScRsp}, {CmdType.CmdGetPhoneDataCsReq, CmdType.CmdGetPhoneDataScRsp},
{CmdType.PlayerLoginFinishCsReq, CmdType.PlayerLoginFinishScRsp} {CmdType.CmdPlayerLoginFinishCsReq, CmdType.CmdPlayerLoginFinishScRsp}
}; };
[ProtoContract] [ProtoContract]

View file

@ -28,5 +28,20 @@
await _channel.WriteAndFlushAsync(packet); await _channel.WriteAndFlushAsync(packet);
} }
public async void Send<T>(int cmdId, T data) where T : class
{
var packet = new NetPacket()
{
CmdId = cmdId,
Data = data
};
var buffer = Unpooled.Buffer();
packet.Serialize<T>(buffer);
packet.Buf = buffer;
await _channel.WriteAndFlushAsync(packet);
}
} }
} }

File diff suppressed because it is too large Load diff

32721
FreeSR.Proto/StarRail.cs Normal file

File diff suppressed because it is too large Load diff