Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[RELEASE] Tribalwars LAN OPENSOURCE 100%

Status
Not open for further replies.
Newbie Spellweaver
Joined
Feb 11, 2014
Messages
6
Reaction score
0
guys i have a problem , i cant run the daemons/event.php every second because minim time for cronjob is 1 minute , so when buildings/troops/etc finishing time is up the time is going on negative like -1,-2,-3,-4,-5 and so on ... what can i do ? it's something wrong from script ? anyone can explain to me how i can fix this poop ? i can't do anything

here's a photo
Mugaru - [RELEASE] Tribalwars LAN OPENSOURCE 100% - RaGEZONE Forums
 
Junior Spellweaver
Joined
Feb 27, 2012
Messages
188
Reaction score
19
Open a new tab in your browser, and open up:

You should later run it as a cronjob ;-) got a fixed script for it.
You can run that every minute. In that minute the server will re run the script every second ;)
 
Newbie Spellweaver
Joined
Oct 30, 2013
Messages
50
Reaction score
1
Failing SQL: SELECT COUNT(`id`) AS `exist`,`banned` FROM `zapping_worlds_m1`.`users` WHERE `id`='1'
Error: SELECT command denied to user 'a1395409_testmysql'@'10.1.1.36' for table 'users'

Any idea on how to fix this? I am hosting on 000webhost so I am using their MySQL database.
 
Last edited:
Newbie Spellweaver
Joined
Feb 20, 2014
Messages
20
Reaction score
0
Failing SQL: SELECT COUNT(`id`) AS `exist`,`banned` FROM `zapping_worlds_m1`.`users` WHERE `id`='1'
Error: SELECT command denied to user 'a1395409_testmysql'@'10.1.1.36' for table 'users'

Any idea on how to fix this? I am hosting on 000webhost so I am using their MySQL database.


have the same problem
 
Junior Spellweaver
Joined
Feb 27, 2012
Messages
188
Reaction score
19
have the same problem

In your database there is a table called: Config, change it to your data ;-)



About the cronjob thing, i got a fix for that.

Replace the whole event.php with this:

PHP:
<?php


function msec(){
	list($msec, $sec) = explode(' ', microtime());
	return ($sec%3600)*1000+$msec*1000;
}
function gets_ms($a){
	global $load_msec;
	echo "$a: ".(msec()-$load_msec)."<br />";
}


$start = microtime(true);
set_time_limit(60);
for ($i = 0; $i < 59; ++$i) {	
	error_reporting(E_ALL ^ E_NOTICE);
	$time = time();
	$load_msec = msec();
	define("PATH", str_replace(PATH_SEPARATOR, "/", dirname(dirname(__FILE__))));
	require_once(PATH."/include/config.php");
	require_once(PATH."/lib/functions.php");
	require_once(PATH."/lib/DB_MySQL.php");
	$db = new DB_MySQL();
	$db->connect($config['db_host'], $config['db_user'], $config['db_pw'], $config['db_name']);
	if($time+5 < time()){
		exit("Sem resposta do MySQL! Verifique a conexao!");
	}
	require_once(PATH."/lib/GetVillageData.php");
	require_once(PATH."/lib/GetUserData.php");
	require_once(PATH."/lib/login.php");
	require_once(PATH."/lib/sid.php");
	require_once(PATH."/lib/map.php");
	require_once(PATH."/lib/builds.php");
	require_once(PATH."/lib/units.php");
	require_once(PATH."/lib/techs.php");
	require_once(PATH."/lib/add_report.php");
	require_once(PATH."/lib/do_action.php");
	require_once(PATH."/lib/awards.php");
	require_once(PATH."/lib/train.php");
	require_once(PATH."/lib/events.php");
	require_once(PATH."/lib/knight_items.php");
	require_once(PATH."/include/configs/buildings.php");
	require_once(PATH."/include/configs/raw_material_production.php");
	require_once(PATH."/include/configs/farm_limits.php");
	require_once(PATH."/include/configs/max_storage.php");
	require_once(PATH."/include/configs/max_hide.php");
	require_once(PATH."/include/configs/units.php");
	require_once(PATH."/include/configs/techs.php");
	require_once(PATH."/include/configs/max_wall_bonus.php");
	require_once(PATH."/include/configs/dealers.php");
	require_once(PATH."/include/configs/awards.php");
	require_once(PATH."/include/configs/knight_items.php");

	$run_key = generate_key();
	$cl_reports = new add_report();
	print("Os eventos estao funcionando... Nao feche esta janela pois aqui a magica de servidor acontece =D");
	// for($i = 0; $i < (2 << 15); ++$i){
	// 	$last = time();
		check_events();
		check();
	// 	if($last == time()){
	// 		sleep(1);
	// 	}
	// }
	time_sleep_until($start + $i + 1);
}
?>
 
Newbie Spellweaver
Joined
Dec 7, 2009
Messages
12
Reaction score
0
In your database there is a table called: Config, change it to your data ;-)



About the cronjob thing, i got a fix for that.

Replace the whole event.php with this:

PHP:
<?php


function msec(){
	list($msec, $sec) = explode(' ', microtime());
	return ($sec%3600)*1000+$msec*1000;
}
function gets_ms($a){
	global $load_msec;
	echo "$a: ".(msec()-$load_msec)."<br />";
}


$start = microtime(true);
set_time_limit(60);
for ($i = 0; $i < 59; ++$i) {	
	error_reporting(E_ALL ^ E_NOTICE);
	$time = time();
	$load_msec = msec();
	define("PATH", str_replace(PATH_SEPARATOR, "/", dirname(dirname(__FILE__))));
	require_once(PATH."/include/config.php");
	require_once(PATH."/lib/functions.php");
	require_once(PATH."/lib/DB_MySQL.php");
	$db = new DB_MySQL();
	$db->connect($config['db_host'], $config['db_user'], $config['db_pw'], $config['db_name']);
	if($time+5 < time()){
		exit("Sem resposta do MySQL! Verifique a conexao!");
	}
	require_once(PATH."/lib/GetVillageData.php");
	require_once(PATH."/lib/GetUserData.php");
	require_once(PATH."/lib/login.php");
	require_once(PATH."/lib/sid.php");
	require_once(PATH."/lib/map.php");
	require_once(PATH."/lib/builds.php");
	require_once(PATH."/lib/units.php");
	require_once(PATH."/lib/techs.php");
	require_once(PATH."/lib/add_report.php");
	require_once(PATH."/lib/do_action.php");
	require_once(PATH."/lib/awards.php");
	require_once(PATH."/lib/train.php");
	require_once(PATH."/lib/events.php");
	require_once(PATH."/lib/knight_items.php");
	require_once(PATH."/include/configs/buildings.php");
	require_once(PATH."/include/configs/raw_material_production.php");
	require_once(PATH."/include/configs/farm_limits.php");
	require_once(PATH."/include/configs/max_storage.php");
	require_once(PATH."/include/configs/max_hide.php");
	require_once(PATH."/include/configs/units.php");
	require_once(PATH."/include/configs/techs.php");
	require_once(PATH."/include/configs/max_wall_bonus.php");
	require_once(PATH."/include/configs/dealers.php");
	require_once(PATH."/include/configs/awards.php");
	require_once(PATH."/include/configs/knight_items.php");

	$run_key = generate_key();
	$cl_reports = new add_report();
	print("Os eventos estao funcionando... Nao feche esta janela pois aqui a magica de servidor acontece =D");
	// for($i = 0; $i < (2 << 15); ++$i){
	// 	$last = time();
		check_events();
		check();
	// 	if($last == time()){
	// 		sleep(1);
	// 	}
	// }
	time_sleep_until($start + $i + 1);
}
?>

Tried your fix for events.php but it does nothing.
 
Junior Spellweaver
Joined
Feb 27, 2012
Messages
188
Reaction score
19
you need to put it in the cronjob settings @ your server ;-). Then it should run every second for one minute, and it will start again ;-)

You need to let it run every minute ;)
 
Junior Spellweaver
Joined
Feb 27, 2012
Messages
188
Reaction score
19
Yes. The best is to find a host (i suggest you to hire a VPS / WebServer somewhere).
Then you can configure the Cronjob. And it will run without any problem ;-)

When i got a server again (since i just ended it yesterday) i will make a tutorial on how to set this up.
 
Newbie Spellweaver
Joined
Jan 29, 2008
Messages
27
Reaction score
0
Someone got the admin panels from it ?

// Acesso master ao painel administrativo
$config['master_user'] = 'Zapping_Admin';
$config['master_pw'] = 'Zapping1234';
 
Banned
Banned
Joined
Jul 30, 2014
Messages
166
Reaction score
7
for a moment i though i saw "TROLLWARS" :D

This should be good files. :)
 
Status
Not open for further replies.
Back
Top