Synapse
Search…
API

Overview

This page contains information on almost all API-Features of Synapse. You can use the page-navigation on the right to get a better overview.

SynapseController

The SynapseController is the main object which contains the entire Synapse API.
It contains 3 static objects:

Server

namespace: Synapse

This object contains the API to interact with many features of SCP:Secret Laboratory.
You can get it with SynapseController.Server or with Server.Get. (The refrence is the same, it's just a shortcut)
Fields:
  • Logger
  • Map
  • Prefabs
  • Files
  • Events
  • Configs
  • Host => The player object of the Server
  • Port => The port the server is running on
  • Name => The ServerName
  • Slots => The amount of player that can join the Server
  • FF => Is FriendlyFire enabled?
  • Colors => All allowed colors for Player badge colors
  • Players => Gives you a list of all Players on the Server
  • ServerConsole => Gives you the ServerConsole Object (Vanilla objects. Not recommended to use)
  • GameConsole => Gives you the GameConsole Object (Vanilla objects. Not recommended to use)
Methods:
  • Reload() => Reloads all Synapse configs and translations
  • OfflineBanID() => Bans the ID of a User even when he is not on the Server
  • OfflineBanIP() => Bans the IP of a User even when he is not on the Server
  • GetObjectsOf<TObject>() => Gives you all Unity objects of that type
  • GetObjectOf<TObject>() => Gives you the first object of that type the Server can find
  • GetPlayers(Func<Player,bool>) => Gives you a list of Players with special arguments (Example: GetPlayers(x => x.NickName == "Dimenzio") => Gives you all players whose name is Dimenzio)
  • GetPlayer(string) => Gives you a Player with that UserId / PlayerId / Nickname
  • GetPlayer(int playerid) => Gives you a Player with that PlayerId

Logger

namespace: Synapse.Api

This object contains methods to send messages in the ServerConsole
You can get it with SynapseController.Server.Logger or with Logger.Get (The refrence is the same, it's just a shortcut)
  • Info(object) => Sends a LogInfo to the Console
  • Warn(object) => Sends an LogWarn to the Console
  • Error(object) => Sends an LogError to the Console
  • Send(string, ConsoleColor) => Sends a message with a defined color to the Console (Plugin name will not be added).

Map

namespace: Synapse.Api

You can get it with SynapseController.Server.Map or Map.Get (The refrence is the same, it's just a shortcut)
This Object contains the fields:
  • Nuke
  • Round
  • Scp914
  • Teslas => A List of all Tesla objects on the Server
  • Elevators => A List of all Elevator objects on the Server
  • Doors => A List of all Door objects on the Server
  • Rooms => A List of all Room objects on the Server
  • Generators => A List of all Generator objects on the Server
  • WorkStations => A List of all WorkStation objects on the Server
  • Ragdolls => A List of all Ragdoll objects on the Server
  • Items => A List of all SynapseItem objects on the Server.
  • Dummies => A list of all Dummy objects on the Server
  • IntercomText => The text which will be displayed in the intercom
  • RespawnPoint => The Position where all Roles should spawn
  • WalkSpeed => The WalkSpeed of Humans
  • SprintSpeed => The SprintSpeed of Humans
  • Seed => The current Map Seed
This Methods contains it:
  • GetRoom() => Gives you a specific room
  • GetDoor()=> Gives you a specific door
  • GetElevator() => Gives you a specific Elevator
  • SendBroadcast() => Sends to all Players a Broadcast
  • AnnounceScpDeath() => Announces the Death of an scp
  • Cassie()=> Sends an Cassie Message
  • GlitchedCassie() => Sends an glitchy Cassie message
  • SpawnGrenade() => Spawns a Grenade
  • Explode() => Spawns and explode a Grenade
  • PlaceBlood() => Places blood for all Players

Nuke

namespace: Synapse.Api

You can get it with SynapseController.Server.Map.Nuke or Map.Get.Nuke (The refrence is the same, it's just a shortcut)
This fields contains it:
  • CountdownTime => The Current Countdown of the Warhead
  • NukeKills => Amount of Players killed by the Nuke
  • Active => If the Nuke is currently active
  • Detonated => If the Nuke is already detonated
  • CanDetonate => If the Nuke can still detonate
The methods it contains:
  • StartDetonation() => Stars the Detonation
  • CancelDetonation() => Cancel the Detonation
  • Detonate() => Detonated the Warhead
  • InstantPrepare() => Prepares the Nuke to detonate instant
  • Shake() => Shakes the screen of all Players

NukeInsidePanel

namespace: Synapse.Api(.Nuke)

You can get it with SynapseController.Server.Map.Nuke.InsidePanel or Map.Get.Nuke.InsidePanel (The refrence is the same, it's just a shortcut)
This Object represents the AlphaWarheadPanel inside the Facility.
The fields it contains:
  • Enabled => The state of the activation of the panel
  • LeverStatus => The current status of the lever
  • Locked => If set to true the lever status cant be set
  • Lever => the transform of the Lever

NukeOutsidePanel

namespace: Synapse.Api(.Nuke)

You can get it with SynapseController.Server.Map.Nuke.OutsidePanel or Map.Get.Nuke.OutsidePanel (The refrence is the same, it's just a shortcut)
This Object represents the AlphaWarheadPanel outside the Facility.
The fields it contains:
  • KeyCardEntered => If a Keycard is already entered and the Nuke can be activated

Round

namespace: Synapse.Api

You can get it with SynapseController.Server.Map.Round or Map.Get.Round (The refrence is the same, it's just a shortcut)
The Fields it contains:
  • CurrentRound => The current Round played since the server started
  • NextRespawn => The Amount of time until the next respawn occurres
  • LobbyLock => get/set the LobbyLock
  • RoundLock => get/set the RoundLock
  • EscapedDPersonnel => The Amount of D-Personnel's which escaped
  • EscapedScientist => The Amount of Scientist's which escaped
  • ScpKills => The Amount of Kills by Scp's
  • RoundLength => The timespan the round is already active
  • RoundIsActive => If the Round is active
  • RoundEnded => If the Round ended
The Method it contains:
  • StartRound() => Starts the Round
  • EndRound() => Ends the Round
  • RestartRound() => Restarts the Round
  • DimScreens() => Make the Screens from all Players black
  • ShowRoundSummary() => Shows the winning screen
  • MtfRespawn() => Respawns a Mtf/Chaos

Decontamination

namespace: Synapse.Api

You can get it with SynapseController.Server.Map.Decontamination or Map.Get.Decontamination (The refrence is the same, it's just a shortcut)
The Fields it contains:
  • Controller => The Vanilla object which controls the decontamination
  • Locked => If the Decontamination should be disabled
  • IsDecontaminationInProgress => If the Decontamination is in progress
The Methods it contains:
  • InstantStart() => Starts the Decontamination

HeavyController

namespace: Synapse.Api

You can get it with SynapseController.Server.Map.HeavyController or Map.Get.HeavyController (The refrence is the same, it's just a shortcut)
The fields it contains:
  • ForcedOvercharge => If the overcharge was forced because all Scp's are death or a Plugin did it
  • ActiveGenerators => The amount of currently engaged Generators
  • Is079Recontained => If the Scp079 Recontainment procedure is over
The methods it contains:
  • Recontain079() => starts the recontainment of SCP 079
  • Overcharge() => starts a overcharge
  • LightsOut() => disables all lights for a set time

Scp914

namespace: Synapse.Api

You can get it with SynapseController.Server.Map.Scp914 or Map.Get.Scp914 (The refrence is the same, it's just a shortcut)
The fields it contains:
  • KnobState => Get / Set the current Knob state
  • GameObject => The gameobject of 914
  • IsActive => If 914 is active
  • Intake => The transform of the Intake
  • Output => The transfrom of the Output
The methods it contains:
  • Activate() => Activates Scp914
  • UpgradeItemID() => Gives you the id of the Item it should become with the current Recipes

Tesla

namespace: Synapse.Api

This object represents a tesla gate on the Map.
The fields it contains:
  • GameObject => The GameObject of the tesla gate
  • Position => The Position of the gate
  • SizeOfTrigger => The Radius in which it will get activated when a player is in it
The methods it contains:
  • Trigger() => Activates the gate
  • InstantTrigger() => Activates the gate instant like Scp-079

Elevator

namespace: Synapse.Api

This object represents a lift on the Map.
The fields it contains:
  • GameObject => The GameObject of the lift
  • Name => The name of the Elevator
  • Position => The Position of the Elevator
  • Status => the current Status of the Elevator
  • Locked => the state of being locked
  • MaxDistance => the max distance of the Elevator
  • ElevatorType => The type of the Elevator
The methods it contains:
  • Use() => Activates the Elevator

Door

namespace: Synapse.Api

This object represents a Door on the Map.
The fields it contains:
  • GameObject => The GameObject of the door
  • Name => The name of the door
  • Position => The Position of the door.
  • Rotation => The Rotation of the Door
  • Open => The state of being open
  • Locked => The state of being locked
  • Room => The Room of the door
  • DoorPermissions => The Permissions required to open the door
  • DoorType => The type of the door
  • IsBreakable => If the Door is breakable
  • Rooms => A List of all Rooms the door belongs to
The methods it contains:
  • TryBreakDoor() => tries to break the door
  • TryPry() => tries to pry the door (Plays the Animation of Scp096 raging through gates)

Room

namespace: Synapse.Api

The fields it contains:
  • GameObject => The GameObject of the room
  • Position => The position of the room
  • RoomName => The name of the room
  • Doors => A list of all Doors in the Room
  • Zone => The zone the room is
  • RoomType => The Roomtype of the Room
The methods it contains:
  • LightsOut() => Deactivates the Lights in the Room
  • SetLightIntensity()=> Sets the Intensity of the Light

Generator

namespace: Synapse.Api

The fields it contains:
  • GameObject => The GameObject of the generator
  • MainGenerator => If it is the MainGenerator
  • Name => The name of the Generator
  • Position => The position of the Generator
  • Open => The state of being open
  • Locked => The state of being locked
  • IsTabletConnected => The state of an tablet being connected
  • ConnectedTablet => The Item which is connected (can also be set to something different than a tablet by an Plugin)
  • RemainingPowerUp => The Remaining power
  • Room => The Room the Generator is in
  • TabletEjectionPoint => The Position where teh tablet should get ejected
  • IsOvercharged => If the Generator is overcharged
The methods it contains:
  • Overcharge() => Overcharge the Generator

WorkStation

namespace: Synapse.Api

The fields it contains:
  • GameObject => The GameObject of the workstation
  • Name => The name of the bench
  • Position => The Position of the bench
  • Scale => The Scale of the Workbench
  • IsTabletConnected => The state of an tablet connected
  • ConnectedTablet => The Item which is connected (can also be set to something different than a tablet by an Plugin)
  • TabletOwner => The Player object of the tablet's owner in the workstation

Ragdoll

namespace: Synapse.Api

The fields it contains:
  • Gameobject => The GameObject of the ragdoll
  • Name => The name of the Ragdoll
  • Position => The position of the Ragdoll
  • Scale => The Scale of the Ragdoll
  • Owner => The Player of the Ragdoll
  • AllowRecall => If Scp-049 can revive it
The methods it contains:
  • Destroy() => Destroys the Ragdoll

Dummy

namespace: Synapse.Api

An Object which creates a fake player which you can use for example as an Npc
The fields it contains:
  • Role => The Role
  • Name => The nickname of the Dummy
  • Position => The Position of the Dummy
  • Rotation => The Rotation of the Dummy
  • Scale => The Scale of the Dummy
  • HeldItem => The Item which the Dummy helds
  • BadgeName => The BadgeName of the Dummy
  • BadgeColor => The BadgeColor of the Dummy
The methods it contains:
  • RotateToPosition() => Rotates the dummy to a specific location
  • Despawns() => Despawns the Dummy
  • Spawn() => Spawns the Dummy
  • Destroy() => Destroys the dummy

Prefabs

FileLocations

namespae: Synapse

The fields it contains:
  • SynapseDirectory => The Directory of Synapse
  • DatabaseDirectory => The Directory of the Database
  • MainPluginDirectory => The Main Directory of the Plugins
  • PluginDirectory => The Plugin Directory
  • SharedPluginDirectory => The shared Plugin Directory
  • MainConfigDirectory => The Main Config Directory
  • ConfigDirectory => The Config Directory
  • SharedConfigDirectory => The shared COnfig Directory
  • PermissionFile => The permission file
  • ConfigFile => The Config File
The methods it contains:
  • Refresh() => Refreshes all fields
  • GetOldTranslationFile() => Gives you the path of the old Translation file system
  • GetTranslationPath() => Gives you the Path of a TranslationFile
  • GetPluginDirectory() => Gives you the Directory of an Plugin

RoleManager

TeamManager

ItemManager

namespace: Synapse.Api.Items

You can get it with SynapseController.Server.ItemManager or Server.Get.ItemManager (The refrence is the same, it's just a shortcut)
The Methods it contains:
  • GetBaseType(int id) => Gives you the ItemType on which the item with the id is based on
  • GetName(int id) => Gives you the Name of the Item with that id
  • GetInfo(int id) => Gives you the CustomItemInformations object with which the item with that id was registered
  • RegisterCustomItem() => Register a new Custom item (for more information read here)
  • IsIDRegistered(int id) => Gives you a boolean back which is set to true if the Id exist (also it gives a true by all Vanilla Item ids)

ConfigHandler

namespace: Synapse.Config

This Object is used to interact with the config.syml. It's highly unlikely you will ever need this object (except for UpdateSection()) because Synapse Reloads you Config automatic(for more information read here)
The methods it contains:
  • GetOrSetDefault<T>() => Gets the Config for the IConfigSection or create deafults if they not exists
  • GetOrSetDefault() => The same from above but don't need the Type(not recommended to use)
  • UpdateSection<T>() => Writes the configs from the ConfigSection in the config.syml
  • Reload() => Reloads the config.syml

NetworkManager

PermissionHandler

namespace: Synapse.Permission

This Object is used to interact with the Permission System of Synapse
The methods it contains:
  • Reload() => Reloads the entire Permission System
  • AddServerGroup() => Creates a new ServerGroup inside the permission.syml
  • GetServerGroup() => Gives you the ServerGroup with that name
  • GetPlayerGroup() => Gives you the ServerGroup of that Player
  • GetDefaultGroup() => Gives you the default ServerGroup which all Players without a group gets
  • GetNorthwoodGroup() => Gives you the Northwood Group which Northwood staffs without a group gets(can be null)
  • AddPlayerToGroup() => Adds a Player to the members of a ServerGroup in the permission.syml
  • RemovePlayerGroup() => Remove a Player from all Groups

PluginLoader

namespace: Synapse.Api.Plugin

You can get it with SynapseController.PluginLoader.
Fields:
  • Plugins => Gives you a List of PluginInformation about Plugins that are installed

Handlers

namespace; Synapse.Command

You can get it with SynapseController.CommandHandlers.
Fields:
  • RemoteAdminHandler => CommandHandler object for the remote admin console.
  • ClientCommandHandler => CommandHandler object for the client console.
  • ServerConsoleHandler => CommandHandler object for the server console.

CommandHandler

namespace: Synapse.Command

It is used to handle commands but it's recommended to read this if you want to create a Command
The fields it contains:
  • Commands => A List of all Commands
The methods it contains:
  • TryGetCommand() => Gives you the Command with that name/alias
  • RegisterCommand() => Register the Command in the CommandHandler (use it only if you dont want to use ISynapseCommand)