koraktor / steam-condenser

A multi-language library for querying the Steam Community, Source, GoldSrc servers and Steam master servers
https://koraktor.de/steam-condenser
Other
356 stars 67 forks source link

SteamPlayer class does not contain check for HLTV #283

Open voed opened 8 years ago

voed commented 8 years ago

In GoldSrc server(dont know about Source, maybe too), HLTV info in status looks like this: img The loss field is empty and its causes crash when its parsing. My workaround: add isHLTV method same as isBot and check for it before parsing loss.

    public boolean isHLTV()
    {
        return this.steamId.equals("HLTV");
    }
if(!this.isBot() && !this.isHLTV()) {
this.loss  = Integer.parseInt(playerData.get("loss"));
this.ping  = Integer.parseInt(playerData.get("ping"));
...
koraktor commented 8 years ago

Sounds like a good improvement.

Would you like to create a pull request for koraktor/steam-condenser-java?

voed commented 8 years ago

Yea, done. But i think catching parse exceptions and adding full HLTV support would be better. Maybe i will do it later.

koraktor commented 8 years ago

Thanks. By the way, SourceTV uses the BOT ID, so this is already covered.