Giter Site home page Giter Site logo

emilianomaccaferri / minecraft-query Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 5.0 52 KB

A Node.js implementation of Minecraft's query protocol

Home Page: https://www.npmjs.com/package/minecraft-query

License: GNU General Public License v3.0

TypeScript 100.00%

minecraft-query's Introduction

Hello there

I'm Emiliano Maccaferri, a 24y/o freelance fullstack web developer and DevOps engineer from Italy.
I mainly focus on backend but I'm constantly striving to get the best UIs I can when working with clients.

When not working or wrapping my head around projects I often travel and/or buy unnecessarily expensive clothes.
I occasionally make music
Hit me up on Telegram (@emilianomaccaferri) if you need anything!

See you around!

minecraft-query's People

Contributors

airplanegobrr avatar emilianomaccaferri avatar ferrybig avatar guppy0130 avatar vriskaserket51 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

minecraft-query's Issues

[ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running

Hello, I have an error after 2nd request:

(node:33404) UnhandledPromiseRejectionWarning: Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
    at healthCheck (dgram.js:831:11)
    at Socket.send (dgram.js:609:3)
    at ...\Query.js:85:29
(node:33404) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:33404) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I'm using Node v12.11.1 and Express 4.16.1

Error while query

(node:15348) UnhandledPromiseRejectionWarning: Error: Challenge token generation timeout: 172.65.216.245
at Timeout._onTimeout (c:\Users\rszur\node_modules\minecraft-query\Query.js:149:28)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)

It is the hypixel ip, also doesn't work with my private server

Can't resolve 'crypto'/'dgram' laravel/vuejs

Hi,

I'm trying to learn how to build a website. For that, i choosed laravel 9 /vuejs 3.
I would like to use minecraft-query to query information from minecraft server.

PS F:\Web\new\stri-site> npm run dev) [DEP0164] DeprecationWarning: Implicit coercion to integer for exit code is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
> dev
> npm run development


> development
> mix && vite


โœ– Mix
  Compiled with some errors in 1.70s

ERROR in ./node_modules/minecraft-query/Query.js 1:12-28
Module not found: Error: Can't resolve 'dgram' in 'F:\Web\new\stri-site\node_modules\minecraft-query'

ERROR in ./node_modules/minecraft-query/Query.js 3:15-32
Module not found: Error: Can't resolve 'crypto' in 'F:\Web\new\stri-site\node_modules\minecraft-query'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
        - install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "crypto": false }

webpack compiled with 2 errors

Here is my package.json

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix && vite",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production && vite build",
        "build": "vite build"
    },
    "devDependencies": {
        "@popperjs/core": "^2.10.2",
        "@tailwindcss/forms": "^0.5.2",
        "@vitejs/plugin-vue": "^3.0.1",
        "alpinejs": "^3.4.2",
        "autoprefixer": "^10.4.2",
        "axios": "^0.25",
        "bootstrap": "^5.2.1",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.4.6",
        "sass": "^1.32.11",
        "tailwindcss": "^3.1.0",
        "vue": "^3.2.37",
        "vue-loader": "^16.8.3"
    },
    "dependencies": {
        "crypto-browserify": "^3.12.0",
        "laravel-vite-plugin": "^0.7.1",
        "minecraft-query": "^1.0.13",
        "minerender": "^1.4.6",
        "node-polyfill-webpack-plugin": "^2.0.1",
        "vue": "^3.2.45",
        "webpack": "^5.75.0"
    }
}

My issue is that i can't compile mix because of this polyfill.
I've already checked google but find something with the same configuration is really hard. Everyone talk about a webpack.config.js,
I find one in my node modules : /node_modules/laravel-mix/setup/webpack.config.js ?

const { assertSupportedNodeVersion } = require('../src/Engine');

module.exports = async () => {
    // @ts-ignore
    process.noDeprecation = true;

    assertSupportedNodeVersion();
    // write module export for webpack env to resolve fallback

    const mix = require('../src/Mix').primary;

    require(mix.paths.mix());

    await mix.installDependencies();
    await mix.init();

    return mix.build();
};

Where should i write this 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }' ?

If you need more information, don't hesitate !
Thank's in advance !

Separate comma players.

Is there any way to separate the players by a space after the comma, when placed in an embed they all appear together.

image

Getting occasional errors with uncatchable exceptions

\node_modules\minecraft-query\Query.js:31
                var players = final[1].split("\0").filter((item) => {
                                       ^

TypeError: Cannot read properties of undefined (reading 'split')
    at Socket.<anonymous> (C:\Users\Kevin\Development\minecraft-discord-bot\node_modules\minecraft-query\Query.js:31:40)
    at Socket.emit (node:events:390:28)
    at UDP.onMessage [as onmessage] (node:dgram:939:8)

This is likely the same issue as #9

I've added an additional try/catch block and extra logging around line 31, will update with more information if I get the exception again.

Timeout, other libraries work though

Error: Challenge token generation timeout: 54.36.175.82 at Timeout._onTimeout (/Users/balint/Munka/Program/vikcraft_status/node_modules/minecraft-query/Query.js:149:28) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

Error being thrown during server startup

I'm getting errors while the server is starting, and despite wrapping the call to .fullStat() in a try/catch block, I am not catching the exception.

\node_modules\minecraft-query\Query.js:31
                var players = final[1].split("\0").filter((item) => {
                                       ^

TypeError: Cannot read properties of undefined (reading 'split')
    at Socket.<anonymous> (C:\Users\Kevin\Development\minecraft-discord-bot\node_modules\minecraft-query\Query.js:31:40)
    at Socket.emit (node:events:390:28)
    at UDP.onMessage [as onmessage] (node:dgram:939:8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.