Page 2 of 6

Re: Public DB temporarily offline

Posted: 08 Jun 2008 15:38
by s!em
Can anyone port it then?

Re: Public DB temporarily offline

Posted: 08 Jun 2008 17:19
by oliverde8
[06/08,19:56:50] ************* (Dedimania) *************
[06/08,19:56:50] * Dataserver connection on Dedimania ...
[06/08,19:56:50] * Try connection on http://dedimania.net:8003/Dedimania ...

Fatal error: Call to a member function retry() on a non-object in C:\Documents and Settings\Oliver\Desktop\oyun\TM\Server\TMF\oliver\include
s\xmlrpc_db.inc.php on line 51

I don't quite understand that part so I tried somethings :grmblz:
S I changed $this->_webaccess->retry($this->_url); To $this->retry($this->_url) as the function is in the same Class. But then

[06/08,19:59:22] ************* (Dedimania) *************
[06/08,19:59:22] * Dataserver connection on Dedimania ...
[06/08,19:59:22] * Try connection on http://dedimania.net:8003/Dedimania ...
-1073741819

And Crash :(

Fo know I did only some mior changes with the idea to find errors on the way. Changed the hall thing to a Class. I take the CP times for Rasp.CP doing a small change to it. changing a private to var ....

Open for any help

Re: Public DB temporarily offline

Posted: 08 Jun 2008 17:48
by Assembler Maniac
If you want to port dedimania, you'll need to make plugin.dedimania.php work like the pubdb plugin.
oliverde8 wrote:[06/08,19:56:50] ************* (Dedimania) *************
[06/08,19:56:50] * Dataserver connection on Dedimania ...
[06/08,19:56:50] * Try connection on http://dedimania.net:8003/Dedimania ...

Fatal error: Call to a member function retry() on a non-object in C:\Documents and Settings\Oliver\Desktop\oyun\TM\Server\TMF\oliver\include
s\xmlrpc_db.inc.php on line 51

I don't quite understand that part so I tried somethings :grmblz:
S I changed $this->_webaccess->retry($this->_url); To $this->retry($this->_url) as the function is in the same Class. But then

[06/08,19:59:22] ************* (Dedimania) *************
[06/08,19:59:22] * Dataserver connection on Dedimania ...
[06/08,19:59:22] * Try connection on http://dedimania.net:8003/Dedimania ...
-1073741819

And Crash :(

Fo know I did only some mior changes with the idea to find errors on the way. Changed the hall thing to a Class. I take the CP times for Rasp.CP doing a small change to it. changing a private to var ....

Open for any help

Re: Public DB temporarily offline

Posted: 08 Jun 2008 20:51
by oliverde8
Assembler Maniac wrote:If you want to port dedimania, you'll need to make plugin.dedimania.php work like the pubdb plugin.
oliverde8 wrote:[06/08,19:56:50] ************* (Dedimania) *************
[06/08,19:56:50] * Dataserver connection on Dedimania ...
[06/08,19:56:50] * Try connection on http://dedimania.net:8003/Dedimania ...

Fatal error: Call to a member function retry() on a non-object in C:\Documents and Settings\Oliver\Desktop\oyun\TM\Server\TMF\oliver\include
s\xmlrpc_db.inc.php on line 51

I don't quite understand that part so I tried somethings :grmblz:
S I changed $this->_webaccess->retry($this->_url); To $this->retry($this->_url) as the function is in the same Class. But then

[06/08,19:59:22] ************* (Dedimania) *************
[06/08,19:59:22] * Dataserver connection on Dedimania ...
[06/08,19:59:22] * Try connection on http://dedimania.net:8003/Dedimania ...
-1073741819

And Crash :(

Fo know I did only some mior changes with the idea to find errors on the way. Changed the hall thing to a Class. I take the CP times for Rasp.CP doing a small change to it. changing a private to var ....

Open for any help
Yes I started a bit to modify to have that part, But my first problem is connection I can't see if what I did works without looking that part. But for a beginig I wanted to keep separate DediRecs from ... as I see the Original codes already handels Record by it self So keep it separate for the moment should not create a probleme I think.

I don't understand the retry businnes going on.

Edit: Okay found out the probleme the web_acess.inc.php has its own retry fınction and I have some troble acesing its Class due the the code of web_acess.inc.php it self that I must change a bit

Re: Public DB temporarily offline

Posted: 09 Jun 2008 12:19
by s!em
Good luck Oliverde8 !!! :D

Re: Public DB temporarily offline

Posted: 09 Jun 2008 12:30
by oliverde8
s!em wrote:Good luck Oliverde8 !!! :D
I think I will need much more then that, I even thin I will give up
+I can connect to dedimania. On the log it says I connect
+CP works okay checked everything.

-all request things doesen't work and that makes me crazy
the ...._cb functions are never called. I tried to place them outside the Class but even then they aren't called :ftw:

So if someone has any idea. didn't progress since this morrning 8 o'clock

Re: Public DB temporarily offline

Posted: 09 Jun 2008 13:44
by w1lla

Code: Select all

$this->dedimania_newchallenge - challenge
Challenge Object
(
    [name] => $w$iW1lla01
    [uid] => npX48_yReeKWtoKqWGdeAOInOL
    [filename] => Challenges\TMX\W1lla01_77207.Challenge.gbx
    [author] => dccw1lla
    [environment] => Stadium
    [mood] => Day
    [bronzetime] => 19000
    [silvertime] => 15000
    [goldtime] => 13000
    [authortime] => 12050
    [copperprice] => 
    [laprace] => 
    [data] => 
    [id] => 0
)

$this->dedimania_serverinfo - serverinfo
Array
(
    [SrvName] => $w$i$f80W1lla
    [Comment] => 
    [Private] => 
    [SrvIP] => 
    [SrvPort] => 0
    [XmlrpcPort] => 0
    [NumPlayers] => 1
    [MaxPlayers] => 25
    [NumSpecs] => 1
    [MaxSpecs] => 10
    [LadderMode] => 1
    [NextFiveUID] => npX48_yReeKWtoKqWGdeAOInOL
)

$this->dedimania_players - players
Array
(
    [0] => Array
        (
            [Login] => dccw1lla
            [Nation] => 
            [TeamName] => 
            [TeamId] => -1
            [IsSpec] => 1
            [Ranking] => 26569
            [IsOff] => 
        )

    [1] => Array
        (
            [Login] => triz_nl
            [Nation] => 
            [TeamName] => 
            [TeamId] => -1
            [IsSpec] => 
            [Ranking] => 37180
            [IsOff] => 
        )

)

[06/09,15:41:17] currently no record on W1lla01
[06/09,15:41:17] XMLRPC Error [-1000] - Start index out of bound.

this error is weird??!!

Code: Select all

[06/09,15:41:17] XMLRPC Error [-1000] - Start index out of bound.

Re: Public DB temporarily offline

Posted: 10 Jun 2008 12:13
by Slig
oliverde8 wrote:the ...._cb functions are never called. I tried to place them outside the Class but even then they aren't called :ftw:
Are you sure you call the $_webaccess->select() at regular interval ? it's the place where the datas are asynchronously sent, received, and the callbacks called.

Tyr to disable compression in webaccess, and grab network datas with wireshark, to first be sure about what is sent to dedimania and received. When you will be sure that the right response is received it will be time to look why your callback is not called.

Re: Public DB temporarily offline

Posted: 10 Jun 2008 12:30
by oliverde8
Slig wrote:
oliverde8 wrote:the ...._cb functions are never called. I tried to place them outside the Class but even then they aren't called :ftw:
Are you sure you call the $_webaccess->select() at regular interval ? it's the place where the datas are asynchronously sent, received, and the callbacks called.

Tyr to disable compression in webaccess, and grab network datas with wireshark, to first be sure about what is sent to dedimania and received. When you will be sure that the right response is received it will be time to look why your callback is not called.
hehe never calling it :roflol:

Re: Public DB temporarily offline

Posted: 10 Jun 2008 13:03
by oliverde8
Thanks a lot it works now :thumbsup: everything works :D No recs doesen't work

Thanks a lot slig :thumbsup:

Edit:
[06/10,17:09:43] XMLRPC Error [-502] - Not enough items in array
whats that :ftw:
Everything works I can see existing recs.... But my Recs aren't sent. I check the playerfinish function. it is called but somwhere there is an error that I can't find.

On console Oliverde8: Players finish track is shown but none of the other Echos are sent even echo "wooow Player Finish\n"; isn't sent

Code: Select all

function dedimania_playerfinish( $finish_item) {
		global $aseco;
		echo"Oliverde8: Players finish track \n";
		
		       $this->checkpoints->checkpoints;  // from plugin.checkpoints.php

		// if no Dedimania records, bail out immediately - Stunts mode temporarily too
	/*	if (!$this->dedi_db['RecsValid'] || $aseco->server->gameinfo->mode == 4){
			echo"oliverde8 error1 ın player finish \n";
			return;			
		}*/
		// in Laps mode on real PlayerFinish event, bail out immediately
		if ($aseco->server->gameinfo->mode == 3 && !$finish_item->new){
			echo"oliverde8 error1 ın player finish \n";
			return;			
		}
		
		$login = $finish_item->player->login;
		$nickname = $finish_item->player->nickname;
		
		
		// if no actual finish, bail out immediately
		if ($login == '' || $finish_item->score == 0) echo"oliverde8 error-2 ın player finish \n"; return; 

		// if LAN login, bail out immediately
		if (preg_match('/\/\d+\.\d+\.\d+\.\d+:\d+/', $login)) echo"oliverde8 error3 ın player finish \n"; return; 

		// if not best/equal run on this track so far, bail out unless Laps mode
		if ($aseco->server->gameinfo->mode != 3 &&
		    (!isset($this->checkpoints->checkpoints[$login]) ||
		     $this->checkpoints->checkpoints[$login]->curr_fin > $this->checkpoints->checkpoints[$login]->best_fin))
			echo"oliverde8 error-4 ın player finish \n"; return; 

		// check for finish/checkpoints consistency, unless Stunts mode
		if ($this->dedi_debug > 0)
			if ($aseco->server->gameinfo->mode != 4 &&
			    ($finish_item->score != $this->checkpoints->checkpoints[$login]->best_fin ||
			     $finish_item->score != end($this->checkpoints->checkpoints[$login]->best_cps)))
				$aseco->console('$this->dedimania_playerfinish - inconsistent finish/checks!  score: ' . $finish_item->score . '  checks:' . LF . print_r($this->checkpoints->checkpoints[$login], true));

		// point to master records list
		$dedi_recs = &$this->dedi_db['Challenge']['Records'];

		// go through all records
		
		echo "wooow Player Finish\n";
		
		for ($i = 0; $i < $this->dedi_db['MaxRecords']; $i++) {
			$cur_record = $dedi_recs[$i];
		
		
			// check if no record, or player's time/score is better
			if (!isset($cur_record) || ($aseco->server->gameinfo->mode == 4 ?
			                            $finish_item->score > $cur_record['Best'] :
			                            $finish_item->score < $cur_record['Best'])) {
				// does player have a record already?
				$cur_rank = -1;
				$cur_score = 0;
				for ($rank = 0; $rank < count($dedi_recs); $rank++) {
					$rec = $dedi_recs[$rank];

					if ($login == $rec['Login']) {
						// new record worse than old one
						if ($aseco->server->gameinfo->mode == 4 ?
						    $finish_item->score < $rec['Best'] :
						    $finish_item->score > $rec['Best']) {
							return;

						// new record is better than or equal to old one
						} else {
							$cur_rank = $rank;
							$cur_score = $rec['Best'];
							break;
						}
					}
				}

				$finish_time = $finish_item->score;
				if ($aseco->server->gameinfo->mode != 4)
					$finish_time = formatTime($finish_time);

				if ($cur_rank != -1) {  // player has a record in topXX already
					// compute difference to old record
					if ($aseco->server->gameinfo->mode != 4) {
						$diff = $cur_score - $finish_item->score;
						$sec = floor($diff/1000);
						$hun = ($diff - ($sec * 1000)) / 10;
					} else {  // Stunts
						$diff = $finish_item->score - $cur_score;
					}

					// update the record if improved
					if ($diff > 0) {
						// ignore 'Rank' field - not used in /dedi* commands
						$dedi_recs[$cur_rank]['Best'] = $finish_item->score;
						$dedi_recs[$cur_rank]['Checks'] = $this->checkpoints->checkpoints[$login]->best_cps;
						$dedi_recs[$cur_rank]['NewBest'] = true;
					}

					// player moved up in Dedimania list
					if ($cur_rank > $i) {
						// move record to the new position
						moveArrayElement($dedi_recs, $cur_rank, $i);

						// do a player improved his/her Dedimania rank message
						$message = formatText($this->dedi_db['Messages']['RECORD_NEW_RANK'][0],
						                      $nickname,
						                      $i+1,
						                      ($aseco->server->gameinfo->mode == 4 ? 'Score' : 'Time'),
						                      $finish_time,
						                      $cur_rank+1,
						                      ($aseco->server->gameinfo->mode == 4 ?
						                       '+' . $diff : sprintf('-%d.%02d', $sec, $hun)));

						// show chat message to all or player
						if ($this->dedi_db['DisplayRecs']) {
							if ($i < $this->dedi_db['LimitRecs']) {
								$aseco->client->query('ChatSendServerMessage', $aseco->formatColors($message));
							} else {
								$message = str_replace('{#server}>> ', '{#server}> ', $message);
								$aseco->client->query('ChatSendServerMessageToLogin', $aseco->formatColors($message), $login);
							}
						}
					} else {
						if ($diff == 0) {
							// do a player equaled his/her record message
							$message = formatText($this->dedi_db['Messages']['RECORD_EQUAL'][0],
							                      $nickname,
							                      $cur_rank+1,
							                      ($aseco->server->gameinfo->mode == 4 ? 'Score' : 'Time'),
							                      $finish_time);
						} else {
							// do a player secured his/her record message
							$message = formatText($this->dedi_db['Messages']['RECORD_NEW'][0],
							                      $nickname,
							                      $i+1,
							                      ($aseco->server->gameinfo->mode == 4 ? 'Score' : 'Time'),
							                      $finish_time,
							                      $cur_rank+1,
							                      ($aseco->server->gameinfo->mode == 4 ?
							                       '+' . $diff : sprintf('-%d.%02d', $sec, $hun)));
						}

						// show chat message to all or player
						if ($this->dedi_db['DisplayRecs']) {
							if ($i < $this->dedi_db['LimitRecs']) {
								$aseco->client->query('ChatSendServerMessage', $aseco->formatColors($message));
							} else {
								$message = str_replace('{#server}>> ', '{#server}> ', $message);
								$aseco->client->query('ChatSendServerMessageToLogin', $aseco->formatColors($message), $login);
							}
						}
					}
				} else {  // player hasn't got a record yet

					// insert new record at the specified position
					// drop worst record if list full
					if (count($dedi_recs) >= $this->dedi_db['MaxRecords'])
						array_pop($dedi_recs);

					// ignore 'Rank' field - not used in /dedi* commands
					$record = array('Login' => $login,
					                'NickName' => $finish_item->player->nickname,
					                'Best' => $finish_item->score,
					                'Checks' => $this->checkpoints->checkpoints[$login]->best_cps,
					                'NewBest' => true);
					insertArrayElement($dedi_recs, $record, $i);

					// do a player drove first record message
					$message = formatText($this->dedi_db['Messages']['RECORD_FIRST'][0],
					                      $nickname,
					                      $i+1,
					                      ($aseco->server->gameinfo->mode == 4 ? 'Score' : 'Time'),
					                      $finish_time);

					// show chat message to all or player
					if ($this->dedi_db['DisplayRecs']) {
						if ($i < $this->dedi_db['LimitRecs']) {
							$aseco->client->query('ChatSendServerMessage', $aseco->formatColors($message));
						} else {
							$message = str_replace('{#server}>> ', '{#server}> ', $message);
							$aseco->client->query('ChatSendServerMessageToLogin', $aseco->formatColors($message), $login);
						}
					}
				}

				// log a new Dedimania record (not an equalled one)
				if ($dedi_recs[$i]['NewBest']) {
					// log record message in console
					$aseco->console('[Dedimania] player {1} finished with {2} and took the {3}. WR place!',
					                $login,
					                $finish_item->score,
					                $i+1);
				}
				if ($this->dedi_debug > 1)
					$aseco->console_text('$this->dedimania_playerfinish - dedi_recs' . LF . print_r($dedi_recs, true));

				// got the record, now stop!
				return;
			}
		}
	}  // $this->dedimania_playerfinish

Re: Public DB temporarily offline

Posted: 10 Jun 2008 14:24
by s!em
making progress, good :D

Re: Public DB temporarily offline

Posted: 10 Jun 2008 14:42
by Slig
oliverde8 wrote:On console Oliverde8: Players finish track is shown but none of the other Echos are sent even echo "wooow Player Finish\n"; isn't sent
you added several echo "" before the return without using brackets, so the return is not conditional any more ;)

Code: Select all

if ($login == '' || $finish_item->score == 0) echo"oliverde8 error-2 ın player finish \n"; return; 
if (preg_match('/\/\d+\.\d+\.\d+\.\d+:\d+/', $login)) echo"oliverde8 error3 ın player finish \n"; return; 
if ($aseco->server->gameinfo->mode != 3 &&
		    (!isset($this->checkpoints->checkpoints[$login]) ||
		     $this->checkpoints->checkpoints[$login]->curr_fin > $this->checkpoints->checkpoints[$login]->best_fin))
			echo"oliverde8 error-4 ın player finish \n"; return; 

Re: Public DB temporarily offline

Posted: 10 Jun 2008 14:46
by oliverde8
That was the probleme :grmblz: it works now thanks a lot Slig

Is there somone ho wants to do the Chat.Dedimania I won't have time to do it. I did a big part of it needs a hand of stlye. And olso some of the messages are missing and must be rebuilt. (edit: all necesary information is in place recs... comes but it must be shown)

Recs are olso sent so everything works :D :P :3 :3 :3

Re: Public DB temporarily offline

Posted: 10 Jun 2008 15:01
by w1lla
i will want to work on chat dedimania piece ;)

Re: Public DB temporarily offline

Posted: 10 Jun 2008 15:02
by Slig
Please be sure to send to dedimania a Tool name specific to your port (so not XASECO), with up to date version numbers if you change it later, so in case there is a real problem specific to a version it will be possible to filter records made by it.