Barotrauma Server
Loading...
Searching...
No Matches
Barotrauma.Networking.Client Class Reference
Inheritance diagram for Barotrauma.Networking.Client:

Public Member Functions

 Client (string name, byte sessionId)
 
GetVote< T > (VoteType voteType)
 
void SetVote (VoteType voteType, object value)
 
bool SessionOrAccountIdMatches (string userId)
 
void WritePermissions (IWriteMessage msg)
 
void ReadPermissions (IReadMessage inc)
 
void Dispose ()
 
void SetClientCharacter (Character character)
 
void Kick (string reason="")
 
void Ban (string reason="", float seconds=-1)
 
bool CheckPermission (ClientPermissions permissions)
 
void InitClientSync ()
 
bool AddressMatches (Address address)
 
void AddKickVote (Client voter)
 
void RemoveKickVote (Client voter)
 
bool HasKickVoteFrom (Client voter)
 
bool HasKickVoteFromSessionId (int id)
 
void ResetVotes (bool resetKickVotes)
 Reset what this client has voted for and the kick votes given to this client.
 
void SetPermissions (ClientPermissions permissions, IEnumerable< DebugConsole.Command > permittedConsoleCommands)
 
void GivePermission (ClientPermissions permission)
 
void RemovePermission (ClientPermissions permission)
 
bool HasPermission (ClientPermissions permission)
 
bool TryTakeOverBot (Character botCharacter)
 

Static Public Member Functions

static void ReadPermissions (IReadMessage inc, out ClientPermissions permissions, out List< DebugConsole.Command > permittedCommands)
 
static string SanitizeName (string name)
 
static void UnbanPlayer (string playerName)
 
static void BanPlayer (string player, string reason, bool range=false, float seconds=-1)
 
static bool IsValidName (string name, ServerSettings serverSettings)
 
static void UpdateKickVotes (IReadOnlyList< Client > connectedClients)
 

Public Attributes

string Name
 
UInt16 NameId
 
readonly byte SessionId
 An ID for this client for the current session. THIS IS NOT A PERSISTENT VALUE. DO NOT STORE THIS LONG-TERM. IT CANNOT BE USED TO IDENTIFY PLAYERS ACROSS SESSIONS.
 
AccountInfo AccountInfo
 
LanguageIdentifier Language
 
UInt16 Ping
 
Identifier PreferredJob
 
CharacterTeamType TeamID
 
CharacterTeamType PreferredTeam
 
bool UsingFreeCam
 Is the client using the 'freecam' console command?
 
UInt16 CharacterID
 
bool HasSpawned
 
HashSet< Identifier > GivenAchievements = new HashSet<Identifier>()
 
ClientPermissions Permissions = ClientPermissions.None
 
readonly HashSet< DebugConsole.CommandPermittedConsoleCommands = new HashSet<DebugConsole.Command>()
 
bool VoiceEnabled = true
 
VoipServerDecoder VoipServerDecoder
 
UInt16 LastRecvClientListUpdate = NetIdUtils.GetIdOlderThan(GameMain.Server.LastClientListUpdateID)
 
UInt16 LastSentServerSettingsUpdate = NetIdUtils.GetIdOlderThan(GameMain.Server.ServerSettings.LastUpdateIdForFlag[ServerSettings.NetFlags.Properties])
 
UInt16 LastRecvServerSettingsUpdate = NetIdUtils.GetIdOlderThan(GameMain.Server.ServerSettings.LastUpdateIdForFlag[ServerSettings.NetFlags.Properties])
 
UInt16 LastRecvLobbyUpdate = NetIdUtils.GetIdOlderThan(GameMain.NetLobbyScreen.LastUpdateID)
 
UInt16 LastSentChatMsgID = 0
 
UInt16 LastRecvChatMsgID = 0
 
UInt16 LastSentEntityEventID = 0
 
UInt16 LastRecvEntityEventID = 0
 
readonly Dictionary< MultiPlayerCampaign.NetFlags, UInt16 > LastRecvCampaignUpdate = new Dictionary<MultiPlayerCampaign.NetFlags, UInt16>()
 
UInt16 LastRecvCampaignSave = 0
 
UInt16 saveId
 
UInt16 float time LastCampaignSaveSendTime
 
readonly List< ChatMessageChatMsgQueue = new List<ChatMessage>()
 
UInt16 LastChatMsgQueueID
 
readonly List< string > LastSentChatMessages = new List<string>()
 
float ChatSpamSpeed
 
float ChatSpamTimer
 
int ChatSpamCount
 
string RejectedName
 
float KickAFKTimer
 
double MidRoundSyncTimeOut
 
bool NeedsMidRoundSync
 
UInt16 UnreceivedEntityEventCount
 
UInt16 FirstNewEventID
 
readonly Dictionary< UInt16, double > EntityEventLastSent = new Dictionary<UInt16, double>()
 
readonly Dictionary< Entity, float > PositionUpdateLastSent = new Dictionary<Entity, float>()
 
readonly Queue< EntityPendingPositionUpdates = new Queue<Entity>()
 
bool ReadyToStart
 
JobVariant AssignedJob
 
float DeleteDisconnectedTimer
 
DateTime JoinTime
 
DateTime LastNameChangeTime
 
string PendingName
 
bool SpectateOnly
 
bool? WaitForNextRoundRespawn
 
int KarmaKickCount
 

Static Public Attributes

const int MaxNameLength = 32
 
static readonly TimeSpan NameChangeCoolDown = new TimeSpan(hours: 0, minutes: 0, seconds: 30)
 

Properties

static IReadOnlyList< ClientClientList [get]
 
ulong SteamID [get]
 
Option< AccountId > AccountId [get]
 The ID of the account used to authenticate this session. This value can be used as a persistent value to identify players in the banlist and campaign saves.
 
Character Character [get, set]
 
Vector2SpectatePos [get, set]
 
bool Spectating [get]
 
bool Muted [get, set]
 
bool HasPermissions [get]
 
VoipQueue VoipQueue [get]
 
bool InGame [get, set]
 
List< JobVariant > JobPreferences [get, set]
 
CharacterInfo CharacterInfo [get, set]
 
NetworkConnection Connection [get, set]
 
float Karma [get, set]
 
int KickVoteCount [get]
 

Constructor & Destructor Documentation

◆ Client()

Barotrauma.Networking.Client.Client ( string name,
byte sessionId )

Member Function Documentation

◆ AddKickVote()

void Barotrauma.Networking.Client.AddKickVote ( Client voter)

◆ AddressMatches()

bool Barotrauma.Networking.Client.AddressMatches ( Address address)

◆ Ban()

void Barotrauma.Networking.Client.Ban ( string reason = "",
float seconds = -1 )

◆ BanPlayer()

static void Barotrauma.Networking.Client.BanPlayer ( string player,
string reason,
bool range = false,
float seconds = -1 )
static

◆ CheckPermission()

bool Barotrauma.Networking.Client.CheckPermission ( ClientPermissions permissions)

◆ Dispose()

void Barotrauma.Networking.Client.Dispose ( )

◆ GetVote< T >()

T Barotrauma.Networking.Client.GetVote< T > ( VoteType voteType)

◆ GivePermission()

void Barotrauma.Networking.Client.GivePermission ( ClientPermissions permission)

◆ HasKickVoteFrom()

bool Barotrauma.Networking.Client.HasKickVoteFrom ( Client voter)

◆ HasKickVoteFromSessionId()

bool Barotrauma.Networking.Client.HasKickVoteFromSessionId ( int id)

◆ HasPermission()

bool Barotrauma.Networking.Client.HasPermission ( ClientPermissions permission)

◆ InitClientSync()

void Barotrauma.Networking.Client.InitClientSync ( )

◆ IsValidName()

static bool Barotrauma.Networking.Client.IsValidName ( string name,
ServerSettings serverSettings )
static

◆ Kick()

void Barotrauma.Networking.Client.Kick ( string reason = "")

◆ ReadPermissions() [1/2]

void Barotrauma.Networking.Client.ReadPermissions ( IReadMessage inc)

◆ ReadPermissions() [2/2]

static void Barotrauma.Networking.Client.ReadPermissions ( IReadMessage inc,
out ClientPermissions permissions,
out List< DebugConsole.Command > permittedCommands )
static

◆ RemoveKickVote()

void Barotrauma.Networking.Client.RemoveKickVote ( Client voter)

◆ RemovePermission()

void Barotrauma.Networking.Client.RemovePermission ( ClientPermissions permission)

◆ ResetVotes()

void Barotrauma.Networking.Client.ResetVotes ( bool resetKickVotes)

Reset what this client has voted for and the kick votes given to this client.

◆ SanitizeName()

static string Barotrauma.Networking.Client.SanitizeName ( string name)
static

◆ SessionOrAccountIdMatches()

bool Barotrauma.Networking.Client.SessionOrAccountIdMatches ( string userId)

◆ SetClientCharacter()

void Barotrauma.Networking.Client.SetClientCharacter ( Character character)

◆ SetPermissions()

void Barotrauma.Networking.Client.SetPermissions ( ClientPermissions permissions,
IEnumerable< DebugConsole.Command > permittedConsoleCommands )

◆ SetVote()

void Barotrauma.Networking.Client.SetVote ( VoteType voteType,
object value )

◆ TryTakeOverBot()

bool Barotrauma.Networking.Client.TryTakeOverBot ( Character botCharacter)

◆ UnbanPlayer()

static void Barotrauma.Networking.Client.UnbanPlayer ( string playerName)
static

◆ UpdateKickVotes()

static void Barotrauma.Networking.Client.UpdateKickVotes ( IReadOnlyList< Client > connectedClients)
static

◆ WritePermissions()

void Barotrauma.Networking.Client.WritePermissions ( IWriteMessage msg)

Member Data Documentation

◆ AccountInfo

AccountInfo Barotrauma.Networking.Client.AccountInfo

◆ AssignedJob

JobVariant Barotrauma.Networking.Client.AssignedJob

◆ CharacterID

UInt16 Barotrauma.Networking.Client.CharacterID

◆ ChatMsgQueue

readonly List<ChatMessage> Barotrauma.Networking.Client.ChatMsgQueue = new List<ChatMessage>()

◆ ChatSpamCount

int Barotrauma.Networking.Client.ChatSpamCount

◆ ChatSpamSpeed

float Barotrauma.Networking.Client.ChatSpamSpeed

◆ ChatSpamTimer

float Barotrauma.Networking.Client.ChatSpamTimer

◆ DeleteDisconnectedTimer

float Barotrauma.Networking.Client.DeleteDisconnectedTimer

◆ EntityEventLastSent

readonly Dictionary<UInt16, double> Barotrauma.Networking.Client.EntityEventLastSent = new Dictionary<UInt16, double>()

◆ FirstNewEventID

UInt16 Barotrauma.Networking.Client.FirstNewEventID

◆ GivenAchievements

HashSet<Identifier> Barotrauma.Networking.Client.GivenAchievements = new HashSet<Identifier>()

◆ HasSpawned

bool Barotrauma.Networking.Client.HasSpawned

◆ JoinTime

DateTime Barotrauma.Networking.Client.JoinTime

◆ KarmaKickCount

int Barotrauma.Networking.Client.KarmaKickCount

◆ KickAFKTimer

float Barotrauma.Networking.Client.KickAFKTimer

◆ Language

LanguageIdentifier Barotrauma.Networking.Client.Language

◆ LastCampaignSaveSendTime

UInt16 float time Barotrauma.Networking.Client.LastCampaignSaveSendTime

◆ LastChatMsgQueueID

UInt16 Barotrauma.Networking.Client.LastChatMsgQueueID

◆ LastNameChangeTime

DateTime Barotrauma.Networking.Client.LastNameChangeTime

◆ LastRecvCampaignSave

UInt16 Barotrauma.Networking.Client.LastRecvCampaignSave = 0

◆ LastRecvCampaignUpdate

readonly Dictionary<MultiPlayerCampaign.NetFlags, UInt16> Barotrauma.Networking.Client.LastRecvCampaignUpdate = new Dictionary<MultiPlayerCampaign.NetFlags, UInt16>()

◆ LastRecvChatMsgID

UInt16 Barotrauma.Networking.Client.LastRecvChatMsgID = 0

◆ LastRecvClientListUpdate

UInt16 Barotrauma.Networking.Client.LastRecvClientListUpdate = NetIdUtils.GetIdOlderThan(GameMain.Server.LastClientListUpdateID)

◆ LastRecvEntityEventID

UInt16 Barotrauma.Networking.Client.LastRecvEntityEventID = 0

◆ LastRecvLobbyUpdate

UInt16 Barotrauma.Networking.Client.LastRecvLobbyUpdate = NetIdUtils.GetIdOlderThan(GameMain.NetLobbyScreen.LastUpdateID)

◆ LastRecvServerSettingsUpdate

UInt16 Barotrauma.Networking.Client.LastRecvServerSettingsUpdate = NetIdUtils.GetIdOlderThan(GameMain.Server.ServerSettings.LastUpdateIdForFlag[ServerSettings.NetFlags.Properties])

◆ LastSentChatMessages

readonly List<string> Barotrauma.Networking.Client.LastSentChatMessages = new List<string>()

◆ LastSentChatMsgID

UInt16 Barotrauma.Networking.Client.LastSentChatMsgID = 0

◆ LastSentEntityEventID

UInt16 Barotrauma.Networking.Client.LastSentEntityEventID = 0

◆ LastSentServerSettingsUpdate

UInt16 Barotrauma.Networking.Client.LastSentServerSettingsUpdate = NetIdUtils.GetIdOlderThan(GameMain.Server.ServerSettings.LastUpdateIdForFlag[ServerSettings.NetFlags.Properties])

◆ MaxNameLength

const int Barotrauma.Networking.Client.MaxNameLength = 32
static

◆ MidRoundSyncTimeOut

double Barotrauma.Networking.Client.MidRoundSyncTimeOut

◆ Name

string Barotrauma.Networking.Client.Name

◆ NameChangeCoolDown

readonly TimeSpan Barotrauma.Networking.Client.NameChangeCoolDown = new TimeSpan(hours: 0, minutes: 0, seconds: 30)
static

◆ NameId

UInt16 Barotrauma.Networking.Client.NameId

◆ NeedsMidRoundSync

bool Barotrauma.Networking.Client.NeedsMidRoundSync

◆ PendingName

string Barotrauma.Networking.Client.PendingName

◆ PendingPositionUpdates

readonly Queue<Entity> Barotrauma.Networking.Client.PendingPositionUpdates = new Queue<Entity>()

◆ Permissions

ClientPermissions Barotrauma.Networking.Client.Permissions = ClientPermissions.None

◆ PermittedConsoleCommands

readonly HashSet<DebugConsole.Command> Barotrauma.Networking.Client.PermittedConsoleCommands = new HashSet<DebugConsole.Command>()

◆ Ping

UInt16 Barotrauma.Networking.Client.Ping

◆ PositionUpdateLastSent

readonly Dictionary<Entity, float> Barotrauma.Networking.Client.PositionUpdateLastSent = new Dictionary<Entity, float>()

◆ PreferredJob

Identifier Barotrauma.Networking.Client.PreferredJob

◆ PreferredTeam

CharacterTeamType Barotrauma.Networking.Client.PreferredTeam

◆ ReadyToStart

bool Barotrauma.Networking.Client.ReadyToStart

◆ RejectedName

string Barotrauma.Networking.Client.RejectedName

◆ saveId

UInt16 Barotrauma.Networking.Client.saveId

◆ SessionId

readonly byte Barotrauma.Networking.Client.SessionId

An ID for this client for the current session. THIS IS NOT A PERSISTENT VALUE. DO NOT STORE THIS LONG-TERM. IT CANNOT BE USED TO IDENTIFY PLAYERS ACROSS SESSIONS.

◆ SpectateOnly

bool Barotrauma.Networking.Client.SpectateOnly

◆ TeamID

CharacterTeamType Barotrauma.Networking.Client.TeamID

◆ UnreceivedEntityEventCount

UInt16 Barotrauma.Networking.Client.UnreceivedEntityEventCount

◆ UsingFreeCam

bool Barotrauma.Networking.Client.UsingFreeCam

Is the client using the 'freecam' console command?

◆ VoiceEnabled

bool Barotrauma.Networking.Client.VoiceEnabled = true

◆ VoipServerDecoder

VoipServerDecoder Barotrauma.Networking.Client.VoipServerDecoder

◆ WaitForNextRoundRespawn

bool? Barotrauma.Networking.Client.WaitForNextRoundRespawn

Property Documentation

◆ AccountId

Option<AccountId> Barotrauma.Networking.Client.AccountId
get

The ID of the account used to authenticate this session. This value can be used as a persistent value to identify players in the banlist and campaign saves.

◆ Character

Character Barotrauma.Networking.Client.Character
getset

◆ CharacterInfo

CharacterInfo Barotrauma.Networking.Client.CharacterInfo
getset

◆ ClientList

IReadOnlyList<Client> Barotrauma.Networking.Client.ClientList
staticget

◆ Connection

NetworkConnection Barotrauma.Networking.Client.Connection
getset

◆ HasPermissions

bool Barotrauma.Networking.Client.HasPermissions
get

◆ InGame

bool Barotrauma.Networking.Client.InGame
getset

◆ JobPreferences

List<JobVariant> Barotrauma.Networking.Client.JobPreferences
getset

◆ Karma

float Barotrauma.Networking.Client.Karma
getset

◆ KickVoteCount

int Barotrauma.Networking.Client.KickVoteCount
get

◆ Muted

bool Barotrauma.Networking.Client.Muted
getset

◆ SpectatePos

Vector2? Barotrauma.Networking.Client.SpectatePos
getset

◆ Spectating

bool Barotrauma.Networking.Client.Spectating
get

◆ SteamID

ulong Barotrauma.Networking.Client.SteamID
get

◆ VoipQueue

VoipQueue Barotrauma.Networking.Client.VoipQueue
get

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