kallefrombosnia / hlds-log

HLDS remote log parser in node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HLDS logger πŸ’£

GitHub issues npm npm version

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' } } 

Installation

HLDS log requires Node.js v6+ to run.

NPM module

$ npm install hlds-log

On the server side type

log on
logaddress 127.0.0.1 27050; [remote ip] [port]

And thats it.

Supported events

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.

Development

Want to contribute? Great! Also leave a ⭐ if you like this project.

Known bugs

See issues.

Todos

  • Write tests
  • Write more examples
  • Add TypeScript support

License

MIT

About

HLDS remote log parser in node.js

License:MIT License


Languages

Language:TypeScript 100.0%