code:
/*
It is recommended you do not perfom any of these queries while your server is live as they will lock the tables during execution.

Backup your database before starting; Breaking errors may occur when old data is not be compatible with new column formats.
i.e. A field that is null or empty due to rows existing before the column was added, data corruption or incorrect inputs will prevent altering the column to be NOT NULL.
To account where this is likely to occur, these queries check if fields have valid data and if not will replace invalid data with 0.
Some fields may be out of range for new column lengths, this will also cause a breaking error.
For instance `death`.`bruteloss` is now SMALLINT and won't accept any values over 65535.
Data in this table can thus be truncated using a query such as:
UPDATE `[database]`.`[table]` SET `[column]` = LEAST(`[column]`, [max column size])
To truncate a text field you would have to use SUBSTRING(), however I don't suggest you truncate any text fields.
If you wish to instead preserve this data you will need to modify the schema and queries to accomodate.

Additionally, you may encounter the error "Error Code: 1411. Incorrect string value: '[query]' for function inet_aton".
This is due to a bug with the default sql_mode in MySQL version 5.7, wherein a value of '' cannot be passed to INET_ATON() without error, see here for reference: https://bugs.mysql.com/bug.php?id=82280
The INET_ATON() function inteprets any abnormal data as being '', examples are:
' 127.0.0.1' - contains a whitespace character such as space, tab or newline.
'127.a.$,1' - contains non-numeric characters
'300.0.0.1' - ipv4 octets must be within a range of 0 to 255
Note that '127.0.1' and '127.0..1' are both valid data formats but will not equate to the correct ip address.

If you get this error there are steps you can take to deal with the invalid data:
To get a list of all unique fields that aren't valid ipv4 addresses, run the query:
SELECT DISTINCT [column] FROM [table] WHERE [column] NOT REGEXP '^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
Note this will only retrieve the first 1000 results, if you want more append to the query:
LIMIT 0, [max result]
Now inspect your results for any data that is invalid and correct them.
If you prefer, you can also automatically replace invalid data with 0 using a similar query:
UPDATE [table] SET [column] = '0' WHERE [column] NOT REGEXP '^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
This will replace all invalid data, even data that could potentially be corrected.
Finally, per the bug report, you can have MySQL ignore the errors and instead produce warnings while continuing with the query.
To do so, run the query:
SET @@sql_mode=''
Do not use this method unless you are sure about it; This setting will persist until your MySQL server is restarted, potentially affecting the data integrity of this and future queries.

Take note some columns have been renamed, removed or changed type. Any services relying on these columns will have to be updated per changes.

----------------------------------------------------*/

START TRANSACTION;
ALTER TABLE `ban`
 DROP COLUMN `rounds`
, CHANGE COLUMN `bantype` `bantype` ENUM('PERMABAN', 'TEMPBAN', 'JOB_PERMABAN', 'JOB_TEMPBAN', 'ADMIN_PERMABAN', 'ADMIN_TEMPBAN') NOT NULL
, CHANGE COLUMN `reason` `reason` VARCHAR(2048) NOT NULL
, CHANGE COLUMN `who` `who` VARCHAR(2048) NOT NULL
, CHANGE COLUMN `adminwho` `adminwho` VARCHAR(2048) NOT NULL
, CHANGE COLUMN `unbanned` `unbanned` TINYINT UNSIGNED NULL DEFAULT NULL
, ADD COLUMN `server_ip` INT UNSIGNED NOT NULL AFTER `serverip`
, ADD COLUMN `server_port` SMALLINT UNSIGNED NOT NULL AFTER `server_ip`
, ADD COLUMN `ipTEMP` INT UNSIGNED NOT NULL AFTER `ip`
, ADD COLUMN `a_ipTEMP` INT UNSIGNED NOT NULL AFTER `a_ip`
, ADD COLUMN `unbanned_ipTEMP` INT UNSIGNED NULL DEFAULT NULL AFTER `unbanned_ip`;
SET SQL_SAFE_UPDATES = 0;
UPDATE `ban`
 SET `server_ip` = INET_ATON(SUBSTRING_INDEX(IF(`serverip` = '', '0', IF(SUBSTRING_INDEX(`serverip`, ':', 1) LIKE '%_._%', `serverip`, '0')), ':', 1))
, `server_port` = IF(`serverip` LIKE '%:_%', CAST(SUBSTRING_INDEX(`serverip`, ':', -1) AS UNSIGNED), '0')
, `ipTEMP` = INET_ATON(IF(`ip` LIKE '%_._%', `ip`, '0'))
, `a_ipTEMP` = INET_ATON(IF(`a_ip` LIKE '%_._%', `a_ip`, '0'))
, `unbanned_ipTEMP` = INET_ATON(IF(`unbanned_ip` LIKE '%_._%', `unbanned_ip`, '0'));
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE `ban`
 DROP COLUMN `unbanned_ip`
, DROP COLUMN `a_ip`
, DROP COLUMN `ip`
, DROP COLUMN `serverip`
, CHANGE COLUMN `ipTEMP` `ip` INT(10) UNSIGNED NOT NULL
, CHANGE COLUMN `a_ipTEMP` `a_ip` INT(10) UNSIGNED NOT NULL
, CHANGE COLUMN `unbanned_ipTEMP` `unbanned_ip` INT(10) UNSIGNED NULL DEFAULT NULL;
COMMIT;

START TRANSACTION;
ALTER TABLE `connection_log`
 ADD COLUMN `server_ip` INT UNSIGNED NOT NULL AFTER `serverip`
, ADD COLUMN `server_port` SMALLINT UNSIGNED NOT NULL AFTER `server_ip`
, ADD COLUMN `ipTEMP` INT UNSIGNED NOT NULL AFTER `ip`;
SET SQL_SAFE_UPDATES = 0;
UPDATE `connection_log`
 SET `server_ip` = INET_ATON(SUBSTRING_INDEX(IF(`serverip` = '', '0', IF(SUBSTRING_INDEX(`serverip`, ':', 1) LIKE '%_._%', `serverip`, '0')), ':', 1))
, `server_port` = IF(`serverip` LIKE '%:_%', CAST(SUBSTRING_INDEX(`serverip`, ':', -1) AS UNSIGNED), '0')
, `ipTEMP` = INET_ATON(IF(`ip` LIKE '%_._%', `ip`, '0'));
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE `connection_log`
 DROP COLUMN `ip`
, DROP COLUMN `serverip`
, CHANGE COLUMN `ipTEMP` `ip` INT(10) UNSIGNED NOT NULL;
COMMIT;

START TRANSACTION;
SET SQL_SAFE_UPDATES = 0;
UPDATE `death`
 SET `bruteloss` = LEAST(`bruteloss`, 65535)
, `brainloss` = LEAST(`brainloss`, 65535)
, `fireloss` = LEAST(`fireloss`, 65535)
, `oxyloss` = LEAST(`oxyloss`, 65535);
ALTER TABLE `death`
 CHANGE COLUMN `pod` `pod` VARCHAR(50) NOT NULL
, CHANGE COLUMN `coord` `coord` VARCHAR(32) NOT NULL
, CHANGE COLUMN `mapname` `mapname` VARCHAR(32) NOT NULL
, CHANGE COLUMN `job` `job` VARCHAR(32) NOT NULL
, CHANGE COLUMN `special` `special` VARCHAR(32) NULL DEFAULT NULL
, CHANGE COLUMN `name` `name` VARCHAR(96) NOT NULL
, CHANGE COLUMN `byondkey` `byondkey` VARCHAR(32) NOT NULL
, CHANGE COLUMN `laname` `laname` VARCHAR(96) NULL DEFAULT NULL
, CHANGE COLUMN `lakey` `lakey` VARCHAR(32) NULL DEFAULT NULL
, CHANGE COLUMN `gender` `gender` ENUM('neuter', 'male', 'female', 'plural') NOT NULL
, CHANGE COLUMN `bruteloss` `bruteloss` SMALLINT UNSIGNED NOT NULL
, CHANGE COLUMN `brainloss` `brainloss` SMALLINT UNSIGNED NOT NULL
, CHANGE COLUMN `fireloss` `fireloss` SMALLINT UNSIGNED NOT NULL
, CHANGE COLUMN `oxyloss` `oxyloss` SMALLINT UNSIGNED NOT NULL
, ADD COLUMN `server_ip` INT UNSIGNED NOT NULL AFTER `server`
, ADD COLUMN `server_port` SMALLINT UNSIGNED NOT NULL AFTER `server_ip`;
UPDATE `death`
 SET `server_ip` = INET_ATON(SUBSTRING_INDEX(IF(`server` = '', '0', IF(SUBSTRING_INDEX(`server`, ':', 1) LIKE '%_._%', `server`, '0')), ':', 1))
, `server_port` = IF(`server` LIKE '%:_%', CAST(SUBSTRING_INDEX(`server`, ':', -1) AS UNSIGNED), '0');
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE `death`
 DROP COLUMN `server`;
COMMIT;

ALTER TABLE `library`
 CHANGE COLUMN `category` `category` ENUM('Any', 'Fiction', 'Non-Fiction', 'Adult', 'Reference', 'Religion') NOT NULL
, CHANGE COLUMN `ckey` `ckey` VARCHAR(32) NOT NULL DEFAULT 'LEGACY'
, CHANGE COLUMN `datetime` `datetime` DATETIME NOT NULL
, CHANGE COLUMN `deleted` `deleted` TINYINT(1) UNSIGNED NULL DEFAULT NULL;

ALTER TABLE `messages`
 CHANGE COLUMN `type` `type` ENUM('memo', 'message', 'message sent', 'note', 'watchlist entry') NOT NULL
, CHANGE COLUMN `text` `text` VARCHAR(2048) NOT NULL
, CHANGE COLUMN `secret` `secret` TINYINT(1) UNSIGNED NOT NULL;

START TRANSACTION;
ALTER TABLE `player`
 ADD COLUMN `ipTEMP` INT UNSIGNED NOT NULL AFTER `ip`;
SET SQL_SAFE_UPDATES = 0;
UPDATE `player`
 SET `ipTEMP` = INET_ATON(IF(`ip` LIKE '%_._%', `ip`, '0'));
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE `player`
 DROP COLUMN `ip`
, CHANGE COLUMN `ipTEMP` `ip` INT(10) UNSIGNED NOT NULL;
COMMIT;

START TRANSACTION;
ALTER TABLE `poll_question`
 CHANGE COLUMN `polltype` `polltype` ENUM('OPTION', 'TEXT', 'NUMVAL', 'MULTICHOICE', 'IRV') NOT NULL
, CHANGE COLUMN `adminonly` `adminonly` TINYINT(1) UNSIGNED NOT NULL
, CHANGE COLUMN `createdby_ckey` `createdby_ckey` VARCHAR(32) NULL DEFAULT NULL
, CHANGE COLUMN `dontshow` `dontshow` TINYINT(1) UNSIGNED NOT NULL
, ADD COLUMN `createdby_ipTEMP` INT UNSIGNED NOT NULL AFTER `createdby_ip`
, DROP COLUMN `for_trialmin`;
SET SQL_SAFE_UPDATES = 0;
UPDATE `poll_question`
 SET `createdby_ipTEMP` = INET_ATON(IF(`createdby_ip` LIKE '%_._%', `createdby_ip`, '0'));
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE `poll_question`
 DROP COLUMN `createdby_ip`
, CHANGE COLUMN `createdby_ipTEMP` `createdby_ip` INT(10) UNSIGNED NOT NULL;
COMMIT;

START TRANSACTION;
ALTER TABLE `poll_textreply`
 CHANGE COLUMN `replytext` `replytext` VARCHAR(2048) NOT NULL
, ADD COLUMN `ipTEMP` INT UNSIGNED NOT NULL AFTER `ip`;
SET SQL_SAFE_UPDATES = 0;
UPDATE `poll_textreply`
 SET `ipTEMP` = INET_ATON(IF(`ip` LIKE '%_._%', `ip`, '0'));
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE `poll_textreply`
 DROP COLUMN `ip`
, CHANGE COLUMN `ipTEMP` `ip` INT(10) UNSIGNED NOT NULL;
COMMIT;

START TRANSACTION;
ALTER TABLE `poll_vote`
 CHANGE COLUMN `ckey` `ckey` VARCHAR(32) NOT NULL
, ADD COLUMN `ipTEMP` INT UNSIGNED NOT NULL AFTER `ip`;
SET SQL_SAFE_UPDATES = 0;
UPDATE `poll_vote`
 SET `ipTEMP` = INET_ATON(IF(`ip` LIKE '%_._%', `ip`, '0'));
SET SQL_SAFE_UPDATES = 1;
ALTER TABLE `poll_vote`
 DROP COLUMN `ip`
, CHANGE COLUMN `ipTEMP` `ip` INT(10) UNSIGNED NOT NULL;
COMMIT;

/*----------------------------------------------------

These queries are to be run after the above.
These indexes are designed with only the codebase queries in mind.
You may find it helpful to modify or create your own indexes if you utilise additional queries for other services.

----------------------------------------------------*/

ALTER TABLE `ban`
 ADD INDEX `idx_ban_checkban` (`ckey` ASC, `bantype` ASC, `expiration_time` ASC, `unbanned` ASC, `job` ASC)
, ADD INDEX `idx_ban_isbanned` (`ckey` ASC, `ip` ASC, `computerid` ASC, `bantype` ASC, `expiration_time` ASC, `unbanned` ASC)
, ADD INDEX `idx_ban_count` (`id` ASC, `a_ckey` ASC, `bantype` ASC, `expiration_time` ASC, `unbanned` ASC);

ALTER TABLE `ipintel`
 ADD INDEX `idx_ipintel` (`ip` ASC, `intel` ASC, `date` ASC);

ALTER TABLE `library`
 ADD INDEX `idx_lib_id_del` (`id` ASC, `deleted` ASC)
, ADD INDEX `idx_lib_del_title` (`deleted` ASC, `title` ASC)
, ADD INDEX `idx_lib_search` (`deleted` ASC, `author` ASC, `title` ASC, `category` ASC);

ALTER TABLE `messages`
 ADD INDEX `idx_msg_ckey_time` (`targetckey` ASC, `timestamp` ASC)
, ADD INDEX `idx_msg_type_ckeys_time` (`type` ASC, `targetckey` ASC, `adminckey` ASC, `timestamp` ASC)
, ADD INDEX `idx_msg_type_ckey_time_odr` (`type` ASC, `targetckey` ASC, `timestamp` ASC);

ALTER TABLE `player`
 ADD INDEX `idx_player_cid_ckey` (`computerid` ASC, `ckey` ASC)
, ADD INDEX `idx_player_ip_ckey` (`ip` ASC, `ckey` ASC);

ALTER TABLE `poll_option`
 ADD INDEX `idx_pop_pollid` (`pollid` ASC);

ALTER TABLE `poll_question`
 ADD INDEX `idx_pquest_question_time_ckey` (`question` ASC, `starttime` ASC, `endtime` ASC, `createdby_ckey` ASC, `createdby_ip` ASC)
, ADD INDEX `idx_pquest_time_admin` (`starttime` ASC, `endtime` ASC, `adminonly` ASC)
, ADD INDEX `idx_pquest_id_time_type_admin` (`id` ASC, `starttime` ASC, `endtime` ASC, `polltype` ASC, `adminonly` ASC);

ALTER TABLE `poll_vote`
 ADD INDEX `idx_pvote_pollid_ckey` (`pollid` ASC, `ckey` ASC)
, ADD INDEX `idx_pvote_optionid_ckey` (`optionid` ASC, `ckey` ASC);

ALTER TABLE `poll_textreply`
 ADD INDEX `idx_ptext_pollid_ckey` (`pollid` ASC, `ckey` ASC);


code:
#Python 3+ Script for populating the key of all ckeys in player table made by Jordie0608
#
#Before starting ensure you have installed the mysqlclient package https://github.com/PyMySQL/mysqlclient-python
#It can be downloaded from command line with pip:
#pip install mysqlclient
#And that you have run the most recent commands listed in database_changelog.txt
#
#To view the parameters for this script, execute it with the argument --help
#All the positional arguments are required, remember to include a prefixe in your table name if you use one
#--useckey and --onlynull are optional arguments, see --help for their function
#An example of the command used to execute this script from powershell:
#python populate_key_2018-07-09.py "localhost" "root" "password" "feedback" "SS13_player" --onlynull --useckey
#
#This script requires an internet connection to function
#Sometimes byond.com fails to return the page for a valid ckey, this can be a temporary problem and may be resolved by rerunning the script
#You can have the script use the existing ckey instead if the key is unable to be parsed with the --useckey optional argument
#To make the script only iterate on rows that failed to parse a ckey and have a null byond_key column, use the --onlynull optional argument
#To make the script only iterate on rows that have a matching ckey and byond_key column, use the --onlyckeymatch optional argument
#The --onlynull and --onlyckeymatch arguments are mutually exclusive, the script can't be run with both of them enabled
#
#It's safe to run this script with your game server(s) active.

import MySQLdb
import argparse
import re
import sys
from urllib.request import urlopen
from datetime import datetime

if sys.version_info[0] < 3:
    raise Exception("Python must be at least version 3 for this script.")
query_values = ""
current_round = 0
parser = argparse.ArgumentParser()
parser.add_argument("address", help="MySQL server address (use localhost for the current computer)")
parser.add_argument("username", help="MySQL login username")
parser.add_argument("password", help="MySQL login password")
parser.add_argument("database", help="Database name")
parser.add_argument("playertable", help="Name of the player table (remember a prefix if you use one)")
parser.add_argument("--useckey", help="Use the player's ckey for their key if unable to contact or parse their member page", action="store_true")
group = parser.add_mutually_exclusive_group()
group.add_argument("--onlynull", help="Only try to update rows if their byond_key column is null, mutually exclusive with --onlyckeymatch", action="store_true")
group.add_argument("--onlyckeymatch", help="Only try to update rows that have matching ckey and byond_key columns from the --useckey argument, mutually exclusive with --onlynull", action="store_true")
args = parser.parse_args()
where = ""
if args.onlynull:
    where = " WHERE byond_key IS NULL"
if args.onlyckeymatch:
    where = " WHERE byond_key = ckey"
db=MySQLdb.connect(host=args.address, user=args.username, passwd=args.password, db=args.database)
cursor=db.cursor()
player_table = args.playertable
cursor.execute("SELECT ckey FROM {0}{1}".format(player_table, where))
ckey_list = cursor.fetchall()
failed_ckeys = []
start_time = datetime.now()
success = 0
fail = 0
print("Beginning script at {0}".format(start_time.strftime("%Y-%m-%d %H:%M:%S")))
if not ckey_list:
    print("Query returned no rows")
for current_ckey in ckey_list:
    link = urlopen("https://secure.byond.com/members/{0}/?format=text".format(current_ckey[0]))
    data = link.read()
    data = data.decode("ISO-8859-1")
    match = re.search("\tkey = \"(.+)\"", data)
    if match:
        key = match.group(1)
        success += 1
    else:
        fail += 1
        failed_ckeys.append(current_ckey[0])
        msg = "Failed to parse a key for {0}".format(current_ckey[0])
        if args.useckey:
            msg += ", using their ckey instead"
            print(msg)
            key = current_ckey[0]
        else:
            print(msg)
            continue
    cursor.execute("UPDATE {0} SET byond_key = %s WHERE ckey = %s".format(player_table), (key, current_ckey[0]))
    db.commit()
end_time = datetime.now()
print("Script completed at {0} with duration {1}".format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"), end_time - start_time))
if failed_ckeys:
    if args.useckey:
        print("The following ckeys failed to parse a key so their ckey was used instead:")
    else:
        print("The following ckeys failed to parse a key and were skipped:")
    print("\n".join(failed_ckeys))
    print("Keys successfully parsed: {0}    Keys failed parsing: {1}".format(success, fail))
cursor.close()

repo_name: AnalWerewolf/sundown

license: mit


code:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `admin`
--

DROP TABLE IF EXISTS `admin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin` (
  `ckey` varchar(32) NOT NULL,
  `rank` varchar(32) NOT NULL,
  `feedback` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

-- SEPTIC SHOCK TABLE
-- Table structure for table `admin`
--

DROP TABLE IF EXISTS `donators`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin` (
  `ckey` varchar(32) NOT NULL,
  `rank` varchar(32) NOT NULL,
  PRIMARY KEY (`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

-- SEPTIC SHOCK END

--
-- Table structure for table `admin_log`
--

DROP TABLE IF EXISTS `admin_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime NOT NULL,
  `round_id` int(11) unsigned NULL,
  `adminckey` varchar(32) NOT NULL,
  `adminip` int(10) unsigned NOT NULL,
  `operation` enum('add admin','remove admin','change admin rank','add rank','remove rank','change rank flags') NOT NULL,
  `target` varchar(32) NOT NULL,
  `log` varchar(1000) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `admin_ranks`
--

DROP TABLE IF EXISTS `admin_ranks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_ranks` (
  `rank` varchar(32) NOT NULL,
  `flags` smallint(5) unsigned NOT NULL,
  `exclude_flags` smallint(5) unsigned NOT NULL,
  `can_edit_flags` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ban`
--

DROP TABLE IF EXISTS `ban`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ban` (
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `bantime` DATETIME NOT NULL,
  `server_ip` INT(10) UNSIGNED NOT NULL,
  `server_port` SMALLINT(5) UNSIGNED NOT NULL,
  `round_id` INT(11) UNSIGNED NULL,
  `role` VARCHAR(32) NULL DEFAULT NULL,
  `expiration_time` DATETIME NULL DEFAULT NULL,
  `applies_to_admins` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
  `reason` VARCHAR(2048) NOT NULL,
  `ckey` VARCHAR(32) NULL DEFAULT NULL,
  `ip` INT(10) UNSIGNED NULL DEFAULT NULL,
  `computerid` VARCHAR(32) NULL DEFAULT NULL,
  `a_ckey` VARCHAR(32) NOT NULL,
  `a_ip` INT(10) UNSIGNED NOT NULL,
  `a_computerid` VARCHAR(32) NOT NULL,
  `who` VARCHAR(2048) NOT NULL,
  `adminwho` VARCHAR(2048) NOT NULL,
  `edits` TEXT NULL DEFAULT NULL,
  `unbanned_datetime` DATETIME NULL DEFAULT NULL,
  `unbanned_ckey` VARCHAR(32) NULL DEFAULT NULL,
  `unbanned_ip` INT(10) UNSIGNED NULL DEFAULT NULL,
  `unbanned_computerid` VARCHAR(32) NULL DEFAULT NULL,
  `unbanned_round_id` INT(11) UNSIGNED NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ban_isbanned` (`ckey`,`role`,`unbanned_datetime`,`expiration_time`),
  KEY `idx_ban_isbanned_details` (`ckey`,`ip`,`computerid`,`role`,`unbanned_datetime`,`expiration_time`),
  KEY `idx_ban_count` (`bantime`,`a_ckey`,`applies_to_admins`,`unbanned_datetime`,`expiration_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `citation`
--
DROP TABLE IF EXISTS `citation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `citation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `round_id` int(11) unsigned NULL,
  `server_ip` int(11) unsigned NOT NULL,
  `server_port` int(11) unsigned NOT NULL,
  `citation` text NOT NULL,
  `action` varchar(20) NOT NULL DEFAULT '',
  `sender` varchar(32) NOT NULL DEFAULT '',
  `sender_ic` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
  `recipient` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
  `crime` text NOT NULL,
  `fine` int(4) DEFAULT NULL,
  `paid` int(4) DEFAULT 0,
  `timestamp` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_constraints` (`round_id`,`server_ip`,`server_port`,`citation`(100)) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `connection_log`
--

DROP TABLE IF EXISTS `connection_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `connection_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime DEFAULT NULL,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) unsigned NULL,
  `ckey` varchar(45) DEFAULT NULL,
  `ip` int(10) unsigned NOT NULL,
  `computerid` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `death`
--

DROP TABLE IF EXISTS `death`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `death` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pod` varchar(50) NOT NULL,
  `x_coord` smallint(5) unsigned NOT NULL,
  `y_coord` smallint(5) unsigned NOT NULL,
  `z_coord` smallint(5) unsigned NOT NULL,
  `mapname` varchar(32) NOT NULL,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) unsigned NULL,
  `tod` datetime NOT NULL COMMENT 'Time of death',
  `job` varchar(32) NOT NULL,
  `special` varchar(32) DEFAULT NULL,
  `name` varchar(96) NOT NULL,
  `byondkey` varchar(32) NOT NULL,
  `laname` varchar(96) DEFAULT NULL,
  `lakey` varchar(32) DEFAULT NULL,
  `bruteloss` smallint(5) unsigned NOT NULL,
  `brainloss` smallint(5) unsigned NOT NULL,
  `fireloss` smallint(5) unsigned NOT NULL,
  `oxyloss` smallint(5) unsigned NOT NULL,
  `toxloss` smallint(5) unsigned NOT NULL,
  `cloneloss` smallint(5) unsigned NOT NULL,
  `staminaloss` smallint(5) unsigned NOT NULL,
  `last_words` varchar(255) DEFAULT NULL,
  `suicide` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `feedback`
--

DROP TABLE IF EXISTS `feedback`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `feedback` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `datetime` datetime NOT NULL,
  `round_id` int(11) unsigned NULL,
  `key_name` varchar(32) NOT NULL,
  `key_type` enum('text', 'amount', 'tally', 'nested tally', 'associative') NOT NULL,
  `version` tinyint(3) unsigned NOT NULL,
  `json` json NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `ipintel`
--

DROP TABLE IF EXISTS `ipintel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ipintel` (
  `ip` int(10) unsigned NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `intel` double NOT NULL DEFAULT '0',
  PRIMARY KEY (`ip`),
  KEY `idx_ipintel` (`ip`,`intel`,`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `legacy_population`
--

DROP TABLE IF EXISTS `legacy_population`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `legacy_population` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `playercount` int(11) DEFAULT NULL,
  `admincount` int(11) DEFAULT NULL,
  `time` datetime NOT NULL,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) unsigned NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `library`
--

DROP TABLE IF EXISTS `library`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `library` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `author` varchar(45) NOT NULL,
  `title` varchar(45) NOT NULL,
  `content` text NOT NULL,
  `category` enum('Any','Fiction','Non-Fiction','Adult','Reference','Religion') NOT NULL,
  `ckey` varchar(32) NOT NULL DEFAULT 'LEGACY',
  `datetime` datetime NOT NULL,
  `deleted` tinyint(1) unsigned DEFAULT NULL,
  `round_id_created` int(11) unsigned NULL,
  PRIMARY KEY (`id`),
  KEY `deleted_idx` (`deleted`),
  KEY `idx_lib_id_del` (`id`,`deleted`),
  KEY `idx_lib_del_title` (`deleted`,`title`),
  KEY `idx_lib_search` (`deleted`,`author`,`title`,`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `library_action`
--

DROP TABLE IF EXISTS `library_action`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `library_action` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `book` int(10) unsigned NOT NULL,
  `reason` longtext DEFAULT NULL,
  `ckey` varchar(11) NOT NULL DEFAULT '',
  `datetime` datetime NOT NULL DEFAULT current_timestamp(),
  `action` varchar(11) NOT NULL DEFAULT '',
  `ip_addr` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `messages`
--

DROP TABLE IF EXISTS `messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` enum('memo','message','message sent','note','watchlist entry') NOT NULL,
  `targetckey` varchar(32) NOT NULL,
  `adminckey` varchar(32) NOT NULL,
  `text` varchar(2048) NOT NULL,
  `timestamp` datetime NOT NULL,
  `server` varchar(32) DEFAULT NULL,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) unsigned NULL,
  `secret` tinyint(1) unsigned NOT NULL,
  `expire_timestamp` datetime DEFAULT NULL,
  `severity` enum('high','medium','minor','none') DEFAULT NULL,
  `playtime` int(11) unsigned NULL DEFAULT NULL,
  `lasteditor` varchar(32) DEFAULT NULL,
  `edits` text,
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `deleted_ckey` VARCHAR(32) NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_msg_ckey_time` (`targetckey`,`timestamp`, `deleted`),
  KEY `idx_msg_type_ckeys_time` (`type`,`targetckey`,`adminckey`,`timestamp`, `deleted`),
  KEY `idx_msg_type_ckey_time_odr` (`type`,`targetckey`,`timestamp`, `deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `role_time`
--

DROP TABLE IF EXISTS `role_time`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;

CREATE TABLE `role_time`
( `ckey` VARCHAR(32) NOT NULL ,
 `job` VARCHAR(32) NOT NULL ,
 `minutes` INT UNSIGNED NOT NULL,
 PRIMARY KEY (`ckey`, `job`)
 ) ENGINE = InnoDB;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `role_time`
--

DROP TABLE IF EXISTS `role_time_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;

CREATE TABLE IF NOT EXISTS `role_time_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ckey` varchar(32) NOT NULL,
  `job` varchar(128) NOT NULL,
  `delta` int(11) NOT NULL,
  `datetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `ckey` (`ckey`),
  KEY `job` (`job`),
  KEY `datetime` (`datetime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `player`
--

DROP TABLE IF EXISTS `player`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `player` (
  `ckey` varchar(32) NOT NULL,
  `byond_key` varchar(32) DEFAULT NULL,
  `firstseen` datetime NOT NULL,
  `firstseen_round_id` int(11) unsigned NULL,
  `lastseen` datetime NOT NULL,
  `lastseen_round_id` int(11) unsigned NULL,
  `ip` int(10) unsigned NOT NULL,
  `computerid` varchar(32) NOT NULL,
  `lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',
  `accountjoindate` DATE DEFAULT NULL,
  `flags` smallint(5) unsigned DEFAULT '0' NOT NULL,
  PRIMARY KEY (`ckey`),
  KEY `idx_player_cid_ckey` (`computerid`,`ckey`),
  KEY `idx_player_ip_ckey` (`ip`,`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_option`
--

DROP TABLE IF EXISTS `poll_option`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_option` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pollid` int(11) NOT NULL,
  `text` varchar(255) NOT NULL,
  `minval` int(3) DEFAULT NULL,
  `maxval` int(3) DEFAULT NULL,
  `descmin` varchar(32) DEFAULT NULL,
  `descmid` varchar(32) DEFAULT NULL,
  `descmax` varchar(32) DEFAULT NULL,
  `default_percentage_calc` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_pop_pollid` (`pollid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_question`
--

DROP TABLE IF EXISTS `poll_question`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_question` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `polltype` enum('OPTION','TEXT','NUMVAL','MULTICHOICE','IRV') NOT NULL,
  `created_datetime` datetime NOT NULL,
  `starttime` datetime NOT NULL,
  `endtime` datetime NOT NULL,
  `question` varchar(255) NOT NULL,
  `subtitle` varchar(255) DEFAULT NULL,
  `adminonly` tinyint(1) unsigned NOT NULL,
  `multiplechoiceoptions` int(2) DEFAULT NULL,
  `createdby_ckey` varchar(32) NOT NULL,
  `createdby_ip` int(10) unsigned NOT NULL,
  `dontshow` tinyint(1) unsigned NOT NULL,
  `allow_revoting` tinyint(1) unsigned NOT NULL,
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_pquest_question_time_ckey` (`question`,`starttime`,`endtime`,`createdby_ckey`,`createdby_ip`),
  KEY `idx_pquest_time_deleted_id` (`starttime`,`endtime`, `deleted`, `id`),
  KEY `idx_pquest_id_time_type_admin` (`id`,`starttime`,`endtime`,`polltype`,`adminonly`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_textreply`
--

DROP TABLE IF EXISTS `poll_textreply`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_textreply` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime NOT NULL,
  `pollid` int(11) NOT NULL,
  `ckey` varchar(32) NOT NULL,
  `ip` int(10) unsigned NOT NULL,
  `replytext` varchar(2048) NOT NULL,
  `adminrank` varchar(32) NOT NULL,
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_ptext_pollid_ckey` (`pollid`,`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_vote`
--

DROP TABLE IF EXISTS `poll_vote`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_vote` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime NOT NULL,
  `pollid` int(11) NOT NULL,
  `optionid` int(11) NOT NULL,
  `ckey` varchar(32) NOT NULL,
  `ip` int(10) unsigned NOT NULL,
  `adminrank` varchar(32) NOT NULL,
  `rating` int(2) DEFAULT NULL,
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_pvote_pollid_ckey` (`pollid`,`ckey`),
  KEY `idx_pvote_optionid_ckey` (`optionid`,`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `round`
--
DROP TABLE IF EXISTS `round`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `round` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `initialize_datetime` DATETIME NOT NULL,
  `start_datetime` DATETIME NULL,
  `shutdown_datetime` DATETIME NULL,
  `end_datetime` DATETIME NULL,
  `server_ip` INT(10) UNSIGNED NOT NULL,
  `server_port` SMALLINT(5) UNSIGNED NOT NULL,
  `commit_hash` CHAR(40) NULL,
  `game_mode` VARCHAR(32) NULL,
  `game_mode_result` VARCHAR(64) NULL,
  `end_state` VARCHAR(64) NULL,
  `shuttle_name` VARCHAR(64) NULL,
  `map_name` VARCHAR(32) NULL,
  `station_name` VARCHAR(80) NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

--
-- Table structure for table `schema_revision`
--
DROP TABLE IF EXISTS `schema_revision`;
CREATE TABLE `schema_revision` (
  `major` TINYINT(3) unsigned NOT NULL,
  `minor` TINYINT(3) unsigned NOT NULL,
  `date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`major`, `minor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `stickyban`
--
DROP TABLE IF EXISTS `stickyban`;
CREATE TABLE `stickyban` (
	`ckey` VARCHAR(32) NOT NULL,
	`reason` VARCHAR(2048) NOT NULL,
	`banning_admin` VARCHAR(32) NOT NULL,
	`datetime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	PRIMARY KEY (`ckey`)
) ENGINE=InnoDB;

--
-- Table structure for table `stickyban_matched_ckey`
--
DROP TABLE IF EXISTS `stickyban_matched_ckey`;
CREATE TABLE `stickyban_matched_ckey` (
	`stickyban` VARCHAR(32) NOT NULL,
	`matched_ckey` VARCHAR(32) NOT NULL,
	`first_matched` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`last_matched` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	`exempt` TINYINT(1) NOT NULL DEFAULT '0',
	PRIMARY KEY (`stickyban`, `matched_ckey`)
) ENGINE=InnoDB;

--
-- Table structure for table `stickyban_matched_ip`
--
DROP TABLE IF EXISTS `stickyban_matched_ip`;
CREATE TABLE `stickyban_matched_ip` (
	`stickyban` VARCHAR(32) NOT NULL,
	`matched_ip` INT UNSIGNED NOT NULL,
	`first_matched` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`last_matched` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	PRIMARY KEY (`stickyban`, `matched_ip`)
) ENGINE=InnoDB;

--
-- Table structure for table `stickyban_matched_cid`
--
DROP TABLE IF EXISTS `stickyban_matched_cid`;
CREATE TABLE `stickyban_matched_cid` (
	`stickyban` VARCHAR(32) NOT NULL,
	`matched_cid` VARCHAR(32) NOT NULL,
	`first_matched` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`last_matched` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	PRIMARY KEY (`stickyban`, `matched_cid`)
) ENGINE=InnoDB;

--
-- Table structure for table `achievements`
--
DROP TABLE IF EXISTS `achievements`;
CREATE TABLE `achievements` (
	`ckey` VARCHAR(32) NOT NULL,
	`achievement_key` VARCHAR(32) NOT NULL,
	`value` INT NULL,
	`last_updated` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	PRIMARY KEY (`ckey`,`achievement_key`)
) ENGINE=InnoDB;

DROP TABLE IF EXISTS `achievement_metadata`;
CREATE TABLE `achievement_metadata` (
	`achievement_key` VARCHAR(32) NOT NULL,
	`achievement_version` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
	`achievement_type` enum('achievement','score','award') NULL DEFAULT NULL,
	`achievement_name` VARCHAR(64) NULL DEFAULT NULL,
	`achievement_description` VARCHAR(512) NULL DEFAULT NULL,
	PRIMARY KEY (`achievement_key`)
) ENGINE=InnoDB;

--
-- Table structure for table `ticket`
--
DROP TABLE IF EXISTS `ticket`;
CREATE TABLE `ticket` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) unsigned NULL,
  `ticket` smallint(11) unsigned NOT NULL,
  `action` varchar(20) NOT NULL DEFAULT 'Message',
  `message` text NOT NULL,
  `timestamp` datetime NOT NULL,
  `recipient` varchar(32) DEFAULT NULL,
  `sender` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ticket_act_recip` (`action`, `recipient`),
  KEY `idx_ticket_act_send` (`action`, `sender`),
  KEY `idx_ticket_tic_rid` (`ticket`, `round_id`),
  KEY `idx_ticket_act_time_rid` (`action`, `timestamp`, `round_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DELIMITER $$
CREATE PROCEDURE `set_poll_deleted`(
	IN `poll_id` INT
)
SQL SECURITY INVOKER
BEGIN
UPDATE `poll_question` SET deleted = 1 WHERE id = poll_id;
UPDATE `poll_option` SET deleted = 1 WHERE pollid = poll_id;
UPDATE `poll_vote` SET deleted = 1 WHERE pollid = poll_id;
UPDATE `poll_textreply` SET deleted = 1 WHERE pollid = poll_id;
END
$$
CREATE TRIGGER `role_timeTlogupdate` AFTER UPDATE ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (NEW.CKEY, NEW.job, NEW.minutes-OLD.minutes);
END
$$
CREATE TRIGGER `role_timeTloginsert` AFTER INSERT ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (NEW.ckey, NEW.job, NEW.minutes);
END
$$
CREATE TRIGGER `role_timeTlogdelete` AFTER DELETE ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (OLD.ckey, OLD.job, 0-OLD.minutes);
END
$$
DELIMITER ;

--
-- Table structure for table `discord_links`
--
DROP TABLE IF EXISTS `discord_links`;
CREATE TABLE `discord_links` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`ckey` VARCHAR(32) NOT NULL,
	`discord_id` BIGINT(20) DEFAULT NULL,
	`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`one_time_token` VARCHAR(100) NOT NULL,
  	`valid` BOOLEAN NOT NULL DEFAULT FALSE,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB;

--
-- Table structure for table `text_adventures`
--
DROP TABLE IF EXISTS `text_adventures`;
CREATE TABLE `text_adventures` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`adventure_data` LONGTEXT NOT NULL,
	`uploader` VARCHAR(32) NOT NULL,
	`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`approved` TINYINT(1) NOT NULL DEFAULT FALSE,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB;

--
-- Table structure for table `admin_connections`
--
DROP TABLE IF EXISTS `admin_connections`;
CREATE TABLE `admin_connections` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `ckey` VARCHAR(32) NOT NULL,
  `ip` INT(11) UNSIGNED NOT NULL,
  `cid` VARCHAR(32) NOT NULL,
  `verification_time` DATETIME NULL,
  PRIMARY KEY (`id`),
  UNIQUE INDEX `unique_constraints` (`ckey`, `ip`, `cid`)
) ENGINE=InnoDB;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;


code:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `SS13_admin`
--

DROP TABLE IF EXISTS `SS13_admin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_admin` (
  `ckey` varchar(32) NOT NULL,
  `rank` varchar(32) NOT NULL,
  `feedback` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_admin_log`
--

DROP TABLE IF EXISTS `SS13_admin_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_admin_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime NOT NULL,
  `round_id` int(11) unsigned NULL,
  `adminckey` varchar(32) NOT NULL,
  `adminip` int(10) unsigned NOT NULL,
  `operation` enum('add admin','remove admin','change admin rank','add rank','remove rank','change rank flags') NOT NULL,
  `target` varchar(32) NOT NULL,
  `log` varchar(1000) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_admin_ranks`
--

DROP TABLE IF EXISTS `SS13_admin_ranks`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_admin_ranks` (
  `rank` varchar(32) NOT NULL,
  `flags` smallint(5) unsigned NOT NULL,
  `exclude_flags` smallint(5) unsigned NOT NULL,
  `can_edit_flags` smallint(5) unsigned NOT NULL,
  PRIMARY KEY (`rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_ban`
--

DROP TABLE IF EXISTS `SS13_ban`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_ban` (
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `bantime` DATETIME NOT NULL,
  `server_ip` INT(10) UNSIGNED NOT NULL,
  `server_port` SMALLINT(5) UNSIGNED NOT NULL,
  `round_id` INT(11) UNSIGNED NULL,
  `role` VARCHAR(32) NULL DEFAULT NULL,
  `expiration_time` DATETIME NULL DEFAULT NULL,
  `applies_to_admins` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
  `reason` VARCHAR(2048) NOT NULL,
  `ckey` VARCHAR(32) NULL DEFAULT NULL,
  `ip` INT(10) UNSIGNED NULL DEFAULT NULL,
  `computerid` VARCHAR(32) NULL DEFAULT NULL,
  `a_ckey` VARCHAR(32) NOT NULL,
  `a_ip` INT(10) UNSIGNED NOT NULL,
  `a_computerid` VARCHAR(32) NOT NULL,
  `who` VARCHAR(2048) NOT NULL,
  `adminwho` VARCHAR(2048) NOT NULL,
  `edits` TEXT NULL DEFAULT NULL,
  `unbanned_datetime` DATETIME NULL DEFAULT NULL,
  `unbanned_ckey` VARCHAR(32) NULL DEFAULT NULL,
  `unbanned_ip` INT(10) UNSIGNED NULL DEFAULT NULL,
  `unbanned_computerid` VARCHAR(32) NULL DEFAULT NULL,
  `unbanned_round_id` INT(11) UNSIGNED NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ban_isbanned` (`ckey`,`role`,`unbanned_datetime`,`expiration_time`),
  KEY `idx_ban_isbanned_details` (`ckey`,`ip`,`computerid`,`role`,`unbanned_datetime`,`expiration_time`),
  KEY `idx_ban_count` (`bantime`,`a_ckey`,`applies_to_admins`,`unbanned_datetime`,`expiration_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `citation`
--
DROP TABLE IF EXISTS `SS13_citation`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `SS13_citation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `round_id` int(11) unsigned NULL,
  `server_ip` int(11) unsigned NOT NULL,
  `server_port` int(11) unsigned NOT NULL,
  `citation` text NOT NULL,
  `action` varchar(20) NOT NULL DEFAULT '',
  `sender` varchar(32) NOT NULL DEFAULT '',
  `sender_ic` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
  `recipient` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
  `crime` text NOT NULL,
  `fine` int(4) DEFAULT NULL,
  `paid` int(4) DEFAULT 0,
  `timestamp` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_constraints` (`round_id`,`server_ip`,`server_port`,`citation`(100)) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_connection_log`
--

DROP TABLE IF EXISTS `SS13_connection_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_connection_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime DEFAULT NULL,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) unsigned NOT NULL,
  `ckey` varchar(45) DEFAULT NULL,
  `ip` int(10) unsigned NOT NULL,
  `computerid` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_death`
--

DROP TABLE IF EXISTS `SS13_death`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_death` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pod` varchar(50) NOT NULL,
  `x_coord` smallint(5) unsigned NOT NULL,
  `y_coord` smallint(5) unsigned NOT NULL,
  `z_coord` smallint(5) unsigned NOT NULL,
  `mapname` varchar(32) NOT NULL,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) NULL,
  `tod` datetime NOT NULL COMMENT 'Time of death',
  `job` varchar(32) NOT NULL,
  `special` varchar(32) DEFAULT NULL,
  `name` varchar(96) NOT NULL,
  `byondkey` varchar(32) NOT NULL,
  `laname` varchar(96) DEFAULT NULL,
  `lakey` varchar(32) DEFAULT NULL,
  `bruteloss` smallint(5) unsigned NOT NULL,
  `brainloss` smallint(5) unsigned NOT NULL,
  `fireloss` smallint(5) unsigned NOT NULL,
  `oxyloss` smallint(5) unsigned NOT NULL,
  `toxloss` smallint(5) unsigned NOT NULL,
  `cloneloss` smallint(5) unsigned NOT NULL,
  `staminaloss` smallint(5) unsigned NOT NULL,
  `last_words` varchar(255) DEFAULT NULL,
  `suicide` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_feedback`
--

DROP TABLE IF EXISTS `SS13_feedback`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_feedback` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `datetime` datetime NOT NULL,
  `round_id` int(11) unsigned NULL,
  `key_name` varchar(32) NOT NULL,
  `version` tinyint(3) unsigned NOT NULL,
  `key_type` enum('text', 'amount', 'tally', 'nested tally', 'associative') NOT NULL,
  `json` json NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_ipintel`
--

DROP TABLE IF EXISTS `SS13_ipintel`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_ipintel` (
  `ip` int(10) unsigned NOT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `intel` double NOT NULL DEFAULT '0',
  PRIMARY KEY (`ip`),
  KEY `idx_ipintel` (`ip`,`intel`,`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_legacy_population`
--

DROP TABLE IF EXISTS `SS13_legacy_population`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_legacy_population` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `playercount` int(11) DEFAULT NULL,
  `admincount` int(11) DEFAULT NULL,
  `time` datetime NOT NULL,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) unsigned NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_library`
--

DROP TABLE IF EXISTS `SS13_library`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_library` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `author` varchar(45) NOT NULL,
  `title` varchar(45) NOT NULL,
  `content` text NOT NULL,
  `category` enum('Any','Fiction','Non-Fiction','Adult','Reference','Religion') NOT NULL,
  `ckey` varchar(32) NOT NULL DEFAULT 'LEGACY',
  `datetime` datetime NOT NULL,
  `deleted` tinyint(1) unsigned DEFAULT NULL,
  `round_id_created` int(11) unsigned NULL,
  PRIMARY KEY (`id`),
  KEY `deleted_idx` (`deleted`),
  KEY `idx_lib_id_del` (`id`,`deleted`),
  KEY `idx_lib_del_title` (`deleted`,`title`),
  KEY `idx_lib_search` (`deleted`,`author`,`title`,`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_library_action`
--

DROP TABLE IF EXISTS `SS13_library_action`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_library_action` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `book` int(10) unsigned NOT NULL,
  `reason` longtext DEFAULT NULL,
  `ckey` varchar(11) NOT NULL DEFAULT '',
  `datetime` datetime NOT NULL DEFAULT current_timestamp(),
  `action` varchar(11) NOT NULL DEFAULT '',
  `ip_addr` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_messages`
--

DROP TABLE IF EXISTS `SS13_messages`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_messages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` enum('memo','message','message sent','note','watchlist entry') NOT NULL,
  `targetckey` varchar(32) NOT NULL,
  `adminckey` varchar(32) NOT NULL,
  `text` varchar(2048) NOT NULL,
  `timestamp` datetime NOT NULL,
  `server` varchar(32) DEFAULT NULL,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) unsigned NULL,
  `secret` tinyint(1) unsigned NOT NULL,
  `expire_timestamp` datetime DEFAULT NULL,
  `severity` enum('high','medium','minor','none') DEFAULT NULL,
  `playtime` int(11) unsigned NULL DEFAULT NULL,
  `lasteditor` varchar(32) DEFAULT NULL,
  `edits` text,
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `deleted_ckey` VARCHAR(32) NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_msg_ckey_time` (`targetckey`,`timestamp`, `deleted`),
  KEY `idx_msg_type_ckeys_time` (`type`,`targetckey`,`adminckey`,`timestamp`, `deleted`),
  KEY `idx_msg_type_ckey_time_odr` (`type`,`targetckey`,`timestamp`, `deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_role_time`
--

DROP TABLE IF EXISTS `SS13_role_time`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;

CREATE TABLE `SS13_role_time`
( `ckey` VARCHAR(32) NOT NULL ,
 `job` VARCHAR(32) NOT NULL ,
 `minutes` INT UNSIGNED NOT NULL,
 PRIMARY KEY (`ckey`, `job`)
 ) ENGINE = InnoDB;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_role_time`
--

DROP TABLE IF EXISTS `SS13_role_time_log`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;

CREATE TABLE IF NOT EXISTS `SS13_role_time_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ckey` varchar(32) NOT NULL,
  `job` varchar(128) NOT NULL,
  `delta` int(11) NOT NULL,
  `datetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `ckey` (`ckey`),
  KEY `job` (`job`),
  KEY `datetime` (`datetime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_player`
--

DROP TABLE IF EXISTS `SS13_player`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_player` (
  `ckey` varchar(32) NOT NULL,
  `byond_key` varchar(32) DEFAULT NULL,
  `firstseen` datetime NOT NULL,
  `firstseen_round_id` int(11) unsigned NULL,
  `lastseen` datetime NOT NULL,
  `lastseen_round_id` int(11) unsigned NULL,
  `ip` int(10) unsigned NOT NULL,
  `computerid` varchar(32) NOT NULL,
  `lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',
  `accountjoindate` DATE DEFAULT NULL,
  `flags` smallint(5) unsigned DEFAULT '0' NOT NULL,
  PRIMARY KEY (`ckey`),
  KEY `idx_player_cid_ckey` (`computerid`,`ckey`),
  KEY `idx_player_ip_ckey` (`ip`,`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_poll_option`
--

DROP TABLE IF EXISTS `SS13_poll_option`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_poll_option` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pollid` int(11) NOT NULL,
  `text` varchar(255) NOT NULL,
  `minval` int(3) DEFAULT NULL,
  `maxval` int(3) DEFAULT NULL,
  `descmin` varchar(32) DEFAULT NULL,
  `descmid` varchar(32) DEFAULT NULL,
  `descmax` varchar(32) DEFAULT NULL,
  `default_percentage_calc` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_pop_pollid` (`pollid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_poll_question`
--

DROP TABLE IF EXISTS `SS13_poll_question`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_poll_question` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `polltype` enum('OPTION','TEXT','NUMVAL','MULTICHOICE','IRV') NOT NULL,
  `created_datetime` datetime NOT NULL,
  `starttime` datetime NOT NULL,
  `endtime` datetime NOT NULL,
  `question` varchar(255) NOT NULL,
  `subtitle` varchar(255) DEFAULT NULL,
  `adminonly` tinyint(1) unsigned NOT NULL,
  `multiplechoiceoptions` int(2) DEFAULT NULL,
  `createdby_ckey` varchar(32) NOT NULL,
  `createdby_ip` int(10) unsigned NOT NULL,
  `dontshow` tinyint(1) unsigned NOT NULL,
  `allow_revoting` tinyint(1) unsigned NOT NULL,
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_pquest_question_time_ckey` (`question`,`starttime`,`endtime`,`createdby_ckey`,`createdby_ip`),
  KEY `idx_pquest_time_deleted_id` (`starttime`,`endtime`, `deleted`, `id`),
  KEY `idx_pquest_id_time_type_admin` (`id`,`starttime`,`endtime`,`polltype`,`adminonly`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_poll_textreply`
--

DROP TABLE IF EXISTS `SS13_poll_textreply`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_poll_textreply` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime NOT NULL,
  `pollid` int(11) NOT NULL,
  `ckey` varchar(32) NOT NULL,
  `ip` int(10) unsigned NOT NULL,
  `replytext` varchar(2048) NOT NULL,
  `adminrank` varchar(32) NOT NULL,
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_ptext_pollid_ckey` (`pollid`,`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_poll_vote`
--

DROP TABLE IF EXISTS `SS13_poll_vote`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_poll_vote` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datetime` datetime NOT NULL,
  `pollid` int(11) NOT NULL,
  `optionid` int(11) NOT NULL,
  `ckey` varchar(32) NOT NULL,
  `ip` int(10) unsigned NOT NULL,
  `adminrank` varchar(32) NOT NULL,
  `rating` int(2) DEFAULT NULL,
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_pvote_pollid_ckey` (`pollid`,`ckey`),
  KEY `idx_pvote_optionid_ckey` (`optionid`,`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `SS13_round`
--
DROP TABLE IF EXISTS `SS13_round`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_round` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `initialize_datetime` DATETIME NOT NULL,
  `start_datetime` DATETIME NULL,
  `shutdown_datetime` DATETIME NULL,
  `end_datetime` DATETIME NULL,
  `server_ip` INT(10) UNSIGNED NOT NULL,
  `server_port` SMALLINT(5) UNSIGNED NOT NULL,
  `commit_hash` CHAR(40) NULL,
  `game_mode` VARCHAR(32) NULL,
  `game_mode_result` VARCHAR(64) NULL,
  `end_state` VARCHAR(64) NULL,
  `shuttle_name` VARCHAR(64) NULL,
  `map_name` VARCHAR(32) NULL,
  `station_name` VARCHAR(80) NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

--
-- Table structure for table `SS13_schema_revision`
--
DROP TABLE IF EXISTS `SS13_schema_revision`;
CREATE TABLE `SS13_schema_revision` (
  `major` TINYINT(3) unsigned NOT NULL,
  `minor` TINYINT(3) unsigned NOT NULL,
  `date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`major`,`minor`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Table structure for table `SS13_stickyban`
--
DROP TABLE IF EXISTS `SS13_stickyban`;
CREATE TABLE `SS13_stickyban` (
	`ckey` VARCHAR(32) NOT NULL,
	`reason` VARCHAR(2048) NOT NULL,
	`banning_admin` VARCHAR(32) NOT NULL,
	`datetime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	PRIMARY KEY (`ckey`)
) ENGINE=InnoDB;

--
-- Table structure for table `SS13_stickyban_matched_ckey`
--
DROP TABLE IF EXISTS `SS13_stickyban_matched_ckey`;
CREATE TABLE `SS13_stickyban_matched_ckey` (
	`stickyban` VARCHAR(32) NOT NULL,
	`matched_ckey` VARCHAR(32) NOT NULL,
	`first_matched` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`last_matched` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	`exempt` TINYINT(1) NOT NULL DEFAULT '0',
	PRIMARY KEY (`stickyban`, `matched_ckey`)
) ENGINE=InnoDB;

--
-- Table structure for table `SS13_stickyban_matched_ip`
--
DROP TABLE IF EXISTS `SS13_stickyban_matched_ip`;
CREATE TABLE `SS13_stickyban_matched_ip` (
	`stickyban` VARCHAR(32) NOT NULL,
	`matched_ip` INT UNSIGNED NOT NULL,
	`first_matched` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`last_matched` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	PRIMARY KEY (`stickyban`, `matched_ip`)
) ENGINE=InnoDB;

--
-- Table structure for table `SS13_stickyban_matched_cid`
--
DROP TABLE IF EXISTS `SS13_stickyban_matched_cid`;
CREATE TABLE `SS13_stickyban_matched_cid` (
	`stickyban` VARCHAR(32) NOT NULL,
	`matched_cid` VARCHAR(32) NOT NULL,
	`first_matched` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`last_matched` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	PRIMARY KEY (`stickyban`, `matched_cid`)
) ENGINE=InnoDB;

--
-- Table structure for table `SS13_achievements`
--
DROP TABLE IF EXISTS `SS13_achievements`;
CREATE TABLE `SS13_achievements` (
	`ckey` VARCHAR(32) NOT NULL,
	`achievement_key` VARCHAR(32) NOT NULL,
	`value` INT NULL,
	`last_updated` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
	PRIMARY KEY (`ckey`,`achievement_key`)
) ENGINE=InnoDB;

DROP TABLE IF EXISTS `SS13_achievement_metadata`;
CREATE TABLE `SS13_achievement_metadata` (
	`achievement_key` VARCHAR(32) NOT NULL,
	`achievement_version` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
	`achievement_type` enum('achievement','score','award') NULL DEFAULT NULL,
	`achievement_name` VARCHAR(64) NULL DEFAULT NULL,
	`achievement_description` VARCHAR(512) NULL DEFAULT NULL,
	PRIMARY KEY (`achievement_key`)
) ENGINE=InnoDB;

--
-- Table structure for table `SS13_ticket`
--
DROP TABLE IF EXISTS `SS13_ticket`;
CREATE TABLE `SS13_ticket` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `server_ip` int(10) unsigned NOT NULL,
  `server_port` smallint(5) unsigned NOT NULL,
  `round_id` int(11) unsigned NULL,
  `ticket` smallint(11) unsigned NOT NULL,
  `action` varchar(20) NOT NULL DEFAULT 'Message',
  `message` text NOT NULL,
  `timestamp` datetime NOT NULL,
  `recipient` varchar(32) DEFAULT NULL,
  `sender` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_ticket_act_recip` (`action`, `recipient`),
  KEY `idx_ticket_act_send` (`action`, `sender`),
  KEY `idx_ticket_tic_rid` (`ticket`, `round_id`),
  KEY `idx_ticket_act_time_rid` (`action`, `timestamp`, `round_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DELIMITER $$
CREATE PROCEDURE `set_poll_deleted`(
	IN `poll_id` INT
)
SQL SECURITY INVOKER
BEGIN
UPDATE `SS13_poll_question` SET deleted = 1 WHERE id = poll_id;
UPDATE `SS13_poll_option` SET deleted = 1 WHERE pollid = poll_id;
UPDATE `SS13_poll_vote` SET deleted = 1 WHERE pollid = poll_id;
UPDATE `SS13_poll_textreply` SET deleted = 1 WHERE pollid = poll_id;
END
$$
CREATE TRIGGER `SS13_role_timeTlogupdate` AFTER UPDATE ON `SS13_role_time` FOR EACH ROW BEGIN INSERT into SS13_role_time_log (ckey, job, delta) VALUES (NEW.CKEY, NEW.job, NEW.minutes-OLD.minutes);
END
$$
CREATE TRIGGER `SS13_role_timeTloginsert` AFTER INSERT ON `SS13_role_time` FOR EACH ROW BEGIN INSERT into SS13_role_time_log (ckey, job, delta) VALUES (NEW.ckey, NEW.job, NEW.minutes);
END
$$
CREATE TRIGGER `SS13_role_timeTlogdelete` AFTER DELETE ON `SS13_role_time` FOR EACH ROW BEGIN INSERT into SS13_role_time_log (ckey, job, delta) VALUES (OLD.ckey, OLD.job, 0-OLD.minutes);
END
$$
DELIMITER ;

--
-- Table structure for table `discord_links`
--
DROP TABLE IF EXISTS `SS13_discord_links`;
CREATE TABLE `SS13_discord_links` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`ckey` VARCHAR(32) NOT NULL,
	`discord_id` BIGINT(20) DEFAULT NULL,
	`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`one_time_token` VARCHAR(100) NOT NULL,
	`valid` BOOLEAN NOT NULL DEFAULT FALSE,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB;

--
-- Table structure for table `text_adventures`
--
DROP TABLE IF EXISTS `SS13_text_adventures`;
CREATE TABLE `SS13_text_adventures` (
	`id` int(11) NOT NULL AUTO_INCREMENT,
	`adventure_data` LONGTEXT NOT NULL,
	`uploader` VARCHAR(32) NOT NULL,
	`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`approved` TINYINT(1) NOT NULL DEFAULT FALSE,
	PRIMARY KEY (`id`)
) ENGINE=InnoDB;

--
-- Table structure for table `admin_connections`
--
DROP TABLE IF EXISTS `SS13_admin_connections`;
CREATE TABLE `SS13_admin_connections` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `ckey` VARCHAR(32) NOT NULL,
  `ip` INT(11) UNSIGNED NOT NULL,
  `cid` VARCHAR(32) NOT NULL,
  `verification_time` DATETIME NULL,
  PRIMARY KEY (`id`),
  UNIQUE INDEX `unique_constraints` (`ckey`, `ip`, `cid`)
) ENGINE=InnoDB;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;


code:
environment = "tgstation.dme"

[langserver]
dreamchecker = true

[code_standards]
disallow_relative_type_definitions = true
disallow_relative_proc_definitions = true

[dmdoc]
use_typepath_names = true

[debugger]
engine = "auxtools"


documentation: /tg/station server 3 configuration file

static_directories: config data


code:
//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE
"a" = (
/turf/template_noop,
/area/template_noop)
"b" = (
/turf/closed/wall/mineral/cult,
/area/ruin/unpowered)
"c" = (
/obj/structure/healingfountain,
/turf/open/floor/engine/cult,
/area/ruin/unpowered)
"d" = (
/obj/structure/fluff/divine/conduit,
/turf/open/floor/engine/cult,
/area/ruin/unpowered)
"e" = (
/obj/structure/sacrificealtar,
/turf/open/floor/engine/cult,
/area/ruin/unpowered)
"f" = (
/turf/open/floor/engine/cult,
/area/ruin/unpowered)
"g" = (
/mob/living/simple_animal/butterfly,
/turf/open/floor/engine/cult,
/area/ruin/unpowered)
"h" = (
/obj/structure/fans/tiny/invisible,
/turf/open/floor/engine/cult,
/area/ruin/unpowered)

(1,1,1) = {"
a
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
"}
(2,1,1) = {"
a
b
d
f
f
d
f
f
d
f
f
d
f
f
d
b
"}
(3,1,1) = {"
b
b
e
g
f
f
g
f
f
f
f
g
f
g
f
b
"}
(4,1,1) = {"
b
c
f
f
f
f
f
f
f
f
f
f
f
f
f
h
"}
(5,1,1) = {"
b
b
e
f
f
f
f
g
f
f
f
f
f
f
f
b
"}
(6,1,1) = {"
a
b
d
g
f
d
f
f
d
f
f
d
f
g
d
b
"}
(7,1,1) = {"
a
b
b
b
b
b
b
b
b
b
b
b
b
b
b
b
"}


code:
//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE
"a" = (
/turf/template_noop,
/area/template_noop)
"b" = (
/turf/closed/wall/mineral/titanium/nodiagonal,
/area/ruin/powered/golem_ship)
"c" = (
/obj/structure/closet/crate,
/obj/item/shovel,
/obj/item/shovel,
/obj/item/shovel,
/obj/item/pickaxe,
/obj/item/pickaxe,
/obj/item/pickaxe,
/obj/item/storage/bag/ore,
/obj/item/storage/bag/ore,
/obj/item/mining_scanner,
/obj/item/flashlight/lantern,
/obj/item/card/id/advanced/mining,
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"d" = (
/obj/structure/closet/crate,
/obj/item/shovel,
/obj/item/shovel,
/obj/item/pickaxe,
/obj/item/pickaxe,
/obj/item/storage/bag/ore,
/obj/item/storage/bag/ore,
/obj/item/mining_scanner,
/obj/item/flashlight/lantern,
/obj/item/card/id/advanced/mining,
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"e" = (
/obj/item/storage/toolbox/mechanical,
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"f" = (
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"g" = (
/obj/structure/reagent_dispensers/watertank,
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"h" = (
/obj/structure/shuttle/engine/heater{
	dir = 4
	},
/obj/structure/window/reinforced{
	dir = 8
	},
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"i" = (
/obj/structure/shuttle/engine/propulsion{
	dir = 4
	},
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"j" = (
/obj/machinery/door/airlock/titanium,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"k" = (
/obj/machinery/computer/arcade/battle,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"l" = (
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"m" = (
/obj/effect/mob_spawn/human/golem/adamantine,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"n" = (
/obj/machinery/mineral/equipment_vendor/golem,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"o" = (
/obj/item/resonator,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"p" = (
/obj/machinery/mineral/ore_redemption,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"q" = (
/obj/structure/statue/gold/rd,
/obj/structure/window/reinforced{
	dir = 4;
	name = "shrine of the liberator"
	},
/obj/machinery/light/directional/west,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"r" = (
/obj/machinery/computer/shuttle,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"t" = (
/obj/structure/extinguisher_cabinet/directional/north,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"u" = (
/obj/structure/table/wood,
/obj/item/bedsheet/rd/royal_cape{
	layer = 3;
	pixel_x = 5;
	pixel_y = 9
	},
/obj/item/book/manual/wiki/research_and_development{
	name = "Sacred Text of the Liberator";
	pixel_x = -4;
	pixel_y = 3
	},
/obj/structure/window/reinforced{
	dir = 4;
	name = "shrine of the liberator"
	},
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"v" = (
/obj/item/resonator/upgraded,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"w" = (
/obj/machinery/autolathe,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"x" = (
/obj/structure/table/wood,
/obj/machinery/reagentgrinder,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"y" = (
/obj/machinery/computer/arcade/orion_trail,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"z" = (
/obj/structure/extinguisher_cabinet/directional/south,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"A" = (
/obj/structure/table/wood,
/obj/item/surgical_drapes{
	pixel_x = 15
	},
/obj/item/storage/firstaid/fire,
/obj/item/storage/firstaid/fire,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"B" = (
/obj/item/storage/firstaid/fire,
/obj/structure/table/wood,
/obj/item/storage/firstaid/fire,
/obj/machinery/light/directional/south,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"C" = (
/obj/item/storage/firstaid/brute,
/obj/structure/table/wood,
/obj/item/storage/firstaid/brute,
/obj/item/areaeditor/blueprints{
	desc = "Use to build new structures in the wastes.";
	name = "land claim"
	},
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"D" = (
/obj/item/storage/firstaid/brute,
/obj/structure/table/wood,
/obj/item/storage/firstaid/brute,
/obj/item/disk/design_disk/golem_shell,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"E" = (
/obj/structure/reagent_dispensers/fueltank,
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"F" = (
/obj/structure/ore_box,
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"G" = (
/turf/closed/wall/mineral/titanium,
/area/ruin/powered/golem_ship)
"H" = (
/obj/machinery/door/airlock/titanium,
/obj/structure/fans/tiny,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"I" = (
/obj/machinery/light/small/directional/south,
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"K" = (
/obj/machinery/door/airlock/titanium,
/obj/structure/fans/tiny,
/obj/effect/mapping_helpers/airlock/cyclelink_helper{
	dir = 8
	},
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"L" = (
/obj/machinery/light/small/directional/north,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"M" = (
/obj/effect/mob_spawn/human/golem/adamantine,
/obj/machinery/light/small/directional/north,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"N" = (
/obj/machinery/light/directional/north,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"O" = (
/obj/machinery/light/directional/west,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"Q" = (
/obj/machinery/light/small/directional/south,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"T" = (
/obj/structure/fans/tiny,
/obj/machinery/door/airlock/titanium,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"U" = (
/obj/effect/mob_spawn/human/golem/adamantine,
/obj/machinery/light/small/directional/south,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"V" = (
/obj/machinery/light/small/directional/north,
/turf/open/floor/plating,
/area/ruin/powered/golem_ship)
"Y" = (
/obj/machinery/door/airlock/titanium,
/obj/effect/mapping_helpers/airlock/cyclelink_helper{
	dir = 4
	},
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)

(1,1,1) = {"
a
a
a
a
a
a
b
b
b
b
a
a
a
a
a
a
"}
(2,1,1) = {"
a
a
a
a
a
a
b
q
u
G
a
a
a
a
a
a
"}
(3,1,1) = {"
a
a
a
b
b
H
b
r
l
G
T
b
b
a
a
a
"}
(4,1,1) = {"
a
a
a
b
k
l
j
l
l
j
l
y
b
a
a
a
"}
(5,1,1) = {"
a
a
a
b
L
l
j
l
l
j
l
l
b
a
a
a
"}
(6,1,1) = {"
b
b
b
b
l
l
b
l
Q
G
l
Q
b
b
b
b
"}
(7,1,1) = {"
b
c
f
j
l
l
b
l
l
G
l
l
j
f
F
b
"}
(8,1,1) = {"
b
c
f
j
l
l
b
L
l
G
l
l
j
f
F
b
"}
(9,1,1) = {"
b
c
I
b
M
o
b
l
l
G
o
U
b
V
F
b
"}
(10,1,1) = {"
b
c
f
b
m
o
b
l
l
G
o
m
b
f
F
b
"}
(11,1,1) = {"
b
c
f
b
b
j
b
j
j
G
j
b
b
f
F
b
"}
(12,1,1) = {"
b
c
I
b
l
l
O
l
l
O
l
z
b
V
F
b
"}
(13,1,1) = {"
b
d
f
j
l
l
l
l
l
l
l
l
j
f
F
b
"}
(14,1,1) = {"
b
d
f
j
l
l
l
l
l
l
l
l
j
f
e
b
"}
(15,1,1) = {"
b
d
f
b
l
l
l
l
l
l
l
A
b
f
f
b
"}
(16,1,1) = {"
T
e
I
b
N
l
l
l
l
v
l
B
b
V
f
T
"}
(17,1,1) = {"
T
f
f
b
l
l
p
l
l
w
l
C
b
f
f
T
"}
(18,1,1) = {"
b
g
g
b
n
l
b
Y
Y
b
x
D
b
E
E
b
"}
(19,1,1) = {"
b
h
h
b
h
h
b
t
Q
b
h
h
b
h
h
b
"}
(20,1,1) = {"
b
i
i
b
i
i
b
K
K
b
i
i
b
i
i
b
"}


code:
//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE
"c" = (
/turf/closed/wall/mineral/bronze,
/area/icemoon/surface)
"e" = (
/obj/structure/fluff/clockwork/alloy_shards/medium,
/turf/open/floor/bronze,
/area/icemoon/surface)
"h" = (
/obj/effect/mob_spawn/human/skeleton,
/obj/item/clothing/suit/bronze,
/obj/item/clothing/shoes/bronze,
/obj/item/clothing/head/bronze,
/turf/open/floor/bronze{
	initial_gas_mix = "TEMP=2.7"
	},
/area/icemoon/surface)
"m" = (
/obj/item/nullrod/spear{
	name = "empowered bronze spear"
	},
/turf/open/floor/bronze{
	initial_gas_mix = "TEMP=2.7"
	},
/area/icemoon/surface)
"o" = (
/turf/open/floor/bronze{
	initial_gas_mix = "TEMP=2.7"
	},
/area/icemoon/surface)
"A" = (
/obj/structure/fluff/clockwork/clockgolem_remains,
/turf/open/floor/bronze,
/area/icemoon/surface)
"B" = (
/turf/open/genturf,
/area/mine/unexplored)
"C" = (
/obj/structure/fluff/clockwork/blind_eye,
/turf/open/floor/bronze,
/area/icemoon/surface)
"D" = (
/obj/structure/fluff/clockwork/alloy_shards/large,
/turf/open/floor/bronze,
/area/icemoon/surface)
"G" = (
/obj/structure/fluff/clockwork/alloy_shards/medium_gearbit,
/turf/open/floor/bronze,
/area/icemoon/surface)
"I" = (
/obj/structure/table/bronze,
/obj/item/toy/clockwork_watch{
	desc = "You can still feel the embers of a once great empire in your hand...";
	name = "drained clockwork slab"
	},
/turf/open/floor/bronze,
/area/icemoon/surface)
"J" = (
/obj/effect/mob_spawn/human/skeleton,
/turf/open/floor/bronze,
/area/icemoon/surface)
"K" = (
/obj/structure/table/bronze,
/turf/open/floor/bronze,
/area/icemoon/surface)
"L" = (
/mob/living/simple_animal/hostile/megafauna/clockwork_defender,
/turf/open/floor/bronze{
	initial_gas_mix = "TEMP=2.7"
	},
/area/icemoon/surface)
"M" = (
/obj/structure/fluff/clockwork/fallen_armor,
/turf/open/floor/bronze,
/area/icemoon/surface)
"N" = (
/turf/closed/mineral/random/snow,
/area/icemoon/surface)
"O" = (
/obj/structure/fluff/clockwork/alloy_shards,
/turf/open/floor/bronze,
/area/icemoon/surface)
"W" = (
/turf/open/floor/bronze,
/area/icemoon/surface)
"X" = (
/obj/machinery/door/airlock/bronze{
	use_power = 0
	},
/turf/open/floor/bronze,
/area/icemoon/surface)
"Y" = (
/obj/item/paper{
	info = "We tried to use the power of this moon to bring him back, but we've failed... I've contained what remains of his power here... if you find this, make sure those Nar-Sian Dogs don't last a second."
	},
/obj/item/pen,
/turf/open/floor/bronze{
	initial_gas_mix = "TEMP=2.7"
	},
/area/icemoon/surface)

(1,1,1) = {"
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
"}
(2,1,1) = {"
N
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
X
X
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
N
"}
(3,1,1) = {"
N
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
K
G
W
A
W
K
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
N
"}
(4,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
C
W
J
W
W
C
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(5,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
c
X
X
c
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(6,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(7,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(8,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(9,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(10,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(11,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(12,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(13,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(14,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(15,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(16,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(17,1,1) = {"
N
c
c
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
c
c
N
"}
(18,1,1) = {"
N
c
K
C
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
C
I
c
N
"}
(19,1,1) = {"
N
c
W
W
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
o
o
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
W
D
c
N
"}
(20,1,1) = {"
N
X
O
J
X
B
B
B
B
B
B
B
B
B
B
B
B
B
o
h
L
o
B
B
B
B
B
B
B
B
B
B
B
B
B
X
J
W
X
N
"}
(21,1,1) = {"
N
X
W
A
X
B
B
B
B
B
B
B
B
B
B
B
B
B
o
m
Y
o
B
B
B
B
B
B
B
B
B
B
B
B
B
X
G
M
X
N
"}
(22,1,1) = {"
N
c
W
W
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
o
o
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
W
W
c
N
"}
(23,1,1) = {"
N
c
K
C
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
C
K
c
N
"}
(24,1,1) = {"
N
c
c
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
c
c
N
"}
(25,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(26,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(27,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(28,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(29,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(30,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(31,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(32,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(33,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(34,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(35,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(36,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
c
X
X
c
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(37,1,1) = {"
N
c
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
C
W
J
e
W
C
c
B
B
B
B
B
B
B
B
B
B
B
B
B
c
c
N
"}
(38,1,1) = {"
N
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
K
W
A
W
W
K
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
N
"}
(39,1,1) = {"
N
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
X
X
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
N
"}
(40,1,1) = {"
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
N
"}


code:
//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE
"as" = (
/obj/machinery/door/airlock/public,
/turf/closed/mineral/random/snow,
/area/icemoon/surface)
"ax" = (
/obj/effect/turf_decal/stripes/white/line{
	color = "#236F26";
	dir = 4
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"aR" = (
/obj/item/reagent_containers/syringe/syriniver,
/obj/effect/turf_decal/siding/wideplating/dark/corner,
/obj/effect/turf_decal/tile/dark/anticorner,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"bu" = (
/obj/effect/spawner/random/food_or_drink/snack,
/mob/living/basic/cockroach,
/turf/open/floor/grass/snow/basalt/safe,
/area/ruin/bughabitat)
"bQ" = (
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 8
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"cK" = (
/mob/living/simple_animal/ant,
/turf/open/floor/grass,
/area/ruin/bughabitat)
"eM" = (
/obj/structure/chair/pew/right{
	dir = 8
	},
/obj/item/bedsheet{
	pixel_y = 13
	},
/obj/machinery/light_switch/directional/east,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"eN" = (
/obj/structure/window/reinforced/spawner/north,
/obj/machinery/biogenerator,
/obj/structure/window/reinforced/spawner/east,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 5
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"fI" = (
/obj/effect/decal/remains/human,
/obj/item/clipboard,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"fO" = (
/turf/open/floor/grass/snow,
/area/ruin/bughabitat)
"fP" = (
/obj/effect/turf_decal/siding/wideplating/dark/corner{
	dir = 1
	},
/obj/effect/turf_decal/tile/dark/anticorner{
	dir = 1
	},
/turf/open/floor/iron,
/area/ruin/bughabitat)
"hk" = (
/obj/structure/window/reinforced/spawner/east,
/turf/open/floor/grass/snow,
/area/ruin/bughabitat)
"hy" = (
/obj/effect/decal/remains/human,
/obj/item/clothing/suit/toggle/labcoat,
/obj/machinery/power/apc/auto_name/west,
/obj/structure/cable,
/obj/structure/window/reinforced/spawner/north,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"hM" = (
/obj/effect/turf_decal/siding/wideplating/dark/corner{
	dir = 4
	},
/obj/effect/turf_decal/tile/dark/anticorner{
	dir = 4
	},
/turf/open/floor/iron,
/area/ruin/bughabitat)
"ih" = (
/obj/structure/window/reinforced/tinted/fulltile,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"kv" = (
/obj/structure/window/reinforced/spawner/east,
/obj/item/shovel,
/turf/open/floor/grass/snow,
/area/ruin/bughabitat)
"lj" = (
/obj/structure/cable,
/obj/structure/window/reinforced/spawner/east,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 6
	},
/obj/machinery/portable_atmospherics/scrubber,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"lE" = (
/obj/structure/extinguisher_cabinet/directional/east,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"lG" = (
/obj/machinery/space_heater,
/turf/open/floor/carpet/neon/simple/lime,
/area/ruin/bughabitat)
"ma" = (
/obj/structure/statue/snow/snowman,
/turf/open/floor/grass/snow,
/area/icemoon/surface)
"mM" = (
/obj/machinery/light/warm/directional/west,
/obj/structure/tank_holder/oxygen,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"of" = (
/obj/structure/sink{
	dir = 4
	},
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 8
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"ot" = (
/mob/living/basic/cockroach,
/obj/item/seeds/soya,
/turf/open/floor/grass/snow/basalt/safe,
/area/ruin/bughabitat)
"oZ" = (
/obj/effect/decal/cleanable/blood/drip,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"qV" = (
/obj/structure/window/reinforced/spawner/east,
/obj/item/wallframe/camera,
/obj/item/stack/cable_coil/cut,
/turf/open/floor/grass,
/area/ruin/bughabitat)
"ri" = (
/obj/structure/window/reinforced/spawner/east,
/obj/effect/spawner/random/food_or_drink/snack,
/turf/open/floor/grass,
/area/ruin/bughabitat)
"rE" = (
/obj/effect/spawner/random/structure/chair_flipped,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"sl" = (
/obj/machinery/light/warm/directional/east,
/obj/effect/decal/cleanable/blood/footprints,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"sr" = (
/obj/machinery/plumbing/growing_vat,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"st" = (
/obj/machinery/light_switch/directional/south,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"tI" = (
/obj/effect/spawner/random/vending/snackvend,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"uB" = (
/mob/living/simple_animal/butterfly,
/obj/structure/chair/pew/left{
	dir = 8
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"va" = (
/obj/item/book/manual/wiki/cytology,
/obj/structure/table,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"wC" = (
/obj/structure/table,
/obj/machinery/microwave,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26"
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"wL" = (
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 10
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"xq" = (
/mob/living/simple_animal/butterfly,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26"
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"yz" = (
/obj/machinery/door/airlock/grunge,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"yC" = (
/obj/machinery/door/window/eastleft,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 4
	},
/turf/open/floor/iron,
/area/ruin/bughabitat)
"zJ" = (
/obj/structure/window/reinforced/spawner/north,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 1
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"AL" = (
/turf/open/floor/iron,
/area/ruin/bughabitat)
"Bs" = (
/turf/closed/wall/ice,
/area/ruin/bughabitat)
"BK" = (
/obj/structure/table/rolling,
/obj/item/petri_dish/random,
/obj/structure/window/reinforced/spawner,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Cb" = (
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Cv" = (
/obj/machinery/light/warm/directional/east,
/obj/structure/closet,
/obj/item/food/cheese,
/obj/item/stack/rods/ten,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Du" = (
/obj/machinery/door/airlock/public,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Ea" = (
/obj/machinery/door/window/northright,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 1
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Fq" = (
/obj/machinery/power/port_gen/pacman,
/obj/structure/cable,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26"
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Ft" = (
/turf/open/floor/grass,
/area/ruin/bughabitat)
"Gg" = (
/obj/item/trash/shrimp_chips,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"HA" = (
/turf/closed/wall,
/area/ruin/bughabitat)
"HU" = (
/obj/machinery/light/warm/directional/east,
/obj/item/clothing/suit/hooded/wintercoat/hydro,
/turf/open/floor/carpet/neon/simple/lime,
/area/ruin/bughabitat)
"IX" = (
/obj/machinery/hydroponics/constructable,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Jr" = (
/obj/machinery/door/airlock/public{
	dir = 4
	},
/obj/structure/barricade/wooden/crude,
/turf/closed/mineral/random/snow,
/area/ruin/bughabitat)
"Kc" = (
/obj/structure/table,
/obj/machinery/light_switch/directional/south,
/obj/machinery/cell_charger,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26"
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Kq" = (
/obj/effect/decal/remains/human,
/turf/open/floor/carpet/neon/simple/lime,
/area/ruin/bughabitat)
"Ku" = (
/obj/structure/table,
/obj/item/construction/plumbing/research,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Ly" = (
/obj/structure/table,
/obj/item/stack/ducts/fifty{
	amount = 23
	},
/mob/living/simple_animal/butterfly,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Nv" = (
/obj/item/reagent_containers/syringe,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"Ou" = (
/obj/structure/toilet{
	dir = 8
	},
/obj/machinery/light/small/blacklight,
/obj/item/plunger,
/mob/living/simple_animal/mouse,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Pt" = (
/obj/machinery/light/warm/directional/west,
/obj/machinery/door/window/northright,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 9
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Qd" = (
/turf/open/floor/grass/snow,
/area/icemoon/surface)
"Qp" = (
/obj/effect/turf_decal/siding/wideplating/dark/corner{
	dir = 8
	},
/obj/effect/turf_decal/tile/dark/anticorner{
	dir = 4
	},
/turf/open/floor/iron,
/area/ruin/bughabitat)
"QV" = (
/obj/structure/table,
/obj/structure/windoor_assembly{
	dir = 4
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"RJ" = (
/obj/structure/window/reinforced/spawner/east,
/mob/living/basic/cockroach,
/turf/open/floor/grass/snow/basalt/safe,
/area/ruin/bughabitat)
"RR" = (
/turf/open/floor/carpet/neon/simple/lime,
/area/ruin/bughabitat)
"Tn" = (
/obj/item/coin/silver,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"Tp" = (
/obj/structure/window/reinforced/spawner/east,
/obj/effect/turf_decal/siding/wideplating/light{
	color = "#236F26";
	dir = 4
	},
/turf/open/floor/iron,
/area/ruin/bughabitat)
"Tr" = (
/obj/item/pen/fountain,
/turf/open/floor/iron,
/area/ruin/bughabitat)
"VM" = (
/obj/machinery/space_heater,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"VQ" = (
/obj/item/coin/silver,
/obj/item/reagent_containers/syringe,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Xn" = (
/turf/closed/mineral/random/snow,
/area/icemoon/surface)
"Xt" = (
/obj/structure/window/reinforced/spawner/east,
/turf/open/floor/grass/snow/basalt/safe,
/area/ruin/bughabitat)
"ZT" = (
/obj/effect/spawner/structure/window/hollow/directional{
	dir = 4
	},
/turf/open/floor/plastic,
/area/ruin/bughabitat)

(1,1,1) = {"
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
"}
(2,1,1) = {"
Xn
Qd
Xn
Xn
Xn
Xn
Xn
Qd
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
"}
(3,1,1) = {"
Xn
Qd
Bs
HA
HA
HA
Bs
ih
Bs
HA
Bs
HA
HA
HA
Qd
Xn
"}
(4,1,1) = {"
Xn
Xn
HA
bu
ot
Pt
of
bQ
wL
Du
Cb
rE
Gg
HA
Qd
Xn
"}
(5,1,1) = {"
Xn
Qd
HA
RJ
Xt
zJ
AL
AL
Kc
HA
ZT
QV
ZT
Bs
Xn
Xn
"}
(6,1,1) = {"
Xn
Qd
Bs
cK
Ft
Ea
aR
hM
wC
HA
RR
RR
lG
Bs
Xn
Xn
"}
(7,1,1) = {"
Xn
Xn
HA
qV
ri
zJ
Qp
fP
xq
Du
HU
Kq
Xn
as
Xn
Xn
"}
(8,1,1) = {"
Xn
Xn
HA
fO
fO
Ea
oZ
Tn
Fq
HA
HA
HA
Bs
Bs
Qd
Xn
"}
(9,1,1) = {"
Xn
Qd
HA
hk
kv
eN
Tp
yC
lj
hy
mM
IX
VM
Bs
ma
Xn
"}
(10,1,1) = {"
Xn
Qd
Bs
va
Ly
Ku
sr
AL
Nv
oZ
AL
lE
st
HA
Qd
Xn
"}
(11,1,1) = {"
Xn
Qd
HA
Cb
Tr
sl
fI
AL
AL
AL
VQ
HA
yz
HA
Qd
Xn
"}
(12,1,1) = {"
Xn
Qd
HA
Bs
HA
HA
Cb
AL
AL
AL
tI
HA
Ou
Bs
Xn
Xn
"}
(13,1,1) = {"
Xn
Qd
Qd
Qd
Qd
Bs
BK
uB
eM
ax
Cv
HA
HA
HA
Qd
Xn
"}
(14,1,1) = {"
Xn
Xn
Qd
Qd
Qd
HA
HA
Bs
Bs
Jr
Bs
Bs
Qd
Qd
Qd
Xn
"}
(15,1,1) = {"
Xn
Xn
Qd
Qd
Qd
Qd
Xn
Xn
Xn
Xn
Xn
Qd
Qd
Qd
Qd
Xn
"}
(16,1,1) = {"
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
Xn
"}