You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
745 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Sog;
using ProtoCSStruct;
namespace GameDB
{
public class TransactionIdGen : Singleton<TransactionIdGen>
{
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();
}
}
}
}