Skip to content

Commit a911894

Browse files
committed
convert item and location ID's to longs.
started work on using StructureModifiers to randomize structure locations.
1 parent 3af4e00 commit a911894

File tree

13 files changed

+42
-38
lines changed

13 files changed

+42
-38
lines changed

src/main/java/gg/archipelago/APClient/APClient.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ public void sendChat(String message) {
196196
}
197197
}
198198

199-
public boolean checkLocation(int locationID) {
199+
public boolean checkLocation(long locationID) {
200200
return locationManager.checkLocation(locationID);
201201
}
202202

203-
public void scoutLocations(ArrayList<Integer> locationIDs) {
203+
public void scoutLocations(ArrayList<Long> locationIDs) {
204204
apWebSocket.scoutLocation(locationIDs);
205205
}
206206

@@ -222,7 +222,11 @@ public void scoutLocations(ArrayList<Integer> locationIDs) {
222222

223223
public abstract void onLocationInfo(ArrayList<NetworkItem> item);
224224

225-
public abstract void onLocationChecked(int locationID);
225+
/***
226+
* called when the Archipelago server checks a location for you, such as during co-op or during a !collect
227+
* @param locationID
228+
*/
229+
public abstract void onLocationChecked(long locationID);
226230

227231
public DataPackage getDataPackage() {
228232
return dataPackage;

src/main/java/gg/archipelago/APClient/APWebSocket.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private void updateRoom(RoomUpdatePacket updateRoomPacket) {
188188
apClient.setHintPoints(updateRoomPacket.hintPoints);
189189
apClient.setAlias(apClient.getRoomInfo().getPlayer(apClient.getTeam(), apClient.getSlot()).alias);
190190

191-
for (int location : updateRoomPacket.checkedLocations) {
191+
for (long location : updateRoomPacket.checkedLocations) {
192192
if(apClient.getLocationManager().getCheckedLocations().contains(location))
193193
continue;
194194
apClient.onLocationChecked(location);
@@ -284,7 +284,7 @@ public boolean isAuthenticated() {
284284
return authenticated;
285285
}
286286

287-
public void scoutLocation(ArrayList<Integer> locationIDs) {
287+
public void scoutLocation(ArrayList<Long> locationIDs) {
288288
LocationScouts packet = new LocationScouts(locationIDs);
289289
sendPacket(packet);
290290
}

src/main/java/gg/archipelago/APClient/SaveData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public class SaveData {
1212

1313
@SerializedName("locations")
14-
public Set<Integer> checkedLocations = new HashSet<>();
14+
public Set<Long> checkedLocations = new HashSet<>();
1515

1616
@SerializedName("items")
1717
public ArrayList<NetworkItem> receivedItems = new ArrayList<>();

src/main/java/gg/archipelago/APClient/itemmanager/ItemManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ItemManager(APClient apClient) {
2222
this.apClient = apClient;
2323
}
2424

25-
public void receiveItems(ArrayList<NetworkItem> ids, int index) {
25+
public void receiveItems(ArrayList<NetworkItem> ids, long index) {
2626
if (index == 0) {
2727
receivedItems = new ArrayList<>();
2828
}
@@ -66,8 +66,8 @@ public ArrayList<NetworkItem> getReceivedItems() {
6666
return receivedItems;
6767
}
6868

69-
public ArrayList<Integer> getReceivedItemIDs() {
70-
ArrayList<Integer> ids = new ArrayList<>();
69+
public ArrayList<Long> getReceivedItemIDs() {
70+
ArrayList<Long> ids = new ArrayList<>();
7171
for (NetworkItem receivedItem : receivedItems) {
7272
ids.add(receivedItem.itemID);
7373
}

src/main/java/gg/archipelago/APClient/locationmanager/LocationManager.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public class LocationManager {
1515
APClient apClient;
1616
APWebSocket webSocket;
1717

18-
Set<Integer> checkedLocations = new HashSet<>();
18+
Set<Long> checkedLocations = new HashSet<>();
1919

2020
public LocationManager(APClient apClient) {
2121
this.apClient = apClient;
2222
}
2323

24-
public boolean checkLocation(int id) {
24+
public boolean checkLocation(long id) {
2525
checkedLocations.add(id);
2626
apClient.getDataManager().save();
2727
LocationChecks packet = new LocationChecks();
@@ -36,15 +36,15 @@ public boolean checkLocation(int id) {
3636
return false;
3737
}
3838

39-
public void writeFromSave(Set<Integer> checkedLocations) {
39+
public void writeFromSave(Set<Long> checkedLocations) {
4040
this.checkedLocations = checkedLocations;
4141

4242
}
4343

44-
public void sendIfChecked(Set<Integer> missingChecks) {
44+
public void sendIfChecked(Set<Long> missingChecks) {
4545
LocationChecks packet = new LocationChecks();
4646
packet.locations = new HashSet<>();
47-
for (int missingCheck : missingChecks) {
47+
for (Long missingCheck : missingChecks) {
4848
if(checkedLocations.contains(missingCheck)) {
4949
packet.locations.add(missingCheck);
5050
}
@@ -65,11 +65,11 @@ public void setAPWebSocket(APWebSocket apWebSocket) {
6565
this.webSocket = apWebSocket;
6666
}
6767

68-
public Set<Integer> getCheckedLocations() {
68+
public Set<Long> getCheckedLocations() {
6969
return checkedLocations;
7070
}
7171

72-
public void addCheckedLocations(Set<Integer> newLocations) {
72+
public void addCheckedLocations(Set<Long> newLocations) {
7373
this.checkedLocations.addAll(newLocations);
7474
apClient.getDataManager().save();
7575
}

src/main/java/gg/archipelago/APClient/network/ConnectedPacket.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class ConnectedPacket extends APPacket {
1515
@SerializedName("players")
1616
public ArrayList<NetworkPlayer> players;
1717
@SerializedName("missing_locations")
18-
public HashSet<Integer> missingLocations = new HashSet<>();
18+
public HashSet<Long> missingLocations = new HashSet<>();
1919
@SerializedName("checked_locations")
20-
public HashSet<Integer> checkedLocations = new HashSet<>();
20+
public HashSet<Long> checkedLocations = new HashSet<>();
2121
}

src/main/java/gg/archipelago/APClient/network/LocationChecks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
public class LocationChecks extends APPacket {
1010

1111
@SerializedName("locations")
12-
public Set<Integer> locations = new HashSet<>();
12+
public Set<Long> locations = new HashSet<>();
1313

1414
public LocationChecks() {
1515
this.cmd = APPacketType.LocationChecks;

src/main/java/gg/archipelago/APClient/network/LocationScouts.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
public class LocationScouts extends APPacket {
77

8-
public ArrayList<Integer> locations = new ArrayList<>();
8+
public ArrayList<Long> locations = new ArrayList<>();
99

10-
public LocationScouts(ArrayList<Integer> locations) {
10+
public LocationScouts(ArrayList<Long> locations) {
1111
this.cmd = APPacketType.LocationScouts;
1212
this.locations = locations;
1313
}

src/main/java/gg/archipelago/APClient/network/RecivedItems.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
public class RecivedItems extends APPacket {
99

1010
@SerializedName("index")
11-
public int index;
11+
public long index;
1212

1313
@SerializedName("items")
1414
public ArrayList<NetworkItem> items;

src/main/java/gg/archipelago/APClient/network/RoomUpdatePacket.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public class RoomUpdatePacket extends APPacket {
3434
public int locationCheckPoints;
3535

3636
@SerializedName("checked_locations")
37-
public ArrayList<Integer> checkedLocations = new ArrayList<>();
37+
public ArrayList<Long> checkedLocations = new ArrayList<>();
3838

3939
@SerializedName("missing_locations")
40-
public ArrayList<Integer> missingLocations = new ArrayList<>();
40+
public ArrayList<Long> missingLocations = new ArrayList<>();
4141

4242
@SerializedName("players")
4343
public ArrayList<NetworkPlayer> networkPlayers = new ArrayList<>();

0 commit comments

Comments
 (0)