all avatars and team character changing
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
|
||||
internal static class LineupReqGroup
|
||||
{
|
||||
public static uint Avatar1 = 8001;
|
||||
public static uint Avatar2 = 1307;
|
||||
public static uint Avatar3 = 1306;
|
||||
public static uint Avatar4 = 1312;
|
||||
[Handler(CmdType.CmdGetCurLineupDataCsReq)]
|
||||
public static void OnGetCurLineupDataCsReq(NetSession session, int cmdId, object _)
|
||||
{
|
||||
@@ -23,7 +27,7 @@
|
||||
MaxMp = 5
|
||||
};
|
||||
|
||||
var characters = new uint[] { 8001, 1307, 1306, 1312 };
|
||||
var characters = new uint[] { Avatar1, Avatar2, Avatar3, Avatar4 };
|
||||
|
||||
foreach (uint id in characters)
|
||||
{
|
||||
@@ -59,7 +63,7 @@
|
||||
LeaderSlot = 0
|
||||
});
|
||||
|
||||
var characters = new uint[] { 8001, 1307, 1306, 1312 };
|
||||
var characters = new uint[] { Avatar1, Avatar2, Avatar3, Avatar4 };
|
||||
|
||||
foreach (uint id in characters)
|
||||
{
|
||||
@@ -87,5 +91,91 @@
|
||||
Retcode = (uint)RetcodeStatus.RetSucc
|
||||
});
|
||||
}
|
||||
|
||||
[Handler(CmdType.CmdJoinLineupCsReq)]
|
||||
public static void OnJoinLineupCsReq(NetSession session, int cmdId, object data)
|
||||
{
|
||||
var request = data as JoinLineupCsReq;
|
||||
if (request.Slot == 0) Avatar1 = request.BaseAvatarId;
|
||||
if (request.Slot == 1) Avatar2 = request.BaseAvatarId;
|
||||
if (request.Slot == 2) Avatar3 = request.BaseAvatarId;
|
||||
if (request.Slot == 3) Avatar4 = request.BaseAvatarId;
|
||||
RefreshLineup(session);
|
||||
|
||||
session.Send(CmdType.CmdJoinLineupScRsp, new JoinLineupScRsp
|
||||
{
|
||||
Retcode = (uint)RetcodeStatus.RetSucc
|
||||
});
|
||||
}
|
||||
|
||||
[Handler(CmdType.CmdReplaceLineupCsReq)]
|
||||
public static void OnReplaceLineupCsReq(NetSession session, int cmdId, object data)
|
||||
{
|
||||
|
||||
var request = data as ReplaceLineupCsReq;
|
||||
Avatar1 = 0; Avatar2 = 0; Avatar3 = 0; Avatar4 = 0;
|
||||
foreach (LineupSlotData slotData in request.LineupSlotLists)
|
||||
{
|
||||
Console.WriteLine($"Replace Slot:{slotData.Slot} Id:{slotData.Id}");
|
||||
if (slotData.Slot == 0) Avatar1 = slotData.Id;
|
||||
if (slotData.Slot == 1) Avatar2 = slotData.Id;
|
||||
if (slotData.Slot == 2) Avatar3 = slotData.Id;
|
||||
if (slotData.Slot == 3) Avatar4 = slotData.Id;
|
||||
}
|
||||
|
||||
RefreshLineup(session);
|
||||
session.Send(CmdType.CmdReplaceLineupScRsp, new ReplaceLineupScRsp
|
||||
{
|
||||
Retcode = (uint)RetcodeStatus.RetSucc
|
||||
});
|
||||
}
|
||||
|
||||
[Handler(CmdType.CmdQuitLineupCsReq)]
|
||||
public static void OnQuitLineupCsReq(NetSession session, int cmdId, object data)
|
||||
{
|
||||
var request = data as QuitLineupCsReq;
|
||||
Console.WriteLine($"CmdQuitLineupCsReq BaseAvatarId:{request.BaseAvatarId} Index:{request.Index} PlaneId:{request.PlaneId}");
|
||||
if (request.BaseAvatarId == Avatar1) Avatar1 = 0;
|
||||
if (request.BaseAvatarId == Avatar2) Avatar2 = 0;
|
||||
if (request.BaseAvatarId == Avatar3) Avatar3 = 0;
|
||||
if (request.BaseAvatarId == Avatar4) Avatar4 = 0;
|
||||
|
||||
RefreshLineup(session);
|
||||
session.Send(CmdType.CmdQuitLineupScRsp, new QuitLineupScRsp
|
||||
{
|
||||
Retcode = (uint)RetcodeStatus.RetSucc,
|
||||
BaseAvatarId = request.BaseAvatarId,
|
||||
IsVirtual = request.IsVirtual
|
||||
});
|
||||
}
|
||||
public static void RefreshLineup(NetSession session) {
|
||||
Console.WriteLine($"Team refreshed!{Avatar1} {Avatar2} {Avatar3} {Avatar4}");
|
||||
var characters = new uint[] { Avatar1, Avatar2, Avatar3, Avatar4 };
|
||||
var response = new SyncLineupNotify
|
||||
{
|
||||
Lineup = new LineupInfo
|
||||
{
|
||||
ExtraLineupType = ExtraLineupType.LineupNone,
|
||||
Name = "Squad 1",
|
||||
Mp = 5,
|
||||
MaxMp = 5,
|
||||
LeaderSlot = 0
|
||||
}
|
||||
};
|
||||
foreach (uint id in characters)
|
||||
{
|
||||
if (id == 0) continue;
|
||||
response.Lineup.AvatarLists.Add(new LineupAvatar
|
||||
{
|
||||
AvatarType = AvatarType.AvatarFormalType,
|
||||
Sp = new AmountInfo { CurAmount = 10000, MaxAmount = 10000 },
|
||||
Hp = 10000,
|
||||
Satiety = 100,
|
||||
Id = id,
|
||||
Slot = (uint)response.Lineup.AvatarLists.Count
|
||||
});
|
||||
}
|
||||
session.Send(CmdType.CmdSyncLineupNotify, response);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user