mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
* [ci skip] Automatic changelog update. * Beretta action: Electric boogaloo (#18362) * Beretta action: Electric boogaloo First part of a three PRs to make a new traitor bundle centered around akimbo pistols. This PR adds the Beretta 92FS to the game, holding 15 9mm rounds per magazine. In addition, the Beretta 92FS is also added to the Summon Guns list for Wizards. :CL: *rsadd: Adds the Beretta 92FS. Kong whiskey not included. * Forgot to add the summon guns change for Berettas. * fuggin pushes destroying MAH CODE * Huh yeah, my copy-pasta skills are getting worse by the day. * Restores PKA charge indicator (#18369) * Restored PKA charge indicator * Updated var name * Player preferences can be edited during server start-up (#18352) * Player preferences can be edited during server start-up * Better safe than sorry * Unit testing (#18329) * Unit testing * Fixes * [ci skip] Automatic changelog update. * Doppelganger tweaks/nerfs (#18353) * Doppelganger tweaks/nerfs * Oof * Oof ! (bis) * [ci skip] Automatic changelog update. * [ci skip] Automatic changelog update. * Unbind the O key in hotkeymode so it can be used for macros (#18395) * Noreact spray bottle (#18367) * Adds the noreact spray bottle. Doesn't react straight away, slightly longer travel time * adds sprite * fixes adminordrazine (#18399) * No-client messages for shades and constructs (#18401) * No-client messages for shades and constructs * No reason to repeat the name * [ci skip] Automatic changelog update. * Fail compilation with an error message if version is <512 (#18403) * Request consoles notify user when their text is invalid (#18408) * Fixed cult armor so it's wearable again (#18410) * [ci skip] Automatic changelog update. * Every day's a good day when you paint (#18351) * Every day's a good day when you paint * Let's paint some happy little trees right here * Windows can now be rotated with alt-click. (#18268) * Windows can now be rotated with alt-click. * Re-adds fullwindow alt-click functionality. * [ci skip] Automatic changelog update. * Flashbangs on your tile ignore protection (#18375) * [ci skip] Automatic changelog update. * Corrects some of the IC dead checks to use the isDead macro (#18377) * Fixed apiary/attackby runtime (#18417) * Fixed bugged revive() regarding restraints (#18428) * [ci skip] Automatic changelog update. * Constructs and shades attackby fixes (#18422) * [ci skip] Automatic changelog update. * adds control datums, so you can control multiple things at once. (#18366) * adds control datums, so you can control multiple things at once. * moves the defines to a _DEFINE file * Fixed revivecounter runtimes (#18421) * Drugs that remove hallucination are 3x as effective while sleeping, 2x as effective while resting (#18398) * [ci skip] Automatic changelog update. * Interesting Crafting (#17540) * Adds material inheritance to created objects, fleshes out material datums a bit * adds description generator and quality generator * converts qualityToString from a proc to a list by index * removes \a macros as they would cause a JS error * adds the mat_type variable to sheets, which holds the material type define that they represent. DO NOT MISUSE, or do, I'm not the law. * instead of multiple different variables holding a sheet type, objects now uses a standardized sheet type variable * removes doubleratchet * tweaks descriptions some more. Things made via dorf stack recipes now inherit the materials sheet type when deconstructed * calling the parent matters now * I was only given the one fixyourshitnigger, I feel ripped off * buffs the cost of dorf recipes * fixes pointed out things * [ci skip] Automatic changelog update. * Adds the grease spell, spell aspect flags (#18373) * Adds the grease spell, summoning forth grease (lube) either from your immediate location, or in an area in proximity to yourself * adds spell aspect flags, for spell congruency. Moves most of the spell defines to their own file, rather than being littered everywhere. * [ci skip] Automatic changelog update. * Updated mob resetVariables() (#18447) * [ci skip] Automatic changelog update. * Fixed uranium chair to diamond transmutation (#18449) * Bee resetVariables() (#18448) * Camera to blinder fixes (#18441) * Camera to blinder fixes * Now with fewer unnecessary bulbs created * Got rid of bulb double negative * Special cam to blinder continuity * Fixed runtime, split decon list into separate vars * [ci skip] Automatic changelog update. * Updated helmet coverage flags (#18412) * [ci skip] Automatic changelog update. * Adds a robot maintenance crate to cargo (#18389) * Adds a robot maintenance crate to cargo * crate * Tweaks because slimes is a crying homo * [ci skip] Automatic changelog update. * Cyborgs cover unlock on death (#18414) * Adds a robot maintenance crate to cargo * Makes cyborg covers unlock on death * Revert "Adds a robot maintenance crate to cargo" This reverts commitbecf044207. * [ci skip] Automatic changelog update. * fixes some of the mobs I added for halloween that just weren't working right. (#18419) * Relish and mustard condiments. (#18420) * [ci skip] Automatic changelog update. * Fixes vanishing cyborg cells (#18425) * Passing var names this time (#18450) * Stray white pixel on sawn-off shotgun in-hand (#18451) * if(x.type in typesof()) -> istype() (#18453) * if(x in typesof()) -> istype() * 100% tested * Fixed preferenecs formatting (#18455) * Moved character records settings under the character-specific prefs (#18454) * Fixed AI-eye runtime (#18456) * [ci skip] Automatic changelog update. * Player-minebot improvements (#18452) * Humanize resets default language (#18464) * [ci skip] Automatic changelog update. * Fixed covering your face and body not preventing examine() from determining your gender (#18466) * Defib burn husks again (#18463) * tick tock goes the clock (#18426) * tick tock goes the clock * removes capitals * [ci skip] Automatic changelog update. * Sokoban vault (#18432) * Sokoban [WIP] * Rewards? * Forgot this one * Hmm did i fuck anything up by this * Adds entrance * Actually I was wrong again lol * That's it for today * Better cheating tracking, LORE * Buff the vest of reflection, exclude it from spessmart * [ci skip] Automatic changelog update. * Fixed gibtonite item not exploding (#18469) * [ci skip] Automatic changelog update. * All code changed here is comedy gold (#18470) * Adds syndie tape for sec, atmos, and engineering. (#18227) * Adds Syndie Tape * I'm dumb as bricks * return standardisation * [ci skip] Automatic changelog update. * Fixed goonchat crash when opening 'save chat logs' (#18477) * Stole some vending machine animations from Bay (#18476) * Stole some vending machine animations from Bay * vend_delay * [ci skip] Automatic changelog update. * Clean up goonchat (#18478) * Fixed health scanner runtime (#18380) * Adds More Shit To Autolathes. (#18328) * Boop * More * Beartraps more expensive. * Axes the axes. Same for the sprays. * Radio messages no longer show the icon of the radio used to send them (#18370) * [ci skip] Automatic changelog update. * [ci skip] Automatic changelog update. * Fixed spells runtime (#17815) * Can now add robotic heads to the body (#18430) * Can now add robotic heads to the body * Can now put organs in those robotic heads * Fixes Molotov logging and bottles breaking (#18481) Actually does NOT fix Molotovs breaking, due to a BYOND bug, but if that bug gets fixed then it will * Staff of Change bolts don't wipe wizard spells (#18461) * Fixed #9955 * Default language isn't carried over from the old mob * Splitting off languages part of this * [ci skip] Automatic changelog update. * collectible kitty ears are back to being permanently black (#18485) * collectible kitty ears are back to being permanently black * indentation was off * Fixed runtime handler configuration runtimes (#18488) * [ci skip] Automatic changelog update. * Adds untable mutagen. (#18212) * [ci skip] Automatic changelog update. * Shift-MMB on things at a distance makes you point at them. (#18487) * alt-click on things at a distance makes you point at them. * Replace mmb swaphands with point, remove altclick point. * Now mmb+shift * [ci skip] Automatic changelog update. * Action Button Runtime Hunt Episode 7: Runtimes die in magma! (#18446) * Action Button Runtime Hunt Episode 6: Runtimes will never die! * Wrong stick * I'M NOT CRAZY * I'M LITERALLY GRASPING AT STRAWS * Removes screwy power (#18493) * Removed screwy power * Non-computer machines must check power too * [ci skip] Automatic changelog update. * Enables ghost pointing (#18489) * Enabled ghost pointing * Visibility sanity for pointed_at() in wolves * [ci skip] Automatic changelog update. * Removed areaMaster (#18459) * reverted the change that made cat ears give brain damage (#18486) * [ci skip] Automatic changelog update. * Reverted the new dizziness (#18498) * [ci skip] Automatic changelog update. * Removes the anti-tamper device from the Tactical Assault Gear crate that can be ordered from Cargo. (#18483) As previous mentioned in this issue, considering that no other cargo crate does this and the fact that Pomf presumably said one time that crates and lockboxes shouldn't be booby-trapped (I don't have a log for that claim, so take it with a grain of salt), I and others believe that cargonians (and other folks) shouldn't have the content of the TACTICOOL ASSAULT GEAR crate get dissolved bya blend of sulphuric acid smoke and capsaicin because they decided to very illegally bust it open for very legitimate reasons. :CL: *tweak: NT decided to cut their budget allocation for anti-tampering device for the Tactical Assault Gear crate, * [ci skip] Automatic changelog update. * Updated HoP preview in character prefs (#18511) * Adds sanity to most cyborg/mommi verbs (#18415) * Adds sanity to most cyborg/mommi verbs * oops * oops 2 * oops 3 * tweaks to make things less hellish * actually, fuck mommis * not needed after all * getting unpowered removes your god dang map * tweaks * returns * reverse stormtrooper gear descriptions (#18516) * lets syndietape fit in belts (#18514) * [ci skip] Automatic changelog update. * Stops testing() abuse (#18504) * Inhaler immulsions (#18520) * Fixed blueprints just not working (#18521) * Fixed blueprints just not working * oops * Moves gun calibers to defines (#18427) * Moves gun calibers to defines * changes shotgun shell and flare defines to 12 guage and flare guage * Update weapons.dm * Give handteles a destination select alt-click, make attackself automa… (#18244) * Give handteles a destination select alt-click, make attackself automatically open a portal to the last destination. * Sanity revisions. * Handtele sanity. * [ci skip] Automatic changelog update. * Fixed a bug that made NT default silicons validhunting shitters (#18467) * Fixed a bug that made NT default silicons validhunting shitters * E V A L U A T E * Re-evaluate * [ci skip] Automatic changelog update. * Fixed rune activation html (#18522) * Removes stupid shit from wonderful wardrobe. (#18501) * Remove stone mask, transmog masks, and holochips from wonderful wardrobe. * Remove time suit and warping claws too. * Fixes a goof in Jewvend's New() (#18528) * Redid blinder fixes (#18482) * allows grenadelauncher on armor suit slot (#18515) * [ci skip] Automatic changelog update. * Make night-vision goggles less green. (#18496) * [ci skip] Automatic changelog update. * :byond: (#18494) * Basic way to eject things from transit tube pods (#18519) * Added ejecting to transit tube pods * List of pod contents when pod is entered, attack_robot(), and no unloading ghosts * So ghosts don't make this print an empty list * Have to declare others as a list * Unload to the front of the pod station * Limit on tube pod unloading * Moved listing of pod occupants to examine() * [ci skip] Automatic changelog update. * adds more guns to summon guns (#18518) * adds more guns to summon guns * stunrevolver * [ci skip] Automatic changelog update. * Adds sanity to fabricator process (#18539) * decoy balloons can now be bopped or popped by simple animals (#18535) * I have to check if a weapon is passed on attackby() because doors are retarded (#18541) * Fixed medbay vending machine turning blue (#18550) * Make resin doors take damage from lasers and bullets. (#18553) * Make resin doors take damage from lasers and bullets. * Remove a return. * [ci skip] Automatic changelog update. * Adds an in-hand sprite for Salem (#18545) *Adds a in-hand sprite for Salem *Fixes Salem turning into Runtime when picked up * [ci skip] Automatic changelog update. * literally replaces R&D with Tetris and clearing a line gives you a random research point (#18555) * [ci skip] Automatic changelog update. * Revert "literally replaces R&D with Tetris and clearing a line gives you a random research point" (#18558) * Revert "[ci skip] Automatic changelog update." This reverts commitbf396be340. * Revert "literally replaces R&D with Tetris and clearing a line gives you a random research point (#18555)" This reverts commit91cb6d94e4. * Added bees to unsafe mobs (#18562) * Make buckshot spread independent of the distance you click at. (#18543) * Current progress * Make buckshot spread independent of where you click on the screen. * [ci skip] Automatic changelog update. * Asthma can't be a roundstart random mutation anymore (#18568) * Lazily fixes mommi holomaps fucking up (#18564) * Make dark gygax overload stop making it invisible (#18567) * [ci skip] Automatic changelog update. * Show silicon ckeys at roundend even if they ghost. (#18534) * Show silicon ckeys at roundend even if they ghost. * Move get_key to unsorted.dm * Remove a blank line * [ci skip] Automatic changelog update. * punk's not quite dead, but a little rare (#18433) * punk is dead * punks almost dead * Can now create vampires through the create antagonists button (#18538) * winter spellbook (#18536) * [ci skip] Automatic changelog update. * Fixes an illegal area in the hallway (#18577) * Added 'Does Not Tip' backdoor traitor item (#18523) * Added 'Does Not Tip' backdoor traitor item * Actually implement the thing * meh * unga bunga * derp derp * [ci skip] Automatic changelog update. * Added a progress bar to the benomorph evolve spell (#18582) * Fixed species-specific spells removal (#18585) * In-hands for training swords (#18581) * [ci skip] Automatic changelog update. * Make malf law not state html to chat, make all law zeroes appear red. (#18570) * Adds thumbs.db to .gitignore (#18597) * Adds .code-workspace to .gitignore (#18598) * Fixed defib in-hands (#18586) * [ci skip] Automatic changelog update. * while hallucinating, chance your coworkers may look like a hostile mob (#18423) * while hallucinating, chance your coworkers may look like a hostile mob * hallucination and adminwarns * gotta initialize * can now fit a pai to a minebot (#18434) * [ci skip] Automatic changelog update. * Balances the masks of transmogriphication (#18205) * Masks take 5 seconds to put on Can no longer become boss mobs through the blank mask. * formatting preferences, and more to the blacklist * No more becoming hitler through mask use * [ci skip] Automatic changelog update. * Can now repair spacepods (#18540) * [ci skip] Automatic changelog update. * Buckshot tweaks. (#18571) * Current progress * Make buckshot spread independent of where you click on the screen. * Remove unused function, tweak bulletstorm * Fix various syntactic problems (#18604) * Horror form fixes, part 1 (#18584) * Horror form fixes, part 1 * Fixed horror form costing 0 chems * [ci skip] Automatic changelog update. * Beekeeping 3.6 (#18592) * Beekeeping 3.6 * qsdqsd * qdqsdq * grammar * [ci skip] Automatic changelog update. * Turns out you can't preallocate associative lists (#18606) * Turns out you can't preallocate associative lists * consistency * Friendly Fire 2: NT Boogaloo (#18607) With the advent of security getting an RPG in their armory's secure locker, NT isn't free from the joys of friendly fire and collateral damage. Please don't bully. * [ci skip] Automatic changelog update. * remove_air() (#18593) * Friendly Fire 3: NT with a vengeance. (#18615) * Revert "remove_air() (#18593)" This reverts commit18167fff6b. * Revert "[ci skip] Automatic changelog update." This reverts commit2983acce13. * Revert "Friendly Fire 2: NT Boogaloo (#18607)" This reverts commit0507bed40e. * [ci skip] Automatic changelog update. * Stops testing() abuse ACT2 (#18549) * Stops testing() abuse ACT2 * Easy weird trick. * Robots can lift tape (#18605) * Robots can lift tape * Whoops, forgot how MoMMIs work. MoMMIs are now unaffected. * [ci skip] Automatic changelog update. * Weighted voting with a threshold (#18560) * Weighted voting with a threshold * Reset discarded_choices * Atmos analyzers get air from the user's location instead of the turf (#18611) * Atmos analyzers get air from the user's location instead of the turf * Check to see if we need a unit volume * Fixed null environment runtimes * [ci skip] Automatic changelog update. * Makes the disability unit test pass (#18618) * Fixed 2 warnings caused by #18549 (#18616) * Unit test for disability datums (#18617) * Fixed atmos analyzer temperature range (#18620) * [ci skip] Automatic changelog update. * Fixed runtime in syndie atmos tape, plus message fixes (#18608) * Ethnic cleansing (#18619) * Remove duplicate defs; rename one def; fix some stray typos (#18599) * Remove duplicate defs * Fix more typos, re-add ED209 defs * Move damage defines to the same spot * okay actually re-add ED209 defs * Fix damage layer runtime (#18626) * Gripper transparent examining (#18629) * [ci skip] Automatic changelog update. * doors made less insane (#18542) * why why * whoops, broke doors. Thanks for catching that. * good catches all round * A scream was heard across the land. The coder had found the forbidden spaghetti. * It echoed across the rooftops, through the forest, and across the sea. * It went unheeded, as they were not the only one to be screaming. * Gripper two-mode dropping (#18627) * [ci skip] Automatic changelog update. * adds anvils (#18600) * adds anvils * Takes a lot of airflow to move an anvil. * let's not go the casual way about this. * [ci skip] Automatic changelog update. * Beekeeping 3.6.1 (#18621) * more beekeeping * sqdqs * better * Ports colorful reagent from TG. (#18492) * Adds colorful reagent. Mescaline psilocybin amatoxin. * Not implementing that shit yet. * Make bleach remove weird colours from items, turfs, mobs. * Remove tab. * [ci skip] Automatic changelog update. * fixing some dumb runtime (#18632) * Fixed runtime in gripper drop_item() (#18635) * Fixed MoMMIs not being able to pick up their modules (#18636) * [ci skip] Automatic changelog update. * Fixes a good in human overlay code (#18631) * Made EMPs instant(?) (#18602) * fixes confusion with the pizza traitor thing (#18655) * Changes the Albuteol (athsma medication) recipe. (#18588) * Adds Magmaws (#18630) * Adds the magmaw. They like to eat plasma. * adds the magmaw to the roid. Makes them not burn themselves apart. They now resurrect if blasted by fire. * mobs of the roid, destroy these invaders! * [ci skip] Automatic changelog update. * Timestamp med and sec records with the in-game time (#18658) * [ci skip] Automatic changelog update. * Albuterol is made with HYPERZONE, not INAPROVALINE (#18661) In other news, everybody followed Shifty's blindness and didn't notice that he swapped the Albuterol recipe to use Inaprovaline instead of Hyperzine. * [ci skip] Automatic changelog update. * Records give seconds again (#18660) * Door fixes (#18669) removes redundant is allowed check on windoors, that would prevent you emagging them unless you already had access to them. Tweaks the allowed check on blast doors, so you can't open them by hand, and bots can't bump them open. * magmaw fixes (#18670) * magmaw fixes magmaw now revive when set on fire through plasmafire magmaw death animation now plays properly. * adds the fire_resurrect proc * RIGGEDsky (#18663) * [ci skip] Automatic changelog update. * General Security-related mapping improvements. (#18594) * Changes the Albuteol (athsma medication) recipe. * General Security-related mapping improvements. * Fix compile, half-fix smartglass * Reeeee English - 1 * Reeee English - 2 * Reee English - 3 * [ci skip] Automatic changelog update. * Fixed robot clown stamp (#18675) * [ci skip] Automatic changelog update. * its (#18694) * Office chairs for chemistry (#18624) * Office chairs for chemistry * fugging dreammaker * fugging dreammaker * fugging dreammaker * Added separate attack verbs for lit and unlit states in matches, lighters, and cigarettes to fix issue #18572 (#18666) * Fixed issue 18572 by adding seperate attack verbs for lit and unlit states in cigarretes, lighters, and matches. * Made the variable declarations more consistent. * Quantity selection for making changelings and vampires (#18673) * [ci skip] Automatic changelog update. * Can now attack pods (#18689) Can now attack pods Adds an obj-level on_attack proc, for when you hit a thing with an object. Holds the attack_delay adjustment for the user, the attack animation, the hitsound, and the material on_hit. * Flashbang tweaks. (#18513) * Flashbang tweaks. * Lower the stun cap from 4 to 2, makes it more progressive. * Dumbass * [ci skip] Automatic changelog update. * glock mag fix (#18703) * [ci skip] Automatic changelog update. * Fixed backwards borg holomap sanity (#18707) * [ci skip] Automatic changelog update. * Fixes
507 lines
18 KiB
Plaintext
507 lines
18 KiB
Plaintext
////////////
|
|
//SECURITY//
|
|
////////////
|
|
#define TOPIC_SPAM_DELAY 2 //2 ticks is about 2/10ths of a second; it was 4 ticks, but that caused too many clicks to be lost due to lag
|
|
#define UPLOAD_LIMIT 10485760 //Restricts client uploads to the server to 10MB //Boosted this thing. What's the worst that can happen?
|
|
#define MIN_CLIENT_VERSION 510 //Just an ambiguously low version for now, I don't want to suddenly stop people playing.
|
|
//I would just like the code ready should it ever need to be used.
|
|
/*
|
|
When somebody clicks a link in game, this Topic is called first.
|
|
It does the stuff in this proc and then is redirected to the Topic() proc for the src=[0xWhatever]
|
|
(if specified in the link). ie locate(hsrc).Topic()
|
|
|
|
Such links can be spoofed.
|
|
|
|
Because of this certain things MUST be considered whenever adding a Topic() for something:
|
|
- Can it be fed harmful values which could cause runtimes?
|
|
- Is the Topic call an admin-only thing?
|
|
- If so, does it have checks to see if the person who called it (usr.client) is an admin?
|
|
- Are the processes being called by Topic() particularly laggy?
|
|
- If so, is there any protection against somebody spam-clicking a link?
|
|
If you have any questions about this stuff feel free to ask. ~Carn
|
|
*/
|
|
/client
|
|
var/account_joined = ""
|
|
var/account_age
|
|
|
|
/client/Topic(href, href_list, hsrc)
|
|
//var/timestart = world.timeofday
|
|
//testing("topic call for [usr] [href]")
|
|
if(!usr || usr != mob) //stops us calling Topic for somebody else's client. Also helps prevent usr=null
|
|
return
|
|
|
|
//Reduces spamming of links by dropping calls that happen during the delay period
|
|
// if(next_allowed_topic_time > world.time)
|
|
// return
|
|
//next_allowed_topic_time = world.time + TOPIC_SPAM_DELAY
|
|
|
|
//search the href for script injection
|
|
if( findtext(href,"<script",1,0) )
|
|
world.log << "Attempted use of scripts within a topic call, by [src]"
|
|
message_admins("Attempted use of scripts within a topic call, by [src]")
|
|
//del(usr)
|
|
return
|
|
|
|
//Admin PM
|
|
if(href_list["priv_msg"])
|
|
var/client/C = locate(href_list["priv_msg"])
|
|
if(ismob(C)) //Old stuff can feed-in mobs instead of clients
|
|
var/mob/M = C
|
|
C = M.client
|
|
cmd_admin_pm(C,null)
|
|
return
|
|
|
|
//Wiki shortcuts
|
|
if(href_list["getwiki"])
|
|
var/url = href_list["getwiki"]
|
|
usr << link(getVGWiki(url))
|
|
return
|
|
|
|
// Global Asset cache stuff.
|
|
if(href_list["asset_cache_confirm_arrival"])
|
|
// to_chat(src, "ASSET JOB [href_list["asset_cache_confirm_arrival"]] ARRIVED.")
|
|
var/job = text2num(href_list["asset_cache_confirm_arrival"])
|
|
completed_asset_jobs += job
|
|
return
|
|
|
|
if(href_list["_src_"] == "chat") // Oh god the ping hrefs.
|
|
return chatOutput.Topic(href, href_list)
|
|
|
|
//Logs all hrefs
|
|
if(config && config.log_hrefs && investigations[I_HREFS])
|
|
var/datum/log_controller/I = investigations[I_HREFS]
|
|
I.write("<small>[time_stamp()] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][copytext(sanitize(href), 1, 3000)]<br />")
|
|
|
|
switch(href_list["_src_"])
|
|
if("holder")
|
|
hsrc = holder
|
|
if("usr")
|
|
hsrc = mob
|
|
if("prefs")
|
|
return prefs.process_link(usr,href_list)
|
|
if("vars")
|
|
return view_var_Topic(href,href_list,hsrc)
|
|
|
|
switch(href_list["action"])
|
|
if ("openLink")
|
|
src << link(href_list["link"])
|
|
|
|
..() //redirect to hsrc.Topic()
|
|
//testing("[usr] topic call took [(world.timeofday - timestart)/10] seconds")
|
|
|
|
/client/proc/handle_spam_prevention(var/message, var/mute_type)
|
|
if(config.automute_on && !holder && src.last_message == message)
|
|
src.last_message_count++
|
|
if(src.last_message_count >= SPAM_TRIGGER_AUTOMUTE)
|
|
to_chat(src, "<span class='warning'>You have exceeded the spam filter limit for identical messages. An auto-mute was applied.</span>")
|
|
cmd_admin_mute(src.mob, mute_type, 1)
|
|
return 1
|
|
if(src.last_message_count >= SPAM_TRIGGER_WARNING)
|
|
to_chat(src, "<span class='warning'>You are nearing the spam filter limit for identical messages.</span>")
|
|
return 0
|
|
else
|
|
last_message = message
|
|
src.last_message_count = 0
|
|
return 0
|
|
|
|
//This stops files larger than UPLOAD_LIMIT being sent from client to server via input(), client.Import() etc.
|
|
/client/AllowUpload(filename, filelength)
|
|
if(filelength > UPLOAD_LIMIT)
|
|
to_chat(src, "<font color='red'>Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT/1024]KiB.</font>")
|
|
return 0
|
|
/* //Don't need this at the moment. But it's here if it's needed later.
|
|
//Helps prevent multiple files being uploaded at once. Or right after eachother.
|
|
var/time_to_wait = fileaccess_timer - world.time
|
|
if(time_to_wait > 0)
|
|
to_chat(src, "<font color='red'>Error: AllowUpload(): Spam prevention. Please wait [round(time_to_wait/10)] seconds.</font>")
|
|
return 0
|
|
fileaccess_timer = world.time + FTPDELAY */
|
|
return 1
|
|
|
|
|
|
///////////
|
|
//CONNECT//
|
|
///////////
|
|
/client/New(TopicData)
|
|
// world.log << "creating chatOutput"
|
|
chatOutput = new /datum/chatOutput(src) // Right off the bat.
|
|
// world.log << "Done creating chatOutput"
|
|
if(config)
|
|
winset(src, null, "window1.msay_output.style=[config.world_style_config];")
|
|
else
|
|
to_chat(src, "<span class='warning'>The stylesheet wasn't properly setup call an administrator to reload the stylesheet or relog.</span>")
|
|
|
|
TopicData = null //Prevent calls to client.Topic from connect
|
|
|
|
//Admin Authorisation
|
|
holder = admin_datums[ckey]
|
|
if(holder)
|
|
admins += src
|
|
holder.owner = src
|
|
|
|
var/static/list/localhost_addresses = list("127.0.0.1","::1")
|
|
if(config.localhost_autoadmin)
|
|
if((!address && !world.port) || (address in localhost_addresses))
|
|
var/datum/admins/D = new /datum/admins("Host", R_HOST, src.ckey)
|
|
D.associate(src)
|
|
|
|
if(connection != "seeker") //Invalid connection type.
|
|
if(connection == "web")
|
|
if(!holder)
|
|
return null
|
|
else
|
|
return null
|
|
|
|
if(byond_version < MIN_CLIENT_VERSION) //Out of date client.
|
|
message_admins("[key]/[ckey] has connected with an out of date client! Their version: [byond_version]. They will be kicked shortly.")
|
|
alert(src,"Your BYOND client is out of date. Please make sure you have have at least version [world.byond_version] installed. Check for a beta update if necessary.", "Update Yo'Self", "OK")
|
|
spawn(5 SECONDS)
|
|
del(src)
|
|
|
|
if(!guests_allowed && IsGuestKey(key))
|
|
alert(src,"This server doesn't allow guest accounts to play. Please go to http://www.byond.com/ and register for a key.","Guest","OK")
|
|
del(src)
|
|
return
|
|
|
|
// Change the way they should download resources.
|
|
if(config.resource_urls)
|
|
src.preload_rsc = pick(config.resource_urls)
|
|
else
|
|
src.preload_rsc = 1 // If config.resource_urls is not set, preload like normal.
|
|
|
|
to_chat(src, "<span class='warning'>If the title screen is black, resources are still downloading. Please be patient until the title screen appears.</span>")
|
|
|
|
clients += src
|
|
directory[ckey] = src
|
|
|
|
|
|
//preferences datum - also holds some persistant data for the client (because we may as well keep these datums to a minimum)
|
|
prefs = preferences_datums[ckey]
|
|
if(!prefs)
|
|
prefs = new /datum/preferences(src)
|
|
preferences_datums[ckey] = prefs
|
|
prefs.last_ip = address //these are gonna be used for banning
|
|
prefs.last_id = computer_id //these are gonna be used for banning
|
|
prefs.client = src
|
|
prefs.initialize_preferences(client_login = 1)
|
|
|
|
. = ..() //calls mob.Login()
|
|
chatOutput.start()
|
|
|
|
if(custom_event_msg && custom_event_msg != "")
|
|
to_chat(src, "<h1 class='alert'>Custom Event</h1>")
|
|
to_chat(src, "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>")
|
|
to_chat(src, "<span class='alert'>[html_encode(custom_event_msg)]</span>")
|
|
to_chat(src, "<br>")
|
|
|
|
if( (world.address == address || !address) && !host )
|
|
host = key
|
|
world.update_status()
|
|
|
|
if(holder)
|
|
add_admin_verbs()
|
|
admin_memo_show()
|
|
holder.add_menu_items()
|
|
|
|
log_client_to_db()
|
|
|
|
send_resources()
|
|
|
|
if(prefs.lastchangelog != changelog_hash) //bolds the changelog button on the interface so we know there are updates.
|
|
winset(src, "rpane.changelog", "background-color=#eaeaea;font-style=bold")
|
|
prefs.SetChangelog(ckey,changelog_hash)
|
|
to_chat(src, "<span class='info'>Changelog has changed since your last visit.</span>")
|
|
|
|
//Set map label to correct map name
|
|
winset(src, "rpane.map", "text=\"[map.nameLong]\"")
|
|
|
|
// Notify scanners.
|
|
INVOKE_EVENT(on_login,list(
|
|
"client"=src,
|
|
"admin"=(holder!=null)
|
|
))
|
|
|
|
if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them.
|
|
to_chat(src, "<span class='warning'>Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.</span>")
|
|
//This is down here because of the browse() calls in tooltip/New()
|
|
if(!tooltips)
|
|
tooltips = new /datum/tooltip(src)
|
|
|
|
//////////////
|
|
//DISCONNECT//
|
|
//////////////
|
|
/client/Del()
|
|
if(holder)
|
|
holder.owner = null
|
|
admins -= src
|
|
directory -= ckey
|
|
clients -= src
|
|
|
|
return ..()
|
|
|
|
/client/proc/log_client_to_db()
|
|
if(IsGuestKey(key))
|
|
return
|
|
|
|
establish_db_connection()
|
|
|
|
if(!dbcon.IsConnected())
|
|
return
|
|
var/list/http[] = world.Export("http://www.byond.com/members/[src.key]?format=text") // Retrieve information from BYOND
|
|
var/Joined = 2550-01-01
|
|
if(http && http.len && ("CONTENT" in http))
|
|
var/String = file2text(http["CONTENT"]) // Convert the HTML file to text
|
|
var/JoinPos = findtext(String, "joined")+10 // Parse for the joined date
|
|
Joined = copytext(String, JoinPos, JoinPos+10) // Get the date in the YYYY-MM-DD format
|
|
|
|
account_joined = Joined
|
|
|
|
var/sql_ckey = sanitizeSQL(ckey)
|
|
var/age
|
|
testing("sql_ckey = [sql_ckey]")
|
|
var/DBQuery/query = dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age, datediff(Now(),accountjoined) as age2 FROM erro_player WHERE ckey = '[sql_ckey]'")
|
|
query.Execute()
|
|
var/sql_id = 0
|
|
while(query.NextRow())
|
|
sql_id = query.item[1]
|
|
player_age = text2num(query.item[2])
|
|
age = text2num(query.item[3])
|
|
break
|
|
|
|
var/sql_address = sanitizeSQL(address)
|
|
|
|
var/DBQuery/query_ip = dbcon.NewQuery("SELECT distinct ckey FROM erro_connection_log WHERE ip = '[sql_address]'")
|
|
query_ip.Execute()
|
|
related_accounts_ip = ""
|
|
while(query_ip.NextRow())
|
|
related_accounts_ip += "[query_ip.item[1]], "
|
|
|
|
|
|
var/sql_computerid = sanitizeSQL(computer_id)
|
|
|
|
var/DBQuery/query_cid = dbcon.NewQuery("SELECT distinct ckey FROM erro_connection_log WHERE computerid = '[sql_computerid]'")
|
|
query_cid.Execute()
|
|
related_accounts_cid = ""
|
|
while(query_cid.NextRow())
|
|
related_accounts_cid += "[query_cid.item[1]], "
|
|
|
|
//Just the standard check to see if it's actually a number
|
|
if(sql_id)
|
|
if(istext(sql_id))
|
|
sql_id = text2num(sql_id)
|
|
if(!isnum(sql_id))
|
|
return
|
|
|
|
var/admin_rank = "Player"
|
|
|
|
if(istype(holder))
|
|
admin_rank = holder.rank
|
|
|
|
var/sql_admin_rank = sanitizeSQL(admin_rank)
|
|
|
|
if(sql_id)
|
|
//Player already identified previously, we need to just update the 'lastseen', 'ip' and 'computer_id' variables
|
|
var/DBQuery/query_update
|
|
if(isnum(age))
|
|
query_update = dbcon.NewQuery("UPDATE erro_player SET lastseen = Now(), ip = '[sql_address]', computerid = '[sql_computerid]', lastadminrank = '[sql_admin_rank]' WHERE id = [sql_id]")
|
|
else
|
|
query_update = dbcon.NewQuery("UPDATE erro_player SET lastseen = Now(), ip = '[sql_address]', computerid = '[sql_computerid]', lastadminrank = '[sql_admin_rank]', accountjoined = '[Joined]' WHERE id = [sql_id]")
|
|
query_update.Execute()
|
|
if(query_update.ErrorMsg())
|
|
WARNING("FINGERPRINT: [query_update.ErrorMsg()]")
|
|
|
|
else
|
|
//New player!! Need to insert all the stuff
|
|
var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_player (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank, accountjoined) VALUES (null, '[sql_ckey]', Now(), Now(), '[sql_address]', '[sql_computerid]', '[sql_admin_rank]', '[Joined]')")
|
|
query_insert.Execute()
|
|
if(query_insert.ErrorMsg())
|
|
WARNING("FINGERPRINT: [query_insert.ErrorMsg()]")
|
|
|
|
if(!isnum(age))
|
|
var/DBQuery/query_age = dbcon.NewQuery("SELECT datediff(Now(),accountjoined) as age2 FROM erro_player WHERE ckey = '[sql_ckey]'")
|
|
query_age.Execute()
|
|
while(query_age.NextRow())
|
|
age = text2num(query_age.item[1])
|
|
if(!isnum(player_age))
|
|
player_age = 0
|
|
if(age < 14)
|
|
message_admins("[ckey(key)]/([src]) is a relatively new player, may consider watching them. AGE = [age] First seen = [player_age]")
|
|
log_admin(("[ckey(key)]/([src]) is a relatively new player, may consider watching them. AGE = [age] First seen = [player_age]"))
|
|
testing("[src]/[ckey(key)] logged in with age of [age]/[player_age]/[Joined]")
|
|
account_age = age
|
|
|
|
// logging player access
|
|
var/server_address_port = "[world.internet_address]:[world.port]"
|
|
var/sql_server_address_port = sanitizeSQL(server_address_port)
|
|
var/DBQuery/query_connection_log = dbcon.NewQuery("INSERT INTO `erro_connection_log`(`id`,`datetime`,`serverip`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),'[sql_server_address_port]','[sql_ckey]','[sql_address]','[sql_computerid]');")
|
|
|
|
query_connection_log.Execute()
|
|
if(query_connection_log.ErrorMsg())
|
|
WARNING("FINGERPRINT: [query_connection_log.ErrorMsg()]")
|
|
|
|
#undef TOPIC_SPAM_DELAY
|
|
#undef UPLOAD_LIMIT
|
|
#undef MIN_CLIENT_VERSION
|
|
|
|
//checks if a client is afk
|
|
//3000 frames = 5 minutes
|
|
/client/proc/is_afk(duration=3000)
|
|
if(inactivity > duration)
|
|
return inactivity
|
|
return 0
|
|
|
|
/client/verb/resend_resources()
|
|
set name = "Resend Resources"
|
|
set desc = "Re-send resources for NanoUI. May help those with NanoUI issues."
|
|
set category = "OOC"
|
|
|
|
to_chat(usr, "<span class='notice'>Re-sending NanoUI resources. This may result in lag.</span>")
|
|
nanomanager.send_resources(src)
|
|
send_html_resources()
|
|
|
|
//send resources to the client. It's here in its own proc so we can move it around easiliy if need be
|
|
/client/proc/send_resources()
|
|
// preload_vox() //Causes long delays with initial start window and subsequent windows when first logged in.
|
|
|
|
getFiles(
|
|
'html/search.js',
|
|
'html/panels.css',
|
|
)
|
|
|
|
// Preload the crew monitor. This needs to be done due to BYOND bug http://www.byond.com/forum/?post=1487244
|
|
//The above bug report thing doesn't exist anymore so uh, whatever.
|
|
spawn
|
|
send_html_resources()
|
|
|
|
// Send NanoUI resources to this client
|
|
spawn nanomanager.send_resources(src)
|
|
|
|
|
|
/client/proc/send_html_resources()
|
|
if(crewmonitor && minimapinit)
|
|
crewmonitor.sendResources(src)
|
|
if(adv_camera && minimapinit)
|
|
adv_camera.sendResources(src)
|
|
while(!vote || !vote.interface)
|
|
sleep(1)
|
|
vote.interface.sendAssets(src)
|
|
|
|
/proc/get_role_desire_str(var/rolepref)
|
|
switch(rolepref & ROLEPREF_VALMASK)
|
|
if(ROLEPREF_NEVER)
|
|
return "Never"
|
|
if(ROLEPREF_NO)
|
|
return "No"
|
|
if(ROLEPREF_YES)
|
|
return "Yes"
|
|
if(ROLEPREF_ALWAYS)
|
|
return "Always"
|
|
return "???"
|
|
|
|
/client/proc/desires_role(var/role_id, var/display_to_user=0)
|
|
var/role_desired = prefs.roles[role_id]
|
|
if(display_to_user && !(role_desired & ROLEPREF_PERSIST))
|
|
if(!(role_desired & ROLEPREF_POLLED))
|
|
spawn
|
|
var/question={"[role_id]
|
|
|
|
Yes/No: Only affects this round
|
|
Never/Always: Affects future rounds, you will not be polled again.
|
|
|
|
NOTE: You will only be polled about this role once per round. To change your choice, use Preferences > Setup Special Roles. The change will take place AFTER this recruiting period."}
|
|
var/answer = alert(src,question,"Role Recruitment", "Yes","No","Never")
|
|
switch(answer)
|
|
if("Never")
|
|
prefs.roles[role_id] = ROLEPREF_NEVER
|
|
if("No")
|
|
prefs.roles[role_id] = ROLEPREF_NO
|
|
if("Yes")
|
|
prefs.roles[role_id] = ROLEPREF_YES
|
|
//if("Always")
|
|
// prefs.roles[role_id] = ROLEPREF_ALWAYS
|
|
//testing("Client [src] answered [answer] to [role_id] poll.")
|
|
prefs.roles[role_id] |= ROLEPREF_POLLED
|
|
else
|
|
to_chat(src, "<span style='recruit'>The game is currently looking for [role_id] candidates. Your current answer is <a href='?src=\ref[prefs]&preference=set_role&role_id=[role_id]'>[get_role_desire_str(role_desired)]</a>.</span>")
|
|
return role_desired & ROLEPREF_ENABLE
|
|
|
|
/client/proc/colour_transition(var/list/colour_to = default_colour_matrix,var/time = 10) // call this with no parametres to reset to default.
|
|
if(!color)
|
|
color = default_colour_matrix
|
|
if(!(colour_to.len))
|
|
colour_to = default_colour_matrix
|
|
animate(src, color=colour_to, time=time, easing=SINE_EASING)
|
|
|
|
/client/proc/changeView(var/newView)
|
|
if(!newView)
|
|
view = world.view
|
|
else
|
|
view = newView
|
|
|
|
if(mob && ishuman(mob))
|
|
var/mob/living/carbon/human/H = mob
|
|
var/obj/item/clothing/under/U = H.get_item_by_slot(slot_w_uniform)
|
|
if(istype(U))
|
|
for(var/obj/item/clothing/accessory/holomap_chip/HC in U.accessories)
|
|
HC.update_holomap()
|
|
|
|
/client/verb/SwapSides()
|
|
set name = "swapsides"
|
|
set hidden = 1
|
|
var/newsplit = 100 - text2num(winget(usr, "mainwindow.mainvsplit", "splitter"))
|
|
if(winget(usr, "mainwindow.mainvsplit", "right") == "rpane")
|
|
winset(usr, "mainwindow.mainvsplit", "right=mapwindow;left=rpane;splitter=[newsplit]")
|
|
else
|
|
winset(usr, "mainwindow.mainvsplit", "right=rpane;left=mapwindow;splitter=[newsplit]")
|
|
|
|
/client/proc/update_special_views()
|
|
if(prefs.space_parallax) //Updating parallax for clients that have parallax turned on.
|
|
if(parallax_initialized)
|
|
mob.hud_used.update_parallax_values()
|
|
|
|
if(!istype(mob, /mob/dead/observer)) //If they are neither an observer nor someone with X-ray vision
|
|
for(var/obj/structure/window/W in one_way_windows)
|
|
if(((W.x >= (mob.x - view)) && (W.x <= (mob.x + view))) && ((W.y >= (mob.y - view)) && (W.y <= (mob.y + view))))
|
|
update_one_way_windows(view(view,mob)) //Updating the one-way window overlay if the client has one in the range of its view.
|
|
break
|
|
|
|
/client/proc/update_one_way_windows(var/list/v) //Needed for one-way windows to work.
|
|
var/Image //Code heavily cannibalized from a demo made by Byond member Shadowdarke.
|
|
var/turf/Oneway
|
|
var/obj/structure/window/W
|
|
var/list/newimages = list()
|
|
var/list/onewaylist = list()
|
|
|
|
if(!v)
|
|
return
|
|
|
|
ObscuredTurfs.len = 0
|
|
|
|
for(W in view(view,mob))
|
|
if(W.one_way)
|
|
if(W.dir & get_dir(W,mob))
|
|
Oneway = get_turf(W)
|
|
Oneway.opacity = 1
|
|
onewaylist += Oneway
|
|
|
|
if(onewaylist.len)
|
|
var/list/List = v - view(view,mob)
|
|
List += onewaylist
|
|
for(var/turf/T in List)
|
|
T.viewblock = image('icons/turf/overlays.dmi',T,"black_box",10)
|
|
if(T in onewaylist)
|
|
for(W in T.contents)
|
|
if(W.one_way)
|
|
T.viewblock = image('icons/turf/overlays.dmi',T,"black_box[W.dir]",10)
|
|
T.viewblock.plane = FULLSCREEN_PLANE
|
|
src << T.viewblock
|
|
newimages += T.viewblock
|
|
ObscuredTurfs += T
|
|
|
|
for(var/turf/I in onewaylist)
|
|
I.opacity = 0
|
|
|
|
for(Image in ViewFilter-newimages)
|
|
images -= Image
|
|
ViewFilter = newimages
|