mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 15:17:36 +00:00
Fix issues with corrupt strings in unreal2 protocol
This commit is contained in:
parent
f952652251
commit
2915d962a8
5 changed files with 57 additions and 16 deletions
|
|
@ -177,6 +177,24 @@ module.exports = Class.extend(EventEmitter,{
|
|||
}
|
||||
return false;
|
||||
},
|
||||
debugBuffer: function(buffer) {
|
||||
var out = '';
|
||||
var out2 = '';
|
||||
for(var i = 0; i < buffer.length; i++) {
|
||||
var sliced = buffer.slice(i,i+1);
|
||||
out += sliced.toString('hex')+' ';
|
||||
var chr = sliced.toString();
|
||||
if(chr < ' ' || chr > '~') chr = ' ';
|
||||
out2 += chr+' ';
|
||||
if(out.length > 60) {
|
||||
console.log(out);
|
||||
console.log(out2);
|
||||
out = out2 = '';
|
||||
}
|
||||
}
|
||||
console.log(out);
|
||||
console.log(out2);
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue