|
|
|
|
![]() ![]() |
Apr 17 2005, 05:16 AM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 408 Joined: 7-December 04 From: Nova Scoita, Canada Member No.: 2,604 |
I just download the army system code because I was curious if it would be better to modify the existing code or rewrite a new game. The code can be download at:
http://mods.invisionize.com/db/index.php/f/3347ttp:// I started a discussion about creating a new game at: http://www.trap17.com/forums/a-home-grown-...t20398-s10.html I created this discussion to help dissect the code and understand what it works. From what the army system does it looks needles complicated. But perhaps there is a lot of extra stuff there for administrator options. The discussion is created to try understand how the army system works. Not knowing php, this will be a formidable task for me I would appreciate any help. |
|
|
|
Apr 17 2005, 05:44 AM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 408 Joined: 7-December 04 From: Nova Scoita, Canada Member No.: 2,604 |
Okay, I don’t know php, put looking at the code so far it looks like the main functions in the game are in the file army.php. Near the first the class army is defined army. Each member in the game I assume when they play has an instance of the class army. It has the properties, $page_title, $nav, $output, $currency, $max, $html, $member, $inv, $all_inv, $sql_class. I am not sure what any of these things do. Darn lack of comments. There is a strange bit of code that is commented out:
CODE // Maximum values // siege = max['maxsiege'] // fort = max['maxfort'] // unit production = max['maxprod'] // spy level = max['maxspy'] There is a method called auto_run(), which must intiate some kind of thread that runs while you are playing. Is there threads in php. Okay, that is enough for now. |
|
|
|
Apr 17 2005, 02:18 PM
Post
#3
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 287 Joined: 23-February 05 Member No.: 3,945 |
Ok, this looks like it could be where our error would be, everyone take a look-see, it is located in sources/army/army_func.php
CODE // How much time do we have left before the next update function timediff($time) { global $ibforums; if($time <= 60) { $time_unit = $ibforums->lang['sec']; if($time == 1) $time_unit = $ibforums->lang['sec1']; $time2 = $time.$time_unit; } elseif($time <= 3600) { $time_unit = $ibforums->lang['min']; $time = floor($time / 60); if($time == 1) $time_unit = $ibforums->lang['min1']; $time2 = $time.$time_unit; } elseif($time <= 86400) { $time_unit = $ibforums->lang['hr']; $time = floor($time / 3600); if($time == 1) $time_unit = $ibforums->lang['hr1']; $time2 = $time.$time_unit; } elseif($time <= 604800) { $time_unit = $ibforums->lang['day']; $time = floor($time / 86400); if($time == 1) $time_unit = $ibforums->lang['day1']; $time2 = $time.$time_unit; } elseif($time > 604800) { $time_unit = $ibforums->lang['week']; $time = floor($time / 604800); if($time == 1) $time_unit = $ibforums->lang['week1']; $time2 = $time.$time_unit; } return $time2; } |
|
|
|
Apr 17 2005, 02:33 PM
Post
#4
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 408 Joined: 7-December 04 From: Nova Scoita, Canada Member No.: 2,604 |
Notice that the time difference is equal to the current time multiplied by the unit time
$time2 = $time.$time_unit; If the current time is the numbers of hours the game has been running and the unit time is increased then the time would be proportionally increased. This would cause the game to jump ahead in time. So the question remains as to whether changing the unit time will change the variable time accordingly or leave it unchanged. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 1st December 2008 - 05:52 PM |