mirror of
https://github.com/MikuLeaks/MikuSB.git
synced 2026-06-04 17:43:57 +00:00
unlock more stage for operation
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace MikuSB.GameServer.Server.CallGS.Handlers.Daily;
|
||||
|
||||
[CallGSApi("Daily_SetSelectSuit")]
|
||||
public class Daily_SetSelectSuit : ICallGSHandler
|
||||
{
|
||||
|
||||
public async Task Handle(Connection connection, string param, ushort seqNo)
|
||||
{
|
||||
var req = JsonSerializer.Deserialize<GirlWeaponSkinParam>(param);
|
||||
if (req == null)
|
||||
{
|
||||
await CallGSRouter.SendScript(connection, "GirlWeaponSkin_Change", "{}");
|
||||
return;
|
||||
}
|
||||
var rsp = $"{{\"SuitId\":{req.Suit}}}";
|
||||
await CallGSRouter.SendScript(connection, "Daily_SetSelectSuit", rsp);
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class GirlWeaponSkinParam
|
||||
{
|
||||
public uint Type { get; set; }
|
||||
public uint Suit { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using MikuSB.Database.Character;
|
||||
using MikuSB.Database.Inventory;
|
||||
using MikuSB.GameServer.Game.Inventory;
|
||||
using MikuSB.GameServer.Game.Player;
|
||||
using MikuSB.Proto;
|
||||
using MikuSB.TcpSharp;
|
||||
|
||||
@@ -84,4 +84,33 @@ public class PacketNtfCallScript : BasePacket
|
||||
proto.ExtraSync = extraSync;
|
||||
SetData(proto);
|
||||
}
|
||||
|
||||
public PacketNtfCallScript(PlayerInstance Player) : base(CmdIds.NtfScript)
|
||||
{
|
||||
Player.BuildPlayerAttr();
|
||||
var proto = new NtfCallScript
|
||||
{
|
||||
Api = "",
|
||||
Arg = "{}"
|
||||
};
|
||||
var sync = new NtfSyncPlayer();
|
||||
foreach (var x in Player.Data.Attrs)
|
||||
{
|
||||
uint gid = x.Gid;
|
||||
uint sid = x.Sid;
|
||||
uint val = x.Val;
|
||||
|
||||
if (gid == 0)
|
||||
{
|
||||
sync.Custom[sid] = val;
|
||||
continue;
|
||||
}
|
||||
|
||||
sync.Custom[Player.ToPackedAttrKey(gid, sid)] = val;
|
||||
sync.Custom[Player.ToShiftedAttrKey(gid, sid)] = val;
|
||||
}
|
||||
proto.ExtraSync = sync;
|
||||
|
||||
SetData(proto);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user