dennisbruner / node-minecraft-pinger Goto Github PK
View Code? Open in Web Editor NEWA promise based minecraft pinger in Node.js
Home Page: https://www.npmjs.com/package/minecraft-pinger
License: MIT License
A promise based minecraft pinger in Node.js
Home Page: https://www.npmjs.com/package/minecraft-pinger
License: MIT License
title
Hi,
Im not 100% sure what is causing this but I am running into the following error:
TypeError: Cannot read property 'name' of undefined
at QueryReqWrap.callback (/Users/REDACTED/Desktop/test-project/node_modules/minecraft-pinger/lib/index.js:107:31)
at QueryReqWrap.onresolve [as oncomplete] (dns.js:205:10)
[ERROR] 12:47:52 TypeError: Cannot read property 'name' of undefined
I will post more info when I've worked out why this is being caused (seems to be related to line 107 in index.js).
EDIT: I've just seen that the open PR against this will fix it, however assume this is no longer maintained because its not been accepted.
Thanks,
Hi there,
Currently the Packet timeout is hard coded to 10 seconds. 10 seconds is quite a long time to wait, and is even more considerable when running this against thousands of servers (on a server list website for example), eg 1% of servers being offline for 10,000 server pings is a total of 16 minutes delay.
This is quite considerable for my use case because I am storing the player counts every hour in a database. I loop over all servers every hour, and the result is that server number 9,997 is seeing a 15 minute delay on its hourly player count - server 1 has a 3pm player count where as server 9997 has a 3:15pm player count.
Would it be possible to add in a variable for this so that the Packet timeout can be lowered?
Hi @dennisbruner ,
I have been testing since the last bump (thanks for doing that) and have noticed the following issue while testing:
SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at .../node_modules/minecraft-pinger/lib/packet.js:136:26
at new Promise (<anonymous>)
at decodeHandshakeResponse (.../node_modules/minecraft-pinger/lib/packet.js:127:10)
at .../node_modules/minecraft-pinger/lib/packet.js:73:18
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I am unsure why this is happening, but is specifically with the server ip HexicPrison.net
port 25565. I have also pinged this server with mcsrvstat and cant see anything unusual: https://api.mcsrvstat.us/2/HexicPrison.net.
Thanks
When ever you ping a server, you get multiple UnhandledPromiseRejectionWarning occurring, before the data retrieved.
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: cb is not a function
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.