major updates from @hansputera to solve the issue which he found with details in #1
Changelogs
- Initializing tsconfig (TypeScript configuration), and package manager lock (I used pnpm)
- Rewrote entire
SampQuery
class methods
- SampQuery#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()
- Added enum
Opcodes
to identify the opcodes easily - Added PacketSent, and PacketReceive to handle out, and in-coming packets
- Use single keep-alive UDP connection to communicate with SA:MP server (it means, we can sent more queries in single connection)
- Restructure ServerInfo, SampQueryOptions, ServerProperty typings. And added ServerPlayers, and ServerPlayerCount interface
- Added unit tests using Ava
References
- https://sampwiki.blast.hk/wiki/Query_Mechanism - Packet buffer documentation
- https://www.open.mp/ - Data Reference