bukkit-stats
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -19,6 +19,6 @@ // module dependencies | ||
// ensure that the object is instanciated with the new operator | ||
if(!(this instanceof Stats)) return new Stats(host, port); | ||
if(!(this instanceof Stats)) return new Stats(host, port, cb); | ||
// parse the arguments | ||
if(~host.indexOf(":")) { | ||
if(typeof host == "string" && ~host.indexOf(":")) { | ||
host = host.split(":"); | ||
@@ -28,6 +28,7 @@ this.config = { host: host[0], port: host[1] }; | ||
this.config = { | ||
host: host || CONNECTION.defaultHost, | ||
port: parseInt(port) || CONNECTION.defaultPort | ||
host: typeof host == "string" ? host : CONNECTION.defaultHost, | ||
port: typeof port == "number" ? port : CONNECTION.defaultPort | ||
}; | ||
} | ||
if(typeof host == "function") cb = host; | ||
@@ -113,3 +114,7 @@ else if(typeof port == "function") cb = port; | ||
return { motd: res[0], onlinePlayers: res[1], maxPlayers: res[2] }; | ||
return { | ||
motd: res[0], | ||
onlinePlayers: parseInt(res[1]), | ||
maxPlayers: parseInt(res[2]) | ||
}; | ||
}; | ||
@@ -116,0 +121,0 @@ |
{ | ||
"name": "bukkit-stats", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Gets a server's stats displayed in the client serverlist", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
6435
192
1