Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
GrafDimenzio edited this page Oct 27, 2020 · 18 revisions

SynapseController

The SynapseController is the main Object which contains almost the entire Synapse Api.

It Contains 3 static Objects:

Server

Namespace: Synapse

This Object contains the API to interact with many Features of Scp:SL.

You can get it with SynapseController.Server or with Server.Get(the second is the same so it is just a shortcut)

The fields it contains

  • Logger
  • Map
  • Files
  • Events
  • RoleManager
  • ItemManager
  • Configs
  • PermissionHandler
  • Host => The Player Object of the Server
  • Port => The Port the Server is running on
  • Name => The ServerName
  • FF => FriendlyFire
  • Players => Gives you a List of all Players on the Server
  • ServerConsole => Gives you the Server Console Object (Vanilla Objects not recommended to use)
  • GameConsole => Gives you the Game Console Object (Vanilla Objects not recommended to use)

The Methods it contains

  • Reload() => Reloads all Synapse Features
  • 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 requirements(Example: GetPlayers(x => x.NickName == "Dimenzio") => Gives you all Players which name is Dimenzio)
  • GetPlayer(string) => Gives you the Player with that userid/playerid/nickname
  • GetPlayer(int playerid) => Gives you the Player with that playerid

Logger

Namespace: Synapse.Api

This Object contains Methods to send Messages in the Server Console

You can get it with SynapseController.Server.Logger or with Logger.Get(the second is the same so it is just a shortcut)

  • Info(string) => Sends an Information in the Console
  • Warn(string) => Sends an Warn in the Console
  • Error(string) => Sends an Error in the Console
  • Send(string,ConsoleColor) => Sends a Message with a defined color in the Console (Plugin name will not be added).

Map

Namespace: Synapse.Api

You can get it with SynapseController.Server.Map or Map.Get(the second is the same so it is just a shortcut)

This Object contains the fields:

  • Nuke
  • Round
  • Decontamination
  • 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.
  • IntercomText => The text which will be displayed in the intercom
  • Seed => The current Map Seed

This Methods contains it:

  • CreateDummy() => Creates a Dummy object
  • CreateWorkStation() => Creates a Workstation object
  • 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

Nuke

Namespace: Synapse.Api

You can get it with SynapseController.Server.Map.Nuke or Map.Get.Nuke(the second is the same so it is just a shortcut)

This fields contains it:

  • WarheadController => Vanilla Object for the AlphaWarheadController
  • InsidePanel
  • OutsidePanel
  • 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 second is the same so it is just a shortcut)

This Object should represent the AlphaWarhead Panel inside the Facility.

The fields it contains:

  • Panel => The Vanilla object for the NukesitePanel
  • 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 second is the same so it is just a shortcut)

This Object should represent the AlphaWarhead Panel outside the Facility.

The fields it contains:

  • Panel => The Vanilla object for the OutsidePanel
  • 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 second is the same so it is just a shortcut)

The Fields it contains:

  • CurrentRound => The current Round played since the server started
  • LobbyLock => get/set the lobbylock
  • RoundLock => get/set the roundlock
  • 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 RoundSummary
  • MtfRespawn() => Respawns a Mtf/Chaos

Decontamination

Namespace: Synapse.Api

You can get it with SynapseController.Server.Map.Decontamination or Map.Get.Decontamination(the second is the same so it is just a shortcut)

The Fields it contains:

  • Controller => The Vanilla object which controls the decontamination
  • DisableDecontamination => If the Decontamination should be disabled
  • IsDecontaminationInProgress => If the Decontamination is in Progress

The Methods it contains:

  • InstantStart() => Starts the Decontamination

Scp914

Namespace: Synapse.Api

Currently a useless Object(Features will be added in the Future)

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
  • 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

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.
  • Open => The state of being open
  • Locked => The state of being locked
  • PermissionLevels => The Permissions required to open the door

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
  • Zone => The zone the room is
  • RoomType => The Roomtype of the Room

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

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 owner 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
  • 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:

  • Despawns() => Despawns the Dummy
  • Spawn() => Spawns the Dummy
  • Destroy() => Destroys the dummy

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() => Refresh all fields
  • GetTranslationFile() => Gives you the translation file
  • GetPluginDirectory => Gives you the Directory of an Plugin

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 Informations read here)

The methods it conatins:

  • GetOrSetDefault() => Gets the Cofig 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 => Writes the configs from the ConfigSection in the config.syml
  • Reload() => Reloads the config.syml

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

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)
Clone this wiki locally