Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. MW3 Server Hosting Support
  3. game stat

game stat

Scheduled Pinned Locked Moved MW3 Server Hosting Support
13 Posts 4 Posters 732 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Xerxesundefined Offline
    Xerxesundefined Offline
    Xerxes
    Plutonium Staff
    wrote on last edited by
    #2

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

    chacha18undefined 1 Reply Last reply
    0
    • Xerxesundefined Xerxes

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

      chacha18undefined Offline
      chacha18undefined Offline
      chacha18
      wrote on last edited by chacha18
      #3

      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) ?

      Xerxesundefined 1 Reply Last reply
      0
      • Chaseundefined Offline
        Chaseundefined Offline
        Chase
        wrote on last edited by
        #4

        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.

        1 Reply Last reply
        0
        • chacha18undefined chacha18

          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) ?

          Xerxesundefined Offline
          Xerxesundefined Offline
          Xerxes
          Plutonium Staff
          wrote on last edited by
          #5

          chacha18 On all, some are however encrypted with DTLS.

          1 Reply Last reply
          0
          • chacha18undefined Offline
            chacha18undefined Offline
            chacha18
            wrote on last edited by
            #6

            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 😉

            1 Reply Last reply
            0
            • chacha18undefined Offline
              chacha18undefined Offline
              chacha18
              wrote on last edited by
              #7

              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 😕

              1 Reply Last reply
              0
              • chacha18undefined Offline
                chacha18undefined Offline
                chacha18
                wrote on last edited by
                #8

                #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 ?

                1 Reply Last reply
                0
                • chacha18undefined Offline
                  chacha18undefined Offline
                  chacha18
                  wrote on last edited by chacha18
                  #9

                  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'])
                  
                  
                  
                  1 Reply Last reply
                  0
                  • FragsAreUsundefined Offline
                    FragsAreUsundefined Offline
                    FragsAreUs
                    Plutonium Staff
                    wrote on last edited by
                    #10

                    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

                    chacha18undefined 1 Reply Last reply
                    0
                    • FragsAreUsundefined FragsAreUs

                      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

                      chacha18undefined Offline
                      chacha18undefined Offline
                      chacha18
                      wrote on last edited by
                      #11

                      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 😉

                      1 Reply Last reply
                      0
                      • chacha18undefined Offline
                        chacha18undefined Offline
                        chacha18
                        wrote on last edited by
                        #12

                        Bad news....

                        Player list is working very well, but scores always stay at 0 😕

                        chacha18undefined 1 Reply Last reply
                        0
                        • chacha18undefined chacha18

                          Bad news....

                          Player list is working very well, but scores always stay at 0 😕

                          chacha18undefined Offline
                          chacha18undefined Offline
                          chacha18
                          wrote on last edited by chacha18
                          #13

                          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
                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Donate