mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 20:43:10 +01:00
Prevents joining with unacked notifications (#11398)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
--
|
||||
-- Increase the message length of the ss13_player_notifications
|
||||
--
|
||||
|
||||
ALTER TABLE `ss13_player_notifications`
|
||||
CHANGE COLUMN `message` `message` MEDIUMTEXT NOT NULL COLLATE 'utf8mb4_unicode_ci' AFTER `type`;
|
||||
@@ -285,11 +285,20 @@
|
||||
return
|
||||
if (!dbcon.IsConnected())
|
||||
return
|
||||
var/count = 0
|
||||
|
||||
var/DBQuery/warning_count_query = dbcon.NewQuery("SELECT COUNT(*) FROM ss13_warnings WHERE (visible = 1 AND acknowledged = 0 AND expired = 0) AND (ckey = :ckey: OR computerid = :computer_id: OR ip = :address:)")
|
||||
warning_count_query.Execute(list("ckey" = ckey, "computer_id" = computer_id, "address" = address))
|
||||
if(warning_count_query.NextRow())
|
||||
unacked_warning_count = text2num(warning_count_query.item[1])
|
||||
return unacked_warning_count
|
||||
count += text2num(warning_count_query.item[1])
|
||||
|
||||
var/DBQuery/notification_count_query = dbcon.NewQuery("SELECT COUNT(*) FROM ss13_player_notifications WHERE ckey = :ckey: AND acked_at is NULL and type IN ('player_greeting','player_greeting_chat')")
|
||||
notification_count_query.Execute(list("ckey" = ckey))
|
||||
if(notification_count_query.NextRow())
|
||||
count += text2num(notification_count_query.item[1])
|
||||
|
||||
unacked_warning_count = count
|
||||
return unacked_warning_count
|
||||
|
||||
/*
|
||||
* A proc for an admin/moderator to look up a member's warnings.
|
||||
|
||||
@@ -156,10 +156,8 @@
|
||||
sound_to(player, 'sound/effects/menu_click.ogg')
|
||||
if(SSticker.current_state <= GAME_STATE_SETTING_UP)
|
||||
if(player.ready)
|
||||
player.ready = FALSE
|
||||
player.ready(FALSE)
|
||||
else
|
||||
player.ready = TRUE
|
||||
player.ready(TRUE)
|
||||
else
|
||||
player.join_game()
|
||||
@@ -230,7 +228,7 @@
|
||||
alert(src, "You have not saved your character yet. Please do so before readying up.")
|
||||
return
|
||||
if(client.unacked_warning_count > 0)
|
||||
alert(src, "You can not ready up, because you have unacknowledged warnings. Acknowledge your warnings in OOC->Warnings and Notifications.")
|
||||
alert(src, "You can not ready up, because you have unacknowledged warnings or notifications. Acknowledge them in OOC->Warnings and Notifications.")
|
||||
return
|
||||
|
||||
ready = readying
|
||||
|
||||
@@ -68,7 +68,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
|
||||
alert(src, "You have not saved your character yet. Please do so before readying up.")
|
||||
return
|
||||
if(client.unacked_warning_count > 0)
|
||||
alert(src, "You can not ready up, because you have unacknowledged warnings. Acknowledge your warnings in OOC->Warnings and Notifications.")
|
||||
alert(src, "You can not ready up, because you have unacknowledged warnings or notifications. Acknowledge them in OOC->Warnings and Notifications.")
|
||||
return
|
||||
|
||||
ready = text2num(href_list["ready"])
|
||||
@@ -121,7 +121,7 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
|
||||
return
|
||||
|
||||
if(client.unacked_warning_count > 0)
|
||||
alert(usr, "You can not join the game, because you have unacknowledged warnings. Acknowledge your warnings in OOC->Warnings and Notifications.")
|
||||
alert(usr, "You can not join the game, because you have unacknowledged warnings or notifications. Acknowledge them in OOC->Warnings and Notifications.")
|
||||
return
|
||||
|
||||
var/datum/species/S = all_species[client.prefs.species]
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
################################
|
||||
# Example Changelog File
|
||||
#
|
||||
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||
#
|
||||
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||
# When it is, any changes listed below will disappear.
|
||||
#
|
||||
# Valid Prefixes:
|
||||
# bugfix
|
||||
# wip (For works in progress)
|
||||
# tweak
|
||||
# soundadd
|
||||
# sounddel
|
||||
# rscadd (general adding of nice things)
|
||||
# rscdel (general deleting of nice things)
|
||||
# imageadd
|
||||
# imagedel
|
||||
# maptweak
|
||||
# spellcheck (typo fixes)
|
||||
# experiment
|
||||
# balance
|
||||
# admin
|
||||
# backend
|
||||
# security
|
||||
# refactor
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: Arrow768
|
||||
|
||||
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||
delete-after: True
|
||||
|
||||
# Any changes you've made. See valid prefix list above.
|
||||
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||
# SCREW THIS UP AND IT WON'T WORK.
|
||||
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||
changes:
|
||||
- bugfix: "Prevents players from joining if they have unacknowledged notifications."
|
||||
Reference in New Issue
Block a user