Commit Graph

378 Commits

Author SHA1 Message Date
Guangcong Luo
d21ac1b768 Workaround for unavailable IPs
Some servers don't support getting IPs from sockets, for some reason.
In these servers, locking/banning one user no longer locks everyone.
2015-07-25 19:29:55 -04:00
Guangcong Luo
34dfc4ba6e Add some more room miscounts to debug log 2015-07-24 03:35:57 -04:00
小太
789dd73c46 Fix tournament bug where merging users doesn't automatically send an update 2015-07-20 15:14:46 +10:00
Guangcong Luo
c1a1623053 Lock unregistered usernames
Before, locking/banning an unregistered user wouldn't punish the
username. In practice, though, PS has millions of user accounts and
sharing an unregistered username with a recently-banned spammer is
unlikely to be a coincidence. Bans are commuted to locks, though,
so users can still PM a moderator in the case of a mistake.
2015-07-18 14:31:41 -04:00
Guangcong Luo
fdfb8f168f Fix ac accounts getting around roombans 2015-07-09 05:50:47 -04:00
Ivo Julca
e92bb1b07f Rename globals toName|toString to Tools.[getName|getString] 2015-07-06 00:34:44 -05:00
Ivo Julca
41af39cc87 Matchmaking: handle each format independently
- GlobalRoom#searches (formatid -> searches array) replaces GlobalRoom#searchers.
- User#searching is now a dictionary.
2015-07-02 04:05:21 -05:00
Guangcong Luo
7e4227a9f4 When merging, pass old user to Config.loginfilter 2015-06-30 03:07:18 -04:00
Guangcong Luo
55423256fa Lock and ban popups are now modal
This is to make sure people don't accidentally miss them by clicking
outside the box.
2015-06-28 00:57:28 -04:00
Guangcong Luo
3b1ef6c616 Export more variables from Users
Certain tables weren't being exported.
2015-06-27 22:33:40 -04:00
Ivo Julca
204501791b Do not save group for unregistered users 2015-06-26 22:59:36 -05:00
Guangcong Luo
e35ed8ebd5 Refactor login
finishRename was a really huge function. This splits it into three
much more manageable functions with more useful names.
2015-06-25 04:43:34 -04:00
Guangcong Luo
5f556f0323 More reliable Config.loginfilter 2015-06-23 23:18:05 -04:00
Guangcong Luo
93db8d50eb Sync nohost list 2015-06-23 23:14:58 -04:00
Guangcong Luo
377943bfaa Nicer restart message
When trying to start a battle during a lockdown, the message is
now "The server is restarting" instead of "The server is shutting
down", to make it clearer that it'll come back up in a few minutes.
2015-06-23 23:14:58 -04:00
Ivo Julca
7693b57f4e Improve error handling for login server requests
- Make sure that error parameters are all instances of `Error`.
- `parseJSON` now distinguishes `null` values from invalid syntax, by returning an object with relevant information.
- Request timeouts are now handled by node built-in `setTimeout` method, and use custom `TimeoutError` (exported from `LoginServer` for debugging).
2015-06-20 15:50:30 -05:00
Guangcong Luo
30d7e4ff68 Support Config.loginfilter
Works like hostfilter, but is applied after user logs in.
2015-06-19 21:43:21 -04:00
SolarisFox
506ddcd6f3 Bug fix: unblock PMs for staff on name change 2015-06-18 19:47:26 -07:00
Guangcong Luo
9db185148e Better error message for invalid names 2015-06-16 19:12:21 -04:00
Guangcong Luo
b792fa64e9 Merge pull request #1867 from SolarisFox/patch-7
Mute refactor
2015-06-16 07:40:57 +00:00
Guangcong Luo
cf6e4e0f19 Pass user to namefilter 2015-06-14 05:08:06 -04:00
SolarisFox
09be77d0b8 Mute refactor 2015-06-14 00:16:44 -07:00
Guangcong Luo
cf112d1d3c Merge pull request #1945 from Slayer95/jscs-rules
Implement custom JSCS rules to enforce code style
2015-06-13 06:18:24 +00:00
Guangcong Luo
4515625335 Clarify error message for joining private rooms 2015-06-12 15:13:57 -04:00
Guangcong Luo
3e1c5b557c Add autojoin to Connection prototype
Minor performance change; should not have any consequences.
2015-06-12 15:13:57 -04:00
Ivo Julca
f18eef39ca Fix Travis build 2015-06-12 03:41:22 -05:00
Guangcong Luo
a8f346b70e Fix build error 2015-06-10 21:24:12 -04:00
Ivo Julca
3fc6bb021f Fix room joining treating battle room IDs as aliases 2015-06-10 20:13:35 -05:00
Guangcong Luo
b5bcbb13dd Refactor /join and /autojoin
Yes, this is the server-side autojoin commit.

Most of the room joining logic has been moved from the /join command
to User#tryJoinRoom. /autojoin now supports a list of rooms to
join, comma-separated.

If a user tries to autojoin a private room, instead of emitting
'namerequired', the server will save the list of unjoined rooms
until the user has logged in, which saves a roundtrip from server
to client to server.

/autojoin ignores the join list if the connection is already in
any rooms, for various reasons including that it's only supposed
to be used on startup.
2015-06-10 20:49:20 -04:00
Guangcong Luo
20912a3cbb Disallow direct /promote
The recommended way to promote and demote is to specify the group
to promote/demote to. PS's group system has never been particularly
linear anyway, so this fixes weirdness and deprecates
Users.getNextGroupSymbol
2015-06-05 10:11:46 -04:00
Guangcong Luo
b10d0c0bba Fix locking to correctly track locked username
A bug made it so the wrong username would be sometimes be tracked
when locking autoconfirmed users, complicating appeals and unlocking.
2015-05-26 21:07:47 -04:00
Guangcong Luo
e34257b37f Improve locked/banned message phrasing 2015-05-26 21:07:47 -04:00
SolarisFox
29b961ff69 Style fix: indexOf() comparisons 2015-05-18 15:55:57 -07:00
Guangcong Luo
169a9756ad Fix .deconfirm()
.deconfirm() wasn't working for global auth. This fixes that.
2015-05-16 17:48:19 -04:00
Guangcong Luo
e0efc92d12 Slightly more console output 2015-05-12 02:33:07 -04:00
Guangcong Luo
fd8ba00742 Support Config.quietconsole
Config.quietconsole is a new (intentionally undocumented) config
setting to decrease the amount of non-error messages PS outputs
to the console.

It's useful because of some upcoming improvements to other PS
console output, and this will make those easier to sift through,
but it's undocumented because only a huge server (namely, Main)
will actually have enough activity to need it.
2015-05-04 04:31:16 -04:00
Guangcong Luo
7550c806b1 Merge pull request #1852 from Morfent/chatqueue
Use last message time for timeout on chat queue creation
2015-05-03 18:49:29 +00:00
Morfent
4289cc8ad3 Use last message time for timeout on chat queue creation 2015-05-03 04:50:25 -03:00
Guangcong Luo
35d6898974 Update /mute to use new confirmed system 2015-04-29 00:07:25 -04:00
Guangcong Luo
e67f04c6ed Improve lock messages
Messages for DNSBL and rangelocks should be clearer now.
2015-04-17 00:33:09 -04:00
Ivo Julca
59597bc710 Fix race condition in MMR caching 2015-04-14 21:19:44 -05:00
Guangcong Luo
736166035f Fix matchmaking bug
Guests could get matched with high level users if people logged
out while searching.
2015-04-11 01:30:22 -04:00
Morfent
ce1724e179 Replace all s.substr(x, 1) with s.charAt(x) 2015-04-06 21:20:43 -03:00
Guangcong Luo
1446e6995e Fix autoconfirmed bug
This fixes an issue where autoconfirm would sometimes be lost
when logging out and back in
2015-04-03 22:19:54 -04:00
Juanma Serrano
2f39098cab Fix possible crash in User.prototype.can
It crashed if groupData was not found if User object has no group and the user is not in a room.
2015-03-31 17:56:04 +02:00
Juanma Serrano
40541d5621 Fix bug with autoconfirmed being lost
.authenticated was changed to .registered on f614c8ed94 but this line was left in the old style on a379ff5fc4, which broke all accounts merging.
2015-03-26 16:54:27 +01:00
Guangcong Luo
a4c3417cd1 Fix isStaff check 2015-03-25 04:29:39 -04:00
Guangcong Luo
a379ff5fc4 Add support for new confirmed user status
'Confirmed' is a new pseudo-usergroup, halfway between autoconfirmed
and voice. It grants immunity to locks and works similarly to
autoconfirm status, except it's only granted by being globalvoice+,
roomdriver+, or manually confirmed.
2015-03-25 04:02:32 -04:00
Guangcong Luo
2587652ecd Remove .forceRenamed flag
The .forceRenamed flag was used to make sure /frt couldn't
accidentally grant console access. /frt had a lot of security
issues and was removed a long time ago, which renders this
part of the code obsolete.
2015-03-23 02:12:08 -04:00
Guangcong Luo
f614c8ed94 Rename .authenticated -> .registered
Considering what it means, .registered is a lot clearer.
2015-03-23 02:12:08 -04:00