Page Index Toggle Pages: 1 ... 4 5 [6] 7 
Topic Tools
Very Hot Topic (More than 25 Replies) PHP Warcraft III Replay Parser (Read 111237 times)
paulon
Peon
*
Offline



Posts: 15
Joined: Mar 7th, 2010
Re: PHP Warcraft III Replay Parser
Reply #75 - Mar 7th, 2010 at 7:14pm
Post Tools
Code
Select All
 <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
Joined: May 11th, 2004
Re: PHP Warcraft III Replay Parser
Reply #76 - Mar 7th, 2010 at 7:29pm
Post Tools
base_url().'parser/w3g-julas.php' - Does this really return the correct path?
  
Back to top
WWWICQ  
IP Logged
 
paulon
Peon
*
Offline



Posts: 15
Joined: Mar 7th, 2010
Re: PHP Warcraft III Replay Parser
Reply #77 - Mar 8th, 2010 at 4:10am
Post Tools
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
Joined: Mar 7th, 2010
Re: PHP Warcraft III Replay Parser
Reply #78 - Mar 8th, 2010 at 2:40pm
Post Tools
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.
« Last Edit: Mar 8th, 2010 at 5:02pm by paulon »  
Back to top
 
IP Logged
 
Julas.wtfwrongpass
Grunt
**
Offline



Posts: 84
Joined: May 11th, 2004
Re: PHP Warcraft III Replay Parser
Reply #79 - Mar 8th, 2010 at 10:40pm
Post Tools
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
WWWICQ  
IP Logged
 
paulon
Peon
*
Offline



Posts: 15
Joined: Mar 7th, 2010
Re: PHP Warcraft III Replay Parser
Reply #80 - Mar 9th, 2010 at 1:58am
Post Tools
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
Joined: Mar 7th, 2010
Re: PHP Warcraft III Replay Parser
Reply #81 - Mar 9th, 2010 at 8:43am
Post Tools
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
Joined: May 11th, 2004
Re: PHP Warcraft III Replay Parser
Reply #82 - Mar 9th, 2010 at 9:58am
Post Tools
No, it's not normal. It should normally take not more than one second on modern hardware.
  
Back to top
WWWICQ  
IP Logged
 
paulon
Peon
*
Offline



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



Posts: 84
Joined: May 11th, 2004
Re: PHP Warcraft III Replay Parser
Reply #84 - Mar 10th, 2010 at 6:53pm
Post Tools
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
WWWICQ  
IP Logged
 
paulon
Peon
*
Offline



Posts: 15
Joined: Mar 7th, 2010
Re: PHP Warcraft III Replay Parser
Reply #85 - Mar 10th, 2010 at 10:49pm
Post Tools
im running it in localhost. and i did a very simple code

Code
Select All
<!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
Joined: Mar 7th, 2010
Re: PHP Warcraft III Replay Parser
Reply #86 - Mar 11th, 2010 at 12:35am
Post Tools
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
Joined: Mar 7th, 2010
Re: PHP Warcraft III Replay Parser
Reply #87 - Mar 11th, 2010 at 1:47pm
Post Tools
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.
« Last Edit: Mar 12th, 2010 at 3:50am by paulon »  
Back to top
 
IP Logged
 
Julas.wtfwrongpass
Grunt
**
Offline



Posts: 84
Joined: May 11th, 2004
Re: PHP Warcraft III Replay Parser
Reply #88 - Mar 12th, 2010 at 1:08pm
Post Tools
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
WWWICQ  
IP Logged
 
paulon
Peon
*
Offline



Posts: 15
Joined: Mar 7th, 2010
Re: PHP Warcraft III Replay Parser
Reply #89 - Mar 12th, 2010 at 2:11pm
Post Tools
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
 
Page Index Toggle Pages: 1 ... 4 5 [6] 7 
Topic Tools