Archived
1
0
Fork 0
forked from Moux23333/FreeSR

all avatars and team character changing

This commit is contained in:
moux23333 2024-01-31 12:30:01 +08:00
parent a8c597104e
commit 855fc2c9bb
4 changed files with 109 additions and 18 deletions

View file

@ -17,7 +17,11 @@
IsAll = request.IsGetAll
};
uint[] characters = new uint[] { 8001, 1307, 1306, 1312 };
uint[] characters = new uint[] { 8001,8002,8003,8004,
1001,1002,1003,1004,1005,1006,1008,1009,1013,
1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,
1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1217,
1302,1303,1305,1306,1307,1312};
foreach (uint id in characters)
{
@ -25,8 +29,8 @@
{
BaseAvatarId = id,
Exp = 0,
Level = 1,
Promotion = 0,
Level = 80,
Promotion = 6,
Rank = 6,
EquipmentUniqueId = 0
};

View file

@ -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);
}
}
}

View file

@ -107,18 +107,6 @@
ServerAnnounceNotify announceNotify = JsonConvert.DeserializeObject<ServerAnnounceNotify>(decodedJsonData);
session.Send(10, announceNotify);
/*session.Send(10, new ServerAnnounceNotify
{
Opgimnkoknjs =
{
new AnnounceData
{
BeginTime = 0,
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

@ -36,7 +36,16 @@
{CmdType.CmdGetNpcTakenRewardCsReq, typeof(Eddbhmdjadb)},
{CmdType.CmdGetFirstTalkByPerformanceNpcCsReq, typeof(Jknjlicadhe)},
//{CmdType.CmdGetBagCsReq, typeof(GetBagCsReq)}
{CmdType.CmdSceneEntityMoveCsReq, typeof(SceneEntityMoveCsReq)},
{CmdType.CmdReplaceLineupCsReq, typeof(ReplaceLineupCsReq)},
{CmdType.CmdJoinLineupCsReq, typeof(JoinLineupCsReq)},
{CmdType.CmdQuitLineupCsReq, typeof(QuitLineupCsReq)},
{CmdType.CmdSwapLineupCsReq, typeof(SwapLineupCsReq)},
{CmdType.CmdSetLineupNameCsReq, typeof(SetLineupNameCsReq)},
{CmdType.CmdStartCocoonStageCsReq, typeof(StartCocoonStageCsReq)},
{CmdType.CmdPVEBattleResultCsReq, typeof(PVEBattleResultCsReq)}
});
s_types = builder.ToImmutable();