private void Callback(IAsyncResult ar) { IPEndPoint ip = new IPEndPoint(IPAddress.Any, NetConst.Port); byte[] receiveBytes = Client.EndReceive(ar, ref ip); var reader = new ReaderMsg(receiveBytes); ReadHeader(reader); Client.BeginReceive(Callback, null); }
protected void ReadHeader(ReaderMsg reader) { var code = reader.ReadUShort(); Dict[code](reader); }
public virtual void Derializer(ReaderMsg reader) { }
public override void Derializer(ReaderMsg reader) { GameObjectName = reader.ReadString(); IsActive = reader.ReadBool(); }