Commit Graph

42 Commits

Author SHA1 Message Date
Mia
5512e76866 Ladder: Add GXE filtering for ladders with a max elo above 1500 2024-09-05 15:51:06 -05:00
adrivrie
e7f54bad08
Ladder: Set current gen to 9 for decay purposes (#2130) 2023-07-18 15:40:18 -07:00
Guangcong Luo
6fc353cbe3 Remove bad code
This part doesn't do anything because it's below
`else if ($elo > 1300)`.

Maybe we'll update the Elo formula some other time... :S
2021-03-18 13:36:48 -04:00
Annika
367ed82e56
Support configurable URLs (#1543) 2020-07-21 15:27:21 -07:00
The Immortal
34e36bf406
Update decay for Random Battle & OU 2019-12-02 05:36:47 +04:00
Guangcong Luo
8ca9916bdc Fix bugs in ladder prefix search
- `$prefix` needs to be initialized
- `$_REQUEST['prefix']` was misspelled as `$_REQUEST['format']`
- prefix argument in `getTop` not correctly marked as optional
- fix missing `FROM`, `AS alias`, and extraneous `)` in query
- `LIMIT` apparently can't be parameterized in MySQL?
2019-07-19 16:36:43 -04:00
Kirk Scheibelhut
80aaab1ef1 Support filtering ladder by username prefix (for OLT) (#1326) 2019-07-18 14:02:06 -05:00
The Immortal
db0b7b3684
Update decay for Random Battle and OU 2018-03-22 00:33:38 +08:00
Guangcong Luo
fceb63c0ee Ladder: Support "both players lose"
Send -1 as the score to mean "both players lose"
2017-07-28 23:09:10 -04:00
Guangcong Luo
638c117db0 Refactor database to use prepared statements
Prepared statements are much better than manually constructing queries,
but PHP's MySQLi prepared statement syntax sucks.

So does PDO's, but we're abstracting it out so we can make it not suck,
and give it the syntax it should always have had. Which is what this
does.

Yay, finally.
2016-10-20 21:12:06 -04:00
Guangcong Luo
fc547732a6 Refactor ntbb-database to PDO
A hack is required to keep Database::escape's API the same, but
otherwise this API lends itself to having the internals swapped out
surprisingly well.
2016-10-20 20:34:52 -04:00
Guangcong Luo
9ea444aeea Fix bugs/crashes in ntbb-session 2016-10-20 20:34:07 -04:00
Guangcong Luo
82e7a917ab Move session library inside repository
For too long, ntbb-session and ntbb-database have been maintained
outside of this repo, but no longer! All these files are now part of the
repository, making it significantly more self-contained.

If I had to say why it took this long, I think it was mostly inertia. It
was easier leaving them where they were than having to audit them for
private keys in the wrong places, etc.

I'm starting to think of PS more as sim first, website secondary than
the other way around, now. Especially now that we don't have a forum,
the website itself isn't really important... Maybe one day I'll get rid
of the landing page and make the sim itself the first thing you see when
you hit pokemonshowdown.com... but today is not that day!

The repo is still not "batteries-included" since I am not going to teach
anyone how to set up PHP and MySQL or even get the config files working.
But for anyone who wanted their own client, well, it gets a lot easier
to do now.
2016-10-20 13:16:06 -04:00
Guangcong Luo
abc4902d34 Make less popular ladders decay slower 2016-02-28 01:57:25 -05:00
Guangcong Luo
5ca5448ed2 Fix Elo rating decay 2016-02-16 20:00:13 -05:00
Guangcong Luo
09fa73f719 Remove serverid from NTBBLadder constructor
NTBBLadder no longer supports alternate servers, making it unnecessary.
2015-12-31 00:34:54 -05:00
Guangcong Luo
dd4e9ae51c Support ladder resets
A lot of this stuff involves the website itself, but this part is
the part contained in the client.
2015-12-31 00:33:47 -05:00
Guangcong Luo
bc8daf62e4 Ladder refactor 2015-11-25 17:36:28 -05:00
Guangcong Luo
4c35e2041a Change rating period advance time
Instead of advancing rating periods at midnight GMT, they're now
advanced at 9:00 GMT, which corresponds to 1am-4am in the US.
2014-09-25 16:43:10 -05:00
Guangcong Luo
da74983e9c Ladder: Tweak decay
Decay how happens half as fast on days where players have played at
least one game.
2014-03-01 16:19:42 -06:00
Guangcong Luo
e04eb7d113 Rating decay and other ladder tweaks
We now have a rating decay of -1/day at 1400, -2/day at 1450, -3/day
at 1500, etc. This roughly translates to a fall from the top of OU to
the bottom over a month of full inactivity, which is somewhat harsh
considering it's done regardless of inactivity. I might tweak this to
be less harsh later.

There's no rating decay below 1400. People can stay there as long as
they want.

The only other tweak is that K is now 40 at >1300 instead of >1400.
Very very slight tweak so that ratings in the 1300-1500 range are
very very slightly more precise.
2014-02-27 19:32:18 -06:00
Guangcong Luo
585e82c26d Ladder: Dynamic K-factor
We are now attempting to enforce a center at 1100 (tentative, may move
to 1200 later) by increasing points gained for winning and decreasing
points lost for losing below that. This will make a user with equal
wins/losses higher than a user who consistently loses.

The other change is to scale K down at higher ratings. >1400 now uses
K=40, and >1600 uses K=32. This is a really conservative scale, and
we might make it less conservative later.

STAY TUNED!
COMING UP NEXT: rating decay
2014-02-12 13:00:09 -06:00
Guangcong Luo
eb102e5474 Add COIL/ARMS to ladders 2014-01-23 12:18:22 -06:00
Guangcong Luo
3aa5c6825e Replace Glicko-2 with Glicko-1 2014-01-16 00:23:37 -06:00
Guangcong Luo
726709c2fb Fix Glicko updating with provisional rating 2014-01-15 12:37:08 -06:00
Guangcong Luo
096047ffd5 Glicko2 rating period now 1 day 2014-01-15 12:37:08 -06:00
Guangcong Luo
2be6563318 Elo ladder 2014-01-15 12:37:08 -06:00
Guangcong Luo
ae12fbbd09 Fix error in ladder rating calculation 2013-11-30 00:54:42 -06:00
小太
cf699c0494 Obliterate trailing whitespace 2013-08-18 22:48:11 +10:00
Guangcong Luo
6918000c34 Ladder: Rating period length reduced to 2 days
(Reduced from 3 days)
2013-08-14 21:48:42 -05:00
Guangcong Luo
4d5b1f89e4 Ladder: Function to lear a ladder 2013-07-12 15:36:30 -05:00
Guangcong Luo
420c702e54 Ladders now show top 500 2013-07-07 16:18:27 -05:00
Cathy J. Fitzpatrick
5fe36c3090 Fix SQL injection vulnerability in ntbb-ladder.lib.php 2013-06-20 12:10:55 -06:00
Cathy J. Fitzpatrick
0dbd829ec6 Rename some globals to avoid namespace collisions 2013-06-03 15:24:50 -06:00
Cathy J. Fitzpatrick
f0e7eabac0 Support using the login database as the ladder database 2013-06-02 21:49:05 -05:00
Cathy J. Fitzpatrick
ecc09d4f6f Revert recent ACRE changes
This reverts commit the part of 18faee531a
that made changes to lib/ntbb-ladder.lib.php.
2013-05-21 02:06:47 -06:00
Guangcong Luo
18faee531a Option to hide PMs from lobby chat log 2013-05-20 19:22:36 -05:00
Cathy J. Fitzpatrick
bf4763dd1d Specify charset for ladder database 2013-04-19 19:57:27 -06:00
Cathy J. Fitzpatrick
82de98d166 Refactor action.php
This moves most of the logic of action.php into a separate file
lib/dispatcher.lib.php and separates the actions into ladder-related
actions and non-ladder-related actions. This is intended to make it
possible to have a second action.php that handlers only ladder-related
actions, which can run on the main server computer and allow
that computer to make HTTP requests to `localhost`, which should
help reduce ladder errors.
2013-04-01 23:21:33 -07:00
Cathy J. Fitzpatrick
8342068a5c Fix an issue resulting from the ladder move 2013-02-28 04:05:43 -07:00
Cathy J. Fitzpatrick
8be53b902e Changes for ladder database move 2013-02-28 00:04:32 -07:00
Guangcong Luo
b16c1527da Populate with current state of client 2013-01-23 16:39:14 -08:00