gainFlag by tsid and hid