Jump to content

FED2k Emperor Ladder


Recommended Posts

Here is the code used for adding new results to the ladder. I had to make a few tweaks to it tonight but so far it is working fine. Is anyone here using the ladder? The names listed there don't seem familiar...

   # update the ladder games table with points for this game #
if ($base == '1' && $cred == '6000' && $plrs == '2' && $unit == '5')
{
$pts0 = mysql_query("SELECT pts, wins, loss FROM ladder_players WHERE name = '$nam0'");
$pts1 = mysql_query("SELECT pts, wins, loss FROM ladder_players WHERE name = '$nam1'");
$pts0 = mysql_fetch_row($pts0);
$pts1 = mysql_fetch_row($pts1);

$stat0 = array(($pts0[0] ? $pts0[0] : 0), ($pts0[1] ? $pts0[1] : 0), ($pts0[2] ? $pts0[2] : 0));
$stat1 = array(($pts1[0] ? $pts1[0] : 0), ($pts1[1] ? $pts1[1] : 0), ($pts1[2] ? $pts1[2] : 0));

if ($cmp0 == 256)
$game = array(array($_POST['nam0'], $stat0[0], $stat0[1], $stat0[2]), array($nam1, $stat1[0], $stat1[1], $stat1[2]));
else
$game = array(array($_POST['nam1'], $stat1[0], $stat1[1], $stat1[2]), array($nam0, $stat0[0], $stat0[1], $stat0[2]));

$wins_pts = round(64 * (1 - (1 / (pow(10, ($game[1][1] - $game[0][1]) / 400) + 1))));

$loss_diff = round(64 * (0 - (1 / (pow(10, ($game[0][1] - $game[1][1]) / 400) + 1))));
$loss_prct = round($game[1][1] * 0.1);
$loss_pts = ($loss_diff < 0 && $loss_diff < -$loss_prct) ? -$loss_prct : $loss_diff;

mysql_query("REPLACE INTO ladder_players (pts, wins, loss, name) VALUES ('" . ($wins_pts + $game[0][1]) . "', '" . $game[0][2] . " + 1', '" . $game[0][3] . "', '" . $game[0][0] . "')");
mysql_query("REPLACE INTO ladder_players (pts, wins, loss, name) VALUES ('" . ($loss_pts + $game[1][1]) . "', '" . $game[1][2] . "', '" . $game[1][3] . " + 1', '" . $game[1][0] . "')");

if ($cmp0 == 256)
mysql_query("INSERT INTO ladder_games VALUES ('$idno', '$wins_pts', '$loss_pts')");
else
mysql_query("INSERT INTO ladder_games VALUES ('$idno', '$loss_pts', '$wins_pts')");
}

Link to comment
Share on other sites

Ok I've added in a few new links on the ladder page. You can now get a listing of all games currently stored in the database, even those that aren't included on the ladder. I also have a link of BC games and player listing, still working on those two sections though.

Link to comment
Share on other sites

yo whats the download u need to get on the fed2k ladder i need it.....

If you read the top post on this page...

This thread will be used to deal with any issues coming from the FED2k Ladder.

I've started a small helpfile, let me know if it covers enough of the common problems/issues you've experienced or areas it could be expanded in.

I would recommend reading the small helpfile.

Link to comment
Share on other sites

is every game on the "ladder" link being added manually by Gob?

EDIT: another Q - does it make a diff which version of the proxy is used (june 16 or june 20, i believe.....) ?

if the answer to both of these is "No", then you definitely got some big defective bugs in that coding

Link to comment
Share on other sites

please delete this game, or give me the Win

http://www.dune2k.com/ladder/?idno=113193260

as you can see, i was winning. due to some sort of weird lag bug, my base exploded for no reason. all he killed of mine was one scout, and i had 3 of his 4 carryalls dead and just as many units and buildings. if you can't give me the Win, then just delete this game entirely. thx.

Link to comment
Share on other sites

"Now whenever you play Emperor and want your games to be recorded to the FED2k Ladder run XCL Proxy in the background while playing Emperor."

This is step 4 in how to play a recorded match. I am unclear as to wether or not BOTH players need to be running the proxy for the game to be recorded? If only one is needed you may want to look at changing that.

Example: Player one runs proxy and anticipates the game being recorded, so he goes with his normal game plan. Player 2 thinks the game is just for fun and tries something he has never tried before, just to see how it pans out. This was a game plan that really didn't fare to well for player 2 and he loses horribly. If Player 2 had known it was a recorded game he would have gone with a proven tactic and the outcome could have been different. If only one player needs to run it, now you have a game that really should not be a valid game.

This is just a thought...and may have already been answered in a thread that I haven't read yet.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...