[XASECO] Sector Records

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: [XASECO] Sector Records

Post by Ant » 05 Aug 2010 08:13

keep_on_dreaming wrote:

Code: Select all

`aseco`.`secrecs_all`
The update queries are still incorrect.
So, what are the corrections ?

User avatar
michixxx93
wheelbarrow operator
wheelbarrow operator
Posts: 15
Joined: 10 Jul 2009 13:25
Owned TM-games: TMUF
Contact:

Re: [XASECO] Sector Records

Post by michixxx93 » 05 Aug 2010 22:31

This is the correct version! I've tried it several times and I always got the right result.
In this case `aseco`.`secrecs_all` and `secrecs_all` are the same, because the database `aseco` is already selected, but I'm used to write my query this way.
Image

Image

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: [XASECO] Sector Records

Post by Ant » 06 Aug 2010 06:57

I haven't noticed anything wrong myself either - its all working as it should do - and thats all I need to worry about :)

User avatar
keep_on_dreaming
pedestrian
pedestrian
Posts: 11
Joined: 10 May 2010 03:30
Owned TM-games: TMUF; TMU
Location: Germany
Contact:

Re: [XASECO] Sector Records

Post by keep_on_dreaming » 15 Aug 2010 05:27

But not everybody is using the default database.

There are a few other problems with this plugin:
1.) Own secrecs won't load on new challenge what causes duplicate entries in database.
2.) The secrecs sometimes aren't correctly sorted.
3.) There is no possibility to just delete 1 secrec after someone took the wrong way for example.

User avatar
Ant
TM-Patrol
TM-Patrol
Posts: 1845
Joined: 01 Dec 2007 17:04
Owned TM-games: TMN, TMUF, TM Wii
Location: London, England
Contact:

Re: [XASECO] Sector Records

Post by Ant » 15 Aug 2010 18:06

Well, I don't use the default database either - mine is named something else and not Aseco but it still seems ok. The possibility to delete 1 secrec as you say would be a good idea though I reckon.

User avatar
michixxx93
wheelbarrow operator
wheelbarrow operator
Posts: 15
Joined: 10 Jul 2009 13:25
Owned TM-games: TMUF
Contact:

Re: [XASECO] Sector Records

Post by michixxx93 » 17 Aug 2010 18:15

keep_on_dreaming wrote:1.) Own secrecs won't load on new challenge what causes duplicate entries in database.
This is called on new challenge:
foreach($aseco->server->players->player_list as $player)
{
load_mysql_own($challengeNow,$player->login);
}
keep_on_dreaming wrote:2.) The secrecs sometimes aren't correctly sorted.
Could you be a little more precisely? own or all records ? The order should be correct because it's sorted by sector and btw a screenshot would help too.
keep_on_dreaming wrote:3.) There is no possibility to just delete 1 secrec after someone took the wrong way for example.
I'll see what I can do. I think a good way would be a window with the records like the jukebox.
Image

Image

User avatar
keep_on_dreaming
pedestrian
pedestrian
Posts: 11
Joined: 10 May 2010 03:30
Owned TM-games: TMUF; TMU
Location: Germany
Contact:

Re: [XASECO] Sector Records

Post by keep_on_dreaming » 21 Aug 2010 01:16

michixxx93 wrote:
keep_on_dreaming wrote:1.) Own secrecs won't load on new challenge what causes duplicate entries in database.
This is called on new challenge:
foreach($aseco->server->players->player_list as $player)
{
load_mysql_own($challengeNow,$player->login);
}
Like i told you, it isn't working.
For example:
After training a map the own secrecs are shown in the window and stored to database. When this map is running again, there aren't any own secrecs loaded, what causes a new insert query into database.
keep_on_dreaming wrote:2.) The secrecs sometimes aren't correctly sorted.
Could you be a little more precisely? own or all records ? The order should be correct because it's sorted by sector and btw a screenshot would help too.

User avatar
L3cKy
happy cruiser
happy cruiser
Posts: 138
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Manialink(s): woa
Location: Sweden
Contact:

Re: [XASECO] Sector Records

Post by L3cKy » 25 Feb 2017 15:07

DB-Store Fix: // there was some problems with correct storing into the db ... now it should work correctly

chnage in plugin.bestsecs.php from line 185 this ->

Code: Select all

function update_mysql_all($recordTime,$sector,$challenge,$playerNick,$aseco)
{
	$query = "";
	if(mysql_num_rows(mysql_query("SELECT * FROM secrecs_all WHERE ChallengeID='".$challenge."' AND Sector='".$sector."' LIMIT 1;")) < 1)
	{
		$query = "INSERT INTO secrecs_all (ID,ChallengeID,Sector,PlayerNick,Time) VALUES ('0','".$challenge."','".$sector."','".$playerNick."','".$recordTime."');";
	}
	else
	{
		$query = "UPDATE `aseco`.`secrecs_all` SET `PlayerNick` = '".$playerNick."', `Time` = '".$recordTime."' WHERE ChallengeID='".$challenge."' AND Sector='".$sector."';";
	}
	mysql_query($query);
}
function update_mysql_own($recordTime,$sector,$challenge,$playerNick,$aseco)
{
	$query = "";
	if(mysql_num_rows(mysql_query("SELECT * FROM secrecs_own WHERE ChallengeID='".$challenge."' AND Sector='".$sector."' AND PlayerNick='".$playerNick."' LIMIT 1;")) < 1)
	{
		$query = "INSERT INTO `secrecs_own` (ID,ChallengeID,Sector,PlayerNick,Time) VALUES ('0','".$challenge."','".$sector."','".$playerNick."','".$recordTime."');";
	}
	else
	{
		$query = "UPDATE `aseco`.`secrecs_own` SET `PlayerNick` = '".$playerNick."', `Time` = '".$recordTime."' WHERE ChallengeID='".$challenge."' AND Sector='".$sector."';";
	}
	mysql_query($query);
}
into this ->

Code: Select all

<?php
function update_mysql_all($recordTime,$sector,$challenge,$playerNick,$aseco)
{
	if(mysql_num_rows(mysql_query("SELECT * FROM secrecs_all WHERE ChallengeID='".$challenge."' AND Sector='".$sector."' LIMIT 1;")) < 1)
	{
		$query = "INSERT INTO secrecs_all (ID,ChallengeID,Sector,PlayerNick,Time) VALUES ('0','".$challenge."','".$sector."','".$playerNick."','".$recordTime."');";
		mysql_query($query);
	}
	else
	{
		$query = "UPDATE `secrecs_all` SET `PlayerNick` = '".$playerNick."', `Time` = '".$recordTime."' WHERE ChallengeID='".$challenge."' AND Sector='".$sector."';";
		mysql_query($query);
	}
}
function update_mysql_own($recordTime,$sector,$challenge,$playerNick,$aseco)
{
	if(mysql_num_rows(mysql_query("SELECT * FROM secrecs_own WHERE ChallengeID='".$challenge."' AND Sector='".$sector."' AND PlayerNick='".$playerNick."' LIMIT 1;")) < 1)
	{
		$query = "INSERT INTO `secrecs_own` (ID,ChallengeID,Sector,PlayerNick,Time) VALUES ('0','".$challenge."','".$sector."','".$playerNick."','".$recordTime."');";
		mysql_query($query);
	}
	else
	{
		$query = "UPDATE `secrecs_own` SET `PlayerNick` = '".$playerNick."', `Time` = '".$recordTime."' WHERE ChallengeID='".$challenge."' AND Sector='".$sector."';";
		mysql_query($query);
	}
}
?>
Greetings
Last edited by L3cKy on 09 Mar 2017 20:25, edited 3 times in total.

Xymph
Pit Crew
Pit Crew
Posts: 5644
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: [XASECO] Sector Records

Post by Xymph » 25 Feb 2017 17:55

L3cKy wrote:Timefix // Now the Sectortimes shows the real time you drove at the cp instead of the time you needed from the last cp to the next one
Then by definition it isn't a sector time anymore. Split time or CP time would be a suitable name.
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

User avatar
L3cKy
happy cruiser
happy cruiser
Posts: 138
Joined: 05 Sep 2007 13:55
Owned TM-games: TMUF
Manialink(s): woa
Location: Sweden
Contact:

Re: [XASECO] Sector Records

Post by L3cKy » 25 Feb 2017 18:13

Xymph wrote:
L3cKy wrote:Timefix // Now the Sectortimes shows the real time you drove at the cp instead of the time you needed from the last cp to the next one
Then by definition it isn't a sector time anymore. Split time or CP time would be a suitable name.
Yes you are right ... i deleted it.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest