You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @andrewda
Been a while since I've used this library, but getting back into it it seems that hltv has upgraded its websocket endpoint and a few other bits and pieces during the connecting. I've played around to see how it works now and pretty sure I've got it - but will need some help integrating that back into this library
In this I was using the websocat command line client to test and connect
Endpoint - scorebot-secure.hltv.org
On connection you will get some information back such as an sid
Echo to the server 61:42["readyForMatch","{\"token\":\"\",\"listId\":\"2328874\"}"]
You should immediately start getting live matchin information
every so ofter you should echo back a "keep alive" of 2, the server will respond with 3. if you do not receive a response generally means the connection has closed
Below is a print of it in action, and a look at the data structure of the json feed that it returs
You also get some useful things during the round such as 42["log","{\"log\":[{\"MatchStarted\":{\"map\":\"de_nuke\"}}]}"] 42["log","{\"log\":[{\"MatchStarted\":{\"map\":\"de_nuke\"}}]}"]
You can also submit the string 61:42["readyForScores","{\"token\":\"\",\"listIds\":[2328874]}"] to the server to get a nice summary of the match 42["score",{"mapScores":{"1":{"firstHalf":{"ctTeamDbId":5158,"ctScore":8,"tTeamDbId":9379,"tScore":7},"secondHalf":{"ctTeamDbId":9379,"ctScore":8,"tTeamDbId":5158,"tScore":6},"overtime":{"ctTeamDbId":9379,"ctScore":0,"tTeamDbId":5158,"tScore":0},"mapOrdinal":1,"scores":{"9379":15,"5158":14},"currentCtId":9379,"currentTId":5158,"map":"de_nuke","mapOver":false}},"listId":2328874,"wins":{},"liveLog":{"":true,"IrregularTeamKillsRequirement":true,"PlayersRequirement":false,"NoSuspectEventsInFirstRoundRequirement":false,"NotKnifeRoundRequirement":true,"BombInPlayRequirement":false,"KillsInFirstRoundRequirement":false,"FiveKillsWhenEnemyElliminatedRequirement less than 5 five kills in round(s) []":true,"MatchStartRequirement":true,"MapNameRequirement":true,"NoDrawRoundsRequirement":true,"FirstRoundOverRequirement":false,"RoundOneMaxEquipmentValueRequirement":true},"forcedLive":false,"forcedDead":false}]
It seems with this method you can list a number of matchId's and get an entire summary back (this is how the main page of HLTV keeps updated for all live matches
Let me know if I can help testing. If I do get some time I may submit a PR for this
The text was updated successfully, but these errors were encountered:
Hey @andrewda
Been a while since I've used this library, but getting back into it it seems that hltv has upgraded its websocket endpoint and a few other bits and pieces during the connecting. I've played around to see how it works now and pretty sure I've got it - but will need some help integrating that back into this library
In this I was using the
websocat
command line client to test and connectEndpoint -
scorebot-secure.hltv.org
websocat "wss://scorebot-secure.hltv.org/socket.io/?EIO=3&transport=websocket"
61:42["readyForMatch","{\"token\":\"\",\"listId\":\"2328874\"}"]
2
, the server will respond with3
. if you do not receive a response generally means the connection has closedBelow is a print of it in action, and a look at the data structure of the json feed that it returs
You also get some useful things during the round such as
42["log","{\"log\":[{\"MatchStarted\":{\"map\":\"de_nuke\"}}]}"]
42["log","{\"log\":[{\"MatchStarted\":{\"map\":\"de_nuke\"}}]}"]
You can also submit the string
61:42["readyForScores","{\"token\":\"\",\"listIds\":[2328874]}"]
to the server to get a nice summary of the match42["score",{"mapScores":{"1":{"firstHalf":{"ctTeamDbId":5158,"ctScore":8,"tTeamDbId":9379,"tScore":7},"secondHalf":{"ctTeamDbId":9379,"ctScore":8,"tTeamDbId":5158,"tScore":6},"overtime":{"ctTeamDbId":9379,"ctScore":0,"tTeamDbId":5158,"tScore":0},"mapOrdinal":1,"scores":{"9379":15,"5158":14},"currentCtId":9379,"currentTId":5158,"map":"de_nuke","mapOver":false}},"listId":2328874,"wins":{},"liveLog":{"":true,"IrregularTeamKillsRequirement":true,"PlayersRequirement":false,"NoSuspectEventsInFirstRoundRequirement":false,"NotKnifeRoundRequirement":true,"BombInPlayRequirement":false,"KillsInFirstRoundRequirement":false,"FiveKillsWhenEnemyElliminatedRequirement less than 5 five kills in round(s) []":true,"MatchStartRequirement":true,"MapNameRequirement":true,"NoDrawRoundsRequirement":true,"FirstRoundOverRequirement":false,"RoundOneMaxEquipmentValueRequirement":true},"forcedLive":false,"forcedDead":false}]
It seems with this method you can list a number of matchId's and get an entire summary back (this is how the main page of HLTV keeps updated for all live matches
Let me know if I can help testing. If I do get some time I may submit a PR for this
The text was updated successfully, but these errors were encountered: