Add send storage request
This commit is contained in:
@@ -1667,6 +1667,71 @@ namespace CSNetwork.S2CCommand
|
||||
public ushort size;
|
||||
public int[] idlist;
|
||||
};
|
||||
|
||||
// PW_CPP: EC_GPDataType.h — trash box C2S payloads
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct cmd_get_trashbox_info
|
||||
{
|
||||
public byte is_accountbox;
|
||||
public byte detail;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct cmd_exg_trashbox_item_c2s
|
||||
{
|
||||
public byte where;
|
||||
public byte index1;
|
||||
public byte index2;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct cmd_move_trashbox_item_c2s
|
||||
{
|
||||
public byte where;
|
||||
public byte src;
|
||||
public byte dest;
|
||||
public uint amount;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct cmd_exg_trashbox_ivtr_c2s
|
||||
{
|
||||
public byte where;
|
||||
public byte idx_tra;
|
||||
public byte idx_inv;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct cmd_trashbox_item_to_ivtr_c2s
|
||||
{
|
||||
public byte where;
|
||||
public byte idx_tra;
|
||||
public byte idx_inv;
|
||||
public uint amount;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct cmd_ivtr_item_to_trashbox_c2s
|
||||
{
|
||||
public byte where;
|
||||
public byte idx_inv;
|
||||
public byte idx_tra;
|
||||
public uint amount;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct cmd_exg_trashbox_money_c2s
|
||||
{
|
||||
public byte is_accountbox;
|
||||
public uint inv_money;
|
||||
public uint trashbox_money;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct OpenTrashCONTENT
|
||||
{
|
||||
public uint psw_size;
|
||||
}
|
||||
}
|
||||
|
||||
// Player and NPC state
|
||||
@@ -4,6 +4,7 @@ using CSNetwork.S2CCommand;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace CSNetwork.C2SCommand
|
||||
@@ -1188,6 +1189,85 @@ namespace CSNetwork.C2SCommand
|
||||
return SerializeCommand(CommandID.SEVNPC_SERVE, cmd, content);
|
||||
}
|
||||
|
||||
public static Octets CreateCmdGetTrashBoxData(bool detail, bool accountBox = false)
|
||||
{
|
||||
var cmd = new cmd_get_trashbox_info
|
||||
{
|
||||
detail = (byte)(detail ? 1 : 0),
|
||||
is_accountbox = (byte)(accountBox ? 1 : 0)
|
||||
};
|
||||
return SerializeCommand(CommandID.GET_TRASHBOX_INFO, cmd);
|
||||
}
|
||||
|
||||
public static Octets CreateCmdExgTrashBoxItem(byte where, byte index1, byte index2)
|
||||
{
|
||||
var cmd = new cmd_exg_trashbox_item_c2s { where = where, index1 = index1, index2 = index2 };
|
||||
return SerializeCommand(CommandID.EXG_TRASHBOX_ITEM, cmd);
|
||||
}
|
||||
|
||||
public static Octets CreateCmdMoveTrashBoxItem(byte where, byte src, byte dest, uint amount)
|
||||
{
|
||||
var cmd = new cmd_move_trashbox_item_c2s { where = where, src = src, dest = dest, amount = amount };
|
||||
return SerializeCommand(CommandID.MOVE_TRASHBOX_ITEM, cmd);
|
||||
}
|
||||
|
||||
public static Octets CreateCmdExgTrashBoxIvtrItem(byte where, byte idxTra, byte idxInv)
|
||||
{
|
||||
var cmd = new cmd_exg_trashbox_ivtr_c2s { where = where, idx_tra = idxTra, idx_inv = idxInv };
|
||||
return SerializeCommand(CommandID.EXG_TRASHBOX_IVTR, cmd);
|
||||
}
|
||||
|
||||
public static Octets CreateCmdMoveTrashBoxToIvtr(byte where, byte idxTra, byte idxInv, uint amount)
|
||||
{
|
||||
var cmd = new cmd_trashbox_item_to_ivtr_c2s
|
||||
{
|
||||
where = where, idx_tra = idxTra, idx_inv = idxInv, amount = amount
|
||||
};
|
||||
return SerializeCommand(CommandID.TRASHBOX_ITEM_TO_IVTR, cmd);
|
||||
}
|
||||
|
||||
public static Octets CreateCmdMoveIvtrToTrashBox(byte where, byte idxInv, byte idxTra, uint amount)
|
||||
{
|
||||
var cmd = new cmd_ivtr_item_to_trashbox_c2s
|
||||
{
|
||||
where = where, idx_inv = idxInv, idx_tra = idxTra, amount = amount
|
||||
};
|
||||
return SerializeCommand(CommandID.IVTR_ITEM_TO_TRASHBOX, cmd);
|
||||
}
|
||||
|
||||
public static Octets CreateCmdExgTrashBoxMoney(int invMoney, int trashMoney, bool accountBox = false)
|
||||
{
|
||||
var cmd = new cmd_exg_trashbox_money_c2s
|
||||
{
|
||||
is_accountbox = (byte)(accountBox ? 1 : 0),
|
||||
inv_money = (uint)invMoney,
|
||||
trashbox_money = (uint)trashMoney
|
||||
};
|
||||
return SerializeCommand(CommandID.EXG_TRASHBOX_MONEY, cmd);
|
||||
}
|
||||
|
||||
public static Octets CreateNPCSevOpenTrashCmd(string password)
|
||||
{
|
||||
uint passwdSize = 0;
|
||||
byte[] passwordBytes = null;
|
||||
if (!string.IsNullOrEmpty(password))
|
||||
{
|
||||
passwordBytes = Encoding.UTF8.GetBytes(password);
|
||||
passwdSize = (uint)passwordBytes.Length;
|
||||
}
|
||||
|
||||
var cmd = new cmd_sevnpc_serve
|
||||
{
|
||||
service_type = NPC_service_type.GP_NPCSEV_OPENTRASH,
|
||||
len = (uint)Marshal.SizeOf<OpenTrashCONTENT>() + passwdSize
|
||||
};
|
||||
var content = new OpenTrashCONTENT { psw_size = passwdSize };
|
||||
var octets = SerializeCommand(CommandID.SEVNPC_SERVE, cmd, content);
|
||||
if (passwdSize > 0 && passwordBytes != null)
|
||||
octets.Insert(octets.Size, passwordBytes);
|
||||
return octets;
|
||||
}
|
||||
|
||||
public static Octets CreateGetOtherEquipCmd(ushort _size, int[] _idlist)
|
||||
{
|
||||
var cmd = new cmd_get_other_equip
|
||||
|
||||
@@ -1416,6 +1416,21 @@ namespace CSNetwork
|
||||
case CommandID.MINE_GATHERED:
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERGATHER, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader);
|
||||
break;
|
||||
case CommandID.TRASHBOX_PWD_CHANGED:
|
||||
case CommandID.TRASHBOX_PWD_STATE:
|
||||
case CommandID.TRASHBOX_OPEN:
|
||||
case CommandID.TRASHBOX_CLOSE:
|
||||
case CommandID.TRASHBOX_WEALTH:
|
||||
case CommandID.EXG_TRASH_MONEY:
|
||||
case CommandID.EXG_TRASHBOX_ITEM:
|
||||
case CommandID.MOVE_TRASHBOX_ITEM:
|
||||
case CommandID.EXG_TRASHBOX_IVTR:
|
||||
case CommandID.IVTR_ITEM_TO_TRASH:
|
||||
case CommandID.TRASH_ITEM_TO_IVTR:
|
||||
case CommandID.TRASHBOX_SIZE:
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_TRASHBOXOP, (int)MANAGER_INDEX.MAN_PLAYER, 0,
|
||||
pDataBuf, pCmdHeader);
|
||||
break;
|
||||
case CommandID.COOLTIME_DATA:
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_COOLTIMEDATA, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader);
|
||||
break;
|
||||
@@ -3104,5 +3119,53 @@ namespace CSNetwork
|
||||
// TODO: C2SCommandFactory.CreateNPCSevCrossServerGetOutCmd() and SendProtocol
|
||||
}
|
||||
|
||||
public void c2s_CmdGetTrashBoxData(bool detail, bool accountBox = false)
|
||||
{
|
||||
var req = new gamedatasend { Data = C2SCommandFactory.CreateCmdGetTrashBoxData(detail, accountBox) };
|
||||
SendProtocol(req);
|
||||
}
|
||||
|
||||
public void c2s_CmdNPCSevOpenTrash(string password)
|
||||
{
|
||||
var req = new gamedatasend { Data = C2SCommandFactory.CreateNPCSevOpenTrashCmd(password ?? "") };
|
||||
SendProtocol(req);
|
||||
}
|
||||
|
||||
public void c2s_CmdExgTrashBoxItem(byte where, byte index1, byte index2)
|
||||
{
|
||||
var req = new gamedatasend { Data = C2SCommandFactory.CreateCmdExgTrashBoxItem(where, index1, index2) };
|
||||
SendProtocol(req);
|
||||
}
|
||||
|
||||
public void c2s_CmdMoveTrashBoxItem(byte where, byte src, byte dest, uint amount)
|
||||
{
|
||||
var req = new gamedatasend { Data = C2SCommandFactory.CreateCmdMoveTrashBoxItem(where, src, dest, amount) };
|
||||
SendProtocol(req);
|
||||
}
|
||||
|
||||
public void c2s_CmdExgTrashBoxIvtrItem(byte where, byte idxTra, byte idxInv)
|
||||
{
|
||||
var req = new gamedatasend { Data = C2SCommandFactory.CreateCmdExgTrashBoxIvtrItem(where, idxTra, idxInv) };
|
||||
SendProtocol(req);
|
||||
}
|
||||
|
||||
public void c2s_CmdMoveTrashBoxToIvtr(byte where, byte idxTra, byte idxInv, uint amount)
|
||||
{
|
||||
var req = new gamedatasend { Data = C2SCommandFactory.CreateCmdMoveTrashBoxToIvtr(where, idxTra, idxInv, amount) };
|
||||
SendProtocol(req);
|
||||
}
|
||||
|
||||
public void c2s_CmdMoveIvtrToTrashBox(byte where, byte idxInv, byte idxTra, uint amount)
|
||||
{
|
||||
var req = new gamedatasend { Data = C2SCommandFactory.CreateCmdMoveIvtrToTrashBox(where, idxInv, idxTra, amount) };
|
||||
SendProtocol(req);
|
||||
}
|
||||
|
||||
public void c2s_CmdExgTrashBoxMoney(int invMoney, int trashMoney, bool accountBox = false)
|
||||
{
|
||||
var req = new gamedatasend { Data = C2SCommandFactory.CreateCmdExgTrashBoxMoney(invMoney, trashMoney, accountBox) };
|
||||
SendProtocol(req);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -655,42 +655,6 @@ namespace BrewMonster.Network
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdStandUp();
|
||||
}
|
||||
|
||||
public static void c2s_CmdSitDown()
|
||||
{
|
||||
BMLogger.LogError("HoangDev: c2s_CmdSitDown");
|
||||
Instance._gameSession.c2s_SendCmdSitDown();
|
||||
}
|
||||
|
||||
public static void c2s_CmdTeamAssistSel(int idTeamMember)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdTeamAssistSel(idTeamMember);
|
||||
}
|
||||
|
||||
public static void c2s_CmdActiveRushFly(bool bActive)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdActiveRushFly(bActive);
|
||||
}
|
||||
|
||||
public static void c2s_CmdOpenBoothTest()
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdOpenBoothTest();
|
||||
}
|
||||
|
||||
public static void c2s_CmdBindPlayerRequest(int idTarget)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdBindPlayerRequest(idTarget);
|
||||
}
|
||||
|
||||
public static void c2s_CmdBindPlayerInvite(int idTarget)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdBindPlayerInvite(idTarget);
|
||||
}
|
||||
|
||||
public static bool trade_Start(int idTarget)
|
||||
{
|
||||
return Instance._gameSession.trade_Start(idTarget);
|
||||
}
|
||||
#region Task
|
||||
public static void c2s_CmdGetAllData(bool byPack, bool byEquip, bool byTask)
|
||||
{
|
||||
@@ -975,6 +939,81 @@ namespace BrewMonster.Network
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdNPCSevRestorePet(iPetIdx);
|
||||
}
|
||||
|
||||
public static void c2s_CmdSitDown()
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdSitDown();
|
||||
}
|
||||
|
||||
public static void c2s_CmdTeamAssistSel(int idTeamMember)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdTeamAssistSel(idTeamMember);
|
||||
}
|
||||
|
||||
public static void trade_Start(int idTarget)
|
||||
{
|
||||
Instance._gameSession.trade_Start(idTarget);
|
||||
}
|
||||
|
||||
public static void c2s_CmdOpenBoothTest()
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdOpenBoothTest();
|
||||
}
|
||||
|
||||
public static void c2s_CmdActiveRushFly(bool bActive)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdActiveRushFly(bActive);
|
||||
}
|
||||
|
||||
public static void c2s_CmdBindPlayerInvite(int idTarget)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdBindPlayerInvite(idTarget);
|
||||
}
|
||||
|
||||
public static void c2s_CmdBindPlayerRequest(int idTarget)
|
||||
{
|
||||
Instance._gameSession.c2s_SendCmdBindPlayerRequest(idTarget);
|
||||
}
|
||||
|
||||
public static void c2s_CmdNPCSevOpenTrash(string password)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdNPCSevOpenTrash(password);
|
||||
}
|
||||
|
||||
public static void c2s_CmdGetTrashBoxData(bool detail, bool accountBox = false)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdGetTrashBoxData(detail, accountBox);
|
||||
}
|
||||
|
||||
public static void c2s_CmdExgTrashBoxItem(byte where, byte index1, byte index2)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdExgTrashBoxItem(where, index1, index2);
|
||||
}
|
||||
|
||||
public static void c2s_CmdMoveTrashBoxItem(byte where, byte src, byte dest, uint amount)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdMoveTrashBoxItem(where, src, dest, amount);
|
||||
}
|
||||
|
||||
public static void c2s_CmdExgTrashBoxIvtrItem(byte where, byte idxTra, byte idxInv)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdExgTrashBoxIvtrItem(where, idxTra, idxInv);
|
||||
}
|
||||
|
||||
public static void c2s_CmdMoveTrashBoxToIvtr(byte where, byte idxTra, byte idxInv, uint amount)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdMoveTrashBoxToIvtr(where, idxTra, idxInv, amount);
|
||||
}
|
||||
|
||||
public static void c2s_CmdMoveIvtrToTrashBox(byte where, byte idxInv, byte idxTra, uint amount)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdMoveIvtrToTrashBox(where, idxInv, idxTra, amount);
|
||||
}
|
||||
|
||||
public static void c2s_CmdExgTrashBoxMoney(int invMoney, int trashMoney, bool accountBox = false)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdExgTrashBoxMoney(invMoney, trashMoney, accountBox);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user