Skip to content

Commit f318c4e

Browse files
ipkpjersiHubcapp
authored andcommitted
Added Long item IDs
1 parent 67c4715 commit f318c4e

File tree

16 files changed

+84
-79
lines changed

16 files changed

+84
-79
lines changed

server/database/mysql/core.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ DROP TABLE IF EXISTS `bank`;
77
CREATE TABLE IF NOT EXISTS `bank`
88
(
99
`playerID` int(10) UNSIGNED NOT NULL,
10-
`itemID` int(10) UNSIGNED NOT NULL,
10+
`itemID` BIGINT NOT NULL,
1111
`slot` int(5) UNSIGNED NOT NULL DEFAULT 0,
1212
KEY (`playerID`)
1313
) ENGINE = InnoDB
@@ -206,7 +206,7 @@ DROP TABLE IF EXISTS `invitems`;
206206
CREATE TABLE IF NOT EXISTS `invitems`
207207
(
208208
`playerID` int(10) UNSIGNED NOT NULL,
209-
`itemID` int(10) UNSIGNED NOT NULL,
209+
`itemID` BIGINT NOT NULL,
210210
`slot` int(5) UNSIGNED NOT NULL,
211211
KEY (`playerID`)
212212
) ENGINE = InnoDB
@@ -549,7 +549,7 @@ CREATE TABLE IF NOT EXISTS `grounditems`
549549
DROP TABLE IF EXISTS `itemstatuses`;
550550
CREATE TABLE IF NOT EXISTS `itemstatuses`
551551
(
552-
`itemID` int(10) UNSIGNED NOT NULL,
552+
`itemID` BIGINT NOT NULL,
553553
`catalogID` int(10) UNSIGNED NOT NULL,
554554
`amount` int(10) UNSIGNED NOT NULL DEFAULT 1,
555555
`noted` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ALTER TABLE `_PREFIX_bank` MODIFY `itemID` BIGINT NOT NULL;
2+
3+
ALTER TABLE `_PREFIX_invitems` MODIFY `itemID` BIGINT NOT NULL;
4+
5+
ALTER TABLE `_PREFIX_itemstatuses` MODIFY `itemID` BIGINT NOT NULL;

server/database/mysql/retro.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DROP TABLE IF EXISTS `bank`;
88
CREATE TABLE IF NOT EXISTS `bank`
99
(
1010
`playerID` int(10) UNSIGNED NOT NULL,
11-
`itemID` int(10) UNSIGNED NOT NULL,
11+
`itemID` BIGINT NOT NULL,
1212
`slot` int(5) UNSIGNED NOT NULL DEFAULT 0,
1313
KEY (`playerID`)
1414
) ENGINE = InnoDB
@@ -98,7 +98,7 @@ CREATE TABLE IF NOT EXISTS `experience`
9898
KEY `playerID` (`playerID`)
9999
) ENGINE = InnoDB
100100
DEFAULT CHARSET = utf8;
101-
101+
102102
DROP TABLE IF EXISTS `maxstats`;
103103
CREATE TABLE IF NOT EXISTS `maxstats`
104104
(
@@ -126,7 +126,7 @@ CREATE TABLE IF NOT EXISTS `maxstats`
126126
KEY `playerID` (`playerID`)
127127
) ENGINE = InnoDB
128128
DEFAULT CHARSET = utf8;
129-
129+
130130
DROP TABLE IF EXISTS `capped_experience`;
131131
CREATE TABLE IF NOT EXISTS `capped_experience`
132132
(
@@ -215,7 +215,7 @@ DROP TABLE IF EXISTS `invitems`;
215215
CREATE TABLE IF NOT EXISTS `invitems`
216216
(
217217
`playerID` int(10) UNSIGNED NOT NULL,
218-
`itemID` int(10) UNSIGNED NOT NULL,
218+
`itemID` BIGINT NOT NULL,
219219
`slot` int(5) UNSIGNED NOT NULL,
220220
KEY (`playerID`)
221221
) ENGINE = InnoDB
@@ -307,7 +307,7 @@ CREATE TABLE IF NOT EXISTS `players`
307307
KEY `banned` (`banned`)
308308
) ENGINE = InnoDB
309309
DEFAULT CHARSET = utf8;
310-
310+
311311
ALTER TABLE `players`
312312
ALTER `cameraauto` SET DEFAULT 1;
313313

@@ -564,7 +564,7 @@ CREATE TABLE IF NOT EXISTS `grounditems`
564564
DROP TABLE IF EXISTS `itemstatuses`;
565565
CREATE TABLE IF NOT EXISTS `itemstatuses`
566566
(
567-
`itemID` int(10) UNSIGNED NOT NULL,
567+
`itemID` BIGINT NOT NULL,
568568
`catalogID` int(10) UNSIGNED NOT NULL,
569569
`amount` int(10) UNSIGNED NOT NULL DEFAULT 1,
570570
`noted` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,

server/src/com/openrsc/server/Server.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public class Server implements Runnable {
128128
private final Map<Integer, Integer> outgoingCountPerPacketOpcode = new HashMap<>();
129129
private int privateMessagesSent = 0;
130130

131-
private volatile int maxItemId;
131+
private volatile long maxItemId;
132132

133133
private final ListeningExecutorService sqlLoggingThreadPool;
134134
private final ListeningExecutorService sqlThreadPool;
@@ -1149,11 +1149,11 @@ public void incrementOutgoingPacketCount(final int packetOpcode) {
11491149
outgoingCountPerPacketOpcode.put(packetOpcode, outgoingCountPerPacketOpcode.get(packetOpcode) + 1);
11501150
}
11511151

1152-
public synchronized int getMaxItemID() {
1152+
public synchronized long getMaxItemID() {
11531153
return maxItemId;
11541154
}
11551155

1156-
public synchronized int incrementMaxItemID() {
1156+
public synchronized long incrementMaxItemID() {
11571157
return ++maxItemId;
11581158
}
11591159

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public GameDatabase(final Server server) {
4848
open.set(false);
4949
}
5050

51-
public abstract Set<Integer> getItemIDList();
51+
public abstract Set<Long> getItemIDList();
5252

5353
protected abstract void openInternal();
5454

@@ -82,7 +82,7 @@ public GameDatabase(final Server server) {
8282

8383
protected abstract FloorItem[] queryGroundItems() throws GameDatabaseException;
8484

85-
public abstract Integer[] queryInUseItemIds() throws GameDatabaseException;
85+
public abstract Long[] queryInUseItemIds() throws GameDatabaseException;
8686

8787
public abstract void queryAddDropLog(ItemDrop drop) throws GameDatabaseException;
8888

@@ -283,9 +283,9 @@ public GameDatabase(final Server server) {
283283

284284
public abstract int queryPlayerIdFromDiscordId(final long discordId) throws GameDatabaseException;
285285

286-
public abstract int queryMaxItemID() throws GameDatabaseException;
286+
public abstract long queryMaxItemID() throws GameDatabaseException;
287287

288-
public abstract int addItemToPlayer(Item item);
288+
public abstract long addItemToPlayer(Item item);
289289

290290
public abstract long queryCheckPlayerMute(final int playerId, final int muteType) throws GameDatabaseException;
291291

@@ -494,7 +494,7 @@ public FloorItem[] getGroundItems() throws GameDatabaseException {
494494
return queryGroundItems();
495495
}
496496

497-
public Integer[] getInUseItemIds() throws GameDatabaseException {
497+
public Long[] getInUseItemIds() throws GameDatabaseException {
498498
return queryInUseItemIds();
499499
}
500500

@@ -510,7 +510,7 @@ public void itemUpdate(final Item item) throws GameDatabaseException {
510510
queryItemUpdate(item);
511511
}
512512

513-
public int incrementMaxItemId(final Player player) {
513+
public long incrementMaxItemId(final Player player) {
514514
return player.getWorld().getServer().incrementMaxItemID();
515515
}
516516

@@ -1046,7 +1046,7 @@ public void querySavePlayerMaxSkills(Player player) throws GameDatabaseException
10461046
querySavePlayerMaxSkills(player.getDatabaseID(), skills);
10471047
}
10481048

1049-
public int getMaxItemID() {
1049+
public long getMaxItemID() {
10501050
try {
10511051
return queryMaxItemID();
10521052
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ public void populateWorld() {
173173
LOGGER.info("Loaded {}", box(countGI) + " grounditems.");
174174

175175
//Load the in-use ItemID's from the database
176-
Integer inUseItemIds[] = getWorld().getServer().getDatabase().getInUseItemIds();
177-
for (Integer itemId : inUseItemIds)
176+
Long inUseItemIds[] = getWorld().getServer().getDatabase().getInUseItemIds();
177+
for (Long itemId : inUseItemIds)
178178
getWorld().getServer().getDatabase().getItemIDList().add(itemId);
179179

180180
LOGGER.info("Loaded {}", box(getWorld().getServer().getDatabase().getItemIDList().size()) + " itemIDs.");

0 commit comments

Comments
 (0)