Guest User

parse_demo_file.py

a guest
Dec 6th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 8.47 KB | None | 0 0
  1. daniel@moja ~/springrts/spring-replay-site/srs $ ./parse_demo_file.py /mnt/games/springrts/demos/20121206_231151_Mescaline_V2_91.sdf
  2. #################### header ##########################
  3. {'demoStreamSize': 4193640,
  4.  'gameID': 'bb18c15069720bd4b1ce04c51cdf4421',
  5.  'gameTime': '0:49:12',
  6.  'headerSize': 352,
  7.  'magic': 'spring demofile',
  8.  'numPlayers': 23,
  9.  'numTeams': 10,
  10.  'playerStatElemSize': 20,
  11.  'playerStatSize': 460,
  12.  'scriptSize': 3751,
  13.  'teamStatElemSize': 80,
  14.  'teamStatPeriod': 16,
  15.  'teamStatSize': 148840,
  16.  'unixTime': '2012-12-06 23:11:51',
  17.  'version': 5,
  18.  'versionString': '91',
  19.  'wallclockTime': '0:52:54',
  20.  'winningAllyTeamsSize': 1}
  21. ################## game_setup ########################
  22. {'allyteam': {'0': {'numallies': 0,
  23.                     'startrectbottom': 1,
  24.                     'startrectleft': 0.75,
  25.                     'startrectright': 1,
  26.                     'startrecttop': 0},
  27.               '1': {'numallies': 0,
  28.                     'startrectbottom': 1,
  29.                     'startrectleft': 0,
  30.                     'startrectright': 0.25,
  31.                     'startrecttop': 0}},
  32.  'host': {'autohostaccountid': 143409,
  33.           'autohostcountrycode': 'FR',
  34.           'autohostname': '[x]TheHost',
  35.           'autohostport': 8454,
  36.           'autohostrank': 7,
  37.           'gametype': 'Balanced Annihilation V7.72',
  38.           'hostport': 8452,
  39.           'ishost': 1,
  40.           'mapname': 'Mescaline_V2',
  41.           'numallyteams': 2,
  42.           'numplayers': 16,
  43.           'numrestrictions': 0,
  44.           'numteams': 10,
  45.           'startpostype': 2},
  46.  'mapoptions': {},
  47.  'modoptions': {'deathmode': 'com',
  48.                 'disablemapdamage': 0,
  49.                 'fixedallies': 0,
  50.                 'ghostedbuildings': 1,
  51.                 'limitdgun': 0,
  52.                 'maxspeed': 1,
  53.                 'maxunits': 4000,
  54.                 'minspeed': 1,
  55.                 'mo_allowfactionchange': 1,
  56.                 'mo_armageddontime': 0,
  57.                 'mo_combomb_full_damage': 0,
  58.                 'mo_comgate': 0,
  59.                 'mo_coop': 1,
  60.                 'mo_enemywrecks': 1,
  61.                 'mo_greenfields': 0,
  62.                 'mo_noowner': 0,
  63.                 'mo_noshare': 1,
  64.                 'mo_nowrecks': 0,
  65.                 'mo_preventdraw': 0,
  66.                 'mo_progmines': 0,
  67.                 'mo_storageowner': 'team',
  68.                 'mo_transportenemy': 'all',
  69.                 'pathfinder': 'normal',
  70.                 'shareddynamicalliancevictory': 0,
  71.                 'startenergy': 1000,
  72.                 'startmetal': 1000,
  73.                 'teamdeathmode': 'allyzerounits'},
  74.  'player': {'0': {'accountid': 9368,
  75.                   'countrycode': 'CH',
  76.                   'name': 'The_Uber_Noob',
  77.                   'password': '2a87a0ca',
  78.                   'rank': 6,
  79.                   'spectator': 1},
  80.             '1': {'accountid': 235626,
  81.                   'countrycode': 'DE',
  82.                   'name': 'Bratkartoffel',
  83.                   'password': '78c92497',
  84.                   'rank': 3,
  85.                   'spectator': 0,
  86.                   'team': 0},
  87.             '10': {'accountid': 204720,
  88.                    'countrycode': 'FR',
  89.                    'name': '[ACE]Krapoo',
  90.                    'password': '919195a3',
  91.                    'rank': 5,
  92.                    'spectator': 1},
  93.             '11': {'accountid': 53304,
  94.                    'countrycode': 'FI',
  95.                    'name': 'niglet_piglet',
  96.                    'password': '6EA3F6F0',
  97.                    'rank': 6,
  98.                    'spectator': 1},
  99.             '12': {'accountid': 115510,
  100.                    'countrycode': 'IT',
  101.                    'name': '[zT]Splinter',
  102.                    'password': '229C4F9F',
  103.                    'rank': 5,
  104.                    'spectator': 0,
  105.                    'team': 6},
  106.             '13': {'accountid': 191405,
  107.                    'countrycode': 'BR',
  108.                    'name': 'luizxd5',
  109.                    'password': '480a1f09',
  110.                    'rank': 5,
  111.                    'spectator': 0,
  112.                    'team': 7},
  113.             '14': {'accountid': 214027,
  114.                    'countrycode': 'IT',
  115.                    'name': '[zT]PabyLove',
  116.                    'password': '41ea1f27',
  117.                    'rank': 3,
  118.                    'spectator': 0,
  119.                    'team': 8},
  120.             '15': {'accountid': 3780,
  121.                    'countrycode': 'NL',
  122.                    'name': '[PiRO]klapmongool',
  123.                    'password': '506F59D5',
  124.                    'rank': 6,
  125.                    'spectator': 0,
  126.                    'team': 9},
  127.             '2': {'accountid': 173246,
  128.                   'countrycode': 'GB',
  129.                   'name': '[Looney]ElmerFudd',
  130.                   'password': '28bd3e14',
  131.                   'rank': 6,
  132.                   'spectator': 1},
  133.             '3': {'accountid': 233815,
  134.                   'countrycode': 'US',
  135.                   'name': 'murtagon',
  136.                   'password': '1abfb79a',
  137.                   'rank': 5,
  138.                   'spectator': 1},
  139.             '4': {'accountid': 237427,
  140.                   'countrycode': 'ES',
  141.                   'name': 'Renew',
  142.                   'password': '7aff46ee',
  143.                   'rank': 1,
  144.                   'spectator': 0,
  145.                   'team': 1},
  146.             '5': {'accountid': 223380,
  147.                   'countrycode': 'FR',
  148.                   'name': '[ACE]Bla',
  149.                   'password': '0a5b543c',
  150.                   'rank': 5,
  151.                   'spectator': 1},
  152.             '6': {'accountid': 34377,
  153.                   'countrycode': '??',
  154.                   'name': 'rainbowmagik',
  155.                   'password': '65f8760d',
  156.                   'rank': 5,
  157.                   'spectator': 0,
  158.                   'team': 2},
  159.             '7': {'accountid': 235365,
  160.                   'countrycode': 'IT',
  161.                   'name': 'nojustno',
  162.                   'password': '1862fa23',
  163.                   'rank': 3,
  164.                   'spectator': 0,
  165.                   'team': 3},
  166.             '8': {'accountid': 204660,
  167.                   'countrycode': 'US',
  168.                   'name': '[WW]_Botman',
  169.                   'password': '4d430bc0',
  170.                   'rank': 5,
  171.                   'spectator': 0,
  172.                   'team': 4},
  173.             '9': {'accountid': 130601,
  174.                   'countrycode': 'DE',
  175.                   'name': 'Danchan',
  176.                   'password': '7763a454',
  177.                   'rank': 5,
  178.                   'spectator': 0,
  179.                   'team': 5}},
  180.  'restrict': {},
  181.  'team': {'0': {'allyteam': 0,
  182.                 'handicap': 0,
  183.                 'rgbcolor': '0.40000 0.60000 0.00000',
  184.                 'side': 'ARM',
  185.                 'teamleader': 1},
  186.           '1': {'allyteam': 1,
  187.                 'handicap': 0,
  188.                 'rgbcolor': '0.00000 1.00000 0.00000',
  189.                 'side': 'ARM',
  190.                 'teamleader': 4},
  191.           '2': {'allyteam': 1,
  192.                 'handicap': 0,
  193.                 'rgbcolor': '1.00000 1.00000 0.00000',
  194.                 'side': 'CORE',
  195.                 'teamleader': 6},
  196.           '3': {'allyteam': 0,
  197.                 'handicap': 0,
  198.                 'rgbcolor': '0.00000 1.00000 0.92157',
  199.                 'side': 'ARM',
  200.                 'teamleader': 7},
  201.           '4': {'allyteam': 0,
  202.                 'handicap': 0,
  203.                 'rgbcolor': '1.00000 0.00000 1.00000',
  204.                 'side': 'CORE',
  205.                 'teamleader': 8},
  206.           '5': {'allyteam': 0,
  207.                 'handicap': 0,
  208.                 'rgbcolor': '0.19608 0.19608 0.19608',
  209.                 'side': 'CORE',
  210.                 'teamleader': 9},
  211.           '6': {'allyteam': 1,
  212.                 'handicap': 0,
  213.                 'rgbcolor': '0.78431 0.00000 0.00000',
  214.                 'side': 'ARM',
  215.                 'teamleader': 12},
  216.           '7': {'allyteam': 0,
  217.                 'handicap': 0,
  218.                 'rgbcolor': '0.54902 1.00000 0.54902',
  219.                 'side': 'ARM',
  220.                 'teamleader': 13},
  221.           '8': {'allyteam': 1,
  222.                 'handicap': 0,
  223.                 'rgbcolor': '1.00000 0.54902 1.00000',
  224.                 'side': 'ARM',
  225.                 'teamleader': 14},
  226.           '9': {'allyteam': 1,
  227.                 'handicap': 0,
  228.                 'rgbcolor': '1.00000 0.50196 0.00000',
  229.                 'side': 'ARM',
  230.                 'teamleader': 15}}}
  231. ############### winningAllyTeams #####################
  232. [0]
Advertisement
Add Comment
Please, Sign In to add comment