Add send revive cmd

This commit is contained in:
HungDK
2025-11-04 14:31:49 +07:00
parent 8278709a45
commit 307f6d8b49
2 changed files with 31 additions and 2 deletions
@@ -260,6 +260,10 @@ namespace CSNetwork.C2SCommand
public byte moveMode; // Walk run swim fly .... walk_back run_back
public ushort stamp; // Move command stamp
}
public struct cmd_revive
{
public int param;
};
struct cmd_object_move
{
public int id;
@@ -20,7 +20,7 @@ namespace CSNetwork.C2SCommand
|| !type.IsValueType;
}
// Generic command serialization
// Generic command serializationw
public static Octets SerializeCommand<T>(CommandID cmdId, T command)
where T : struct
{
@@ -47,7 +47,7 @@ namespace CSNetwork.C2SCommand
return octets;
}
// Serialize a nake command (commands that have id but havn't data)
public static Octets SerializeCommand(CommandID cmdId)
{
@@ -335,6 +335,31 @@ namespace CSNetwork.C2SCommand
};
return SerializeCommand(CommandID.GET_IVTR_DETAIL, cmd);
}
public static Octets CreateReviveBase(int param)
{
var cmd = new cmd_revive
{
param = param
};
return SerializeCommand(CommandID.REVIVE_VILLAGE, cmd);
}
public static Octets CreateReviveItem(int param)
{
var cmd = new cmd_revive
{
param = param
};
return SerializeCommand(CommandID.REVIVE_ITEM, cmd);
}
public static Octets CreateReviveByPlayer(int param)
{
var cmd = new cmd_revive
{
param = param
};
return SerializeCommand(CommandID.REVIVAL_AGREE, cmd);
}
public static Octets CreateGetMallShopping(uint count, CMD_MallShopping.goods[] goodsArray)
{
var cmd = new CMD_MallShopping()