64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
using CSNetwork;
|
|
using CSNetwork.GPDataType;
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace PerfectWorld.Scripts.Managers
|
|
{
|
|
namespace BrewMonster.Managers
|
|
{
|
|
public class EC_ManPlayer : IMsgHandler
|
|
{
|
|
public int HandlerId => MANAGER_INDEX.MAN_PLAYER;
|
|
public bool ProcessMessage(ECMSG Msg)
|
|
{
|
|
if (Msg.iSubID == 0)
|
|
{
|
|
|
|
}
|
|
else if (Msg.iSubID < 0)
|
|
{
|
|
switch ((int)Msg.dwMsg)
|
|
{
|
|
case int value when value == EC_MsgDef.MSG_PM_PLAYERINFO:
|
|
{
|
|
OnMsgPlayerInfo(Msg);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public void OnMsgPlayerInfo(ECMSG Msg)
|
|
{
|
|
int iHostID = (int)Msg.dwParam3;
|
|
int lenghtByte = Marshal.SizeOf<int>();
|
|
byte[] byteArray = new byte[lenghtByte];
|
|
byte[] data = (byte[])Msg.dwParam1;
|
|
for (int i = 0; i < lenghtByte; i++)
|
|
{
|
|
byteArray[i] = data[i];
|
|
}
|
|
int cid = BitConverter.ToInt32(byteArray);
|
|
switch (Msg.dwParam2)
|
|
{
|
|
case CommandID.PLAYER_INFO_1:
|
|
case CommandID.PLAYER_ENTER_WORLD:
|
|
case CommandID.PLAYER_ENTER_SLICE:
|
|
{
|
|
if (cid != iHostID)
|
|
{
|
|
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |