Broke Protocol Game API Reference  1.39
Code reference for server and client scripting
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Properties | List of all members
BrokeProtocol.Managers.SvManager Class Reference
Inheritance diagram for BrokeProtocol.Managers.SvManager:
BrokeProtocol.Utility.MonoBehaviourSingleton< SvManager >

Public Member Functions

void SendGameMessageToConnection (Peer connection, string message)
 
bool Connected (Peer peer)
 
IEnumerator TransferData (ConnectData c, byte[] buffer, ClPacket packetType)
 
void DrawLine (Vector3 start, Vector3 end, Color color, float duration)
 
void SendToAll (PacketFlags channel, ClPacket packet, params object[] args)
 
void SvCustomEnvironmentPacket (ShPlayer player)
 
void SvCustomEnvironment ()
 
void SvSetDefaultEnvironment ()
 
void SvSetTimeScale (float timeScale)
 
void SvSetDayFraction (float fraction)
 
void SvSetWeatherFraction (float fraction)
 
void SvSetSkyColor (Color color)
 
void SvSetCloudColor (Color color)
 
void SvSetWaterColor (Color color)
 
void SvSetCloudHeight (float height)
 
IEnumerator StartVote ()
 
void SendTextMenu (Peer connection, string title, string text, string id="", float xMin=0.25f, float yMin=0.1f, float xMax=0.75f, float yMax=0.9f)
 
void SendOptionMenu (Peer connection, string title, int targetID, string id, LabelID[] options, LabelID[] actions, float xMin=0.25f, float yMin=0.1f, float xMax=0.75f, float yMax=0.9f)
 
void SendInputMenu (Peer connection, string title, int targetID, string id, InputField.ContentType contentType=InputField.ContentType.Alphanumeric, int characterLimit=16, float xMin=0.25f, float yMin=0.35f, float xMax=0.75f, float yMax=0.65f)
 
void SendTextPanel (Peer connection, string text, string id="", LabelID[] options=default, int initialOptionIndex=default)
 
void SendText (Peer connection, string text, float timeout, Vector2 anchor, string id="", int fontSize=Util.defaultTextSize, TextAnchor alignment=TextAnchor.MiddleCenter)
 
void SendTimer (Peer connection, float timeout, Vector2 anchor, string id="", int fontSize=Util.defaultTextSize, TextAnchor alignment=TextAnchor.MiddleCenter)
 
void SendRegisterMenu (Peer connection, bool allowLogin, List< ShPlayer > skinPrefabs)
 
void DestroyMenu (Peer connection, string id="")
 
void DestroyTextPanel (Peer connection, string id="")
 
void DestroyText (Peer connection, string id="")
 
void SaveAll ()
 
void UpdateVideos ()
 
void UpdateServerInfo ()
 
void UpdateAnnouncements ()
 
void UpdateWhitelist ()
 
void ParseFile (ref HashSet< string > hashSet, string file)
 
void SendPlayerCount ()
 
void LoadSavedPlayer (User playerData, ConnectData c)
 
void AddNewPlayer (ShPlayer prefab, ConnectData connectData, Persistent persistent, Vector3 position, Quaternion rotation, Transform parent, int spawnJobIndex=0)
 
void AddNewEntityDelay (ShEntity prefab, Place place, Vector3 position, Quaternion rotation, Vector3 scale, bool respawnable, string data, float delay)
 
AddNewEntity< T > (T prefab, Place place, Vector3 position, Quaternion rotation, bool respawnable, ShPlayer spawner=null, bool thrown=false)
 
AddNewEntity< T > (T prefab, Place place, Vector3 position, Quaternion rotation, IDCollection< ShPlayer > subscribedPlayers)
 
void AddNewEntityExisting (ShEntity entity, bool respawnable=true)
 
bool HandleWhitelist (string accountID)
 
void RegisterFail (Peer connection, string message)
 
bool TryGetUserData (string accountID, out User playerData)
 
void ForceQuit (string message=null, bool restart=false)
 
void SendToMaster (MasterPacket masterPacket, params object[] args)
 
void SendToConnection (Peer connection, PacketFlags channel)
 
void KickConnection (Peer connection)
 
void Disconnect (Peer connection, uint data)
 
void RemoveConnection (Peer connection)
 

Public Attributes

ShManager manager
 
bool singlePlayer
 
Driver database
 
VideoOption[] videoOptions = new VideoOption[0]
 
string serverInfo
 
Settings settings
 
ShEntity deathZonePrefab
 
ShEntity firePrefab
 
ShEntity markerGoalPrefab
 
ShEntity markerSelfPrefab
 
ShEntity greenCheckpointPrefab
 
ShEntity redCheckpointPrefab
 
readonly CustomData sessionData = new()
 
AstarPath aStarPath
 
GraphUpdateScene penaltyModifier
 
Transform penaltyModifierT
 
readonly Dictionary< GraphNode, uint > decayNodes = new()
 
ShPlayer pathPlayer
 
readonly Dictionary< ShPlayer, Vector3 > pathQueue = new()
 
readonly Dictionary< int, VisNode[]> visMap = new()
 
readonly Dictionary< uint, ShPlayerconnectedPlayers = new ()
 
readonly Dictionary< Peer, ConnectDataconnections = new ()
 
readonly Queue< PlayerRecordplayerRecords = new ()
 
int playerCount
 
Queue< int > freeIDs = new()
 
Dictionary< int, ShApartmentapartments = new ()
 
LimitQueue< string > recentConnections = new (5, 30f)
 
LimitQueue< string > packetLimit = new(150, 3f)
 
LimitQueue< string > kickedConnections = new (0, 600f)
 
LimitQueue< ShPlayerstartedVote = new (0, 60f)
 
LimitQueue< ShPlayerplacedItem = new (8, 20f)
 
LimitQueue< ShPlayerpathing = new(7, 2f)
 
LimitQueue< int > overwatchPositions = new(0, 5f)
 
HashSet< string > whitelist = new ()
 
HashSet< string > announcements = new ()
 
Dictionary< ValueTuple< Place, Vector2Int >, Sectorsectors = new ()
 
Action< ShPlayer >[] handler
 
HashSet< ShPlayervotedYes = new ()
 
HashSet< ShPlayervotedNo = new ()
 
Vote vote
 
HashSet< ShEntityfires = new ()
 
ShEntity[] briefcasePrefabs
 
string[] names
 
BuyerType[] buyerTypes
 

Static Public Attributes

static readonly ChatMode[] chatModeArray = (ChatMode[])Enum.GetValues(typeof(ChatMode))
 
static readonly ManagerEvents events = new()
 

Protected Member Functions

void ProcessPlaces (bool doVisibility)
 
- Protected Member Functions inherited from BrokeProtocol.Utility.MonoBehaviourSingleton< SvManager >
virtual void Awake ()
 

Properties

RecastGraph GetMainGraph [get]
 
- Properties inherited from BrokeProtocol.Utility.MonoBehaviourSingleton< SvManager >
virtual bool DontDestroy [get]
 
static T Instance [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from BrokeProtocol.Utility.MonoBehaviourSingleton< SvManager >
static void Instantiate ()
 

Member Function Documentation

◆ AddNewEntity< T >() [1/2]

T BrokeProtocol.Managers.SvManager.AddNewEntity< T > ( T prefab,
Place place,
Vector3 position,
Quaternion rotation,
bool respawnable,
ShPlayer spawner = null,
bool thrown = false )
inline
Type Constraints
T :ShEntity 

◆ AddNewEntity< T >() [2/2]

T BrokeProtocol.Managers.SvManager.AddNewEntity< T > ( T prefab,
Place place,
Vector3 position,
Quaternion rotation,
IDCollection< ShPlayer > subscribedPlayers )
inline
Type Constraints
T :ShEntity 

◆ AddNewEntityDelay()

void BrokeProtocol.Managers.SvManager.AddNewEntityDelay ( ShEntity prefab,
Place place,
Vector3 position,
Quaternion rotation,
Vector3 scale,
bool respawnable,
string data,
float delay )

◆ AddNewEntityExisting()

void BrokeProtocol.Managers.SvManager.AddNewEntityExisting ( ShEntity entity,
bool respawnable = true )
inline

◆ AddNewPlayer()

void BrokeProtocol.Managers.SvManager.AddNewPlayer ( ShPlayer prefab,
ConnectData connectData,
Persistent persistent,
Vector3 position,
Quaternion rotation,
Transform parent,
int spawnJobIndex = 0 )
inline

◆ Connected()

bool BrokeProtocol.Managers.SvManager.Connected ( Peer peer)

◆ DestroyMenu()

void BrokeProtocol.Managers.SvManager.DestroyMenu ( Peer connection,
string id = "" )
inline

◆ DestroyText()

void BrokeProtocol.Managers.SvManager.DestroyText ( Peer connection,
string id = "" )
inline

◆ DestroyTextPanel()

void BrokeProtocol.Managers.SvManager.DestroyTextPanel ( Peer connection,
string id = "" )
inline

◆ Disconnect()

void BrokeProtocol.Managers.SvManager.Disconnect ( Peer connection,
uint data )
inline

◆ DrawLine()

void BrokeProtocol.Managers.SvManager.DrawLine ( Vector3 start,
Vector3 end,
Color color,
float duration )

◆ ForceQuit()

void BrokeProtocol.Managers.SvManager.ForceQuit ( string message = null,
bool restart = false )
inline

◆ HandleWhitelist()

bool BrokeProtocol.Managers.SvManager.HandleWhitelist ( string accountID)

◆ KickConnection()

void BrokeProtocol.Managers.SvManager.KickConnection ( Peer connection)
inline

◆ LoadSavedPlayer()

void BrokeProtocol.Managers.SvManager.LoadSavedPlayer ( User playerData,
ConnectData c )
inline

◆ ParseFile()

void BrokeProtocol.Managers.SvManager.ParseFile ( ref HashSet< string > hashSet,
string file )
inline

◆ ProcessPlaces()

void BrokeProtocol.Managers.SvManager.ProcessPlaces ( bool doVisibility)
inlineprotected

◆ RegisterFail()

void BrokeProtocol.Managers.SvManager.RegisterFail ( Peer connection,
string message )
inline

◆ RemoveConnection()

void BrokeProtocol.Managers.SvManager.RemoveConnection ( Peer connection)
inline

◆ SaveAll()

void BrokeProtocol.Managers.SvManager.SaveAll ( )
inline

◆ SendGameMessageToConnection()

void BrokeProtocol.Managers.SvManager.SendGameMessageToConnection ( Peer connection,
string message )
inline

◆ SendInputMenu()

void BrokeProtocol.Managers.SvManager.SendInputMenu ( Peer connection,
string title,
int targetID,
string id,
InputField::ContentType contentType = InputField::ContentType::Alphanumeric,
int characterLimit = 16,
float xMin = 0::25f,
float yMin = 0::35f,
float xMax = 0::75f,
float yMax = 0::65f )
inline

◆ SendOptionMenu()

void BrokeProtocol.Managers.SvManager.SendOptionMenu ( Peer connection,
string title,
int targetID,
string id,
LabelID[] options,
LabelID[] actions,
float xMin = 0::25f,
float yMin = 0::1f,
float xMax = 0::75f,
float yMax = 0::9f )
inline

◆ SendPlayerCount()

void BrokeProtocol.Managers.SvManager.SendPlayerCount ( )
inline

◆ SendRegisterMenu()

void BrokeProtocol.Managers.SvManager.SendRegisterMenu ( Peer connection,
bool allowLogin,
List< ShPlayer > skinPrefabs )
inline

◆ SendText()

void BrokeProtocol.Managers.SvManager.SendText ( Peer connection,
string text,
float timeout,
Vector2 anchor,
string id = "",
int fontSize = Util::defaultTextSize,
TextAnchor alignment = TextAnchor::MiddleCenter )
inline

◆ SendTextMenu()

void BrokeProtocol.Managers.SvManager.SendTextMenu ( Peer connection,
string title,
string text,
string id = "",
float xMin = 0::25f,
float yMin = 0::1f,
float xMax = 0::75f,
float yMax = 0::9f )
inline

◆ SendTextPanel()

void BrokeProtocol.Managers.SvManager.SendTextPanel ( Peer connection,
string text,
string id = "",
LabelID[] options = default,
int initialOptionIndex = default )
inline

◆ SendTimer()

void BrokeProtocol.Managers.SvManager.SendTimer ( Peer connection,
float timeout,
Vector2 anchor,
string id = "",
int fontSize = Util::defaultTextSize,
TextAnchor alignment = TextAnchor::MiddleCenter )
inline

◆ SendToAll()

void BrokeProtocol.Managers.SvManager.SendToAll ( PacketFlags channel,
ClPacket packet,
params object[] args )
inline

◆ SendToConnection()

void BrokeProtocol.Managers.SvManager.SendToConnection ( Peer connection,
PacketFlags channel )
inline

◆ SendToMaster()

void BrokeProtocol.Managers.SvManager.SendToMaster ( MasterPacket masterPacket,
params object[] args )
inline

◆ StartVote()

IEnumerator BrokeProtocol.Managers.SvManager.StartVote ( )
inline

◆ SvCustomEnvironment()

void BrokeProtocol.Managers.SvManager.SvCustomEnvironment ( )
inline

◆ SvCustomEnvironmentPacket()

void BrokeProtocol.Managers.SvManager.SvCustomEnvironmentPacket ( ShPlayer player)

◆ SvSetCloudColor()

void BrokeProtocol.Managers.SvManager.SvSetCloudColor ( Color color)
inline

◆ SvSetCloudHeight()

void BrokeProtocol.Managers.SvManager.SvSetCloudHeight ( float height)
inline

◆ SvSetDayFraction()

void BrokeProtocol.Managers.SvManager.SvSetDayFraction ( float fraction)
inline

◆ SvSetDefaultEnvironment()

void BrokeProtocol.Managers.SvManager.SvSetDefaultEnvironment ( )
inline

◆ SvSetSkyColor()

void BrokeProtocol.Managers.SvManager.SvSetSkyColor ( Color color)
inline

◆ SvSetTimeScale()

void BrokeProtocol.Managers.SvManager.SvSetTimeScale ( float timeScale)
inline

◆ SvSetWaterColor()

void BrokeProtocol.Managers.SvManager.SvSetWaterColor ( Color color)
inline

◆ SvSetWeatherFraction()

void BrokeProtocol.Managers.SvManager.SvSetWeatherFraction ( float fraction)
inline

◆ TransferData()

IEnumerator BrokeProtocol.Managers.SvManager.TransferData ( ConnectData c,
byte[] buffer,
ClPacket packetType )
inline

◆ TryGetUserData()

bool BrokeProtocol.Managers.SvManager.TryGetUserData ( string accountID,
out User playerData )
inline

◆ UpdateAnnouncements()

void BrokeProtocol.Managers.SvManager.UpdateAnnouncements ( )

◆ UpdateServerInfo()

void BrokeProtocol.Managers.SvManager.UpdateServerInfo ( )
inline

◆ UpdateVideos()

void BrokeProtocol.Managers.SvManager.UpdateVideos ( )
inline

◆ UpdateWhitelist()

void BrokeProtocol.Managers.SvManager.UpdateWhitelist ( )

Member Data Documentation

◆ announcements

HashSet<string> BrokeProtocol.Managers.SvManager.announcements = new ()

◆ apartments

Dictionary<int, ShApartment> BrokeProtocol.Managers.SvManager.apartments = new ()

◆ aStarPath

AstarPath BrokeProtocol.Managers.SvManager.aStarPath

◆ briefcasePrefabs

ShEntity [] BrokeProtocol.Managers.SvManager.briefcasePrefabs

◆ buyerTypes

BuyerType [] BrokeProtocol.Managers.SvManager.buyerTypes
Initial value:
= new BuyerType[]
{
new (null, "Outta my face!"),
new (typeof(ShWearable), "I'll buy any clothes you got"),
new (typeof(ShConsumable), "I need some food or drugs!"),
new (typeof(ShWeapon), "What weapons you got?")
}

◆ chatModeArray

readonly ChatMode [] BrokeProtocol.Managers.SvManager.chatModeArray = (ChatMode[])Enum.GetValues(typeof(ChatMode))
static

◆ connectedPlayers

readonly Dictionary<uint, ShPlayer> BrokeProtocol.Managers.SvManager.connectedPlayers = new ()

◆ connections

readonly Dictionary<Peer, ConnectData> BrokeProtocol.Managers.SvManager.connections = new ()

◆ database

Driver BrokeProtocol.Managers.SvManager.database

◆ deathZonePrefab

ShEntity BrokeProtocol.Managers.SvManager.deathZonePrefab

◆ decayNodes

readonly Dictionary<GraphNode, uint> BrokeProtocol.Managers.SvManager.decayNodes = new()

◆ events

readonly ManagerEvents BrokeProtocol.Managers.SvManager.events = new()
static

◆ firePrefab

ShEntity BrokeProtocol.Managers.SvManager.firePrefab

◆ fires

HashSet<ShEntity> BrokeProtocol.Managers.SvManager.fires = new ()

◆ freeIDs

Queue<int> BrokeProtocol.Managers.SvManager.freeIDs = new()

◆ greenCheckpointPrefab

ShEntity BrokeProtocol.Managers.SvManager.greenCheckpointPrefab

◆ handler

Action<ShPlayer> [] BrokeProtocol.Managers.SvManager.handler

◆ kickedConnections

LimitQueue<string> BrokeProtocol.Managers.SvManager.kickedConnections = new (0, 600f)

◆ manager

ShManager BrokeProtocol.Managers.SvManager.manager

◆ markerGoalPrefab

ShEntity BrokeProtocol.Managers.SvManager.markerGoalPrefab

◆ markerSelfPrefab

ShEntity BrokeProtocol.Managers.SvManager.markerSelfPrefab

◆ names

string [] BrokeProtocol.Managers.SvManager.names

◆ overwatchPositions

LimitQueue<int> BrokeProtocol.Managers.SvManager.overwatchPositions = new(0, 5f)

◆ packetLimit

LimitQueue<string> BrokeProtocol.Managers.SvManager.packetLimit = new(150, 3f)

◆ pathing

LimitQueue<ShPlayer> BrokeProtocol.Managers.SvManager.pathing = new(7, 2f)

◆ pathPlayer

ShPlayer BrokeProtocol.Managers.SvManager.pathPlayer

◆ pathQueue

readonly Dictionary<ShPlayer, Vector3> BrokeProtocol.Managers.SvManager.pathQueue = new()

◆ penaltyModifier

GraphUpdateScene BrokeProtocol.Managers.SvManager.penaltyModifier

◆ penaltyModifierT

Transform BrokeProtocol.Managers.SvManager.penaltyModifierT

◆ placedItem

LimitQueue<ShPlayer> BrokeProtocol.Managers.SvManager.placedItem = new (8, 20f)

◆ playerCount

int BrokeProtocol.Managers.SvManager.playerCount

◆ playerRecords

readonly Queue<PlayerRecord> BrokeProtocol.Managers.SvManager.playerRecords = new ()

◆ recentConnections

LimitQueue<string> BrokeProtocol.Managers.SvManager.recentConnections = new (5, 30f)

◆ redCheckpointPrefab

ShEntity BrokeProtocol.Managers.SvManager.redCheckpointPrefab

◆ sectors

Dictionary<ValueTuple<Place, Vector2Int>, Sector> BrokeProtocol.Managers.SvManager.sectors = new ()

◆ serverInfo

string BrokeProtocol.Managers.SvManager.serverInfo

◆ sessionData

readonly CustomData BrokeProtocol.Managers.SvManager.sessionData = new()

◆ settings

Settings BrokeProtocol.Managers.SvManager.settings

◆ singlePlayer

bool BrokeProtocol.Managers.SvManager.singlePlayer

◆ startedVote

LimitQueue<ShPlayer> BrokeProtocol.Managers.SvManager.startedVote = new (0, 60f)

◆ videoOptions

VideoOption [] BrokeProtocol.Managers.SvManager.videoOptions = new VideoOption[0]

◆ visMap

readonly Dictionary<int, VisNode[]> BrokeProtocol.Managers.SvManager.visMap = new()

◆ vote

Vote BrokeProtocol.Managers.SvManager.vote

◆ votedNo

HashSet<ShPlayer> BrokeProtocol.Managers.SvManager.votedNo = new ()

◆ votedYes

HashSet<ShPlayer> BrokeProtocol.Managers.SvManager.votedYes = new ()

◆ whitelist

HashSet<string> BrokeProtocol.Managers.SvManager.whitelist = new ()

Property Documentation

◆ GetMainGraph

RecastGraph BrokeProtocol.Managers.SvManager.GetMainGraph
get

The documentation for this class was generated from the following file: