[solved]how to get PB?

This is the dedicated forum for RemoteCP4: the web based dedicated server control script.

Moderators: hal|Sascha, TM-Patrol

Post Reply
nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

[solved]how to get PB?

Post by nikolans » 12 Nov 2008 12:09

Hello,

How to get Personal best in time attack mode? I can not figure out this i RemoteCP.

Anyone?

p.s. explanation would be enough.
Last edited by nikolans on 12 Nov 2008 16:49, edited 1 time in total.

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: how to get PB?

Post by nikolans » 12 Nov 2008 12:15

I found this:

Code: Select all

$result2 = $this->base->SQLQuery("	SELECT a.Score, DATE_FORMAT(a.Date,'%d-%m-%y %H:%i') AS Date, b.NickName
												FROM rcp_records AS a
												LEFT JOIN rcp_players AS b
													ON a.PlayerId = b.Id
												WHERE a.ChallengeId = '". $this->base->SQLEscape($this->base->challenge->Id) ."' && a.PlayerId = '". $this->base->SQLEscape($params[0]->Id) ."'
												ORDER BY a.Score asc
												LIMIT 0,1");
			$pb = $this->base->SQLFetch($result2);
But rcp_records and rcp_players are empty all the time!!!

corto-72
smooth traffic navigator
smooth traffic navigator
Posts: 284
Joined: 28 Jul 2008 16:12
Owned TM-games: TMUF
Location: Toulouse
Contact:

Re: how to get PB?

Post by corto-72 » 12 Nov 2008 12:44

The bit of code you've extracted should give you PB...

No reasons for the tables to be empty since when a player finishes the DB is updated if score has been improved...
see extracted code from onPlayerFinish in Records plugin:

Code: Select all

		//Insert/Update record
		$result = $this->base->sql->query("SELECT Score FROM rcp_records WHERE ChallengeId = '". $this->base->sql->escape($challenge->Id) ."' && PlayerId = '". $this->base->sql->escape($player->Id) ."'");
		$row    = $this->base->sql->fetch($result);
		$score2 = empty($row->Score) ? 999999999999 : $row->Score;
		$this->base->sql->free($result);

		//Update PB
		if(($this->base->status->gamemode != 4 && $score < $player->Record) || ($this->base->status->gamemode == 4 && $score > $player->Record)) {
			$player->Record = $score;
		}

		if(($this->base->status->gamemode != 4 && $score2 > $score) || ($this->base->status->gamemode == 4 && $score2 < $score)) {
			//Insert Record
			$result = $this->base->sql->query("	INSERT INTO rcp_records
												(ChallengeId, PlayerId, Score, Date)
												VALUES
												('". $this->base->sql->escape($challenge->Id) ."', '". $this->base->sql->escape($player->Id) ."', '". $this->base->sql->escape($score) ."', NOW())
												ON DUPLICATE KEY UPDATE Id = LAST_INSERT_ID(Id), ChallengeId = VALUES(ChallengeId), PlayerId = VALUES(PlayerId), Score = VALUES(Score), Date = VALUES(Date)");
			if(!$result) return;
			$this->base->sql->free($result);
...
...
RemoteCP is working fine on our servers

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: how to get PB?

Post by nikolans » 12 Nov 2008 12:47

all rcp_ tables are emtpy. i change

Code: Select all

<sql enabled='true'>
      <host>localhost</host>
      <username>user</username>
      <password>pass</password>
      <dbname>aseco</dbname>
    </sql>
and nothing!!!!
all tables are empty!

corto-72
smooth traffic navigator
smooth traffic navigator
Posts: 284
Joined: 28 Jul 2008 16:12
Owned TM-games: TMUF
Location: Toulouse
Contact:

Re: how to get PB?

Post by corto-72 » 12 Nov 2008 12:58

I hoep you have imported remoteCP tables into your database... Aseco and remoteCP are 2 independant server controler, with different DB setups...

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: how to get PB?

Post by nikolans » 12 Nov 2008 13:03

I got this tables in aseco db:

Code: Select all

rcp_challenges
rcp_cptransactions
rcp_ladder
rcp_players
rcp_quotes
rcp_records
rcp_votes
rs_karma
rs_rank
rs_times
All empty. I know that aseco and remote cp are two different controls ...

corto-72
smooth traffic navigator
smooth traffic navigator
Posts: 284
Joined: 28 Jul 2008 16:12
Owned TM-games: TMUF
Location: Toulouse
Contact:

Re: how to get PB?

Post by corto-72 » 12 Nov 2008 13:11

Have you checked the log files in the ./cache folder to see if there was any clue to the problem? or are they empty as well?

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: how to get PB?

Post by nikolans » 12 Nov 2008 13:24

./cache is empty all the time (chmod is 777). maybe permissions? root.root is owner of all reomtecp dir!!!!

i try apache.apache also nothing i ./cache dir!!!

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: how to get PB?

Post by nikolans » 12 Nov 2008 13:30

I shutdown mysql and again RemoteCP is working normally....

corto-72
smooth traffic navigator
smooth traffic navigator
Posts: 284
Joined: 28 Jul 2008 16:12
Owned TM-games: TMUF
Location: Toulouse
Contact:

Re: how to get PB?

Post by corto-72 » 12 Nov 2008 13:46

Strange since on our server - and on my PC where I develop, if mySQL/apache is not running, the script crashes...

nikolans
cyclist
cyclist
Posts: 38
Joined: 03 Nov 2008 14:30
Owned TM-games: tmf

Re: how to get PB?

Post by nikolans » 12 Nov 2008 13:53

I put remoteCP :: Dedicated Server Remote Control Panel [4.0.2.7] update tables (delete tables then add new from live.sql and again nothing!!!!!!!! Do you use remoteCP-4 Live or remoteCP-4? I use remoteCP-4

corto-72
smooth traffic navigator
smooth traffic navigator
Posts: 284
Joined: 28 Jul 2008 16:12
Owned TM-games: TMUF
Location: Toulouse
Contact:

Re: [solved]how to get PB?

Post by corto-72 » 12 Nov 2008 19:01

I use the whole sheebang - so remoteCP4 Live for the online server / ingame management parts, and RemoteCP4 for the web admin (it's actually one single zip though, the one found on tmbase.de, tools page) [latest version as well]

Post Reply