mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
Added support for cs2d (2.0.5)
This commit is contained in:
parent
04bd6d9514
commit
5aaff8e1e0
6 changed files with 90 additions and 4 deletions
|
|
@ -278,7 +278,7 @@ class Core extends EventEmitter {
|
|||
|
||||
/**
|
||||
* @param {Buffer|string} buffer
|
||||
* @param {function(Buffer):T} onPacket
|
||||
* @param {function(Buffer):T=} onPacket
|
||||
* @param {(function():T)=} onTimeout
|
||||
* @returns Promise<T>
|
||||
* @template T
|
||||
|
|
@ -297,6 +297,10 @@ class Core extends EventEmitter {
|
|||
const socket = this.udpSocket;
|
||||
socket.send(buffer, address, port);
|
||||
|
||||
if (!onPacket && !onTimeout) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let socketCallback;
|
||||
let timeout;
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue