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 => (int)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(); 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 (Convert.ToInt32(Msg.dwParam2)) { case CommandID.PLAYER_INFO_1: case CommandID.PLAYER_ENTER_WORLD: case CommandID.PLAYER_ENTER_SLICE: { if (cid != iHostID) { GameController.Instance.Log("ElsePlayer has join"); } break; } } } } } }