Make PlayerStorage.getAllCharacters() return a copy (#386)
* Clear continent drops when using !reloaddrops * Return a copy on PlayerStorage.getAllCharacters()
This commit is contained in:
@@ -84,7 +84,7 @@ public class PlayerStorage {
|
|||||||
public Collection<MapleCharacter> getAllCharacters() {
|
public Collection<MapleCharacter> getAllCharacters() {
|
||||||
rlock.lock();
|
rlock.lock();
|
||||||
try {
|
try {
|
||||||
return storage.values();
|
return new ArrayList<>(storage.values());
|
||||||
} finally {
|
} finally {
|
||||||
rlock.unlock();
|
rlock.unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ public class World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setExpRate(int exp) {
|
public void setExpRate(int exp) {
|
||||||
List<MapleCharacter> list = new LinkedList<>(getPlayerStorage().getAllCharacters());
|
Collection<MapleCharacter> list = getPlayerStorage().getAllCharacters();
|
||||||
|
|
||||||
for(MapleCharacter chr : list) {
|
for(MapleCharacter chr : list) {
|
||||||
if(!chr.isLoggedin()) continue;
|
if(!chr.isLoggedin()) continue;
|
||||||
@@ -311,7 +311,7 @@ public class World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setDropRate(int drop) {
|
public void setDropRate(int drop) {
|
||||||
List<MapleCharacter> list = new LinkedList<>(getPlayerStorage().getAllCharacters());
|
Collection<MapleCharacter> list = getPlayerStorage().getAllCharacters();
|
||||||
|
|
||||||
for(MapleCharacter chr : list) {
|
for(MapleCharacter chr : list) {
|
||||||
if(!chr.isLoggedin()) continue;
|
if(!chr.isLoggedin()) continue;
|
||||||
@@ -337,7 +337,7 @@ public class World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setMesoRate(int meso) {
|
public void setMesoRate(int meso) {
|
||||||
List<MapleCharacter> list = new LinkedList<>(getPlayerStorage().getAllCharacters());
|
Collection<MapleCharacter> list = getPlayerStorage().getAllCharacters();
|
||||||
|
|
||||||
for(MapleCharacter chr : list) {
|
for(MapleCharacter chr : list) {
|
||||||
if(!chr.isLoggedin()) continue;
|
if(!chr.isLoggedin()) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user