send npc accept task cmd
This commit is contained in:
@@ -36,6 +36,23 @@ namespace CSNetwork.C2SCommand
|
||||
|
||||
return octets;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Some commands have a dynamic body. Usually they have 2 parts. <br/>
|
||||
/// The first part is a static part, and the second part will be changed according to the first part. <br/>
|
||||
/// This function is used to serialize such commands.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Octets SerializeCommand<T, T2>(CommandID cmdId, T command, T2 command2) where T : struct where T2 : struct
|
||||
{
|
||||
var octets = new Octets();
|
||||
|
||||
// Write command header - write enum value directly
|
||||
WriteBasicValue(octets, (ushort)cmdId);
|
||||
WriteStruct(octets, command);
|
||||
WriteStruct(octets, command2);
|
||||
return octets;
|
||||
}
|
||||
public static Octets SerializeCommand<T>(eCommandID cmdId, T command)
|
||||
where T : struct
|
||||
{
|
||||
@@ -499,6 +516,25 @@ namespace CSNetwork.C2SCommand
|
||||
return SerializeCommand(CommandID.NORMAL_ATTACK, cmd);
|
||||
}
|
||||
|
||||
public static Octets CreateCmdNPCSevAcceptTask(int idTask,int idStorage,int idRefreshItem)
|
||||
{
|
||||
cmd_sevnpc_serve cmd = new cmd_sevnpc_serve()
|
||||
{
|
||||
service_type = 1,
|
||||
len = Marshal.SizeOf<accept_task_CONTENT>()
|
||||
};
|
||||
|
||||
accept_task_CONTENT acceptTaskContent = new accept_task_CONTENT()
|
||||
{
|
||||
idTask = idTask,
|
||||
idStorage = idStorage,
|
||||
idRefreshItem = idRefreshItem
|
||||
};
|
||||
|
||||
var octets = SerializeCommand(CommandID.SEVNPC_SERVE, command: cmd, command2: acceptTaskContent);
|
||||
return octets;
|
||||
}
|
||||
|
||||
public static Octets CreateNakeCmd(CommandID iCmd)
|
||||
{
|
||||
return SerializeCommand(iCmd);
|
||||
|
||||
@@ -1458,5 +1458,18 @@ namespace CSNetwork.GPDataType
|
||||
public int timebias;
|
||||
public int lua_version;
|
||||
};
|
||||
|
||||
public struct cmd_sevnpc_serve
|
||||
{
|
||||
public int service_type;
|
||||
public int len;
|
||||
};
|
||||
|
||||
public struct accept_task_CONTENT
|
||||
{
|
||||
public int idTask;
|
||||
public int idStorage;
|
||||
public int idRefreshItem;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -994,6 +994,13 @@ namespace CSNetwork
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERBASEINFO, MANAGER_INDEX.MAN_PLAYER, -1, p);
|
||||
}
|
||||
|
||||
public void c2s_CmdNPCSevAcceptTask(int idTask,int idStorage,int idRefreshItem)
|
||||
{
|
||||
gamedatasend gamedatasend = new gamedatasend();
|
||||
gamedatasend.Data = C2SCommandFactory.CreateCmdNPCSevAcceptTask(idTask, idStorage, idRefreshItem);
|
||||
SendProtocol(gamedatasend);
|
||||
}
|
||||
|
||||
public void c2s_SendCmdGetAllData(bool byPack, bool byEquip, bool byTask)
|
||||
{
|
||||
gamedatasend gamedatasend = new gamedatasend();
|
||||
|
||||
@@ -261,6 +261,10 @@ namespace BrewMonster.Network
|
||||
{
|
||||
Instance._gameSession.c2s_CmdSendEnterPKPrecinctint();
|
||||
}
|
||||
public static void c2s_CmdNPCSevAcceptTask(int idTask,int idStorage,int idRefreshItem)
|
||||
{
|
||||
Instance._gameSession.c2s_CmdNPCSevAcceptTask(idTask, idStorage, idRefreshItem);
|
||||
}
|
||||
#region Task
|
||||
public static void c2s_CmdGetAllData(bool byPack, bool byEquip, bool byTask)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user