forked from CringeStudios/gamja
store: protect against dup buffers
This commit is contained in:
parent
c8fda8ed53
commit
5db0105dbd
6
store.js
6
store.js
@ -130,12 +130,18 @@ export class Buffer {
|
||||
}
|
||||
|
||||
list(server) {
|
||||
// Some gamja versions would store the same buffer multiple times
|
||||
let names = new Set();
|
||||
let buffers = [];
|
||||
for (const buf of this.m.values()) {
|
||||
if (buf.server.bouncerNetwork !== server.bouncerNetwork) {
|
||||
continue;
|
||||
}
|
||||
if (names.has(buf.name)) {
|
||||
continue;
|
||||
}
|
||||
buffers.push(buf);
|
||||
names.add(buf.name);
|
||||
}
|
||||
return buffers;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user