API
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.
The SynapseController is the main object which contains the entire Synapse API.
It contains 3 static objects:
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:
- 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
- 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 translationsOfflineBanID()
=> Bans the ID of a User even when he is not on the ServerOfflineBanIP()
=> Bans the IP of a User even when he is not on the ServerGetObjectsOf<TObject>
() => Gives you all Unity objects of that typeGetObjectOf<TObject>
() => Gives you the first object of that type the Server can findGetPlayers(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)
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 ConsoleWarn(object)
=> Sends an LogWarn to the ConsoleError(object)
=> Sends an LogError to the ConsoleSend(string, ConsoleColor)
=> Sends a message with a defined color to the Console (Plugin name will not be added).
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:
- 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 roomGetDoor()
=> Gives you a specific doorGetElevator()
=> Gives you a specific ElevatorSendBroadcast()
=> Sends to all Players a BroadcastAnnounceScpDeath()
=> Announces the Death of an scpCassie()
=> Sends an Cassie MessageGlitchedCassie()
=> Sends an glitchy Cassie messageSpawnGrenade()
=> Spawns a GrenadeExplode()
=> Spawns and explode a GrenadePlaceBlood()
=> Places blood for all Players
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 DetonationCancelDetonation()
=> Cancel the DetonationDetonate()
=> Detonated the WarheadInstantPrepare()
=> Prepares the Nuke to detonate instantShake()
=> Shakes the screen of all Players
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
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
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 RoundEndRound()
=> Ends the RoundRestartRound()
=> Restarts the RoundDimScreens()
=> Make the Screens from all Players blackShowRoundSummary()
=> Shows the winning screenMtfRespawn()
=> Respawns a Mtf/Chaos
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
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 079Overcharge()
=> starts a overchargeLightsOut()
=> disables all lights for a set time
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 Scp914UpgradeItemID()
=> Gives you the id of the Item it should become with the current Recipes
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 gateInstantTrigger()
=> Activates the gate instant like Scp-079
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
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 doorTryPry()
=> tries to pry the door (Plays the Animation of Scp096 raging through gates)
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 RoomSetLightIntensity()
=> Sets the Intensity of the Light
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
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)
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
- AllowRecall => If Scp-049 can revive it
The methods it contains:
Destroy()
=> Destroys the Ragdoll
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 locationDespawns()
=> Despawns the DummySpawn()
=> Spawns the DummyDestroy()
=> Destroys the dummy
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 fieldsGetOldTranslationFile()
=> Gives you the path of the old Translation file systemGetTranslationPath()
=> Gives you the Path of a TranslationFileGetPluginDirectory()
=> Gives you the Directory of an Plugin
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 onGetName(int id)
=> Gives you the Name of the Item with that idGetInfo(int id)
=> Gives you theCustomItemInformations
object with which the item with that id was registeredIsIDRegistered(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)
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 existsGetOrSetDefault()
=> 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.symlReload()
=> Reloads the config.syml
This Object is used to interact with the Permission System of Synapse
The methods it contains:
Reload()
=> Reloads the entire Permission SystemAddServerGroup()
=> Creates a new ServerGroup inside the permission.symlGetServerGroup()
=> Gives you the ServerGroup with that nameGetPlayerGroup()
=> Gives you the ServerGroup of that PlayerGetDefaultGroup()
=> Gives you the default ServerGroup which all Players without a group getsGetNorthwoodGroup()
=> 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.symlRemovePlayerGroup()
=> Remove a Player from all Groups
You can get it with
SynapseController.PluginLoader
.Fields:
- Plugins => Gives you a List of
PluginInformation
about Plugins that are installed
You can get it with
SynapseController.CommandHandlers
.Fields:
The fields it contains:
- Commands => A List of all Commands
The methods it contains:
TryGetCommand()
=> Gives you the Command with that name/aliasRegisterCommand()
=> Register the Command in the CommandHandler (use it only if you dont want to use ISynapseCommand)
Last modified 1yr ago