Skip to content

Commit

Permalink
Fixed typo in readme, changed phrasing
Browse files Browse the repository at this point in the history
  • Loading branch information
woodendoors7 committed Dec 8, 2023
1 parent 5ada0ea commit dba0a6e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div align="center">
<img src="https://papers.floppa.hair/mcstatuspinger/mcblock.png" alt="big MinecraftStatusPinger logo" width="600" border="0px"/>
</div>
<h3><code style="color: yellowgreen">A modern, small, performant, zero dependency TypeScript library made for fast pinging and getting status of Minecraft servers</code></h3>
<h3><code style="color: yellowgreen">A modern, small, fast, performant, zero dependency TypeScript library made for pinging and getting status of Minecraft servers.</code></h3>

<hr>

Expand Down Expand Up @@ -66,47 +66,47 @@ console.log(result);
* <b>`host:`</b> string
> Either an IP, or a hostname of the server. (alias: hostname)
* <b>`port?:`</b> number <i> `default: 25565`</i>
> Port of the server. Any port other than 25565 disables SRV lookup.
> Port of the server. SRV lookup is disabled when using ports other than 25565.
* <b>`timeout?:`</b> number <i>`default: 10000`</i>
> Timeout of when an error is thrown after no response. Default is 10 seconds.
> How long until an error is thrown if the transaction still hasn't finished. Default is 10 seconds.
* <b>`ping?:`</b> boolean <i>`default: true`</i>
> Whether to send a payload at the end to get the latency of the server. If false, the `latency` field will be null.
> Whether to send a payload at the end to measure the server latency. If false, the `latency` field will be null.
* <b>`protocolVersion?:`</b> number <i>`default: 764`</i>
> Protocol version to send to the server to simulate different Minecraft client versions. Here, you can see the [Protocol Version Numbers](https://wiki.vg/Protocol_version_numbers). The current default protocol version is for 1.20.2 (764) and will be irregularly updated to newer versions.
* <b>`throwOnParseError?:`</b> boolean <i>`default: true`</i>
> Whether to throw an error if the status packet fails to parse the status field. The `statusRaw` field is always included.
> Whether to throw an error if the status packet fails to parse the status field. The `statusRaw` field is always included.
* <b>`disableSrv?:`</b> boolean <i>`default: false`</i>
> Whether to force skip SRV lookups. Useful when only pinging IP addresses and not hostnames.
> Whether to force skip SRV lookups. Useful when only pinging IP addresses and not hostnames (domains).
* <b>`disableJSONParse?:`</b> boolean <i>`default: false`</i>
> Whether to skip JSON parsing. Useful if you only want the raw text response. If true, the `status` field to be undefined.
> Whether to skip JSON parsing. Useful if you only want a raw plaintext response. If true, the `status` field will be undefined.
* ServerStatus
* <b>`latency?:`</b> number
> The time it takes to send and receive a payload from the server. Will be null if `ping` option is false.
> The time it takes to receive back a response after sending a small payload to a server, in milliseconds. Will be null if the `ping` option is false.
* <b>`status?:`</b> DynamicObject
> Parsed status response from the sever. Will be null if the status fails to parse, or if disableJSONParse is true. <a href="https://pinger.floppa.hair/responses/">Example of a valid Status Response.</a>
> Parsed status response from the server. Will be null if the status fails to parse, or if disableJSONParse is true. <a href="https://pinger.floppa.hair/responses/">Example of a valid Status Response.</a>
* <b>`statusRaw:`</b> string
> Raw status response in the form of a string. Useful when `status` fails to parse.
> Plaintext status response in the form of JSON. Useful when `status` fails to parse.
* <b id="setDnsOptions">.setDnsServers(): `((serverArray: string[]) => Promise<boolean>)`</b>
> It wraps the `dns.setServers` function, ueful when you want to look up the SRV records with different DNS servers. <br>
The first IP in the array is always the main DNS server, others are backup servers. <br><br>
Pass in a parameter which is an array of hostnames or IP addresses of DNS servers. It will either return true, or throw an error.
> It wraps the `dns.setServers` function, useful for looking up SRV records through different DNS servers. <br>
The first IP in the array will always be used first, others will be tried if the first one is unreachable. <br><br>
Accepts an array of hostnames or IP addresses of DNS servers. It will either return true, or throw an error.


Usage:
```js
// For example:
mc.setDnsServers(["9.9.9.9", "1.1.1.1", "8.8.8.8"])
// (Quad9, Cloudflare, Google)
// Cloudflare is the fastest for DNS queries in most of the world.
// Cloudflare is usually the fastest for DNS queries.
```
If you never changed the DNS settings of your computer, the default DNS server will be your ISP's.<br>
<code style="color : darkorange">❗ I recommend changing your default DNS servers if you're doing thousands of lookups, for better performance.</code><br>
<code style="color : darkorange">❗ I recommend changing your default DNS servers if you're doing thousands of lookups, such as for mass scanning.</code><br>

### Changelog

**[View Changelog](https://pinger.floppa.hair/changelog/)**,
Latest version: <i><code>v1.1.4</code></i>
Latest version: <b><i><code>v1.1.4</code></i></b>



Expand Down

0 comments on commit dba0a6e

Please sign in to comment.