ShadowFlare's Realm
http://sfsrealm.hopto.org/cgi-bin/yabb2/YaBB.pl
ShadowFlare's Realm Forums >> Program Development >> PHP Warcraft III Replay Parser
http://sfsrealm.hopto.org/cgi-bin/yabb2/YaBB.pl?num=1084574897

Message started by Julas.wtfwrongpass on May 15th, 2004, 12:48am

Title: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on May 15th, 2004, 12:48am

The newest version of the parser is available at http://w3rep.sourceforge.net/

Title: Re: PHP Warcraft III Replay Parser
Post by Ruffy on Jun 14th, 2004, 10:33pm

Hi, I have the follow Problem with your parser Script:

[...]
replays is not an array, we've got trouble.
Warning: Invalid argument supplied for foreach() in /www/path/replays/example.php on line 97
[...]

I can upload a file but this file is not stored after the session ... And many array errors comes ...

A other Problem is this after i try to upload a Replay:

[...]
Warning: array_search() [function.array-search]: Wrong datatype for second argument in /www/path/replays/example.php on line 137 [...]

I see the Replay with the Stats ... but the Replay is not saved and the Script says "Replay folder contains no replays!" (Yes, the database and replay folder are created and the webserver has the right permissions to this folders)

I have this Problems on 3 different Servers with different OS (+Apache+PHP+...)

Sorry for my bad english :)

Bye
Avalon

PS: I use w3g-julas-1.9.zip

Title: Re: PHP Warcraft III Replay Parser
Post by Hesiode on Jun 15th, 2004, 12:38pm

I try to parse this file :

http://replay-fr.com/20040520084000049-W3XP-solo.w3g

and i have this error message :
20040520084000049-W3XP-solo.w3g: Unhandled replay action: 0x63, previous was 0x0

Have u a solution ?

thx

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 15th, 2004, 2:47pm


Ruffy wrote:
[...]
replays is not an array, we've got trouble.
Warning: Invalid argument supplied for foreach() in /www/path/replays/example.php on line 97
[...]


Sorry for the late answer - I've got your mail but didn't have time to reply (end of the semester so I was trying to get better marks).
Have you modified the source of my parser or example in any way?

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 15th, 2004, 2:49pm


Hesiode wrote:
I try to parse this file :
http://replay-fr.com/20040520084000049-W3XP-solo.w3g

and i have this error message :
20040520084000049-W3XP-solo.w3g: Unhandled replay action: 0x63, previous was 0x0

Have u a solution ?


The rep seems very weird. Even though W3GMaster parses it, both players seem to have over 600 APM, which iis the biggest value I've seen. I've tried modifing max block size but that didn't help... I'll try to find some more 1.15 tournament reps and find out what's going on (but if Nagger and Blue read this they'll be probably faster :))

Title: Re: PHP Warcraft III Replay Parser
Post by Oui-Oui on Jun 17th, 2004, 11:38am

I have a problem uing the parser on my computer : I am working on a mac uing OS X, and i installed the parser under my apache server. I installed the latest version of php, but when i load the example (i didn't change anything), it tells me the replays i have are incomplete. I tested these replays on other servers without any problem :/ What can i do ?

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 17th, 2004, 2:49pm


Oui-Oui wrote:
I have a problem uing the parser on my computer : I am working on a mac uing OS X, and i installed the parser under my apache server. I installed the latest version of php, but when i load the example (i didn't change anything), it tells me the replays i have are incomplete. I tested these replays on other servers without any problem :/ What can i do ?


Oh no, a Mac... ;p (I work on them in school... brr). Do you have zlib support in your PHP?

Title: Re: PHP Warcraft III Replay Parser
Post by Ruffy on Jun 22nd, 2004, 10:03pm


Julas.wtfwrongpass wrote:
Sorry for the late answer - I've got your mail but didn't have time to reply (end of the semester so I was trying to get better marks).
Have you modified the source of my parser or example in any way?


Thx for the Answer, and Sorry for email Spaming.

I dont do anything with the code, only unpack the .zip file, change the owner/group permissions and that is it.

Thats the Directory:
http://hlc.frankenmafia.info/replays/file_struct.txt

and here is a copy from the three main *.php Files in .phps, u can show the code:
http://hlc.frankenmafia.info/replays/example.phps
http://hlc.frankenmafia.info/replays/w3g-julas-convert.phps
http://hlc.frankenmafia.info/replays/w3g-julas.phps

bye

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 22nd, 2004, 11:42pm


Ruffy wrote:
I dont do anything with the code, only unpack the .zip file, change the owner/group permissions and that is it.


http://hlc.frankenmafia.info/replays/example.php
Well, isn't the first line there the answer? :O

Title: Re: PHP Warcraft III Replay Parser
Post by Ruffy on Jun 23rd, 2004, 12:49am

Hi,

But when i try to upload some Test-Replays in the replays/ folder then i become much errors from the example.php:

Example 1:
Replay = 1vs1-Doombringer-Bubbel-01.w3g
URL = http://hlc.frankenmafia.info/replays/example.php
Error =
1. 1vs1-Doombringer-Bubbel-01 download(82 KB)
Warning: Invalid argument supplied for foreach() in /www/hlc.frankenmafia.info/replays/example.php on line 108

------

Example 2 (same Script, but with a other Replay in the replay folder):
Replay = Fun-The_Great_Strategy_v1_17e-04.w3g
URL = http://hlc.frankenmafia.info/replays-2/example.php
Error =
Warning: unpack(): Type C: not enough input, need 1, have 0 in /www/hlc.frankenmafia.info/replays-2/w3g-julas.php on line 383
Warning: unpack(): Type C: not enough input, need 1, have 0 in /www/hlc.frankenmafia.info/replays-2/w3g-julas.php on line 383
Warning: unpack(): Type C: not enough input, need 1, have 0 in /www/hlc.frankenmafia.info/replays-2/w3g-julas.php on line 383
... endless loop

------

But W3GMasters can parse this Replays without any Problem.  All tested Replays (5 Replays) show me Error's ??? :-/

Avalon

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 23rd, 2004, 3:56pm


Ruffy wrote:
But W3GMasters can parse this Replays without any Problem.  All tested Replays (5 Replays) show me Error's ??? :-/


W3GMaster 1.9.9.105 says "Stream read error." when I try to parse the first replay. However, Warcraft plays the replay fine... Weird. What program are you using for uploading replays? Are you sure you send them in binary, not ASCII mode?

Title: Re: PHP Warcraft III Replay Parser
Post by Ruffy on Jun 23rd, 2004, 6:13pm


Julas.wtfwrongpass wrote:
W3GMaster 1.9.9.105 says "Stream read error." when I try to parse the first replay. However, Warcraft plays the replay fine... Weird. What program are you using for uploading replays? Are you sure you send them in binary, not ASCII mode?


I upload the first time with normally FTP, second time with scp (prot ssh) in binary mode ... but i try the same with only copy & paste on my local network (apache server). Same Problems.

Avalon

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 23rd, 2004, 8:22pm


Ruffy wrote:
I upload the first time with normally FTP, second time with scp (prot ssh) in binary mode ... but i try the same with only copy & paste on my local network (apache server). Same Problems.


What version of W3GMaster do you use? As I said the version I use (AFAIK the most recent) doesn't parse it too. So maybe there are some new undiscovered actions...

Title: Re: PHP Warcraft III Replay Parser
Post by Ruffy on Jun 23rd, 2004, 8:45pm

Sorry,

It was not my WG3Masters, it was from a friend, he said he can parse the replays with it. I think he dont lie.  :)

Can u parse the other (big) Replay? It brings a other Error, please see the error'msg.

Avalon

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 25th, 2004, 1:36pm


Ruffy wrote:
Sorry,

It was not my WG3Masters, it was from a friend, he said he can parse the replays with it. I think he dont lie.  :)

As I said it doesn't on my computer...


Quote:
Can u parse the other (big) Replay? It brings a other Error, please see the error'msg.

It's UMS, isnt it?. And I never tested my script with those... I just never thought anybody saves replays from UMS. It doesn't parse in my script because it contains some trigger actions that are present only in UMS games.
W3GMaster parses it because, as I noticed, it has some algorithm that can just evade actions it doesn't recognise. Soar, if you read this, how did you solve that problem?

Title: Re: PHP Warcraft III Replay Parser
Post by Soar on Jun 25th, 2004, 7:54pm

I forgot what I coded.
In my memory, I seperate blocks and actions, even when an action is incorrect, it will still skip to next block and ignore all unreconized actions.
Also if there is an unknown block number, I will move the block to next byte to analyse, this once caused some critical problems on initial versions, but later, it ensures the stability of parsing engine

Title: Re: PHP Warcraft III Replay Parser
Post by Nagger on Jun 29th, 2004, 12:34am


Hesiode wrote:
I try to parse this file :

http://replay-fr.com/20040520084000049-W3XP-solo.w3g

and i have this error message :
20040520084000049-W3XP-solo.w3g: Unhandled replay action: 0x63, previous was 0x0

I checked this replay with my program and it also failed. But after some debugging a got it and it looks like julas made the same mistake:

patch 1.14b (and later versions) shifted some action-ids. To distingish between 1.14 and 1.14b replays we had to check the build number (not only the minor version number as usual).
Unfortunatly in official tournament replays the build number is set to zero.
So with a simple build-number-check your replay was recognized as pre 1.14b and the action parsing failed.

@julas:
if ($this->header['build_v'] >= 6040)
should be replaced by
if ($this->header['build_v'] >= 6040 || $this->header['major_v'] >= 15)

I think there is no chance to differtiate between 1.14 and 1.14b official tournament replays (except parsing with both formats and taking the one that works ;) )

Title: Re: PHP Warcraft III Replay Parser
Post by Hesiode on Jun 30th, 2004, 8:46pm

OK, thx a lot !!!!

Title: Re: PHP Warcraft III Replay Parser
Post by Blue on Jul 1st, 2004, 3:32pm


Nagger wrote:
I think there is no chance to differtiate between 1.14 and 1.14b official tournament replays (except parsing with both formats and taking the one that works ;) )

I just thought of an alternative: we could check the date of the game encoded in the name of an tournament replay vs. the release date of patch 1.14b.
I am not sure if the release dates in our docu are 100% accurate though.
But it should work for most replays.

Title: Re: PHP Warcraft III Replay Parser
Post by Unity on Aug 15th, 2004, 11:12pm

Hey guys!

I got a little problem with your replay parser (surprise surprise  ;D )

I unzipped your package and, after having created a directory with Read/Write/Execute-flags, uploaded all of the files. As I spent some time on the example.php, I realized that I EITHER have to create the sub-directories replays/ and database/ OR change the script a little. After having done first, I experienced some errors looking like this:

By calling the example.php, it showes all replays in the replay folder with proper names and file-size, but it seems like the script is unable to extract the game data:

Warning: Wrong parameter count for fgets() in /data/rw/home/n/nick.pr/wrathofsquirrels/replaysection/example.php on line 104

Warning: Invalid argument supplied for foreach() in /data/rw/home/n/nick.pr/wrathofsquirrels/replaysection/example.php on line 108

So I downloaded some replays from your example site and tried these, but the errors stayed. By using the "Check your own replay!"-function there isn't any trouble with these replays; can u help me?

Title: Re: PHP Warcraft III Replay Parser
Post by Elven-ranger on Oct 16th, 2004, 6:48pm

What is this?

"Warning: array_search(): Wrong datatype for second argument in /home2/ranger/public_html/example.php on line 135"  

Its working but its anoying error.

Check my website: www.clangold.co.nr

Title: Re: PHP Warcraft III Replay Parser
Post by doicromoy on Oct 23rd, 2004, 8:48pm

hi. I have some problems.

details about replays does not working. :( nothing happens.
this is thelink. http://br2d.lx.ro/w3g-julas-2.0/example.php

Please help. Thanks a lot

Title: Re: PHP Warcraft III Replay Parser
Post by ubertheworld on Feb 12th, 2005, 1:07pm

i got the same problem.. all works but the details... and thats what is the best thing which comes with ur script

http://www.flo.xados.de/wc3/example.php

Title: Re: PHP Warcraft III Replay Parser
Post by BuLdOzEr on Feb 12th, 2005, 11:20pm

http://www.clanglb.com/~w3g/

"The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. "

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Feb 12th, 2005, 11:47pm

http://toya.net.pl/~julas/w3g/
Hint: Use Google, Luke.

Title: Re: PHP Warcraft III Replay Parser
Post by BuLdOzEr on Feb 13th, 2005, 12:22am

[bJulas.wtfwrongpass[/b]

Thanks a lot! :)

P.S.: Just i have no Power, Master Yoda!


Title: Re: PHP Warcraft III Replay Parser
Post by Greg on Mar 11th, 2005, 1:49am

Hi Julas!
First of all, thanks for the parser. But tell me how can i upload replays to server using your example. Because i now i can only view parsed results.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 11th, 2005, 1:53pm

You can't -  you have to create your own frontend or modify the one I provided.

Title: Re: PHP Warcraft III Replay Parser
Post by Greg on Mar 12th, 2005, 4:55pm

Hmm  ??? but it's impossible, because for listing stored replays your function needs mistery txt file in folder "database", so it won't help if i'll upload w3g replay by myself. What thing creates that txt file?

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 12th, 2005, 6:30pm

The thing is example.php and the function is serialize()
http://php.net/serialize

PS A quote from sbd's Battle.net profile description:
"Impossible is just a big word thrown around by small men who find it easier to live in the world they've been given than to explore the power they have to change it. Impossible is not a fact. It's an opinion. Impossible is not a declaration. It's a dare. Impossible is potential. Impossible is temporary. Impossible is nothing."
;)

Title: Re: PHP Warcraft III Replay Parser
Post by Greg on Mar 14th, 2005, 10:17pm


Julas.wtfwrongpass wrote:
The thing is example.php and the function is serialize()

Thanks, i'll try. I hope i understand, what you mean.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on May 25th, 2005, 9:05pm

The new version is here, it is a big one:

2.2 (25.05.05)

   * fixed: hero abilities after using a Tome of Retraining (not 100% perfect but should work in most cases)
   * fixed: units from 2 or more rax counted once (there are still some minor issues left but it should work better now)
   * fixed: generally units should be counted a bit more precisely now (but the numbers still aren't 100% correct)
   * fixed: not counting Destroyers, now Obsidian Statues are statues which haven't been morphed (so Destroyers + Obsidian Statues = total statues)
   * fixed: not counting Incinerate ability in 1.18 replays
   * fixed: not counting high level Tinker's abilities
   * fixed: in replays saved by Waaagh!TV users there were sometimes unnecessary player records which shouldn't have been shown (thanks to Nagger)
   * fixed: problems with actions in tournament replays from Battle.net website
   * fixed: [example] got rid of some of the notices
   * changed: boolean values are no longer converted to Yes/No (convert_yesno() changed to convert_bool())
   * changed: [example] private names in chatlog are now shown instead of numbers
   * added: hotkeys array for each player containing the number of each group hotkey assigments and uses (and an interpretation in example.php)
   * added: handling Select subgroup actions (TAB key, etc.) for 1.14b and higher replays (up to these days, we were able to count them only in older replays but I think I've figured out the algorithm; APM is a bit higher now)
   * added: [example] additional items in General information
   * added: "[number] [unit name]" in units order arrays, where number is the number of units trained at one click; -1 means that the unit was cancelled
   * added: support for RoC replays older than 1.03 patch ;)
   * added: support for computer players

As usual you can download it from http://toya.net.pl/~julas/w3g/

Title: dont show the player´s names
Post by KarOn on May 29th, 2005, 9:21pm

this version dont show the players names, or i have to do shomethink else ? always show "computer"
in the index.php archive say in the "TODO" part that have apm chart..... say that have? or say that will have?
how can i show only 10 replays and then gtenerate other page with another 10 reps, etc, dynamicly......thx for this work... and thx for the support, baytheway (i dont know how spell jeje), i erase the other post that didint like u in the "apm chart" post... sorry

Title: Re: dont show the player´s names
Post by Julas.wtfwrongpass on May 29th, 2005, 9:34pm


KarOn wrote:
this version dont show the players names, or i have to do shomethink else ? always show "computer"


Haven't you mixed the old files with the new files? E.g. from some previous version of the script.


Quote:
in the index.php archive say in the "TODO" part that have apm chart..... say that have? or say that will have?


TODO means to do...


Quote:
how can i show only 10 replays and then gtenerate other page with another 10 reps, etc, dynamicly


1) learn PHP
2) make your own version of the frontend

Title: ok th
Post by KarOn on May 29th, 2005, 9:55pm

about learn php .... im doing that but , i think that anyone could help me... about "TODO" word, i dont know what it means... sorry about my english :)

thx for ur help.

Title: Re: PHP Warcraft III Replay Parser
Post by KarOn on May 29th, 2005, 9:59pm

i unzip all the files and use the newest, but nothing, still show computer´s name

Title: Re: PHP Warcraft III Replay Parser
Post by w3g_parser_rox on Jun 12th, 2005, 2:30am

Hi can somone please explain to me how I can make the replays not display in alphabetical order but ascending or descending order? Thank you

Title: Re: PHP Warcraft III Replay Parser
Post by w3g_parser_rox on Jun 12th, 2005, 3:29am

After thinking about it I think I mean something different. I do not want the replays to be listed in alphabetical or numerical order but as they appear in the directory. Like when a user uoloads a replay to the specified directory it will go to the bottomn of the list rather then be organized into it by a specific way. I hope this makes sense :P

Title: Re: PHP Warcraft III Replay Parser
Post by w3g_parser_rox on Jun 12th, 2005, 7:26am

Ok also one last thing promise, is their a simple way to make this file span multiple pages? Like 10 or 20 replays then a new page etc

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 12th, 2005, 11:55am

Sorry I won't answer such questions. Everything you need is a basic PHP knowledge.

Title: Re: PHP Warcraft III Replay Parser
Post by w3g_parser_rox on Jun 14th, 2005, 7:06am

I'm sorry to sound blunt with this post but what sort of an answer is that, I wont answer your question. This is a great script you have written but with lack of support it seems there are a very limited few who actually use it to its full potential. Would you at least be kind enough to post a link to a forum where these sorts of questions might be asked? I'm sorry for my noob'ishness in php language, but I believe for the own sake of your hardwork it is neccessary to at least point somone in the right direction if there is a question such as my own that you dont feel enticed to answer.

Just want to say anyhow this IS is lovely thing you have done and thanks for that much at least(I just wish it was more newbie friendly :D)

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 17th, 2005, 2:23pm

First of all I've done this script for myself, later for replays.pl. I published it only because I though it may be useful for others (and, AFAIK, it is). I attend two schools, five days a week, plus some other lessons on Saturdays. So, my time is very limited and as a result, very valuable.
You would have to pay me to make me to do anything more than I do. I provide simple support, and I do not add any additional features on demand. Suggestions are welcome though and I may consider them in future.

As for s PHP forum link, I've found such a forum after 5 seconds of searching with Google. I think you're also capable of doing that.

I didn't want to sound rude, but it starts to piss me off that people just want more and more, not trying to do things themselves.

Title: Re: PHP Warcraft III Replay Parser
Post by w3g_parser_rox on Jun 20th, 2005, 11:03am

you're right and I'm wrong sorry to have offended you, obviously this is a great contribution out of your own time. I have a quick question though, do you get upset if you see this script on a random website with no copyright or mention of you? I know I would ><

Title: Re: PHP Warcraft III Replay Parser
Post by Gamer_man on Jun 20th, 2005, 10:30pm

Hello

I don't speak english good, sorry.

I use php 5.0.0 with apache 2.0 on my localhost.
PHP is configured to display every errors (error_reporting = E_ALL).

When i try the script, i got a big amouth of notices like :

Quote:
Notice:  Undefined variable:  block_id in C:\_d-Php\__Downloads__\Parser warcraft 3\w3g-julas-2.2\w3g-julas.php on line 263


I am average in PHP, and i know what mean this notice, but i don't understand why thoses appears. I don't use class for the moment, then i don't know why i got thoses notices.
Its come from a bug in script, or... ?

Thx

Kiss

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 20th, 2005, 10:38pm

As it says, it's a notice. Notices are acceptable if the programmer knows what's he doing. Solution: just disable them either in php.ini or by error_reporting() in the script.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jun 20th, 2005, 10:40pm


w3g_parser_rox wrote:
you're right and I'm wrong sorry to have offended you, obviously this is a great contribution out of your own time. I have a quick question though, do you get upset if you see this script on a random website with no copyright or mention of you? I know I would ><


It doesn't upset me that much. But it's simply stupid to not tell others about a thing that you find useful, isn't it?

Title: Re: PHP Warcraft III Replay Parser
Post by Gamer_man on Jun 21st, 2005, 12:10am

Ho, thx, i didn't knew this function (error_reporting()).
Next to a try, i saw that we can use it several times.

Thx you again, and nice job for your class, it will be very usefull to me :)

Title: Re: PHP Warcraft III Replay Parser
Post by w3g_parser_rox on Jul 5th, 2005, 6:43pm

Hi again I have a quick question,
While I was stumbling across the net looking for another script I came across this page

http://warcraft.kliegman.com/

Is this also you?

Title: Re: PHP Warcraft III Replay Parser
Post by Nagger on Jul 5th, 2005, 8:25pm

warcraft.kliegman.com is the mother of all war3 replay analysis  :D

kliegs was the first one who starts with analysing and documenting the replay format. His work was the base for blue's and my further format descriptions and also for all the replay tools - like julas' script - out there.

Title: Re: PHP Warcraft III Replay Parser
Post by w3g_parser_rox on Jul 8th, 2005, 4:36am

oooooo k then ^^

Title: Re: PHP Warcraft III Replay Parser
Post by _seym. on Sep 6th, 2005, 4:11pm

hi all!
ive got some problems running the replay parser on my webserver. does php safe mode have to be turned off?

mfg,
_seym.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Sep 6th, 2005, 7:41pm

No, it should work fine even with Safe mode on.

Title: Re: PHP Warcraft III Replay Parser
Post by _seym. on Sep 7th, 2005, 12:10am

bloed. then i dunno what to do ^^
running the script locally it works but trying to run it on the webserver it doesnt. well it does but it does not create the database files because (i think ^^) as the parseheader()-function read the first 48bytes it gets some really weird data.
e.g. ["header_v"]=> int(16777216)
...
can this be caused by a php misconfiguration?

mfg,
_seym.

Title: Re: PHP Warcraft III Replay Parser
Post by tiagojco on Sep 7th, 2005, 10:54am

hi.
i tried to acces http://toya.net.pl/~julas/w3g/, but it show an error message when i try, something like 'page not found'. am i the only who get this message when trying to browse such page ?! (probally a problem with my ISP ?)

Furthermore, i took a look ( ::)) in w3g_format.txt that lies in warcraft.kliegman.com CVS repository, and got a question. How do i decompress in ZLIB inflate using PHP5 ? i tried a lot today with gzinflate($str), where $str is a substr of a usual replay (CG GAME @ BNET) turned into a string, from position 0x4C (the start of the compressed data block) with a lenght value equal to the word @ 0x44 (e.g. substr($replay,0x4C,0x**), but i always get a null returned value.

sorry my bad english.

i hope i let myself clear :-/

p.s.: U did a nice thing with this parser. gj. 8)
p.s.2: Really need to take a look at ur source code. Can u mail me them ?

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Sep 7th, 2005, 2:36pm

The page works fine, it must be your ISP.
A replay file is divided into more than a single compressed block and you have to uncompress them separately, one by one.

Title: Re: PHP Warcraft III Replay Parser
Post by _seym. on Sep 7th, 2005, 3:24pm

ok. ty, then.
if anyone encounteres the same problem and knows how to solve it or even did already solve it, please notify me! i'd really like to run this great script on my website.
btw.: i do know that the replay is split into compressed and uncompressed data. to problem is the header['header_size'] field which contains the complete filesize and makes the file position indicator go --> eof. so theres no data left to gzinflate();

as mentioned above, it would be great if anyone was able to help me ^^

mfg,
_seym.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Sep 7th, 2005, 5:26pm

Erm... my last answer was for tiagojco ;) I don't know why you get different values on different servers and unforunately I don't have time now to investigate.

Title: Re: PHP Warcraft III Replay Parser
Post by _seym. on Sep 7th, 2005, 5:43pm

:-[
omg... sry...
...
whatever. okay. i'll try to solve it on my own. i'll tell u if i find a fix or something else.
ty anyway.

_seym.

Title: Re: PHP Warcraft III Replay Parser
Post by tiagojco on Sep 7th, 2005, 7:17pm

since i cant browse ur page, can u mail me the files i would have access to ?! it would be of great help.

thnx

Title: Re: PHP Warcraft III Replay Parser
Post by Hesiode on Sep 8th, 2005, 12:49am

Hi,

How add some word to chat ?

I know it's impossible with your script, but have you a idea for make that ?

Many thanks.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Sep 8th, 2005, 8:06am


Hesiode wrote:
How add some word to chat ?
I know it's impossible with your script, but have you a idea for make that ?


I've already talked about that with Hetzy (replayers.com headadmin) and we both agreed that it is forbidden by the EULA and that Blizzard has to be notified about what replays.net does with their replays.
Though it may be a pain in the ass for us developers if Blizz changes something in replays structure, I think this had to be done. I guess replay sites shouldn't advertise themselves in the replays.

Title: Re: PHP Warcraft III Replay Parser
Post by Cariocas on Sep 8th, 2005, 6:38pm

Hi, first of all thx for this great program !

Here is my problem:

I wanted to try this prog out , on my own PC in local.

When i clicked on the example button i got the listing of all my replays stored in the replays directory.Until there, no prob.

It comes when i want to see details of the replays. When i click on the name, i just got exactly the same page with the listing of all replays, and i don't have the details of the replay itself :/

Any help would be appreciated, thx :)

I have to notice, i'm a novice in PHP :p

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Sep 8th, 2005, 6:48pm

Read line 28 of example.php. Yes, you have register globals off.

Title: Re: PHP Warcraft III Replay Parser
Post by Cariocas on Sep 9th, 2005, 2:05am

Cool it works now :) thx

Title: Re: PHP Warcraft III Replay Parser
Post by Racek on Sep 11th, 2005, 6:03pm

Bug report...
Maybe You don't wanna this bug report but ;D...


"Warning: rsort() expects parameter 1 to be array, null given in C:\Inetpub\wwwroot\replays\index.php on line 50

Warning: Invalid argument supplied for foreach() in C:\Inetpub\wwwroot\replays\index.php on line 52"

Hmmm... No files in 'download'... Maybe it would like be "No files in 'download' folder"...



Warning: main(counter.inc) [function.main]: failed to open stream: No such file or directory in C:\Inetpub\wwwroot\replays\index.php on line 104

Warning: main() [function.include]: Failed opening 'counter.inc' for inclusion (include_path='.;C:\php5\pear') in C:\Inetpub\wwwroot\replays\index.php on line 104
visits since 21.09.04.

Script cannot include counter.inc... I've checked "w3g-julas-2.2.zip" and file 'counter.inc' doesn't exist!

Pisze po ang. z przymusu, ale jakbym cos poknocil - nie smiac sie!  ;D

Title: Re: PHP Warcraft III Replay Parser
Post by wulfskin on Sep 12th, 2005, 10:41pm

I guess your problem is installing a web server with php right.
Because these errors are not caused by the script.

Regards,
Hape

Title: Re: PHP Warcraft III Replay Parser
Post by rekrfeht on Nov 28th, 2007, 10:26am

I've tried several versions of PHP Parser(1.0, 1.9, 2.0, 2.1, 2.2) and different replays (WC3 v1.20, 1.20b, and 1.21) they produced similiar result:

Fatal error: Maximum execution time of 30 seconds exceeded in E:\htdocs\julas\w3g-julas.php on line 448

I think 30 seconds maximum execution time should be more than enough. I tried it on my notebook (core duo T2300, 1GB RAM). One of the replays is less than 100KB.

Does anyone have any idea what's wrong with it?

Thanks.

Title: Re: PHP Warcraft III Replay Parser
Post by DraF.Alex on Dec 22nd, 2007, 5:31pm

Hi

I get this error msg when i upload replays: "/mnt/tmp/phpQtaGND: Unhandled replay action: 0x41, previous was 0x0"

I tried several replays but no one worked.

My Strato Support said that:
We detect that you are working wit dynamic paths. Ypu could see this at this path: /mnt/tmp/phpQtaGND
These dynamic paths change automatically.
Please use in your script the absolutely path to your packet or /tmp file.


But what shall i do now? Can someone help me, pls?  :'(

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Jan 6th, 2008, 1:11pm

Hi, I'm back after a long break ;) Actually, I didn't know this forum was still online.

I released a new version of the parser with a few fixes, most importantly with a fix for the replays with changed chatlog.

The website is now available at: http://w3rep.sourceforge.net/

Title: Re: PHP Warcraft III Replay Parser
Post by reshine on Jan 29th, 2008, 3:29pm

hello julas,
i'm from indonesian.. and about 2-3 years ago i try to contact you but i don't get any reply as far as i remember...

i need your permission to change your php warcraft replay parser to analyze DOTA CustomMap... and i'm actually already working at that after try to contact you...

this project is unfinished, it just updated until march 2006 and just up to date until DOTA 6.46 , a lot of new hero, skills and item that i'm not updated yet... but, now i'm with some friends want to update and finish this script... so i want to ask permissions from you because your parser is the one that we modified and combine with rush4hire unfinished script...

right now, it's online on : http://reshine.bunglon.net ... our long term goal is to made a dota replay file sharing server cms..  so before we are going too far, we need your permissions to make this modified script...

Thanks for your attention and your great script


p.s.  Sorry for a bad english... ^_^

Title: Re: PHP Warcraft III Replay Parser
Post by Dahnjin on Feb 19th, 2008, 6:41am

The ACTION_DELAY seems to make this unusable. I've used example.php to parse a bunch of replays and unfortunately every one of them has inaccuracies unless I muck with the ACTION_DELAY.

Certainly there seems to be a better way to see if a unit is actually built or a hero levels than the way it's being done with the ACTION_DELAY determining if it's a "duplicate" but I can't find any solid documentation on the file format anymore (the ones on the front page for this website are 404.)

Anyone have a copy of the file format spec?

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Feb 19th, 2008, 9:07am

Please, first read, then ask. The docs are included in the release of my parser and this fact is even mentioned on the parser's website.

If you found a better way to find duplicate actions, it would be great.
In your e-mail, you stated that reducing ACTION_DELAY to 100 helped with one of your replays. Well, for low APM replays it would probably work, as ACTION_DELAY equal to 100 is exactly the same as no ACTION_DELAY at all (TimeBlocks are either 100 or 250ms) and players with low APM tend not to generate duplicate actions.
However, I found 1000 to be most accurate for the majority of replays (usually it only messes up/reduces the number of first trained workers).

Still, even if you solve the matter of duplicate actions, there are also other problems. One of them is when a user has multiple buildings under one hotkey, say one Crypt and two Slaughterhouses. If he selects two Slaughterhouses subgroup and issues train Abomination, we don't really know how many units are trained. AFAIR I mentioned this problem on this forum some time ago in more detail.

Finally, stating that the parser is unusable because unit counts are not 100% accurate seems like an exaggeration. What do you use the parser for?

Title: Re: PHP Warcraft III Replay Parser
Post by Dahnjin on Feb 19th, 2008, 1:23pm

Hi and thanks for the quick reply!  ;D

I have not started to use it at all yet, we were considering using it for a major WC3 replays site. Quite obviously if our site had the wrong number of units for replays, or even the wrong hero levels, that would look very bad.

I will email you specifics on files I'm having trouble with so if you have time you can look. Perhaps it's user error on my part, but I'm not sure how that could be.

Cheers,
D

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 7th, 2010, 6:19pm

hi guys im kindy newby in w3g php parser. im include the file w3g-julas.php at my project and im having an error saying
Code:
Fatal error: Class 'replay' not found in D:\xampp\htdocs\globe-replay\application\views\files.php on line 13

can any1 explain me why?

tnx in advance.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 7th, 2010, 6:28pm

Please show some source code.

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 7th, 2010, 7:14pm


Code:
<div class="round_5 body_content_1">
             <?=anchor('files/view_detail/1','View sample');?>
       <?php
                 require(base_url().'parser/w3g-julas.php');
                 //$this->load->library('w3g-julas');
                 
                 $rep = new replay(base_url().'replays/tupac_vs_jasmin.w3g');
                 echo $rep->game['creator'];
                 
           ?>
   </div>

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 7th, 2010, 7:29pm

base_url().'parser/w3g-julas.php' - Does this really return the correct path?

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 8th, 2010, 4:10am

require(base_url().'parser/w3g-julas.php');
ok i did reconstruct the directory to were the w3g-julas.php to place. so i place the w3g-julas.php to the directory to were it is been called.

so i change it to :

<div class="round_5 body_content_1">
           <?=anchor('files/view_detail/1','View sample');?>
      <?php
                 
                 require('w3g-julas.php');
           
                 
                 $rep = new replay(base_url().'replays/tupac_vs_jasmin.w3g');
                 echo $rep->game['creator'];
                 
           ?>
</div>


now i call the class replay, but i got soo many errors like
Message: fseek() [function.fseek]: stream does not support seeking
Message: Undefined variable: block_id
Message: Undefined variable: action
Message: Undefined index: actions_details
Message: Undefined index: Select / deselect
..
...
and ohers.


but the echo $rep->game['creator']; did return the actual name of the creator.

so i place an @ sign at
@$rep = new replay(base_url().'replays/tupac_vs_jasmin.w3g');
to ignore the error.

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 8th, 2010, 2:40pm

and also how is it load too long, it takes about 15 to 20 sec to load. what if i have let say a 100 files on my w3g directory and i need to read each and every file to see if there is player name pacman and list out all the file that has a player name pacman, it will end up in 25min.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 8th, 2010, 10:40pm

This is definitely not normal but I'm quite clueless. Possibly some unusual configuration of your web server or PHP is causing that.

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 9th, 2010, 1:58am

i can see here that the delay loading is cause by the errors that i mention above i guess it in the looping inside w3g-julas.php.

im using xampp [PHP: 5.3.0]

im checking it out the first error

Quote:
A PHP Error was encountered

Severity: Warning

Message: fseek() [function.fseek]: stream does not support seeking

Filename: views/w3g-julas.php

Line Number: 85

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 9th, 2010, 8:43am

i did try the normal php and include w3g-jules.php in it and it works fine,
ok the error must have been come from codeigniter framework fseek must have been disabled or something in CI and i dont know why...

but is it always taking some time to read a single w3g file? its taking about 15 sec to read 1 file, is it normal?



Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 9th, 2010, 9:58am

No, it's not normal. It should normally take not more than one second on modern hardware.

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 10th, 2010, 4:59am

any suggestion why? or any alternative suggestion?

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 10th, 2010, 6:53pm

What is the configuration of the server? Is it a shared hosting? Are your resources (CPU, memory) somehow limited by the hosting provider?

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 10th, 2010, 10:49pm

im running it in localhost. and i did a very simple code


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php
$time_start = microtime();
require('w3g-julas.php');
$rep = new replay('momon.w3g');
                 
echo 'Host: '.$rep->game['creator'].'<br />';
echo 'Game time :'.convert_time($rep->header['length']).'<br />';
                 
$time_end = microtime();
$temp = explode(' ', $time_start.' '.$time_end);
$duration=sprintf('%.8f',($temp[2]+$temp[3])-($temp[0]+$temp[1]));
echo 'Generated in '.$duration.' seconds.<br />';
echo $rep->game['winner_team'];
?>

<body>
</body>
</html>


this one is taking me about 13sec to load.

apache server at :
xampp

pc specs..:
AMD athlon(tm)64 x2 dual
2gb memory



Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 11th, 2010, 12:35am

sorry for not mentioning, im using dota w3g replay map.

ok i did change the said file w3g-julas-convert.php to w3g-dota-convert.php

now it only gives me about 3sec in loading. is it the usual time of loading?

note: running on eclipse im getting undefined variable and undefined index in console,..

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 11th, 2010, 1:47pm

how to get hero name? and also how to update the parser when there is new patch in warcraft? i can see here that w3g-dota-convert.php is old, and their is a lot of update from where this file has been updated.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 12th, 2010, 1:08pm

Sorry, I'm not the author of DOTA modifications so I can't speak for them. Can you send me the replay anyway so I can check it on my computer?

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 12th, 2010, 2:11pm

where to send? it says here that the author is


Quote:
/******************************************************************************
Additional conversion functions for
Warcraft III Replay Parser 2.3
(c) 2003-2008 Juliusz 'Julas' Gonera
http://w3rep.sourceforge.net/
e-mail: julas@toya.net.pl
******************************************************************************/

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 12th, 2010, 3:14pm

sorry for being eager to know how replay class work... :P

can i start here

Quote:
$this->header = @unpack('a28intro/Vheader_size/Vc_size/Vheader_v/Vu_size/Vblocks', $data);


is the a28intro/Vheader_size/Vc_size/Vheader_v/Vu_size/Vblocks is a part of the array in w3g replay file?

is there a documentation that will assist me where does this array will use?

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 15th, 2010, 6:36pm

No idea. Seems that the author of the DOTA mod forgot to include his contact info.

The docs are included in the official release (available on http://w3rep.sf.net/). There's no array in a replay file. It's binary data and unpack() is a function for reading binary values from files in PHP. Please refer to the PHP manual.

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 16th, 2010, 2:41pm

yes i have reviewed how to read a binary file,. but even though, i still don't know how does the w3g file structure are made.

Title: Re: PHP Warcraft III Replay Parser
Post by Julas.wtfwrongpass on Mar 17th, 2010, 6:48pm

Sorry, I don't have enough time to help you with that. There's plenty of information in the Internet.

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 17th, 2010, 7:13pm

oh... should i consider this forum as closed?

Title: Re: PHP Warcraft III Replay Parser
Post by paulon on Mar 22nd, 2010, 2:25pm

anyway tnx for the replies. some of this might help me start a new one.

Title: Re: PHP Warcraft III Replay Parser
Post by zloba on Jun 5th, 2011, 12:52am

I want know still have someone in this forum ??? I need help i want to integrate replay parser in php fusion system 7.01. Can someone give me a ideas. Thx.

ShadowFlare's Realm » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.