Archived
1
0
Fork 0
forked from Moux23333/FreeSR
This repository has been archived on 2024-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
FreeSR/FreeSR.Gateserver/Manager/Handlers/LineupReqGroup.cs

90 lines
2.9 KiB
C#
Raw Normal View History

2024-01-27 13:06:07 +00:00
namespace FreeSR.Gateserver.Manager.Handlers
{
using FreeSR.Gateserver.Manager.Handlers.Core;
using FreeSR.Gateserver.Network;
using FreeSR.Proto;
internal static class LineupReqGroup
{
2024-01-27 13:08:24 +00:00
[Handler(CmdType.CmdGetCurLineupDataCsReq)]
2024-01-27 13:06:07 +00:00
public static void OnGetCurLineupDataCsReq(NetSession session, int cmdId, object _)
{
var response = new GetCurLineupDataScRsp
{
2024-01-27 13:08:24 +00:00
Retcode = (uint)RetcodeStatus.RetSucc
2024-01-27 13:06:07 +00:00
};
response.Lineup = new LineupInfo
{
2024-01-27 13:08:24 +00:00
ExtraLineupType = ExtraLineupType.LineupNone,
2024-01-27 13:06:07 +00:00
Name = "Squad 1",
2024-01-27 13:08:24 +00:00
LeaderSlot = 0,
Mp = 5
2024-01-27 13:06:07 +00:00
};
2024-01-27 13:08:24 +00:00
var characters = new uint[] { 8001, 1307, 1306, 1312 };
2024-01-27 13:06:07 +00:00
2024-01-27 13:08:24 +00:00
foreach (uint id in characters)
2024-01-27 13:06:07 +00:00
{
2024-01-27 13:08:24 +00:00
response.Lineup.AvatarLists.Add(new LineupAvatar
2024-01-27 13:06:07 +00:00
{
2024-01-27 13:08:24 +00:00
AvatarType = AvatarType.AvatarFormalType,
Hp = 10000,
Sp = new AmountInfo { CurAmount = 10000,MaxAmount = 10000},
2024-01-27 13:06:07 +00:00
Satiety = 100,
Id = id,
2024-01-27 13:08:24 +00:00
Slot = (uint)response.Lineup.AvatarLists.Count
2024-01-27 13:06:07 +00:00
});
}
2024-01-27 13:08:24 +00:00
session.Send(CmdType.CmdGetCurLineupDataScRsp, response);
2024-01-27 13:06:07 +00:00
}
2024-01-27 13:08:24 +00:00
[Handler(CmdType.CmdGetAllLineupDataCsReq)]
2024-01-27 13:06:07 +00:00
public static void OnGetAllLineupDataCsReq(NetSession session, int cmdId, object data)
{
var response = new GetAllLineupDataScRsp
{
2024-01-27 13:08:24 +00:00
Retcode = (uint)RetcodeStatus.RetSucc,
2024-01-27 13:06:07 +00:00
CurIndex = 0,
};
2024-01-27 13:08:24 +00:00
response.LineupLists.Add(new LineupInfo
2024-01-27 13:06:07 +00:00
{
2024-01-27 13:08:24 +00:00
ExtraLineupType = ExtraLineupType.LineupNone,
2024-01-27 13:06:07 +00:00
Name = "Squad 1",
2024-01-27 13:08:24 +00:00
Mp = 5,
LeaderSlot = 0
2024-01-27 13:06:07 +00:00
});
2024-01-27 13:08:24 +00:00
var characters = new uint[] { 8001, 1307, 1306, 1312 };
2024-01-27 13:06:07 +00:00
2024-01-27 13:08:24 +00:00
foreach (uint id in characters)
2024-01-27 13:06:07 +00:00
{
2024-01-27 13:08:24 +00:00
response.LineupLists[0].AvatarLists.Add(new LineupAvatar
2024-01-27 13:06:07 +00:00
{
2024-01-27 13:08:24 +00:00
AvatarType = AvatarType.AvatarFormalType,
Sp = new AmountInfo { CurAmount = 10000, MaxAmount = 10000 },
Hp = 10000,
2024-01-27 13:06:07 +00:00
Satiety = 100,
Id = id,
2024-01-27 13:08:24 +00:00
Slot = (uint)response.LineupLists[0].AvatarLists.Count
2024-01-27 13:06:07 +00:00
});
}
2024-01-27 13:08:24 +00:00
session.Send(CmdType.CmdGetAllLineupDataScRsp, response);
2024-01-27 13:06:07 +00:00
}
2024-01-27 13:08:24 +00:00
[Handler(CmdType.CmdChangeLineupLeaderCsReq)]
2024-01-27 13:06:07 +00:00
public static void OnChangeLineupLeaderCsReq(NetSession session, int cmdId, object data)
{
var request = data as ChangeLineupLeaderCsReq;
2024-01-27 13:08:24 +00:00
session.Send(CmdType.CmdChangeLineupLeaderScRsp, new ChangeLineupLeaderScRsp
2024-01-27 13:06:07 +00:00
{
Slot = request.Slot,
2024-01-27 13:08:24 +00:00
Retcode = (uint)RetcodeStatus.RetSucc
2024-01-27 13:06:07 +00:00
});
}
}
}