Page 1 of 1

IdFactory overflowing!?

Posted: Wed Dec 02, 2009 6:18 pm
by Pere
I'm using a BitSet idfactory (defult one) in my server, and last days it began to get bugged.
It reachs numbers which overflow the Integer.MAX_VALUE (2.1kkk) and generates NEGATIVE ids. Then, the server gets completely bugged.
The idFactory is skipping huge counts of ids, it doesn't increment the last id when generates a new one..
What could be the cause of that? And most important, how could I fix this issue?

(NO, I didn't mod anything there)

Re: IdFactory overflowing!?

Posted: Wed Dec 02, 2009 10:07 pm
by Pere
On BitSetIDFactory.initialize() I found that line:
_freeIds = new BitSet(PrimeFinder.nextPrime(100000));

And I can see that if the server had more objects on the DB that this nextPrime, the _freeIds BitSet will get bugged.. Or am I wrong??

By the way, my server has near 5kk objects (chars, clans, items..) in the DB. What idfactory do you recommend to me? Or just by increasing this nextPrime it should be enough?

Re: IdFactory overflowing!?

Posted: Thu Dec 03, 2009 2:51 am
by denser
once in my scripts I used for unique id a linux tame-stamp, but still has problem of one-time items...
sometimes i get errors in my server about ids...try to figure out this