Permalink
Browse files

unban in db when player joins

  • Loading branch information...
1 parent 15826db commit 9d0fa5e99b8f060113179d0e24584cab3494a08b @sbezboro committed Nov 9, 2016
Showing with 12 additions and 3 deletions.
  1. +11 −2 standardweb/jobs/query.py
  2. +1 −0 standardweb/models.py
  3. +0 −1 standardweb/views/main.py
@@ -203,9 +203,18 @@ def _query_server(server, mojang_status):
enter = PlayerActivity(server=server, player=player,
activity_type=PLAYER_ACTIVITY_TYPES['enter'])
enter.save(commit=False)
-
- # respect nicknames from the main server
+
if server.id == app.config['MAIN_SERVER_ID']:
+ if player.banned:
+ player.banned = False
+ AuditLog.create(
+ AuditLog.PLAYER_UNBAN,
+ player_id=player.id,
+ username=player.username,
+ source='server_sync',
+ commit=False
+ )
+
nickname_ansi = player_info.get('nickname_ansi')
nickname = player_info.get('nickname')
@@ -869,6 +869,7 @@ class AuditLog(db.Model, Base):
PLAYER_TIME_ADJUSTMENT = 'player_time_adjustment'
PLAYER_RENAME = 'player_rename'
PLAYER_BAN = 'player_ban'
+ PLAYER_UNBAN = 'player_unban'
QUICK_USER_CREATE = 'quick_user_create'
@classmethod
@@ -10,7 +10,6 @@
import StringIO
from standardweb import app
-from standardweb.lib import forums as libforums
from standardweb.lib import leaderboards as libleaderboards
from standardweb.lib import player as libplayer
from standardweb.lib import server as libserver

0 comments on commit 9d0fa5e

Please sign in to comment.