Welcome, Guest. Please Login
Back to main page
  News:
Welcome to the ShadowFlare's Realm Forums.  New registrations are by request only.  To be considered for a new forum account, send an e-mail with the user name and display name you want and the reason you want to register.
  Home SFRealm HelpSearchLogin  
 
Pages: 1 ... 4 5 6 7 
Send Topic Print
PHP Warcraft III Replay Parser (Read 104930 times)
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #75 - Mar 07th, 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> 

Back to top
 
 
  IP Logged
Julas.wtfwrongpass
Grunt
**
Offline



Posts: 84

Re: PHP Warcraft III Replay Parser
Reply #76 - Mar 7th, 2010, 7:29pm
 
base_url().'parser/w3g-julas.php' - Does this really return the correct path?
Back to top
 
 
WWW 64994211   IP Logged
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #77 - 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.
Back to top
 
 
  IP Logged
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #78 - 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.
Back to top
 
« Last Edit: Mar 8th, 2010, 5:02pm by paulon »  
  IP Logged
Julas.wtfwrongpass
Grunt
**
Offline



Posts: 84

Re: PHP Warcraft III Replay Parser
Reply #79 - 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.
Back to top
 
 
WWW 64994211   IP Logged
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #80 - 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
Back to top
 
 
  IP Logged
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #81 - 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?


Back to top
 
 
  IP Logged
Julas.wtfwrongpass
Grunt
**
Offline



Posts: 84

Re: PHP Warcraft III Replay Parser
Reply #82 - Mar 9th, 2010, 9:58am
 
No, it's not normal. It should normally take not more than one second on modern hardware.
Back to top
 
 
WWW 64994211   IP Logged
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #83 - Mar 10th, 2010, 4:59am
 
any suggestion why? or any alternative suggestion?
Back to top
 
 
  IP Logged
Julas.wtfwrongpass
Grunt
**
Offline



Posts: 84

Re: PHP Warcraft III Replay Parser
Reply #84 - 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?
Back to top
 
 
WWW 64994211   IP Logged
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #85 - 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


Back to top
 
 
  IP Logged
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #86 - 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,..
Back to top
 
 
  IP Logged
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #87 - 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.
Back to top
 
« Last Edit: Mar 12th, 2010, 3:50am by paulon »  
  IP Logged
Julas.wtfwrongpass
Grunt
**
Offline



Posts: 84

Re: PHP Warcraft III Replay Parser
Reply #88 - 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?
Back to top
 
 
WWW 64994211   IP Logged
paulon
Peon
*
Offline



Posts: 15

Re: PHP Warcraft III Replay Parser
Reply #89 - 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
******************************************************************************/
Back to top
 
 
  IP Logged
Pages: 1 ... 4 5 6 7 
Send Topic Print