using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Sog; using ProtoCSStruct; namespace GameDB { public class TransactionIdGen : Singleton { private long m_iSeq = 0; private object m_lock = new object(); public string GenIDForExchangeCoupon(long uid, int itemid) { lock(m_lock) { if(m_iSeq == 0) { m_iSeq = AppTime.GetNowSysMs(); m_iSeq = m_iSeq << 8; } m_iSeq++; return "coupon-" + uid.ToString() + "-" + itemid.ToString() + "-" + m_iSeq.ToString(); } } } }