Skip to content

Commit 6373d5f

Browse files
ipkpjersiHubcapp
authored andcommitted
Possibly fixed long DB IDs
1 parent 80a1146 commit 6373d5f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

server/src/com/openrsc/server/database/GameDatabase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public GameDatabase(final Server server) {
244244
public abstract void querySaveLastRecoveryTryId(final int playerId, final int lastRecoveryTryId) throws GameDatabaseException;
245245

246246
//Item and Container operations
247-
public abstract int queryItemCreate(Item item) throws GameDatabaseException;
247+
public abstract long queryItemCreate(Item item) throws GameDatabaseException;
248248

249249
public abstract void purgeItem(Item item) throws GameDatabaseException;
250250

@@ -498,7 +498,7 @@ public Long[] getInUseItemIds() throws GameDatabaseException {
498498
return queryInUseItemIds();
499499
}
500500

501-
public int itemCreate(final Item item) throws GameDatabaseException {
501+
public long itemCreate(final Item item) throws GameDatabaseException {
502502
return queryItemCreate(item);
503503
}
504504

server/src/com/openrsc/server/database/impl/mysql/MySqlGameDatabase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,8 +1930,8 @@ public long queryMaxItemID() throws GameDatabaseException {
19301930
}
19311931

19321932
@Override
1933-
public int queryItemCreate(final Item item) throws GameDatabaseException {
1934-
int itemId = -1;
1933+
public long queryItemCreate(final Item item) throws GameDatabaseException {
1934+
long itemId = -1;
19351935
try (final PreparedStatement statement = getConnection().prepareStatement(getMySqlQueries().save_ItemCreate, 1)) {
19361936
statement.setInt(1, item.getCatalogId());
19371937
statement.setInt(2, item.getItemStatus().getAmount());
@@ -1942,7 +1942,7 @@ public int queryItemCreate(final Item item) throws GameDatabaseException {
19421942

19431943
try (final ResultSet rs = statement.getGeneratedKeys()) {
19441944
if (rs.next()) {
1945-
itemId = rs.getInt(1);
1945+
itemId = rs.getLong(1);
19461946
}
19471947
}
19481948
} catch (final SQLException ex) {

0 commit comments

Comments
 (0)