public void DelNpcAppear(AS_SC_NPC_DISAPPEAR_2 _npcDisAppear) { if (!dicNpcAppear.ContainsKey(_npcDisAppear.nNpcIdx)) dicNpcAppear.Remove(_npcDisAppear.nNpcIdx); }
public new void PacketBytesToClass( byte[] data) { Type infotype = this.GetType(); FieldInfo headerinfo = null; int index = ParsePacketHeader( data); // nNpcCnt byte[] npcCnt = new byte[ sizeof( Int32)]; headerinfo = infotype.GetField( "nNpcCnt", BINDING_FLAGS_PIG); Buffer.BlockCopy( data, index, npcCnt, 0, sizeof( Int32)); headerinfo.SetValue( this, BitConverter.ToInt32( npcCnt, 0)); index += sizeof( Int32); body = new AS_SC_NPC_DISAPPEAR_2[nNpcCnt]; for( int i = 0; i < nNpcCnt; i++) { body[i] = new AS_SC_NPC_DISAPPEAR_2(); byte[] tmpData = new byte[AS_SC_NPC_DISAPPEAR_2.size]; Buffer.BlockCopy( data, index, tmpData, 0, tmpData.Length); body[i].ByteArrayToClass( tmpData); index += AS_SC_NPC_DISAPPEAR_2.size; } }