Reduced chance of protocol collisions between gamespy3 and minecraftbedrock (2.0.27)

This commit is contained in:
Michael Morrison 2021-02-12 11:36:51 -06:00
parent 883700d7dd
commit 052736edd7
6 changed files with 41 additions and 21 deletions

View file

@ -148,9 +148,15 @@ class Gamespy3 extends Core {
return await this.udpSend(b,(buffer) => {
const reader = this.reader(buffer);
const iType = reader.uint(1);
if(iType !== type) return;
if(iType !== type) {
this.logger.debug('Skipping packet, type mismatch');
return;
}
const iSessionId = reader.uint(4);
if(iSessionId !== this.sessionId) return;
if(iSessionId !== this.sessionId) {
this.logger.debug('Skipping packet, session id mismatch');
return;
}
if(!assemble) {
return reader.rest();