Minecraft Server List Ping library written in Go

minequery

Minecraft Server List Ping library written in Go.

Features

  • Modern Minecraft support (1.7 and newer)
  • Legacy protocol support (1.6 and older)
  • Older versions support (Beta 1.8 to Release 1.3)

Usage

package main

import (
	"fmt"

	"github.com/altea-minecraft/minequery/ping"
)

func main() {
	res, err := ping.Ping("altea.land", 25565)
	if err != nil {
		panic(err)
	}

	fmt.Println(res.Description.Text)
}
Comments
  • panic: runtime error: slice bounds out of range [-1:]

    panic: runtime error: slice bounds out of range [-1:]

    When running pings in coroutines after a few "threads" finish i get this error/panic:

    panic: runtime error: slice bounds out of range [-3:]
    
    goroutine 183 [running]:
    github.com/dreamscached/minequery/v2.(*Pinger).ping17ReadStatusResponsePacketPayload(0xc0000564a0?, {0x2673ea66f98, 0xc0065da1c0})
            C:/Users/Sandbox/go/pkg/mod/github.com/dreamscached/minequery/[email protected]/ping_17.go:1841 +0x525
    

    This is my code:

    var wg sync.WaitGroup
    var pingout []minequery.Status17
    for i, data := range payload {
      wg.Add(1)
    
      go func(data Data, i int) {
        defer wg.Done()
    
        res, err := minequery.Ping17(data.IP, data.Ports[0].Port)
        if err != nil { fmt.Printf("[%d -> %s] (Failed) %s\n", i, data.IP, err); return }
        pingout = append(pingout, *res)
      }(data, i)
    }
    wg.Wait()
    
  • Velocity does not ping correctly

    Velocity does not ping correctly

    Hello, i run a velocity 3.1 server.

    When i try to use the example in the README, i get:

    panic: ping error: response error: expected packet 0x0 but got 0x1 instead

  • Implement session store for querying

    Implement session store for querying

    Current implementation of Query creates a new session for each request; ideally this has to be done with session pool of some sort per documentation at wiki.vg

  • Spigot 1.4 servers reply with 1.6 ping response format

    Spigot 1.4 servers reply with 1.6 ping response format

    Spigot 1.4 servers (unlike CraftBukkit and Vanilla) reply with 1.6 response, which include 5 and not 3 fields, and uses \0\0 separator instead of §.

    Documentation on wiki.vg, however, doesn't mention it; in addition to that, Minecraft client 1.4.7 easily handles both responses, both from Spigot and Vanilla/Bukkit implementations of server.

  • sendServerListPing does not use timeout

    sendServerListPing does not use timeout

    So if server doesn't respond, we just staying locked.

    See https://github.com/alteamc/minequery/blob/0902c57917dc366ee7e8fe4750c73942234f3b83/ping/ping.go#L16

    // PingWithTimeout performs a Server List Ping interaction with modern (1.7 and newer) Minecraft server running on the specified host and the specified port with
    // read and write timeout.
    func PingWithTimeout(host string, port uint16, timeout time.Duration) (*Response, error) {
    	// ...
    	res, err := sendServerListPing(conn, host, port)
    	if err != nil {
    		return nil, fmt.Errorf("ping error: %w", err)
    	}
            // ...
    }
    
  • Fix #15

    Fix #15

    Although it is stated on the Server List Ping wiki page that one can ignore the description length, ignoring it and waiting for the connection to close results in a delay due to internal call to io.ReadAll function. This PR resolves this issue.

  • Use custom JSON unmarshaller

    Use custom JSON unmarshaller

    Some projects might require usage of custom JSON unmarshaller that is more efficient than encoding/json from stdlib. For this purpose it's necessary that we add support for this feature.

  • Create error types

    Create error types

    Currently library API returns new error instances on each error; in order to more flexibly respond to errors it would be nice to have actual error instances comparable with errors.Is

Implementation of Minecraft protocols : ping, query and icon.
Implementation of Minecraft protocols : ping, query and icon.

mcutils - Implementation of Minecraft protocols in Go Informations General All protocols are implemented in Go, without any external dependency. All p

Dec 19, 2022
Web app utility to get server list data from Minecraft servers.

Ping Web app utility to get server list data from Minecraft servers. Avalible at https://ping.turtley12.dev/app, Running yourself Before compiling and

Dec 21, 2021
[FORK] ICMP Ping library for Go

forked from go-ping/ping go get -u github.com/gandaldf/ping go-ping A simple but powerful ICMP echo (ping) library for Go, inspired by go-fastping. He

Oct 21, 2021
Ping library for Golang with multi-host support

pingo Fast and lightweight ping library for Golang with multi-host support. Features ICMP sockets: UDP port 0 means "let the kernel pick a free number

Nov 9, 2022
Connect a Minecraft Forge server to Matterbridge

Mattercraft Mattercraft is a Minecraft Forge mod that relays chat messages between a Minecraft server and Matterbridge. It uses Matterbridge's HTTP AP

Jul 28, 2022
Matterbridge link for Minecraft Server chat.

Matterbridge link for Minecraft Server chat. Simple bridge between Minecraft, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, Rocket.Chat, Hipchat(via xmpp), Matrix and Steam.

Mar 28, 2022
Server-tool - A simple tool to run and create Minecraft servers

Server Tool A simple tool to run and maintain different Minecraft servers. This

Dec 15, 2022
Minekube Connect allows you to connect any Minecraft server

Minekube Connect allows you to connect any Minecraft server, whether online mode, public, behind your protected home network or anywhere else in the world, with our highly available, performant and low latency edge proxies network nearest to you.

Dec 27, 2022
ULE - Rust-based minecraft server core

ULE - Minecraft's server core written in Rust This's server core fully written i

Jan 6, 2023
ping 和 http get 请求探测 适配 nightingale

n9e-probe 功能 ping 和 http get 请求探测 适配 nightingale 指标 ping metric 说明 ping.latency ping 请求的延迟,单位是毫秒。-1 表示 ping 不通 tag 说明 ip 探测的目标 ip region 如果配置了,则插入 reg

Sep 27, 2022
🚥 Yet another pinger: A high-performance ICMP ping implementation build on top of BPF technology.

yap Yet-Another-Pinger: A high-performance ICMP ping implementation build on top of BPF technology. yap uses the gopacket library to receive and handl

Nov 9, 2022
DNS Ping: to check packet loss and latency issues with DNS servers

DNSping DNS Ping checks packet loss and latency issues with DNS servers Installation If you have golang, easiest install is go get -u fortio.org/dnspi

Nov 18, 2022
Prometheus exporter for ping metrics such as RTT, packet loss, and jitter to any number of hosts.

ping_exporter Command ping_exporter provides a Prometheus exporter for ping metrics such as RTT, packet loss, and jitter to any number of hosts. Usage

Sep 24, 2022
A little ping pong service that implements rate limiting with golang

Fred the Guardian Introduction Writing a little ping pong service that implements rate limiting with the programming language golang. Requirements Web

Jan 2, 2022
PinGo is a standalone and feature-rich tool for common IP-based reachability checking tasks. Ping or Trace and Observe in real-time the statistics.

pingo As a network champion from designing and implementing to troubleshooting large scale networks - I know that is usually not easy for administrato

Sep 26, 2022
HCio is a straightforward way to ping Healthchecks.io checks directly from a Go application

HCio HCio is a straightforward way to ping Healthchecks.io checks directly from a Go application. Getting Started Create a simple Check: check := hcio

Nov 20, 2022
Vmessping - A ping prober for vmess:// links in common seen formats

VMessPing A ping prober for vmess:// links in common seen formats. vmessping sup

Jan 9, 2022
QUIC-PING: A UDP client for sending QUIC PINGs.

QUIC-PING A UDP client for sending "QUIC PING"s. What is a QUIC PING? A QUIC Initial packet with random payload and the version 0xbabababa to force Ve

Dec 14, 2022
Minecraft noise searching tool written in go

Commotion A minecraft world generation imitation library written in golang. TODO

Aug 7, 2022