Skip to content

kallefrombosnia/hlds-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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