HLDS log is nodejs package for advanced usage of remote HLDS server logging.
HLDS log provides you:
- safe text parsing from remote host
- usage of server native events like bomb plants, defuse etc
- event based system
Example of server event invoked by client chat:
log L 05/31/2020 - 11:08:13: "kalle<1><STEAM_ID_LAN><CT>" say "hello"
{ event: 'say',
player:
{ name: 'kalle',
id: '1',
steamid: 'STEAM_ID_LAN',
side: 'CT',
message: 'hello' },
time: { ss: '13', mm: '08', hh: '11' },
date: { dd: '31', mm: '05', yy: '2020' } }
HLDS log requires Node.js v6+ to run.
$ npm install hlds-log
On the server side type
log on
logaddress 127.0.0.1 27050; [remote ip] [port]
And thats it.
Event | Supported | Note |
---|---|---|
hlds_connect | β | Event fires on first log message from remote server, can be used with Event.once() |
raw | β | Prints raw server message (default false) |
kill | β | Event with information about killer and victim |
say | β | Chat event with sender message and information |
say_team | β | Team chat event with =|= |
enter | β | Player connected to server |
connect | β | Player is fully connected to the server |
join | β | Player is switching team sides |
leave | β | Player left the server |
round_end | β | Indicates that round is over with specific reason ex. mission fail time, bomb explode, hostages rescued, other team is dead... |
end_score | β | Last message before level is changed, contains team scores. |
server_action | β | Actions triggered by server which affects every player ex. bomb explode, bomb defused etc |
player_action | β | Action by player ex bomb pickup, drop, start defusing, stop defusing etc |
map_change | β | Info who changed map and which map is next |
map_start | β | Info when map is fully loaded |
suicide | β | Player makes suicide (some plugins dont respect this type, but it will be implemented) |
shutdown | β | Signal server shutdown |
log_off | β | Server stopped logging |
kick | β | Kick from the server |
cvarsDone | β | All map cvars on map start (emit after specific time because game server sends randomly cvar values). Also cvars are always availble in Logger.cvarList property to get values. |
Want to contribute? Great! Also leave a β if you like this project.
See issues.
- Write tests
- Write more examples
- Add TypeScript support
MIT