Make sure your environment has pnpm package manager installed
Install required devDependencies using pnpm i OR pnpm install
Compile using pnpm run build or simply type tsc
Create file .npmignore with contents:
node_modules/
src/
tests/
tsconfig.json
ava.config.js
pnpm-lock.yaml
5. Now, you are ready to publish it on npmjs or another registry
## References
1. https://sampwiki.blast.hk/wiki/Query_Mechanism - Packet buffer documentation
6. https://www.open.mp/ - Data Reference
Changelogs
[x] Initializing tsconfig (TypeScript configuration), and package manager lock (I used pnpm)
[x] Rewrote entire
SampQuery
class methodsSampQuery#getServerProperties()
SampQuery#getServerOnline()
SampQuery#getServerMaxPlayers()
SampQuery#getServerName()
SampQuery#getServerGamemodeName()
SampQuery#getServerLanguage()
SampQuery#getServerVersion()
SampQuery#getServerWeather()
SampQuery#getServerWebSite()
SampQuery#getServerWorldTime()
SampQuery#getServerPing()
SampQuery#getServerPlayersDetailed()
SampQuery#getServerPlayers()
SampQuery#getServerPlayerCount()
SampQuery#getServerInfo()
SampQuery#getServerRules()
SampQuery#getPseudoNumbers()
[x] Added enum
Opcodes
to identify the opcodes easily[x] Added PacketSent, and PacketReceive to handle out, and in-coming packets
[x] Use single keep-alive UDP connection to communicate with SA:MP server (it means, we can sent more queries in single connection)
[x] Restructure ServerInfo, SampQueryOptions, ServerProperty typings. And added ServerPlayers, and ServerPlayerCount interface
[x] Added unit tests using Ava
Building / Compiling
pnpm
package manager installedpnpm i
ORpnpm install
pnpm run build
or simply typetsc
.npmignore
with contents:tsconfig.json ava.config.js pnpm-lock.yaml