game stat

Topic created ยท 13 Posts ยท 161 Views
  • Hi guys,

    I'm gona try Plutonium (coming from Tecknogods) on MW3 first and hopefuly BO2.
    I'm wondering if as opposed to tckgds, plutonium is supporting gamestat protocol (or rather Gamespy3/4) ? Like used in Gametracker.

    I am building a multi-game hosting with cross-game players statistics, fully relying on quake2stat cmd wich is using gamespy protocol. Is it compatible with your dedicated server ? It appear to be not the case with tckgds ..

    If not, I plan to build a rcon/gamespy wrapper daemon but before I need to know :).

    Thx

  • You can use the Q3 Protocol to query both IW5 and T6 Servers.

  • @Xerxes said in game stat:

    Q3 Protocol

    Super new !
    And do you confirm its an evolution regardin tecknogods server ? or is it enabled by default in all MW server (genuine or not) ?

  • I know this doesn't exactly answer your question, but IW4MAdmin does a fantastic job at managing servers with a full web front you can try out.

  • @chacha18 On all, some are however encrypted with DTLS.

  • Its working very good now with plutonium, perfect !
    I think the tecknogods version is either broken / disabled / encrypted because despite the dedicated server starts I was never able to read stats with quake2stat...

    Thanks for IW4MAdmin, I'll have a look ๐Ÿ˜‰

  • @update:

    Actually, server stat are Ok for current game map, number of players, server name.. but not for player list / score.

    Should I do something to get it to work ?
    Or is it normal behavior ?

    Player name / score measurement is a must-have for my project ๐Ÿ˜•

  • #update2:

    interesting thing, in the server browser the function "Get Server Info" lead to a timeout in every server. Not sure it is for the same reason but maybe ! Ill try wireshark-ing... Maybe someone from IW4MAdmin dev team have some info about this ?

  • Ok, so I ended with developing a python script to trigger a RCON command and get the data.

    For those who needs (not tested a lot yet to be honest !):

    import socket
    import re
    
    Rconpassword =  "YOUR_SERVER_RCON_PASSWORD"
    ServerIp     =  "YOUR_SERVER_IP"
    ServerPort   =  YOUR_SERVER_PORT
    
    
    def Rcon_GetPlayersInfo(Ip,Port,Pass): 
        MsgBuffSize      = 1500
        PlayerStartRegex = r"-----\n"
        PlayerLineRegex   = r"[\s]*(?P<num>-?\d+)[\s]+(?P<score>-?\d+)[\s]+(?P<bot>-?\d+)[\s]+(?P<ping>-?\d+)[\s]+(?P<guid>[0-9a-fA-F]+)[\s]+(?P<name>[^\s\]+)[\s]+(?P<last_msg>\d+)[\s]+(?P<ip>[0-9.:]+)[\s]+(?P<qport>-?\d+)[\s]+(?P<rate>\d+)\n"
      
        msgClient = b'\xff\xff\xff\xffrcon ' + Pass.encode() + b' status\x00\xe6\xea'
        msgToSend = msgClient
        addrPort = (Ip, Port)
        bufferSize = MsgBuffSize
    
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.settimeout(0.1)
        
        bFetchOK = False
        nTry = 0
        while (not bFetchOK and nTry < 10):
            try:
                s.sendto(msgToSend, addrPort)
                data = bytearray(s.recvfrom(bufferSize)[0])
                bFetchOK = True
            except socket.timeout:
                nTry+=1
                continue
                    
        if not bFetchOK:
            return []
            
        Newdata = bytearray()
        for _byte in data:
            if _byte == 0xff:
                continue
            else:
                Newdata.append(_byte)
                
            
    
        msg = Newdata.decode('ascii')
    
        pattern = re.compile(PlayerStartRegex)
        matchStart = pattern.search(msg)
        if matchStart is None:
            print('no match found, leaving')
            exit(0)
    
        pattern = re.compile(PlayerLineRegex)
    
        offset = matchStart.end()
        ar_players = []
        while True:
            MatchPlayer = pattern.search(msg,offset)
            if MatchPlayer is not None:
                ar_players.append(MatchPlayer.groupdict())
                offset = MatchPlayer.end()  
            else :
                break;
    
        return ar_players
    
    ar_players=Rcon_GetPlayersInfo(ServerIp,ServerPort,Rconpassword)
    
    for player in ar_players:
        print ("=== Player " + player['name'])
        print (player['score'])
        print (player['bot'])
        print (player['ping'])
        print (player['guid'])
        print (player['name'])
        print (player['last_msg'])
        print (player['ip'])
        print (player['qport'])
        print (player['rate'])
    
    
    
  • that you would have to talk to either raidmax about who made iw4madmin or maybe rekt over the server info timing out but if they python script works for you then congrats on helping out with something in the community it is always good to see new stuff coming to mw3

  • @FragsAreUs
    Thank you !
    For the moment - actually, for the last 8 hours - my script seems to work really well !

    Not sure if the retry trick I had to add is because the server do not respond or if it respond too fast but anyway... I have so many other thinks to do on the project and Im a bit tired of wireshark for today ๐Ÿ™‚
    I have 2 MW3 server and soon 2 BO2 that I pool every 10 sec, its enough for this job ๐Ÿ™‚

    I will update this post in the future if I make new fixes / features ๐Ÿ˜‰

  • Bad news....

    Player list is working very well, but scores always stay at 0 ๐Ÿ˜•

  • I talked with RedMax from IW4MAdmin and it seems he also have the same issue.
    You may have something broken.

    Facts:

    • QuakeStat can not get the player list (Q3 protocol)
    • RCON status command is always displaying 0 for player score
Log in to reply