diff --git a/.travis.yml b/.travis.yml index 2c2b9dec61d..58cfbe98583 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,6 @@ jobs: - tools/travis/install_build_deps.sh - tools/travis/install_dreamchecker.sh script: - - shopt -s globstar - find . -name "*.php" -print0 | xargs -0 -n1 php -l - find . -name "*.json" -not -path "./nano/node_modules/*" -print0 | xargs -0 python3 ./tools/travis/json_verifier.py - tools/travis/build_nanoui.sh @@ -38,4 +37,35 @@ jobs: - tools/travis/install_byond.sh - source $HOME/BYOND/byond/bin/byondsetup script: + - tools/travis/generate_maplist.sh - tools/travis/dm.sh -Mtravis_map_testing paradise.dme + + - name: "Unit Tests + SQL Validation" + addons: + mariadb: '10.2' + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - python3 + - libstdc++6:i386 + - libssl-dev:i386 + - gcc-multilib + - g++-7 + - g++-7-multilib + - pkg-config:i386 + - zlib1g-dev:i386 + cache: + directories: + - $HOME/.cargo + - $HOME/.rustup + - $HOME/BYOND + install: + - tools/travis/install_byond.sh + - source $HOME/BYOND/byond/bin/byondsetup + - python3 tools/travis/generate_sql_scripts.py + before_script: + - tools/travis/validate_sql.sh + script: + - tools/travis/dm.sh -DTRAVISBUILDING paradise.dme || travis_terminate 1 + - tools/travis/run_server.sh diff --git a/SQL/updates/10-11.sql b/SQL/updates/10-11.sql index b2718db85e6..843eb9d9982 100644 --- a/SQL/updates/10-11.sql +++ b/SQL/updates/10-11.sql @@ -18,7 +18,7 @@ ALTER TABLE feedback.connection_log CONVERT TO CHARACTER SET utf8mb4 COLLATE utf ALTER TABLE feedback.customuseritems CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.death CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.donators CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -ALTER TABLE feedback.erro_privacy CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; +ALTER TABLE feedback.privacy CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.feedback CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.ipintel CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.karma CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; @@ -34,7 +34,6 @@ ALTER TABLE feedback.poll_option CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb ALTER TABLE feedback.poll_question CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.poll_textreply CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.poll_vote CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -ALTER TABLE feedback.population CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.privacy CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.vpn_whitelist CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE feedback.watch CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; diff --git a/_build_dependencies.sh b/_build_dependencies.sh index e78949dc81e..a6ce9f31cb5 100644 --- a/_build_dependencies.sh +++ b/_build_dependencies.sh @@ -8,4 +8,4 @@ export PHP_VERSION=5.6 # Byond Major export BYOND_MAJOR=513 # Byond Minor -export BYOND_MINOR=1514 +export BYOND_MINOR=1526 diff --git a/_maps/travis_map_testing.dm b/_maps/travis_map_testing.dm deleted file mode 100644 index 2087f9c9f6e..00000000000 --- a/_maps/travis_map_testing.dm +++ /dev/null @@ -1,155 +0,0 @@ -// This is for Travis testing. DO NOT SET THIS AS THE GAME'S MAP NORMALLY! - -#if !defined(USING_MAP_DATUM) - // Cyberiad - #include "map_files/Cyberiad/cyberiad.dmm" - #include "map_files/Cyberiad/z2.dmm" - #include "map_files/Cyberiad/z6.dmm" - - // Debug Maps - #include "map_files/Debug/singletile.dmm" - #include "map_files/Debug/smoothing.dmm" - - // Delta - #include "map_files/Delta/delta.dmm" - - // Generic Z Levels - #include "map_files/Generic/Lavaland.dmm" - #include "map_files/Generic/tcommsat-blown.dmm" - #include "map_files/generic/z4.dmm" - #include "map_files/Generic/z6.dmm" - #include "map_files/Generic/z7.dmm" - - // MetaStation - #include "map_files/MetaStation/MetaStation.v41A.II.dmm" - #include "map_files/MetaStation/z2.dmm" - - // Lavaland Ruins - #include "map_files/RandomRuins/LavaRuins/lavaland_biodome_beach.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_biodome_clown_planet.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_biodome_winter.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_animal_hospital.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_ash_walker1.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_blooddrunk1.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_blooddrunk2.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_blooddrunk3.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_cube.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_cultaltar.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_dead_ratvar.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_envy.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_fountain_hall.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_gluttony.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_golem_ship.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_greed.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_hermit.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_hierophant.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_pizzaparty.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_pride.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_puzzle.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_random_ripley.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_seed_vault.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_sloth.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_survivalpod.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_swarmer_crash.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_ufo_crash.dmm" - #include "map_files/RandomRuins/LavaRuins/lavaland_surface_xeno_nest.dmm" - - // Space Ruins - #include "map_files/RandomRuins/SpaceRuins/abandonedzoo.dmm" - #include "map_files/RandomRuins/SpaceRuins/asteroid1.dmm" - #include "map_files/RandomRuins/SpaceRuins/asteroid2.dmm" - #include "map_files/RandomRuins/SpaceRuins/asteroid3.dmm" - #include "map_files/RandomRuins/SpaceRuins/asteroid4.dmm" - #include "map_files/RandomRuins/SpaceRuins/asteroid5.dmm" - #include "map_files/RandomRuins/SpaceRuins/deepstorage.dmm" - #include "map_files/RandomRuins/SpaceRuins/derelict1.dmm" - #include "map_files/RandomRuins/SpaceRuins/derelict2.dmm" - #include "map_files/RandomRuins/SpaceRuins/derelict3.dmm" - #include "map_files/RandomRuins/SpaceRuins/derelict4.dmm" - #include "map_files/RandomRuins/SpaceRuins/derelict5.dmm" - #include "map_files/RandomRuins/SpaceRuins/emptyshell.dmm" - #include "map_files/RandomRuins/SpaceRuins/gasthelizards.dmm" - #include "map_files/RandomRuins/SpaceRuins/intactemptyship.dmm" - #include "map_files/RandomRuins/SpaceRuins/listeningpost.dmm" - #include "map_files/RandomRuins/SpaceRuins/mechtransport.dmm" - #include "map_files/RandomRuins/SpaceRuins/oldstation.dmm" - #include "map_files/RandomRuins/SpaceRuins/onehalf.dmm" - #include "map_files/RandomRuins/SpaceRuins/spacebar.dmm" - #include "map_files/RandomRuins/SpaceRuins/turretedoutpost.dmm" - #include "map_files/RandomRuins/SpaceRuins/way_home.dmm" - #include "map_files/RandomRuins/SpaceRuins/wizardcrash.dmm" - - // Gateway Missions - #include "map_files/RandomZLevels/academy.dmm" - #include "map_files/RandomZLevels/beach.dmm" - #include "map_files/RandomZLevels/blackmarketpackers.dmm" - #include "map_files/RandomZLevels/centcomAway.dmm" - #include "map_files/RandomZLevels/evil_santa.dmm" - #include "map_files/RandomZLevels/example.dmm" - #include "map_files/RandomZLevels/moonoutpost19.dmm" - #include "map_files/RandomZLevels/spacebattle.dmm" - #include "map_files/RandomZLevels/spacehotel.dmm" - #include "map_files/RandomZLevels/stationCollision.dmm" - #include "map_files/RandomZLevels/terrorspiders.dmm" - #include "map_files/RandomZLevels/undergroundoutpost45.dmm" - #include "map_files/RandomZLevels/wildwest.dmm" - - // Shuttles - #include "map_files/shuttles/admin_admin.dmm" - #include "map_files/shuttles/admin_hospital.dmm" - #include "map_files/shuttles/cargo_base.dmm" - #include "map_files/shuttles/emergency_bar.dmm" - #include "map_files/shuttles/emergency_clown.dmm" - #include "map_files/shuttles/emergency_cramped.dmm" - #include "map_files/shuttles/emergency_cyb.dmm" - #include "map_files/shuttles/emergency_dept.dmm" - #include "map_files/shuttles/emergency_meta.dmm" - #include "map_files/shuttles/emergency_mil.dmm" - #include "map_files/shuttles/emergency_narnar.dmm" - #include "map_files/shuttles/emergency_old.dmm" - #include "map_files/shuttles/ferry_base.dmm" - #include "map_files/shuttles/ferry_meat.dmm" - - // Templates - #include "map_files/templates/light_floor_1.dmm" - #include "map_files/templates/light_floor_2.dmm" - #include "map_files/templates/light_floor_3.dmm" - #include "map_files/templates/medium_shuttle1.dmm" - #include "map_files/templates/medium_shuttle2.dmm" - #include "map_files/templates/medium_shuttle3.dmm" - #include "map_files/templates/shelter_1.dmm" - #include "map_files/templates/shelter_2.dmm" - #include "map_files/templates/small_asteroid_1.dmm" - #include "map_files/templates/small_shuttle_1.dmm" - - // Spacehotel Rooms - #include "map_files/templates/spacehotel/n_01.dmm" - #include "map_files/templates/spacehotel/n_02.dmm" - #include "map_files/templates/spacehotel/n_03.dmm" - #include "map_files/templates/spacehotel/n_04.dmm" - #include "map_files/templates/spacehotel/n_05.dmm" - #include "map_files/templates/spacehotel/n_06.dmm" - #include "map_files/templates/spacehotel/n_07.dmm" - #include "map_files/templates/spacehotel/n_08.dmm" - #include "map_files/templates/spacehotel/n_09.dmm" - #include "map_files/templates/spacehotel/n_10.dmm" - #include "map_files/templates/spacehotel/n_11.dmm" - #include "map_files/templates/spacehotel/n_12.dmm" - #include "map_files/templates/spacehotel/n_13.dmm" - #include "map_files/templates/spacehotel/n_14.dmm" - #include "map_files/templates/spacehotel/n_15.dmm" - #include "map_files/templates/spacehotel/n_16.dmm" - #include "map_files/templates/spacehotel/n_17.dmm" - #include "map_files/templates/spacehotel/n_18.dmm" - #include "map_files/templates/spacehotel/n_19.dmm" - #include "map_files/templates/spacehotel/s_01.dmm" - #include "map_files/templates/spacehotel/s_02.dmm" - #include "map_files/templates/spacehotel/s_03.dmm" - #include "map_files/templates/spacehotel/s_04.dmm" - #include "map_files/templates/spacehotel/s_05.dmm" - #include "map_files/templates/spacehotel/s_06.dmm" - -#elif !defined(MAP_OVERRIDE) - #warn a map has already been included. -#endif diff --git a/code/_compile_options.dm b/code/_compile_options.dm index c966514d64e..342e572177a 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -1,6 +1,14 @@ #define DEBUG //#define TESTING +// Uncomment the following line to compile unit tests. +// #define UNIT_TESTS + + +#ifdef TRAVISBUILDING +#define UNIT_TESTS +#endif + #ifdef TESTING //#define GC_FAILURE_HARD_LOOKUP //makes paths that fail to GC call find_references before del'ing. //implies FIND_REF_NO_CHECK_TICK diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 32d6370f3d0..74591eb8070 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -101,3 +101,4 @@ GLOBAL_PROTECT(dbcon) GLOBAL_LIST_EMPTY(ability_verbs) // Create-level abilities GLOBAL_LIST_INIT(pipe_colors, list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_RED, "blue" = PIPE_COLOR_BLUE, "cyan" = PIPE_COLOR_CYAN, "green" = PIPE_COLOR_GREEN, "yellow" = PIPE_COLOR_YELLOW, "purple" = PIPE_COLOR_PURPLE)) + diff --git a/code/_globalvars/sensitive.dm b/code/_globalvars/sensitive.dm index b1e6751c4dd..4c04b2d480b 100644 --- a/code/_globalvars/sensitive.dm +++ b/code/_globalvars/sensitive.dm @@ -9,4 +9,4 @@ GLOBAL_REAL_VAR(sqlfdbkdb) = "test" GLOBAL_REAL_VAR(sqlfdbklogin) = "root" GLOBAL_REAL_VAR(sqlfdbkpass) = "" GLOBAL_REAL_VAR(sqlfdbktableprefix) = "erro_" - +GLOBAL_REAL_VAR(sql_version) = 0 diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index ba43e1a0b60..d348747fb80 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -809,7 +809,6 @@ /datum/configuration/proc/loadsql(filename) // -- TLE var/list/Lines = file2list(filename) - var/db_version = 0 for(var/t in Lines) if(!t) continue @@ -848,10 +847,13 @@ if("feedback_tableprefix") sqlfdbktableprefix = value if("db_version") - db_version = text2num(value) + sql_version = text2num(value) else log_config("Unknown setting in configuration: '[name]'") - if(config.sql_enabled && db_version != SQL_VERSION) + + // The unit tests have their own version of this check, which wont hold the server up infinitely, so this is disabled if we are running unit tests + #ifndef UNIT_TESTS + if(config.sql_enabled && sql_version != SQL_VERSION) config.sql_enabled = 0 log_config("WARNING: DB_CONFIG DEFINITION MISMATCH!") spawn(60) @@ -859,6 +861,7 @@ SSticker.ticker_going = FALSE spawn(600) to_chat(world, "DB_CONFIG MISMATCH, ROUND START DELAYED.
Please check database version for recent upstream changes!
") + #endif /datum/configuration/proc/loadoverflowwhitelist(filename) var/list/Lines = file2list(filename) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 228f1a7c528..475bdaccb3c 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -279,7 +279,9 @@ SUBSYSTEM_DEF(ticker) for(var/mob/new_player/N in GLOB.mob_list) if(N.client) N.new_player_panel_proc() - + #ifdef UNIT_TESTS + RunUnitTests() + #endif return 1 /datum/controller/subsystem/ticker/proc/station_explosion_cinematic(station_missed = 0, override = null) diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index f8abaa7a17e..ec717b3db32 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -6,7 +6,8 @@ var/lootdoubles = 1 //if the same item can be spawned twice var/list/loot //a list of possible items to spawn e.g. list(/obj/item, /obj/structure, /obj/effect) -/obj/effect/spawner/lootdrop/New() +/obj/effect/spawner/lootdrop/Initialize(mapload) + ..() if(loot && loot.len) for(var/i = lootcount, i > 0, i--) if(!loot.len) break @@ -15,8 +16,8 @@ loot.Remove(lootspawn) if(lootspawn) - new lootspawn(get_turf(src)) - qdel(src) + new lootspawn(loc) + return INITIALIZE_HINT_QDEL /obj/effect/spawner/lootdrop/armory_contraband name = "armory contraband gun spawner" diff --git a/code/game/world.dm b/code/game/world.dm index 899cdcf3ad7..4b1ccc641cf 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -9,6 +9,9 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) enable_debugger() // Enable the extools debugger log_world("World loaded at [time_stamp()]") log_world("[GLOB.vars.len - GLOB.gvars_datum_in_built_vars.len] global variables") + #ifdef UNIT_TESTS + log_world("Unit Tests Are Enabled!") + #endif if(byond_version < MIN_COMPILER_VERSION || byond_build < MIN_COMPILER_BUILD) log_world("Your server's byond version does not meet the recommended requirements for this code. Please update BYOND") @@ -32,6 +35,11 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) populate_robolimb_list() Master.Initialize(10, FALSE) + + #ifdef UNIT_TESTS + HandleTestRun() + #endif + return //world/Topic(href, href_list[]) @@ -309,6 +317,11 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday) GLOB.dbcon.Disconnect() // DCs cleanly from the database shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss. + #ifdef UNIT_TESTS + FinishTestRun() + return + #endif + for(var/client/C in GLOB.clients) if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite C << link("byond://[config.server]") diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm new file mode 100644 index 00000000000..5b1409af4e7 --- /dev/null +++ b/code/modules/unit_tests/_unit_tests.dm @@ -0,0 +1,12 @@ +//include unit test files in this module in this ifdef +//Keep this sorted alphabetically + +#ifdef UNIT_TESTS +#include "component_tests.dm" +#include "reagent_id_typos.dm" +#include "spawn_humans.dm" +#include "sql.dm" +#include "subsystem_init.dm" +#include "timer_sanity.dm" +#include "unit_test.dm" +#endif diff --git a/code/modules/unit_tests/component_tests.dm b/code/modules/unit_tests/component_tests.dm new file mode 100644 index 00000000000..0099d7508c5 --- /dev/null +++ b/code/modules/unit_tests/component_tests.dm @@ -0,0 +1,12 @@ +/datum/unit_test/component_duping/Run() + var/list/bad_dms = list() + var/list/bad_dts = list() + for(var/t in typesof(/datum/component)) + var/datum/component/comp = t + if(!isnum(initial(comp.dupe_mode))) + bad_dms += t + var/dupe_type = initial(comp.dupe_type) + if(dupe_type && !ispath(dupe_type)) + bad_dts += t + if(length(bad_dms) || length(bad_dts)) + Fail("Components with invalid dupe modes: ([bad_dms.Join(",")]) ||| Components with invalid dupe types: ([bad_dts.Join(",")])") diff --git a/code/modules/unit_tests/reagent_id_typos.dm b/code/modules/unit_tests/reagent_id_typos.dm new file mode 100644 index 00000000000..7f45774db0b --- /dev/null +++ b/code/modules/unit_tests/reagent_id_typos.dm @@ -0,0 +1,11 @@ + + +/datum/unit_test/reagent_id_typos + +/datum/unit_test/reagent_id_typos/Run() + for(var/I in GLOB.chemical_reactions_list) + for(var/V in GLOB.chemical_reactions_list[I]) + var/datum/chemical_reaction/R = V + for(var/id in (R.required_reagents + R.required_catalysts)) + if(!GLOB.chemical_reagents_list[id]) + Fail("Unknown chemical id \"[id]\" in recipe [R.type]") diff --git a/code/modules/unit_tests/spawn_humans.dm b/code/modules/unit_tests/spawn_humans.dm new file mode 100644 index 00000000000..ae1f4961b02 --- /dev/null +++ b/code/modules/unit_tests/spawn_humans.dm @@ -0,0 +1,8 @@ +/datum/unit_test/spawn_humans/Run() + var/locs = block(run_loc_bottom_left, run_loc_top_right) + + for(var/I in 1 to 5) + new /mob/living/carbon/human(pick(locs)) + + // There is a 5 second delay here so that all the items on the humans have time to initialize and spawn + sleep(50) diff --git a/code/modules/unit_tests/sql.dm b/code/modules/unit_tests/sql.dm new file mode 100644 index 00000000000..d14bdf11001 --- /dev/null +++ b/code/modules/unit_tests/sql.dm @@ -0,0 +1,42 @@ +// Unit test to check SQL version has been updated properly., +/datum/unit_test/sql_version/Run() + // Check if the SQL version set in the code is equal to the travis DB config + if(config.sql_enabled && sql_version != SQL_VERSION) + Fail("SQL version error: Game is running V[SQL_VERSION] but config is V[sql_version]. You may need to update tools/travis/dbconfig.txt") + // Check if the travis DB config is up to date with the example dbconfig + // This proc is a little unclean but it works + var/example_db_version + var/list/Lines = file2list("config/example/dbconfig.txt") + for(var/t in Lines) + if(!t) continue + + t = trim(t) + if(length(t) == 0) + continue + else if(copytext(t, 1, 2) == "#") + continue + + var/pos = findtext(t, " ") + var/name = null + var/value = null + + if(pos) + name = lowertext(copytext(t, 1, pos)) + value = copytext(t, pos + 1) + else + name = lowertext(t) + + if(!name) + continue + + switch(name) + if("db_version") + example_db_version = text2num(value) + + if(!example_db_version) + Fail("SQL version error: File config/example/dbconfig.txt does not have a valid SQL version set!") + + if(example_db_version != SQL_VERSION) + Fail("SQL version error: Game is running V[SQL_VERSION] but config/example/dbconfig.txt is V[example_db_version].") + + diff --git a/code/modules/unit_tests/subsystem_init.dm b/code/modules/unit_tests/subsystem_init.dm new file mode 100644 index 00000000000..7d5473bc1bb --- /dev/null +++ b/code/modules/unit_tests/subsystem_init.dm @@ -0,0 +1,7 @@ +/datum/unit_test/subsystem_init/Run() + for(var/i in Master.subsystems) + var/datum/controller/subsystem/ss = i + if(ss.flags & SS_NO_INIT) + continue + if(!ss.initialized) + Fail("[ss]([ss.type]) is a subsystem meant to initialize but doesn't get set as initialized.") diff --git a/code/modules/unit_tests/timer_sanity.dm b/code/modules/unit_tests/timer_sanity.dm new file mode 100644 index 00000000000..d92323a5253 --- /dev/null +++ b/code/modules/unit_tests/timer_sanity.dm @@ -0,0 +1,3 @@ +/datum/unit_test/timer_sanity/Run() + if(SStimer.bucket_count < 0) + Fail("SStimer is going into negative bucket count from something") diff --git a/code/modules/unit_tests/unit_test.dm b/code/modules/unit_tests/unit_test.dm new file mode 100644 index 00000000000..3a1d39bd133 --- /dev/null +++ b/code/modules/unit_tests/unit_test.dm @@ -0,0 +1,102 @@ +/* +Usage: +Override /Run() to run your test code +Call Fail() to fail the test (You should specify a reason) +You may use /New() and /Destroy() for setup/teardown respectively +You can use the run_loc_bottom_left and run_loc_top_right to get turfs for testing +*/ + +/// VARS FOR UNIT TESTS +GLOBAL_DATUM(current_test, /datum/unit_test) +GLOBAL_VAR_INIT(failed_any_test, FALSE) +GLOBAL_VAR(test_log) + +/datum/unit_test + //Bit of metadata for the future maybe + var/list/procs_tested + + //usable vars + var/turf/run_loc_bottom_left + var/turf/run_loc_top_right + + //internal shit + var/succeeded = TRUE + var/list/fail_reasons + +/datum/unit_test/New() + run_loc_bottom_left = locate(1, 1, 1) + run_loc_top_right = locate(5, 5, 1) + +/datum/unit_test/Destroy() + //clear the test area + for(var/atom/movable/AM in block(run_loc_bottom_left, run_loc_top_right)) + qdel(AM) + return ..() + +/datum/unit_test/proc/Run() + Fail("Run() called parent or not implemented") + +/datum/unit_test/proc/Fail(reason = "No reason") + succeeded = FALSE + + if(!istext(reason)) + reason = "FORMATTED: [reason != null ? reason : "NULL"]" + + LAZYADD(fail_reasons, reason) + +/proc/RunUnitTests() + CHECK_TICK + + for(var/I in subtypesof(/datum/unit_test)) + var/datum/unit_test/test = new I + + GLOB.current_test = test + var/duration = REALTIMEOFDAY + + test.Run() + + duration = REALTIMEOFDAY - duration + GLOB.current_test = null + GLOB.failed_any_test |= !test.succeeded + + var/list/log_entry = list("[test.succeeded ? "PASS" : "FAIL"]: [I] [duration / 10]s") + var/list/fail_reasons = test.fail_reasons + + qdel(test) + + for(var/J in 1 to LAZYLEN(fail_reasons)) + log_entry += "\tREASON #[J]: [fail_reasons[J]]" + log_world(log_entry.Join("\n")) + + CHECK_TICK + + world.Reboot("Unit Test Reboot", "end_test", "tests ended", 0) + + +// OTHER MISC PROCS RELATED TO UNIT TESTS // + +/world/proc/HandleTestRun() + //trigger things to run the whole process + Master.sleep_offline_after_initializations = FALSE + // This will have the ticker set the game up + // Running the tests is part of the ticker's start function, because I cant think of any better place to put it + SSticker.force_start = TRUE + +/world/proc/FinishTestRun() + set waitfor = FALSE + var/list/fail_reasons + if(GLOB) + if(GLOB.total_runtimes != 0) + fail_reasons = list("Total runtimes: [GLOB.total_runtimes]") + if(!GLOB.log_directory) + LAZYADD(fail_reasons, "Missing GLOB.log_directory!") + if(GLOB.failed_any_test) + LAZYADD(fail_reasons, "Unit Tests failed!") + else + fail_reasons = list("Missing GLOB!") + if(!fail_reasons) + text2file("Success!", "data/clean_run.lk") + else + log_world("Test run failed!\n[fail_reasons.Join("\n")]") + sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes + del(src) //shut it down diff --git a/libmariadb.so b/libmariadb.so old mode 100644 new mode 100755 diff --git a/librust_g.so b/librust_g.so old mode 100644 new mode 100755 index d70052a39c9..57d9ed9fa57 Binary files a/librust_g.so and b/librust_g.so differ diff --git a/paradise.dme b/paradise.dme index bb0c7d6e2cb..8bdc190652f 100644 --- a/paradise.dme +++ b/paradise.dme @@ -2473,6 +2473,7 @@ #include "code\modules\telesci\telepad.dm" #include "code\modules\telesci\telesci_computer.dm" #include "code\modules\tooltip\tooltip.dm" +#include "code\modules\unit_tests\_unit_tests.dm" #include "code\modules\vehicle\ambulance.dm" #include "code\modules\vehicle\atv.dm" #include "code\modules\vehicle\janicart.dm" diff --git a/tools/travis/README.MD b/tools/travis/README.MD index 3079e9bfa43..7088bc74caf 100644 --- a/tools/travis/README.MD +++ b/tools/travis/README.MD @@ -1,3 +1,6 @@ -# Info - -All scripts utilised by Travis CI should be placed into this folder for the sake of maintainability, and knowing where stuff is \ No newline at end of file +# Info + +All scripts utilised by Travis CI should be placed into this folder for the sake of maintainability, and knowing where stuff is + +# NOTE +Do not move the `dm.sh` script without **VERY** good reason, as the server backend relies on it for updating, and moving this file **WILL** break server updating, but make the server appear to still be updated. TLDR: Dont move it or break its existing functionality, without advancing changes to the server host. diff --git a/tools/travis/dbconfig.txt b/tools/travis/dbconfig.txt new file mode 100644 index 00000000000..911828e37a7 --- /dev/null +++ b/tools/travis/dbconfig.txt @@ -0,0 +1,11 @@ +# This exists solely as a DBconfig file for travis testing +# Dont use it ingame +# Remember to update this when you increase the SQL version! -aa +SQL_ENABLED +DB_VERSION 12 +ADDRESS 127.0.0.1 +PORT 3306 +FEEDBACK_DATABASE feedback +FEEDBACK_TABLEPREFIX +FEEDBACK_LOGIN travis_sql +FEEDBACK_PASSWORD not_a_strong_password diff --git a/tools/travis/generate_maplist.sh b/tools/travis/generate_maplist.sh new file mode 100755 index 00000000000..3620d65d263 --- /dev/null +++ b/tools/travis/generate_maplist.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -euo pipefail + +# This script loops through every subdir here to generate a list of all maps programatically to avoid the list getting out of date + +cd _maps +find | grep -Ei ".dmm" | grep -v -e ".before" -e ".backup" > travis_map_testing.dm +sed -i -e 's/.*/#include \"&\"/' travis_map_testing.dm +echo "Generated map compile file with `wc -l travis_map_testing.dm` maps" diff --git a/tools/travis/generate_sql_scripts.py b/tools/travis/generate_sql_scripts.py new file mode 100644 index 00000000000..d1fe66ea7ea --- /dev/null +++ b/tools/travis/generate_sql_scripts.py @@ -0,0 +1,73 @@ +# Python script for SQL validation +# For Python 3!, not 2 +# Basically, this script reads through every SQL update file and prepares it for testing against the SQL server +# This ensures that SQL files have correct syntax, and are not malformed +# -AA07 +import glob, os, shutil, stat +os.chdir("SQL/updates") +sqlFiles = glob.glob("*.sql") +orderedSqlFiles = [] +# These need to be ordered properly, so begin awful hacky code +for fileName in sqlFiles: + prev = fileName.split("-")[0] + orderedSqlFiles.append(int(prev)) + +orderedSqlFiles = sorted(orderedSqlFiles) + +for index in orderedSqlFiles: + # Yes I know half these casts are probably not necassary, but python is very picky + orderedSqlFiles[index] = str(index) + "-" + (str(int(index)+1)) + ".sql" + +print("Found " + str(len(orderedSqlFiles)) + " SQL update files to validate") + +# FROM THIS POINT ON, DO NOT SORT THAT LIST +# Go back up two directories +os.chdir("../../") + +# Delete the testing directory IF it exists. +# This is what I mean by python being picky +if os.path.exists("tools/travis/sql_tmp") and os.path.isdir("tools/travis/sql_tmp"): + shutil.rmtree("tools/travis/sql_tmp") + +# Now make the dir +os.mkdir("tools/travis/sql_tmp") + +# These lines will be used to generate a file which runs all the SQL scripts +# First we test from schema 0 all the way up to latest +# Then the prefixed schema +# Then the main schema, which the server will use +scriptLines = [ + "#!/bin/bash\n", + "set -euo pipefail\n" + "mysql -u root < tools/travis/sql_v0.sql\n" +] + +# And write the files and tell them to be used +for file in orderedSqlFiles: + inFile = open("SQL/updates/" + file, "r") + fileLines = inFile.readlines() + inFile.close() + # Add in a line which tells it to use the feedback DB + fileLines.insert(0, "USE `feedback`;\n") + + # Write new files to be used by the testing script + outFile = open("tools/travis/sql_tmp/" + file, "w+") + outFile.writelines(fileLines) + outFile.close() + + # Add a line to the script being made that tells it to use this SQL file + scriptLines.append("mysql -u root < tools/travis/sql_tmp/" + str(file) + "\n") + +scriptLines.append("mysql -u root -e 'DROP DATABASE feedback;'\n") +scriptLines.append("mysql -u root < SQL/paradise_schema_prefixed.sql\n") +scriptLines.append("mysql -u root -e 'DROP DATABASE feedback;'\n") +scriptLines.append("mysql -u root < SQL/paradise_schema.sql\n") +scriptLines.append("mysql -u root -e 'GRANT ALL on feedback.* TO `travis_sql`@`127.0.0.1` IDENTIFIED BY \"not_a_strong_password\";'\n") + +outputScript = open("tools/travis/validate_sql.sh", "w+") +outputScript.writelines(scriptLines) +outputScript.close() + +st = os.stat('tools/travis/validate_sql.sh') +os.chmod('tools/travis/validate_sql.sh', st.st_mode | stat.S_IEXEC) +print("SQL validation script written successfully") diff --git a/tools/travis/run_server.sh b/tools/travis/run_server.sh new file mode 100755 index 00000000000..e5a7cd6bc03 --- /dev/null +++ b/tools/travis/run_server.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -euo pipefail + +cp config/example/* config/ + +#Apply test DB config for SQL connectivity +rm config/dbconfig.txt +cp tools/travis/dbconfig.txt config + +# Now run the server and the unit tests +DreamDaemon paradise.dmb -close -trusted -verbose + +# Check if the unit tests actually suceeded +cat data/clean_run.lk diff --git a/tools/travis/sql_v0.sql b/tools/travis/sql_v0.sql new file mode 100644 index 00000000000..512509bade9 --- /dev/null +++ b/tools/travis/sql_v0.sql @@ -0,0 +1,537 @@ +# This file is revision 0 of the server SQL schema +# It is intended ONLY for travis testing, and thus has data thrown in to test all update files with +# DO NOT SET THIS AS THE GAMES PROPER SCHEMA OR A LOT OF STUFF WILL BREAK + +-- -------------------------------------------------------- +-- Host: AA07-S-SQL +-- Server version: 10.3.22-MariaDB-0ubuntu0.19.10.1 - Ubuntu 19.10 +-- Server OS: debian-linux-gnu +-- HeidiSQL Version: 10.2.0.5599 +-- -------------------------------------------------------- + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET NAMES utf8 */; +/*!50503 SET NAMES utf8mb4 */; +/*!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' */; + + +-- Dumping database structure for feedback +DROP DATABASE IF EXISTS `feedback`; +CREATE DATABASE IF NOT EXISTS `feedback` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `feedback`; + +-- Dumping structure for table feedback.admin +DROP TABLE IF EXISTS `admin`; +CREATE TABLE IF NOT EXISTS `admin` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ckey` varchar(32) NOT NULL, + `rank` varchar(32) NOT NULL DEFAULT 'Administrator', + `level` int(2) NOT NULL DEFAULT 0, + `flags` int(16) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.admin: ~0 rows (approximately) +/*!40000 ALTER TABLE `admin` DISABLE KEYS */; +INSERT INTO `admin` (`id`, `ckey`, `rank`, `level`, `flags`) VALUES + (1, 'AffectedArc07', 'Administrator', 0, 131071); +/*!40000 ALTER TABLE `admin` ENABLE KEYS */; + +-- Dumping structure for table feedback.admin_log +DROP TABLE IF EXISTS `admin_log`; +CREATE TABLE IF NOT EXISTS `admin_log` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `datetime` datetime NOT NULL, + `adminckey` varchar(32) NOT NULL, + `adminip` varchar(18) NOT NULL, + `log` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.admin_log: ~0 rows (approximately) +/*!40000 ALTER TABLE `admin_log` DISABLE KEYS */; +INSERT INTO `admin_log` (`id`, `datetime`, `adminckey`, `adminip`, `log`) VALUES + (1, '2020-04-24 17:36:49', 'AffectedArc07', '127.0.0.1', 'Created this row'); +/*!40000 ALTER TABLE `admin_log` ENABLE KEYS */; + +-- Dumping structure for table feedback.ban +DROP TABLE IF EXISTS `ban`; +CREATE TABLE IF NOT EXISTS `ban` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `bantime` datetime NOT NULL, + `serverip` varchar(32) NOT NULL, + `bantype` varchar(32) NOT NULL, + `reason` text NOT NULL, + `job` varchar(32) DEFAULT NULL, + `duration` int(11) NOT NULL, + `rounds` int(11) DEFAULT NULL, + `expiration_time` datetime NOT NULL, + `ckey` varchar(32) NOT NULL, + `computerid` varchar(32) NOT NULL, + `ip` varchar(32) NOT NULL, + `a_ckey` varchar(32) NOT NULL, + `a_computerid` varchar(32) NOT NULL, + `a_ip` varchar(32) NOT NULL, + `who` text NOT NULL, + `adminwho` text NOT NULL, + `edits` text DEFAULT NULL, + `unbanned` tinyint(1) DEFAULT NULL, + `unbanned_datetime` datetime DEFAULT NULL, + `unbanned_ckey` varchar(32) DEFAULT NULL, + `unbanned_computerid` varchar(32) DEFAULT NULL, + `unbanned_ip` varchar(32) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.ban: ~0 rows (approximately) +/*!40000 ALTER TABLE `ban` DISABLE KEYS */; +INSERT INTO `ban` (`id`, `bantime`, `serverip`, `bantype`, `reason`, `job`, `duration`, `rounds`, `expiration_time`, `ckey`, `computerid`, `ip`, `a_ckey`, `a_computerid`, `a_ip`, `who`, `adminwho`, `edits`, `unbanned`, `unbanned_datetime`, `unbanned_ckey`, `unbanned_computerid`, `unbanned_ip`) VALUES + (1, '2020-04-24 17:40:05', '127.0.0.1', 'PERMABAN', 'Breaking it all', NULL, -1, NULL, '2020-04-24 17:40:20', 'AffectedArc07', '1111111111', '127.0.0.1', 'AffectedArc07', '1111111111', '127.0.0.1', 'Player1, Player2, Whoever', 'SomeAdmin', NULL, NULL, NULL, NULL, NULL, NULL); +/*!40000 ALTER TABLE `ban` ENABLE KEYS */; + +-- Dumping structure for table feedback.characters +DROP TABLE IF EXISTS `characters`; +CREATE TABLE IF NOT EXISTS `characters` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ckey` varchar(32) NOT NULL, + `slot` int(2) NOT NULL, + `OOC_Notes` mediumtext NOT NULL, + `real_name` varchar(45) NOT NULL, + `name_is_always_random` tinyint(1) NOT NULL, + `gender` varchar(11) NOT NULL, + `age` smallint(4) NOT NULL, + `species` varchar(45) NOT NULL, + `language` varchar(45) NOT NULL, + `hair_red` smallint(4) NOT NULL, + `hair_green` smallint(4) NOT NULL, + `hair_blue` smallint(4) NOT NULL, + `secondary_hair_red` smallint(4) NOT NULL, + `secondary_hair_green` smallint(4) NOT NULL, + `secondary_hair_blue` smallint(4) NOT NULL, + `facial_red` smallint(4) NOT NULL, + `facial_green` smallint(4) NOT NULL, + `facial_blue` smallint(4) NOT NULL, + `secondary_facial_red` smallint(4) NOT NULL, + `secondary_facial_green` smallint(4) NOT NULL, + `secondary_facial_blue` smallint(4) NOT NULL, + `skin_tone` smallint(4) NOT NULL, + `skin_red` smallint(4) NOT NULL, + `skin_green` smallint(4) NOT NULL, + `skin_blue` smallint(4) NOT NULL, + `marking_colours` varchar(255) NOT NULL DEFAULT 'head=%23000000&body=%23000000&tail=%23000000', + `head_accessory_red` smallint(4) NOT NULL, + `head_accessory_green` smallint(4) NOT NULL, + `head_accessory_blue` smallint(4) NOT NULL, + `hair_style_name` varchar(45) NOT NULL, + `facial_style_name` varchar(45) NOT NULL, + `marking_styles` varchar(255) NOT NULL DEFAULT 'head=None&body=None&tail=None', + `head_accessory_style_name` varchar(45) NOT NULL, + `alt_head_name` varchar(45) NOT NULL, + `eyes_red` smallint(4) NOT NULL, + `eyes_green` smallint(4) NOT NULL, + `eyes_blue` smallint(4) NOT NULL, + `underwear` mediumtext NOT NULL, + `undershirt` mediumtext NOT NULL, + `backbag` mediumtext NOT NULL, + `b_type` varchar(45) NOT NULL, + `alternate_option` smallint(4) NOT NULL, + `job_support_high` mediumint(8) NOT NULL, + `job_support_med` mediumint(8) NOT NULL, + `job_support_low` mediumint(8) NOT NULL, + `job_medsci_high` mediumint(8) NOT NULL, + `job_medsci_med` mediumint(8) NOT NULL, + `job_medsci_low` mediumint(8) NOT NULL, + `job_engsec_high` mediumint(8) NOT NULL, + `job_engsec_med` mediumint(8) NOT NULL, + `job_engsec_low` mediumint(8) NOT NULL, + `job_karma_high` mediumint(8) NOT NULL, + `job_karma_med` mediumint(8) NOT NULL, + `job_karma_low` mediumint(8) NOT NULL, + `flavor_text` mediumtext NOT NULL, + `med_record` mediumtext NOT NULL, + `sec_record` mediumtext NOT NULL, + `gen_record` mediumtext NOT NULL, + `disabilities` mediumint(8) NOT NULL, + `player_alt_titles` mediumtext NOT NULL, + `organ_data` mediumtext NOT NULL, + `rlimb_data` mediumtext NOT NULL, + `nanotrasen_relation` varchar(45) NOT NULL, + `speciesprefs` int(1) NOT NULL, + `socks` mediumtext NOT NULL, + `body_accessory` mediumtext NOT NULL, + `gear` mediumtext NOT NULL, + `autohiss` tinyint(1) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +-- Dumping data for table feedback.characters: ~0 rows (approximately) +/*!40000 ALTER TABLE `characters` DISABLE KEYS */; +INSERT INTO `characters` (`id`, `ckey`, `slot`, `OOC_Notes`, `real_name`, `name_is_always_random`, `gender`, `age`, `species`, `language`, `hair_red`, `hair_green`, `hair_blue`, `secondary_hair_red`, `secondary_hair_green`, `secondary_hair_blue`, `facial_red`, `facial_green`, `facial_blue`, `secondary_facial_red`, `secondary_facial_green`, `secondary_facial_blue`, `skin_tone`, `skin_red`, `skin_green`, `skin_blue`, `marking_colours`, `head_accessory_red`, `head_accessory_green`, `head_accessory_blue`, `hair_style_name`, `facial_style_name`, `marking_styles`, `head_accessory_style_name`, `alt_head_name`, `eyes_red`, `eyes_green`, `eyes_blue`, `underwear`, `undershirt`, `backbag`, `b_type`, `alternate_option`, `job_support_high`, `job_support_med`, `job_support_low`, `job_medsci_high`, `job_medsci_med`, `job_medsci_low`, `job_engsec_high`, `job_engsec_med`, `job_engsec_low`, `job_karma_high`, `job_karma_med`, `job_karma_low`, `flavor_text`, `med_record`, `sec_record`, `gen_record`, `disabilities`, `player_alt_titles`, `organ_data`, `rlimb_data`, `nanotrasen_relation`, `speciesprefs`, `socks`, `body_accessory`, `gear`, `autohiss`) VALUES + (1, 'AffectedArc07', 1, 'Some notes', 'John Smith', 0, 'male', 25, 'Human', 'None', 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 25, 10, 10, 10, 'head=%23000000&body=%23000000&tail=%23000000', 10, 10, 10, 'Bald', 'Shaved', 'head=None&body=None&tail=None', 'None', 'None', 10, 10, 10, 'Nude', 'Nude', 'Grey Backpack', 'A+', 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'He is short', 'Yes', 'Yes', 'Yes', 0, ' ', ' ', ' ', 'Neutral', 0, 'Nude', ' ', ' ', 0); +/*!40000 ALTER TABLE `characters` ENABLE KEYS */; + +-- Dumping structure for table feedback.customuseritems +DROP TABLE IF EXISTS `customuseritems`; +CREATE TABLE IF NOT EXISTS `customuseritems` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `cuiCKey` varchar(36) NOT NULL, + `cuiRealName` varchar(60) NOT NULL, + `cuiPath` varchar(255) NOT NULL, + `cuiItemName` text DEFAULT NULL, + `cuiDescription` text DEFAULT NULL, + `cuiReason` text DEFAULT NULL, + `cuiPropAdjust` text DEFAULT NULL, + `cuiJobMask` text NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.customuseritems: 0 rows +/*!40000 ALTER TABLE `customuseritems` DISABLE KEYS */; +INSERT INTO `customuseritems` (`id`, `cuiCKey`, `cuiRealName`, `cuiPath`, `cuiItemName`, `cuiDescription`, `cuiReason`, `cuiPropAdjust`, `cuiJobMask`) VALUES + (1, 'AffectedArc07', 'Character Name', '/obj/item/multitool', NULL, NULL, NULL, NULL, '*'); +/*!40000 ALTER TABLE `customuseritems` ENABLE KEYS */; + +-- Dumping structure for table feedback.death +DROP TABLE IF EXISTS `death`; +CREATE TABLE IF NOT EXISTS `death` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `pod` text NOT NULL COMMENT 'Place of death', + `coord` text NOT NULL COMMENT 'X, Y, Z POD', + `tod` datetime NOT NULL COMMENT 'Time of death', + `job` text NOT NULL, + `special` text NOT NULL, + `name` text NOT NULL, + `byondkey` text NOT NULL, + `laname` text NOT NULL COMMENT 'Last attacker name', + `lakey` text NOT NULL COMMENT 'Last attacker key', + `gender` text NOT NULL, + `bruteloss` int(11) NOT NULL, + `brainloss` int(11) NOT NULL, + `fireloss` int(11) NOT NULL, + `oxyloss` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.death: 0 rows +/*!40000 ALTER TABLE `death` DISABLE KEYS */; +INSERT INTO `death` (`id`, `pod`, `coord`, `tod`, `job`, `special`, `name`, `byondkey`, `laname`, `lakey`, `gender`, `bruteloss`, `brainloss`, `fireloss`, `oxyloss`) VALUES + (1, 'Central Primary Hallway', '1,1,1', '2020-04-24 17:58:41', 'Captain', 'Traitor', 'John Smith', 'AffectedArc07', 'Bad Man', 'BadGuyCkey', 'Male', 12, 12, 12, 12); +/*!40000 ALTER TABLE `death` ENABLE KEYS */; + +-- Dumping structure for table feedback.donators +DROP TABLE IF EXISTS `donators`; +CREATE TABLE IF NOT EXISTS `donators` ( + `patreon_name` varchar(32) NOT NULL, + `tier` int(2) DEFAULT NULL, + `ckey` varchar(32) DEFAULT NULL COMMENT 'Manual Field', + `start_date` datetime DEFAULT NULL, + `end_date` datetime DEFAULT NULL, + `active` tinyint(1) DEFAULT NULL, + PRIMARY KEY (`patreon_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- Dumping data for table feedback.donators: ~0 rows (approximately) +/*!40000 ALTER TABLE `donators` DISABLE KEYS */; +INSERT INTO `donators` (`patreon_name`, `tier`, `ckey`, `start_date`, `end_date`, `active`) VALUES + ('AffectedArc07', 3, 'AffectedArc07', '2020-04-24 18:00:47', '2020-04-24 18:00:48', 1); +/*!40000 ALTER TABLE `donators` ENABLE KEYS */; + +-- Dumping structure for table feedback.feedback +DROP TABLE IF EXISTS `feedback`; +CREATE TABLE IF NOT EXISTS `feedback` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `time` datetime NOT NULL, + `round_id` int(8) NOT NULL, + `var_name` varchar(32) NOT NULL, + `var_value` int(16) DEFAULT NULL, + `details` text DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.feedback: 0 rows +/*!40000 ALTER TABLE `feedback` DISABLE KEYS */; +INSERT INTO `feedback` (`id`, `time`, `round_id`, `var_name`, `var_value`, `details`) VALUES + (1, '2020-04-24 18:01:08', 1, 'yes', 1, 'feedback scares me'); +/*!40000 ALTER TABLE `feedback` ENABLE KEYS */; + +-- Dumping structure for table feedback.karma +DROP TABLE IF EXISTS `karma`; +CREATE TABLE IF NOT EXISTS `karma` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `spendername` text NOT NULL, + `spenderkey` text NOT NULL, + `receivername` text NOT NULL, + `receiverkey` text NOT NULL, + `receiverrole` text DEFAULT NULL, + `receiverspecial` text DEFAULT NULL, + `isnegative` tinyint(1) DEFAULT NULL, + `spenderip` text NOT NULL, + `time` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.karma: 0 rows +/*!40000 ALTER TABLE `karma` DISABLE KEYS */; +INSERT INTO `karma` (`id`, `spendername`, `spenderkey`, `receivername`, `receiverkey`, `receiverrole`, `receiverspecial`, `isnegative`, `spenderip`, `time`) VALUES + (1, 'John Smith', 'AffectedArc07', 'Other Man', 'OtherCkey', 'Captain', 'Special', 0, '127.0.0.1', '2020-04-24 18:02:00'); +/*!40000 ALTER TABLE `karma` ENABLE KEYS */; + +-- Dumping structure for table feedback.karmatotals +DROP TABLE IF EXISTS `karmatotals`; +CREATE TABLE IF NOT EXISTS `karmatotals` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `byondkey` text NOT NULL, + `karma` int(11) NOT NULL, + `karmaspent` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.karmatotals: 0 rows +/*!40000 ALTER TABLE `karmatotals` DISABLE KEYS */; +INSERT INTO `karmatotals` (`id`, `byondkey`, `karma`, `karmaspent`) VALUES + (1, 'AffectedArc07', 1000, 100); +/*!40000 ALTER TABLE `karmatotals` ENABLE KEYS */; + +-- Dumping structure for table feedback.legacy_population +DROP TABLE IF EXISTS `legacy_population`; +CREATE TABLE IF NOT EXISTS `legacy_population` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `playercount` int(11) DEFAULT NULL, + `admincount` int(11) DEFAULT NULL, + `time` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.legacy_population: 0 rows +/*!40000 ALTER TABLE `legacy_population` DISABLE KEYS */; +INSERT INTO `legacy_population` (`id`, `playercount`, `admincount`, `time`) VALUES + (1, 233, 23, '2020-04-24 18:02:19'); +/*!40000 ALTER TABLE `legacy_population` ENABLE KEYS */; + +-- Dumping structure for table feedback.library +DROP TABLE IF EXISTS `library`; +CREATE TABLE IF NOT EXISTS `library` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `author` text NOT NULL, + `title` text NOT NULL, + `content` text NOT NULL, + `category` text NOT NULL, + `ckey` varchar(45) NOT NULL, + `flagged` int(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.library: 0 rows +/*!40000 ALTER TABLE `library` DISABLE KEYS */; +INSERT INTO `library` (`id`, `author`, `title`, `content`, `category`, `ckey`, `flagged`) VALUES + (1, 'John Smith', 'A book', 'WOW WHAT A BOOK', 'Fiction', 'AffectedArc07', 0); +/*!40000 ALTER TABLE `library` ENABLE KEYS */; + +-- Dumping structure for table feedback.memo +DROP TABLE IF EXISTS `memo`; +CREATE TABLE IF NOT EXISTS `memo` ( + `ckey` varchar(32) NOT NULL, + `memotext` text NOT NULL, + `timestamp` datetime NOT NULL, + `last_editor` varchar(32) DEFAULT NULL, + `edits` text DEFAULT NULL, + PRIMARY KEY (`ckey`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.memo: ~0 rows (approximately) +/*!40000 ALTER TABLE `memo` DISABLE KEYS */; +INSERT INTO `memo` (`ckey`, `memotext`, `timestamp`, `last_editor`, `edits`) VALUES + ('AffectedArc07', 'Remember to test your PRs', '2020-04-24 18:04:00', NULL, NULL); +/*!40000 ALTER TABLE `memo` ENABLE KEYS */; + +-- Dumping structure for table feedback.notes +DROP TABLE IF EXISTS `notes`; +CREATE TABLE IF NOT EXISTS `notes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ckey` varchar(32) NOT NULL, + `notetext` text NOT NULL, + `timestamp` datetime NOT NULL, + `adminckey` varchar(32) NOT NULL, + `last_editor` varchar(32) DEFAULT NULL, + `edits` text DEFAULT NULL, + `server` varchar(50) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.notes: ~0 rows (approximately) +/*!40000 ALTER TABLE `notes` DISABLE KEYS */; +INSERT INTO `notes` (`id`, `ckey`, `notetext`, `timestamp`, `adminckey`, `last_editor`, `edits`, `server`) VALUES + (1, 'AffectedArc07', 'Cant behave', '2020-04-24 18:04:14', 'AffectedArc07', NULL, NULL, 'SS13'); +/*!40000 ALTER TABLE `notes` ENABLE KEYS */; + +-- Dumping structure for table feedback.player +DROP TABLE IF EXISTS `player`; +CREATE TABLE IF NOT EXISTS `player` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ckey` varchar(32) NOT NULL, + `firstseen` datetime NOT NULL, + `lastseen` datetime NOT NULL, + `ip` varchar(18) NOT NULL, + `computerid` varchar(32) NOT NULL, + `lastadminrank` varchar(32) NOT NULL DEFAULT 'Player', + `ooccolor` varchar(7) DEFAULT '#b82e00', + `UI_style` varchar(10) DEFAULT 'Midnight', + `UI_style_color` varchar(7) DEFAULT '#ffffff', + `UI_style_alpha` smallint(4) DEFAULT 255, + `be_role` mediumtext DEFAULT NULL, + `default_slot` smallint(4) DEFAULT 1, + `toggles` mediumint(8) DEFAULT 383, + `sound` mediumint(8) DEFAULT 31, + `randomslot` tinyint(1) DEFAULT 0, + `volume` smallint(4) DEFAULT 100, + `nanoui_fancy` smallint(4) DEFAULT 1, + `show_ghostitem_attack` smallint(4) DEFAULT 1, + `lastchangelog` varchar(32) NOT NULL DEFAULT '0', + `windowflashing` smallint(4) DEFAULT 1, + `ghost_anonsay` tinyint(1) NOT NULL DEFAULT 0, + `exp` mediumtext DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ckey` (`ckey`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.player: ~0 rows (approximately) +/*!40000 ALTER TABLE `player` DISABLE KEYS */; +INSERT INTO `player` (`id`, `ckey`, `firstseen`, `lastseen`, `ip`, `computerid`, `lastadminrank`, `ooccolor`, `UI_style`, `UI_style_color`, `UI_style_alpha`, `be_role`, `default_slot`, `toggles`, `sound`, `randomslot`, `volume`, `nanoui_fancy`, `show_ghostitem_attack`, `lastchangelog`, `windowflashing`, `ghost_anonsay`, `exp`) VALUES + (1, 'AffectedArc07', '2020-04-24 18:04:44', '2020-04-24 18:04:45', '127.0.0.1', '1111111111', 'Player', '#b82e00', 'Midnight', '#ffffff', 10, NULL, 1, 1024, 16, 0, 100, 1, 1, '0', 1, 1, NULL); +/*!40000 ALTER TABLE `player` ENABLE KEYS */; + +-- Dumping structure for table feedback.poll_option +DROP TABLE IF EXISTS `poll_option`; +CREATE TABLE IF NOT EXISTS `poll_option` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `pollid` int(11) NOT NULL, + `text` varchar(255) NOT NULL, + `percentagecalc` tinyint(1) NOT NULL DEFAULT 1, + `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, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.poll_option: ~0 rows (approximately) +/*!40000 ALTER TABLE `poll_option` DISABLE KEYS */; +INSERT INTO `poll_option` (`id`, `pollid`, `text`, `percentagecalc`, `minval`, `maxval`, `descmin`, `descmid`, `descmax`) VALUES + (1, 1, 'What is this', 12, NULL, NULL, NULL, NULL, NULL); +/*!40000 ALTER TABLE `poll_option` ENABLE KEYS */; + +-- Dumping structure for table feedback.poll_question +DROP TABLE IF EXISTS `poll_question`; +CREATE TABLE IF NOT EXISTS `poll_question` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `polltype` varchar(16) NOT NULL DEFAULT 'OPTION', + `starttime` datetime NOT NULL, + `endtime` datetime NOT NULL, + `question` varchar(255) NOT NULL, + `adminonly` tinyint(1) DEFAULT 0, + `multiplechoiceoptions` int(2) DEFAULT NULL, + `createdby_ckey` varchar(45) DEFAULT NULL, + `createdby_ip` varchar(45) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.poll_question: ~0 rows (approximately) +/*!40000 ALTER TABLE `poll_question` DISABLE KEYS */; +INSERT INTO `poll_question` (`id`, `polltype`, `starttime`, `endtime`, `question`, `adminonly`, `multiplechoiceoptions`, `createdby_ckey`, `createdby_ip`) VALUES + (1, 'OPTION', '2020-04-24 18:05:31', '2020-04-24 18:05:33', 'Is this a good idea', 0, NULL, NULL, NULL); +/*!40000 ALTER TABLE `poll_question` ENABLE KEYS */; + +-- Dumping structure for table feedback.poll_textreply +DROP TABLE IF EXISTS `poll_textreply`; +CREATE TABLE IF NOT EXISTS `poll_textreply` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `datetime` datetime NOT NULL, + `pollid` int(11) NOT NULL, + `ckey` varchar(32) NOT NULL, + `ip` varchar(18) NOT NULL, + `replytext` text NOT NULL, + `adminrank` varchar(32) NOT NULL DEFAULT 'Player', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.poll_textreply: ~0 rows (approximately) +/*!40000 ALTER TABLE `poll_textreply` DISABLE KEYS */; +INSERT INTO `poll_textreply` (`id`, `datetime`, `pollid`, `ckey`, `ip`, `replytext`, `adminrank`) VALUES + (1, '2020-04-24 18:05:42', 1, 'AffectedArc07', '127.0.0.1', 'This is far too much work for a travis rework', 'Player'); +/*!40000 ALTER TABLE `poll_textreply` ENABLE KEYS */; + +-- Dumping structure for table feedback.poll_vote +DROP TABLE IF EXISTS `poll_vote`; +CREATE TABLE IF NOT EXISTS `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(255) NOT NULL, + `ip` varchar(16) NOT NULL, + `adminrank` varchar(32) NOT NULL, + `rating` int(2) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.poll_vote: ~0 rows (approximately) +/*!40000 ALTER TABLE `poll_vote` DISABLE KEYS */; +INSERT INTO `poll_vote` (`id`, `datetime`, `pollid`, `optionid`, `ckey`, `ip`, `adminrank`, `rating`) VALUES + (1, '2020-04-24 18:06:02', 1, 1, 'AffectedArc07', '127.0.0.1', 'Administrator', NULL); +/*!40000 ALTER TABLE `poll_vote` ENABLE KEYS */; + +-- Dumping structure for table feedback.privacy +DROP TABLE IF EXISTS `privacy`; +CREATE TABLE IF NOT EXISTS `privacy` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `datetime` datetime NOT NULL, + `ckey` varchar(32) NOT NULL, + `option` varchar(128) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.privacy: ~0 rows (approximately) +/*!40000 ALTER TABLE `privacy` DISABLE KEYS */; +INSERT INTO `privacy` (`id`, `datetime`, `ckey`, `option`) VALUES + (1, '2020-04-24 18:06:20', 'AffectedArc07', '1'); +/*!40000 ALTER TABLE `privacy` ENABLE KEYS */; + +-- Dumping structure for table feedback.watch +DROP TABLE IF EXISTS `watch`; +CREATE TABLE IF NOT EXISTS `watch` ( + `ckey` varchar(32) NOT NULL, + `reason` text NOT NULL, + `timestamp` datetime NOT NULL, + `adminckey` varchar(32) NOT NULL, + `last_editor` varchar(32) DEFAULT NULL, + `edits` text DEFAULT NULL, + PRIMARY KEY (`ckey`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.watch: ~0 rows (approximately) +/*!40000 ALTER TABLE `watch` DISABLE KEYS */; +INSERT INTO `watch` (`ckey`, `reason`, `timestamp`, `adminckey`, `last_editor`, `edits`) VALUES + ('AffectedArc07', 'Cant behave', '2020-04-24 18:06:33', 'AffectedArc07', NULL, NULL); +/*!40000 ALTER TABLE `watch` ENABLE KEYS */; + +-- Dumping structure for table feedback.whitelist +DROP TABLE IF EXISTS `whitelist`; +CREATE TABLE IF NOT EXISTS `whitelist` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `ckey` text NOT NULL, + `job` text DEFAULT NULL, + `species` text DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- Dumping data for table feedback.whitelist: 0 rows +/*!40000 ALTER TABLE `whitelist` DISABLE KEYS */; +INSERT INTO `whitelist` (`id`, `ckey`, `job`, `species`) VALUES + (1, 'AffectedArc07', 'Captain', 'Machine'); +/*!40000 ALTER TABLE `whitelist` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; +/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;