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