Barotrauma Client Doc
Barotrauma.Networking.GameClient Class Reference
Inheritance diagram for Barotrauma.Networking.GameClient:

Classes

struct  PermissionChangedEvent
 

Public Member Functions

void SetName (string value)
 
void ForceNameAndJobUpdate ()
 
 GameClient (string newName, Endpoint endpoint, string serverName, Option< int > ownerKey)
 
ServerInfo CreateServerInfoFromSettings ()
 
void SetLobbyPublic (bool isPublic)
 
void CreateServerCrashMessage ()
 
void Update (float deltaTime)
 
IEnumerable< CoroutineStatusEndGame (string endMessage, CampaignMode.TransitionType transitionType=CampaignMode.TransitionType.None, TraitorManager.TraitorResults? traitorResults=null)
 
void SendChatMessage (ChatMessage msg)
 
void SendChatMessage (string message, ChatMessageType type=ChatMessageType.Default)
 
void SendRespawnPromptResponse (bool waitForNextRoundRespawn)
 
void RequestFile (FileTransferType fileType, string file, string fileHash)
 
void CancelFileTransfer (FileReceiver.FileTransferIn transfer)
 
void UpdateFileTransfer (FileReceiver.FileTransferIn transfer, int expecting, int lastSeen, bool reliable=false)
 
void CancelFileTransfer (int id)
 
override void CreateEntityEvent (INetSerializable entity, NetEntityEvent.IData extraData=null)
 
bool HasPermission (ClientPermissions permission)
 
bool HasConsoleCommandPermission (Identifier commandName)
 
void Quit ()
 
void SendCharacterInfo (string newName=null)
 
void WriteCharacterInfo (IWriteMessage msg, string newName=null)
 
void Vote (VoteType voteType, object data)
 
void VoteForKick (Client votedClient)
 
void InitiateSubmarineChange (SubmarineInfo sub, bool transferItems, VoteType voteType)
 
void ShowSubmarineChangeVoteInterface (Client starter, SubmarineInfo info, VoteType type, bool transferItems, float timeOut)
 
void ShowMoneyTransferVoteInterface (Client starter, Client from, int amount, Client to, float timeOut)
 
override void AddChatMessage (ChatMessage message)
 
override void KickPlayer (string kickedName, string reason)
 
override void BanPlayer (string kickedName, string reason, TimeSpan? duration=null)
 
override void UnbanPlayer (string playerName)
 
override void UnbanPlayer (Endpoint endpoint)
 
void UpdateClientPermissions (Client targetClient)
 
void SendCampaignState ()
 
void SendConsoleCommand (string command)
 
void RequestStartRound (bool continueCampaign=false)
 Tell the server to start the round (permission required) More...
 
void RequestSelectSub (SubmarineInfo sub, bool isShuttle)
 Tell the server to select a submarine (permission required) More...
 
void RequestSelectMode (int modeIndex)
 Tell the server to select a mode (permission required) More...
 
void SetupNewCampaign (SubmarineInfo sub, string saveName, string mapSeed, CampaignSettings settings)
 
void SetupLoadCampaign (string saveName)
 
void RequestRoundEnd (bool save, bool quitCampaign=false)
 Tell the server to end the round (permission required) More...
 
bool SpectateClicked (GUIButton button, object _)
 
bool SetReadyToStart (GUITickBox tickBox)
 
bool ToggleEndRoundVote (GUITickBox tickBox)
 
void UpdateLogButtonPermissions ()
 
bool TypingChatMessage (GUITextBox textBox, string text)
 
bool EnterChatMessage (GUITextBox textBox, string message)
 
void AddToGUIUpdateList ()
 
void UpdateHUD (float deltaTime)
 
void Draw (Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
 
bool SelectCrewCharacter (Character character, GUIComponent frame)
 
bool SelectCrewClient (Client client, GUIComponent frame)
 
void CreateKickReasonPrompt (string clientName, bool ban)
 
void ReportError (ClientNetError error, UInt16 expectedId=0, UInt16 eventId=0, UInt16 entityId=0)
 

Public Attributes

string PendingName = string.Empty
 
LocalizedString endRoundVoteText
 
GUITickBox EndVoteTickBox
 
readonly NetStats NetStats
 
CameraTransition EndCinematic
 
bool LateCampaignJoin = false
 
readonly List< SubmarineInfoServerSubmarines = new List<SubmarineInfo>()
 
UInt16 LastSentEntityEventID
 
bool HasSpawned
 
LocalizedString TraitorFirstObjective
 
TraitorEventPrefab TraitorMission = null
 
readonly FileReceiver FileReceiver
 
readonly ClientEntityEventManager EntityEventManager
 
readonly NamedEvent< PermissionChangedEvent > OnPermissionChanged = new NamedEvent<PermissionChangedEvent>()
 
GUIButton ShowLogButton
 

Static Public Attributes

static readonly TimeSpan CampaignSaveTransferTimeOut = new TimeSpan(0, 0, seconds: 100)
 
static readonly TimeSpan LevelTransitionTimeOut = new TimeSpan(0, 0, seconds: 150)
 

Protected Attributes

GUITickBox cameraFollowsSub
 
CharacterInfo characterInfo
 
Character myCharacter
 
GUIFrame inGameHUD
 
ChatBox chatBox
 

Properties

override bool IsClient [get]
 
override bool IsServer [get]
 
override Voting Voting [get]
 
string Name [get]
 
ClientPeer ClientPeer [get]
 
GUITickBox FollowSubTickBox [get]
 
bool IsFollowSubTickBoxVisible [get]
 
bool RoundStarting [get]
 
string ServerName [get]
 
byte SessionId [get]
 
VoipClient VoipClient [get]
 
override IReadOnlyList< ClientConnectedClients [get]
 
Option< int > Ping [get]
 
IEnumerable< ClientPreviouslyConnectedClients [get]
 
bool MidRoundSyncing [get]
 
bool? WaitForNextRoundRespawn [get, set]
 
bool IsServerOwner [get]
 
CharacterInfo CharacterInfo [get, set]
 
Character Character [get, set]
 
GUIFrame InGameHUD [get]
 
ChatBox ChatBox [get]
 
VotingInterface VotingInterface [get]
 

Detailed Description

Definition at line 16 of file GameClient.cs.

Constructor & Destructor Documentation

◆ GameClient()

Barotrauma.Networking.GameClient.GameClient ( string  newName,
Endpoint  endpoint,
string  serverName,
Option< int >  ownerKey 
)

Definition at line 184 of file GameClient.cs.

Member Function Documentation

◆ AddChatMessage()

override void Barotrauma.Networking.GameClient.AddChatMessage ( ChatMessage  message)

Definition at line 2673 of file GameClient.cs.

◆ AddToGUIUpdateList()

void Barotrauma.Networking.GameClient.AddToGUIUpdateList ( )

Definition at line 3016 of file GameClient.cs.

◆ BanPlayer()

override void Barotrauma.Networking.GameClient.BanPlayer ( string  kickedName,
string  reason,
TimeSpan?  duration = null 
)

Definition at line 2696 of file GameClient.cs.

◆ CancelFileTransfer() [1/2]

void Barotrauma.Networking.GameClient.CancelFileTransfer ( FileReceiver.FileTransferIn  transfer)

Definition at line 2371 of file GameClient.cs.

◆ CancelFileTransfer() [2/2]

void Barotrauma.Networking.GameClient.CancelFileTransfer ( int  id)

Definition at line 2393 of file GameClient.cs.

◆ CreateEntityEvent()

override void Barotrauma.Networking.GameClient.CreateEntityEvent ( INetSerializable  entity,
NetEntityEvent.IData  extraData = null 
)

Definition at line 2543 of file GameClient.cs.

◆ CreateKickReasonPrompt()

void Barotrauma.Networking.GameClient.CreateKickReasonPrompt ( string  clientName,
bool  ban 
)

Definition at line 3325 of file GameClient.cs.

◆ CreateServerCrashMessage()

void Barotrauma.Networking.GameClient.CreateServerCrashMessage ( )

Definition at line 339 of file GameClient.cs.

◆ CreateServerInfoFromSettings()

ServerInfo Barotrauma.Networking.GameClient.CreateServerInfoFromSettings ( )

Definition at line 282 of file GameClient.cs.

◆ Draw()

void Barotrauma.Networking.GameClient.Draw ( Microsoft.Xna.Framework.Graphics.SpriteBatch  spriteBatch)

Definition at line 3109 of file GameClient.cs.

◆ EndGame()

IEnumerable<CoroutineStatus> Barotrauma.Networking.GameClient.EndGame ( string  endMessage,
CampaignMode.TransitionType  transitionType = CampaignMode.TransitionType.None,
TraitorManager.TraitorResults traitorResults = null 
)

Definition at line 1681 of file GameClient.cs.

◆ EnterChatMessage()

bool Barotrauma.Networking.GameClient.EnterChatMessage ( GUITextBox  textBox,
string  message 
)

Definition at line 2989 of file GameClient.cs.

◆ ForceNameAndJobUpdate()

void Barotrauma.Networking.GameClient.ForceNameAndJobUpdate ( )

Definition at line 40 of file GameClient.cs.

◆ HasConsoleCommandPermission()

bool Barotrauma.Networking.GameClient.HasConsoleCommandPermission ( Identifier  commandName)

Definition at line 2557 of file GameClient.cs.

◆ HasPermission()

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

Definition at line 2552 of file GameClient.cs.

◆ InitiateSubmarineChange()

void Barotrauma.Networking.GameClient.InitiateSubmarineChange ( SubmarineInfo  sub,
bool  transferItems,
VoteType  voteType 
)

Definition at line 2644 of file GameClient.cs.

◆ KickPlayer()

override void Barotrauma.Networking.GameClient.KickPlayer ( string  kickedName,
string  reason 
)

Definition at line 2685 of file GameClient.cs.

◆ Quit()

void Barotrauma.Networking.GameClient.Quit ( )

Definition at line 2576 of file GameClient.cs.

◆ ReportError()

void Barotrauma.Networking.GameClient.ReportError ( ClientNetError  error,
UInt16  expectedId = 0,
UInt16  eventId = 0,
UInt16  entityId = 0 
)

Definition at line 3403 of file GameClient.cs.

◆ RequestFile()

void Barotrauma.Networking.GameClient.RequestFile ( FileTransferType  fileType,
string  file,
string  fileHash 
)

Definition at line 2352 of file GameClient.cs.

◆ RequestRoundEnd()

void Barotrauma.Networking.GameClient.RequestRoundEnd ( bool  save,
bool  quitCampaign = false 
)

Tell the server to end the round (permission required)

Definition at line 2857 of file GameClient.cs.

◆ RequestSelectMode()

void Barotrauma.Networking.GameClient.RequestSelectMode ( int  modeIndex)

Tell the server to select a mode (permission required)

Definition at line 2802 of file GameClient.cs.

◆ RequestSelectSub()

void Barotrauma.Networking.GameClient.RequestSelectSub ( SubmarineInfo  sub,
bool  isShuttle 
)

Tell the server to select a submarine (permission required)

Definition at line 2787 of file GameClient.cs.

◆ RequestStartRound()

void Barotrauma.Networking.GameClient.RequestStartRound ( bool  continueCampaign = false)

Tell the server to start the round (permission required)

Definition at line 2773 of file GameClient.cs.

◆ SelectCrewCharacter()

bool Barotrauma.Networking.GameClient.SelectCrewCharacter ( Character  character,
GUIComponent  frame 
)

Definition at line 3234 of file GameClient.cs.

◆ SelectCrewClient()

bool Barotrauma.Networking.GameClient.SelectCrewClient ( Client  client,
GUIComponent  frame 
)

Definition at line 3249 of file GameClient.cs.

◆ SendCampaignState()

void Barotrauma.Networking.GameClient.SendCampaignState ( )

Definition at line 2737 of file GameClient.cs.

◆ SendCharacterInfo()

void Barotrauma.Networking.GameClient.SendCharacterInfo ( string  newName = null)

Definition at line 2585 of file GameClient.cs.

◆ SendChatMessage() [1/2]

void Barotrauma.Networking.GameClient.SendChatMessage ( ChatMessage  msg)

Definition at line 2318 of file GameClient.cs.

◆ SendChatMessage() [2/2]

void Barotrauma.Networking.GameClient.SendChatMessage ( string  message,
ChatMessageType  type = ChatMessageType.Default 
)

Definition at line 2326 of file GameClient.cs.

◆ SendConsoleCommand()

void Barotrauma.Networking.GameClient.SendConsoleCommand ( string  command)

Definition at line 2751 of file GameClient.cs.

◆ SendRespawnPromptResponse()

void Barotrauma.Networking.GameClient.SendRespawnPromptResponse ( bool  waitForNextRoundRespawn)

Definition at line 2343 of file GameClient.cs.

◆ SetLobbyPublic()

void Barotrauma.Networking.GameClient.SetLobbyPublic ( bool  isPublic)

Definition at line 318 of file GameClient.cs.

◆ SetName()

void Barotrauma.Networking.GameClient.SetName ( string  value)

Definition at line 33 of file GameClient.cs.

◆ SetReadyToStart()

bool Barotrauma.Networking.GameClient.SetReadyToStart ( GUITickBox  tickBox)

Definition at line 2900 of file GameClient.cs.

◆ SetupLoadCampaign()

void Barotrauma.Networking.GameClient.SetupLoadCampaign ( string  saveName)

Definition at line 2838 of file GameClient.cs.

◆ SetupNewCampaign()

void Barotrauma.Networking.GameClient.SetupNewCampaign ( SubmarineInfo  sub,
string  saveName,
string  mapSeed,
CampaignSettings  settings 
)

Definition at line 2818 of file GameClient.cs.

◆ ShowMoneyTransferVoteInterface()

void Barotrauma.Networking.GameClient.ShowMoneyTransferVoteInterface ( Client  starter,
Client  from,
int  amount,
Client  to,
float  timeOut 
)

Definition at line 2660 of file GameClient.cs.

◆ ShowSubmarineChangeVoteInterface()

void Barotrauma.Networking.GameClient.ShowSubmarineChangeVoteInterface ( Client  starter,
SubmarineInfo  info,
VoteType  type,
bool  transferItems,
float  timeOut 
)

Definition at line 2650 of file GameClient.cs.

◆ SpectateClicked()

bool Barotrauma.Networking.GameClient.SpectateClicked ( GUIButton  button,
object  _ 
)

Definition at line 2869 of file GameClient.cs.

◆ ToggleEndRoundVote()

bool Barotrauma.Networking.GameClient.ToggleEndRoundVote ( GUITickBox  tickBox)

Definition at line 2911 of file GameClient.cs.

◆ TypingChatMessage()

bool Barotrauma.Networking.GameClient.TypingChatMessage ( GUITextBox  textBox,
string  text 
)

Definition at line 2984 of file GameClient.cs.

◆ UnbanPlayer() [1/2]

override void Barotrauma.Networking.GameClient.UnbanPlayer ( Endpoint  endpoint)

Definition at line 2718 of file GameClient.cs.

◆ UnbanPlayer() [2/2]

override void Barotrauma.Networking.GameClient.UnbanPlayer ( string  playerName)

Definition at line 2708 of file GameClient.cs.

◆ Update()

void Barotrauma.Networking.GameClient.Update ( float  deltaTime)

Definition at line 459 of file GameClient.cs.

◆ UpdateClientPermissions()

void Barotrauma.Networking.GameClient.UpdateClientPermissions ( Client  targetClient)

Definition at line 2728 of file GameClient.cs.

◆ UpdateFileTransfer()

void Barotrauma.Networking.GameClient.UpdateFileTransfer ( FileReceiver.FileTransferIn  transfer,
int  expecting,
int  lastSeen,
bool  reliable = false 
)

Definition at line 2376 of file GameClient.cs.

◆ UpdateHUD()

void Barotrauma.Networking.GameClient.UpdateHUD ( float  deltaTime)

Definition at line 3033 of file GameClient.cs.

◆ UpdateLogButtonPermissions()

void Barotrauma.Networking.GameClient.UpdateLogButtonPermissions ( )

Definition at line 2946 of file GameClient.cs.

◆ Vote()

void Barotrauma.Networking.GameClient.Vote ( VoteType  voteType,
object  data 
)

Definition at line 2616 of file GameClient.cs.

◆ VoteForKick()

void Barotrauma.Networking.GameClient.VoteForKick ( Client  votedClient)

Definition at line 2637 of file GameClient.cs.

◆ WriteCharacterInfo()

void Barotrauma.Networking.GameClient.WriteCharacterInfo ( IWriteMessage  msg,
string  newName = null 
)

Definition at line 2593 of file GameClient.cs.

Member Data Documentation

◆ cameraFollowsSub

GUITickBox Barotrauma.Networking.GameClient.cameraFollowsSub
protected

Definition at line 56 of file GameClient.cs.

◆ CampaignSaveTransferTimeOut

readonly TimeSpan Barotrauma.Networking.GameClient.CampaignSaveTransferTimeOut = new TimeSpan(0, 0, seconds: 100)
static

Definition at line 18 of file GameClient.cs.

◆ characterInfo

CharacterInfo Barotrauma.Networking.GameClient.characterInfo
protected

Definition at line 2925 of file GameClient.cs.

◆ chatBox

ChatBox Barotrauma.Networking.GameClient.chatBox
protected

Definition at line 2941 of file GameClient.cs.

◆ EndCinematic

CameraTransition Barotrauma.Networking.GameClient.EndCinematic

Definition at line 63 of file GameClient.cs.

◆ endRoundVoteText

LocalizedString Barotrauma.Networking.GameClient.endRoundVoteText

Definition at line 50 of file GameClient.cs.

◆ EndVoteTickBox

GUITickBox Barotrauma.Networking.GameClient.EndVoteTickBox

Definition at line 51 of file GameClient.cs.

◆ EntityEventManager

readonly ClientEntityEventManager Barotrauma.Networking.GameClient.EntityEventManager

Definition at line 157 of file GameClient.cs.

◆ FileReceiver

readonly FileReceiver Barotrauma.Networking.GameClient.FileReceiver

Definition at line 150 of file GameClient.cs.

◆ HasSpawned

bool Barotrauma.Networking.GameClient.HasSpawned

Definition at line 113 of file GameClient.cs.

◆ inGameHUD

GUIFrame Barotrauma.Networking.GameClient.inGameHUD
protected

Definition at line 2940 of file GameClient.cs.

◆ LastSentEntityEventID

UInt16 Barotrauma.Networking.GameClient.LastSentEntityEventID

Definition at line 100 of file GameClient.cs.

◆ LateCampaignJoin

bool Barotrauma.Networking.GameClient.LateCampaignJoin = false

Definition at line 65 of file GameClient.cs.

◆ LevelTransitionTimeOut

readonly TimeSpan Barotrauma.Networking.GameClient.LevelTransitionTimeOut = new TimeSpan(0, 0, seconds: 150)
static

Definition at line 20 of file GameClient.cs.

◆ myCharacter

Character Barotrauma.Networking.GameClient.myCharacter
protected

Definition at line 2926 of file GameClient.cs.

◆ NetStats

readonly NetStats Barotrauma.Networking.GameClient.NetStats

Definition at line 54 of file GameClient.cs.

◆ OnPermissionChanged

readonly NamedEvent<PermissionChangedEvent> Barotrauma.Networking.GameClient.OnPermissionChanged = new NamedEvent<PermissionChangedEvent>()

Definition at line 182 of file GameClient.cs.

◆ PendingName

string Barotrauma.Networking.GameClient.PendingName = string.Empty

Definition at line 31 of file GameClient.cs.

◆ ServerSubmarines

readonly List<SubmarineInfo> Barotrauma.Networking.GameClient.ServerSubmarines = new List<SubmarineInfo>()

Definition at line 90 of file GameClient.cs.

◆ ShowLogButton

GUIButton Barotrauma.Networking.GameClient.ShowLogButton

Definition at line 2943 of file GameClient.cs.

◆ TraitorFirstObjective

LocalizedString Barotrauma.Networking.GameClient.TraitorFirstObjective

Definition at line 115 of file GameClient.cs.

◆ TraitorMission

TraitorEventPrefab Barotrauma.Networking.GameClient.TraitorMission = null

Definition at line 116 of file GameClient.cs.

Property Documentation

◆ Character

Character Barotrauma.Networking.GameClient.Character
getset

Definition at line 2934 of file GameClient.cs.

◆ CharacterInfo

CharacterInfo Barotrauma.Networking.GameClient.CharacterInfo
getset

Definition at line 2928 of file GameClient.cs.

◆ ChatBox

ChatBox Barotrauma.Networking.GameClient.ChatBox
get

Definition at line 2973 of file GameClient.cs.

◆ ClientPeer

ClientPeer Barotrauma.Networking.GameClient.ClientPeer
get

Definition at line 45 of file GameClient.cs.

◆ ConnectedClients

override IReadOnlyList<Client> Barotrauma.Networking.GameClient.ConnectedClients
get

Definition at line 126 of file GameClient.cs.

◆ FollowSubTickBox

GUITickBox Barotrauma.Networking.GameClient.FollowSubTickBox
get

Definition at line 57 of file GameClient.cs.

◆ InGameHUD

GUIFrame Barotrauma.Networking.GameClient.InGameHUD
get

Definition at line 2968 of file GameClient.cs.

◆ IsClient

override bool Barotrauma.Networking.GameClient.IsClient
get

Definition at line 22 of file GameClient.cs.

◆ IsFollowSubTickBoxVisible

bool Barotrauma.Networking.GameClient.IsFollowSubTickBoxVisible
get

Definition at line 59 of file GameClient.cs.

◆ IsServer

override bool Barotrauma.Networking.GameClient.IsServer
get

Definition at line 23 of file GameClient.cs.

◆ IsServerOwner

bool Barotrauma.Networking.GameClient.IsServerOwner
get

Definition at line 168 of file GameClient.cs.

◆ MidRoundSyncing

bool Barotrauma.Networking.GameClient.MidRoundSyncing
get

Definition at line 152 of file GameClient.cs.

◆ Name

string Barotrauma.Networking.GameClient.Name
get

Definition at line 29 of file GameClient.cs.

◆ Ping

Option<int> Barotrauma.Networking.GameClient.Ping
get

Definition at line 134 of file GameClient.cs.

◆ PreviouslyConnectedClients

IEnumerable<Client> Barotrauma.Networking.GameClient.PreviouslyConnectedClients
get

Definition at line 145 of file GameClient.cs.

◆ RoundStarting

bool Barotrauma.Networking.GameClient.RoundStarting
get

Definition at line 86 of file GameClient.cs.

◆ ServerName

string Barotrauma.Networking.GameClient.ServerName
get

Definition at line 92 of file GameClient.cs.

◆ SessionId

byte Barotrauma.Networking.GameClient.SessionId
get

Definition at line 118 of file GameClient.cs.

◆ VoipClient

VoipClient Barotrauma.Networking.GameClient.VoipClient
get

Definition at line 120 of file GameClient.cs.

◆ Voting

override Voting Barotrauma.Networking.GameClient.Voting
get

Definition at line 25 of file GameClient.cs.

◆ VotingInterface

VotingInterface Barotrauma.Networking.GameClient.VotingInterface
get

Definition at line 2978 of file GameClient.cs.

◆ WaitForNextRoundRespawn

bool? Barotrauma.Networking.GameClient.WaitForNextRoundRespawn
getset

Definition at line 159 of file GameClient.cs.