ItemStatus autoincrement value needs to be able to be handled by the database rather than the server
Basically the Server itself should not store a "next item status ID" variable. This should be queried from the DB (or the LoginServer if that's the DB Driver)
As is, the item status storage of the autoincrement value is going to make the login server more difficult because each server accessing the same DB can't allocate PK values without collision.
We'll need to convert this process to use temporary local values, like negative, until saving into the DB. Once the item status is saved we'll need to repair the local id to be the same as the real DB id.
Here's an algorithm in pseusocode.
if (id < 0) {
origId = id;
save();
id = getCorrectItemId();
ItemStatuses.remove(origId);
ItemStatuses.put(id);
findItemsAndUpdateStatusId(origId, id);
}
Max Item Count moved from Server to GameDatabase
Item status primary key should also be a Long rather than Int
Here is the code that originally added in the bugged ItemStatus code !2915 (merged)