t_express_system Serial
#1

Hello, Someone can explain how is calculated a_serial ?

On t_purchase is very simple ((lastInsertId * 10) + (AccountID % 10));

If im not wrong, i see here a 

CurrentTime     ?         ?  

1648411105 0101 6460

1648570643 0102 7405

Thank you.

#2

CurrentTime ServerNum ChannelNum SerialNumber (increases everytime by 1 till 9999 and then resets to 0000)

1648570643 01 02 7405

std:Confusedtring GetSerial()
{
static int serial = 0;
int nowtime = (int)time(0);

std:Confusedtring str = boost:Confusedtr(boost::format("%d%02d%02d%04d") % nowtime % gserver->m_serverno % gserver->m_subno % serial);
++serial;
if (serial > 9999)
{
serial = 0;
}

return str;
}

 

#3

Thank you very much



Forum Jump:


Users browsing this thread: 1 Guest(s)