Commit Graph

348 Commits

Author SHA1 Message Date
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
codelegend
4c3806ec53 cache config groups: optimize user permission checks 2015-03-20 23:53:37 +05:30
Guangcong Luo
a6e7912147 Refactor roombans
Roombans are now implemented in rooms.js, and work similarly to
the old global lock/ban code, although with a slight improvement
to unroomban.
2015-03-19 03:02:01 -04:00
Guangcong Luo
2c3228d548 Fix bypassing roombans with merging
Username roombans could be bypassed by joining the room before
merging into the banned user.

This removes connections from a room if they're merging into a user
roombanned in that room. It's done rather crudely because midway
through a merge, the user and connection objects are in an
inconsistent state.
2015-03-17 04:49:11 -04:00
Guangcong Luo
ea76b84b37 Fill in fake hosts for IP ranges with no host
Reverse DNS can't always find a host for certain common IP
ranges (generally cell networks), so we're going to fill in
a fake host in that case, to make rangebans and the like
easier.
2015-03-14 19:13:17 -04:00
sirDonovan
84d56423c4 Unblock PMs on rename for global staff 2015-03-09 00:04:48 -05:00
Guangcong Luo
87b0550b4f Cancel searches when user changes name
This plugs an exploit where users could start laddering and
change name to be matched with users at a different Elo rating
than the one they play with.
2015-03-05 04:21:11 -05:00
Guangcong Luo
27a4a1b55b Cache whether user is searching
This speeds up Rooms.global.cancelSearch
2015-03-05 04:19:09 -05:00
Guangcong Luo
b95edd1695 Run Config.hostfilter when host lookup fails
Config.hostfilter has access to connection.ip which can be used
for filtering even if we can't get a hostname for the IP.
2015-02-04 22:27:48 -05:00
Guangcong Luo
820facd0b2 Refactor Users.shortenHost
New one matches '.uk' at end instead of '.co' in middle, which
helps with .net.uk domains
2015-02-04 22:27:48 -05:00
Guangcong Luo
1649f302d3 Pass connection to hostfilter 2015-01-31 16:24:17 -05:00
sirDonovan
0fb4ce80f8 Unlock users affected by rangelocks on alts
Users should be unlocked if they switch to accounts that would normally be unaffected
2015-01-21 11:17:37 -06:00
Juanma Serrano
0b394381bc Fix Travis build after npm update
Fix errors that weren't triggering before:
Missing spaces after semicolons.
Missing spaces after tests.
2015-01-15 09:22:08 +01:00
sirDonovan
0a5340fdab Support IPs in /rangelock 2015-01-14 15:02:30 -06:00
Ivo Julca
483662f9c4 Prevent battles between offline users from starting
There is no reason to allow them, while doing so allows some race conditions where the first connection of a player joining a battle room doesn't receive their request.
2014-12-25 18:50:48 -05:00
Ivo Julca
2265951312 Fix support for multiple connections in the same battle
The request would not be sent to the connection as it wasn't in the room.
2014-12-25 18:26:36 -05:00
Ivo Julca
e276f56d60 Battle#resendRequest's argument is now a connection, rather than user
- The higher specificity saves bandwidth and suppresses a client crash when another user connection joins the battle.
2014-12-25 18:18:21 -05:00
Ivo Julca
947c04a699 Fix early failure in User#disconnectAll for multiple connections
The ascending loop over the connections array wasn't appropriate, given that Connection#destroy mutates that array.
2014-12-25 18:15:26 -05:00
Guangcong Luo
c10498bcab Merge pull request #1312 from ascriptmaster/modbattle
Private Room refactor - Distinguish hidden and secret rooms
2014-12-23 16:40:52 -06:00
ascriptmaster
fa79202649 Private Room refactor - Distinguish hidden and secret rooms
Seperated /privateroom command into /privateroom and /hiddenroom. In
hidden rooms, mostly set by battle players, global staff maintain their
ranks within the room, but the rank is not kept in secret/private rooms
(only set by users who can create chat rooms).

Created command /whoare to allow global staff to see the hidden rooms a
user is in.
2014-12-22 02:39:50 -08:00
Ivo Julca
c969855228 Fix ghost users staying in rooms when a user merged into a banned account
A mismatch between the key in `room.users` and the userid arised due to the fact that users had their `userid` property updated before getting disconnected from the server.
2014-12-20 06:59:10 -05:00
Ivo Julca
842ab65ecd Fix IP miscount for banned users 2014-12-20 06:53:40 -05:00
Ivo Julca
8d5a43417b Fix tracking of autolocked/autobanned userids
- `user.locked` would be equal to the id the user had when the rename has performed, rather than the autolocked userid.
- `lockedIps`'s property values would be sometimes wrong in a similar way due to a missing change in 47e90226.
Both of these issues are hereby fixed.
2014-12-19 01:46:51 -05:00
Guangcong Luo
4a3e2ff73e More specific /join fail message
user.joinRoom() now returns null if the user is banned.
2014-12-07 12:29:05 -05:00
Guangcong Luo
e8b85a2497 Clarify invalid name message 2014-12-01 16:51:06 -05:00
Guangcong Luo
be8fe06c9d Merge pull request #1262 from sirDonovan/lockdown
Add /prelockdown command
2014-11-13 23:25:29 +08:00
Ivo Julca
af0e0b69f4 Fix user.onDisconnect not being run on disconnectAll()
- Guests banned on join will now be immediately destroyed.
- Unauthenticated authorities will now lose their group after banned.
2014-10-24 21:39:29 -05:00
sirDonovan
de8e38d040 Add /prelockdown command
Allows current tournaments to finish before progressing to a proper lockdown
2014-10-15 22:33:24 -05:00
Guangcong Luo
c7ea3f09fc Merge pull request #1249 from ascriptmaster/tourney-join-lock
Prevent voices from entering tournament battles as a battler
2014-10-12 21:21:06 -05:00
ascriptmaster
122a4d9a6e BattleRoom refactor to support tournaments better
Generalized the BattleRoom constructor function (and the functions that
call it) to pass an arbitrary `options` object instead of a boolean for
`rated` only. Also, removed mention of `parent` or `parentid` in the
constructor and functions because it's no longer needed or used.

Added support to the BattleRoom constructor to let it process tournaments
properly. Now, instead of having the tournament forcefully override the
BattleRoom.win function, the BattleRoom itself can handle the callback for
when a tournament participant wins the battle.

Added a check for tournament battles to prevent users who aren't part of
that specific tournament battle from entering the battle.
2014-10-12 19:11:38 -07:00
sirDonovan
8addbe1c77 Implement report command 2014-10-10 21:54:59 -05:00