fixx
This commit is contained in:
@@ -14,6 +14,7 @@ using System.Diagnostics;
|
||||
using System.Numerics;
|
||||
using CSNetwork.C2SCommand;
|
||||
using CSNetwork.GPDataType;
|
||||
using BrewMonster;
|
||||
|
||||
namespace CSNetwork
|
||||
{
|
||||
@@ -184,7 +185,7 @@ namespace CSNetwork
|
||||
gamedatasend gamedatasendRequest = new gamedatasend();
|
||||
gamedatasendRequest.Data = C2SCommandFactory.CreateDropEquipItem(index);
|
||||
SendProtocol(gamedatasendRequest);
|
||||
}
|
||||
}
|
||||
|
||||
public void RequestPickupItem(int idItem, int tid)
|
||||
{
|
||||
@@ -344,7 +345,7 @@ namespace CSNetwork
|
||||
int lenghtDataType = Marshal.SizeOf<int>();
|
||||
byte[] arrByteData = GetBytes(pDataBuf, lenghtDataType, 0);
|
||||
int idObjMove = BitConverter.ToInt32(arrByteData);
|
||||
if (IsPlayerId(idObjMove))
|
||||
if (ISPLAYERID(idObjMove))
|
||||
{
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERMOVE, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader, iHostID);
|
||||
}
|
||||
@@ -356,12 +357,12 @@ namespace CSNetwork
|
||||
break;
|
||||
case CommandID.OBJECT_STOP_MOVE:
|
||||
{
|
||||
int id = GPDataTypeHelper.FromBytes<int>(pDataBuf);
|
||||
if (IsPlayerId(id))
|
||||
int id1 = GPDataTypeHelper.FromBytes<int>(pDataBuf);
|
||||
if (ISPLAYERID(id1))
|
||||
{
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERSTOPMOVE, (int)MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader);
|
||||
}
|
||||
else if (ISNPCID(id))
|
||||
else if (ISNPCID(id1))
|
||||
{
|
||||
_logger.Info("HoangDev : NPC OBJECT_MOVE");
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCSTOPMOVE, (int)MANAGER_INDEX.MAN_NPC, 0, pDataBuf, pCmdHeader);
|
||||
@@ -382,7 +383,7 @@ namespace CSNetwork
|
||||
case CommandID.EQUIP_ITEM:
|
||||
case CommandID.MOVE_EQUIP_ITEM:
|
||||
case CommandID.UNFREEZE_IVTR_SLOT:
|
||||
case CommandID.PLAYER_EQUIP_TRASHBOX_ITEM:
|
||||
case CommandID.PLAYER_EQUIP_TRASHBOX_ITEM:
|
||||
_logger.Info($"HUNG EQUIP ITEM: " + pCmdHeader);
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ITEMOPERATION, (int)MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader);
|
||||
break;
|
||||
@@ -414,6 +415,27 @@ namespace CSNetwork
|
||||
case CommandID.TASK_VAR_DATA:
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_TASKDATA, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader, dwDataSize);
|
||||
break;
|
||||
case CommandID.BE_HURT:
|
||||
case CommandID.HURT_RESULT:
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_HURTRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader);
|
||||
break;
|
||||
case CommandID.OBJECT_ATTACK_RESULT:
|
||||
_logger.Info($"OBJECT_ATTACK_RESULT: " + pCmdHeader);
|
||||
int id = GPDataTypeHelper.FromBytes<int>(pDataBuf);
|
||||
if (ISPLAYERID(id))
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERATKRESULT, MANAGER_INDEX.MAN_PLAYER, -1, pDataBuf, pCmdHeader);
|
||||
else if (ISNPCID(id))
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_NM_NPCATKRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader);
|
||||
break;
|
||||
case CommandID.HOST_ATTACKRESULT:
|
||||
BMLogger.LogError("HoangDev : HOST_ATTACKRESULT");
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ATKRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader);
|
||||
break;
|
||||
case CommandID.HOST_ATTACKED:
|
||||
BMLogger.LogError("HoangDev : HOST_ATTACKED");
|
||||
EC_ManMessage.PostMessage(EC_MsgDef.MSG_HST_ATKRESULT, MANAGER_INDEX.MAN_PLAYER, 0, pDataBuf, pCmdHeader);
|
||||
break;
|
||||
|
||||
case CommandID.ERROR_MESSAGE:
|
||||
_logger.Info($"### GameDataSend: ERROR_MESSAGE: {BitConverter.ToInt32(pDataBuf, 0)}");
|
||||
break;
|
||||
@@ -659,11 +681,11 @@ namespace CSNetwork
|
||||
// GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
public bool IsPlayerId(int id)
|
||||
public bool ISPLAYERID(int id)
|
||||
{
|
||||
return id != 0 && (id & 0x80000000) == 0;
|
||||
}
|
||||
public bool ISNPCID(int id) => ((id & unchecked((int)0x80000000)) != 0)
|
||||
public bool ISNPCID(int id) => ((id & unchecked((int)0x80000000)) != 0)
|
||||
&& ((id & 0x40000000) == 0);
|
||||
private byte[] GetBytes(byte[] bytes, int length, int index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user