Client LuaCsForBarotrauma
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs
1
#nullable enable
2
3
using
Barotrauma
.
Networking
;
4
using
System.Linq;
5
6
namespace
Barotrauma
7
{
8
sealed
partial class
TraitorManager
9
{
10
public
struct
TraitorResults
: INetSerializableStruct
11
{
12
[
NetworkSerialize
]
13
public
byte
VotedAsTraitorClientSessionId
;
14
15
[
NetworkSerialize
]
16
public
bool
VotedCorrectTraitor
;
17
18
[
NetworkSerialize
]
19
public
bool
ObjectiveSuccessful
;
20
21
[
NetworkSerialize
]
22
public
int
MoneyPenalty
;
23
24
[
NetworkSerialize
]
25
public
Identifier
TraitorEventIdentifier
;
26
27
public
TraitorResults
(
Client
? votedAsTraitor,
TraitorEvent
traitorEvent)
28
{
29
VotedAsTraitorClientSessionId
= votedAsTraitor?.
SessionId
?? 0;
30
VotedCorrectTraitor
= votedAsTraitor == traitorEvent.
Traitor
;
31
if
(traitorEvent.
Prefab
.
AllowAccusingSecondaryTraitor
&& !
VotedCorrectTraitor
)
32
{
33
VotedCorrectTraitor
= traitorEvent.
SecondaryTraitors
.Contains(votedAsTraitor);
34
}
35
ObjectiveSuccessful
= traitorEvent.
CurrentState
==
TraitorEvent
.
State
.Completed;
36
MoneyPenalty
= votedAsTraitor !=
null
&& !
VotedCorrectTraitor
?
37
traitorEvent.
Prefab
.
MoneyPenaltyForUnfoundedTraitorAccusation
:
38
0;
39
TraitorEventIdentifier
= traitorEvent.
Prefab
.
Identifier
;
40
}
41
42
public
Client
?
GetTraitorClient
()
43
{
44
int
sessionId =
VotedAsTraitorClientSessionId
;
45
return
GameMain
.
NetworkMember
?.ConnectedClients?.FirstOrDefault(c => c.SessionId == sessionId);
46
}
47
}
48
}
49
}
Barotrauma.GameMain
Definition:
GameMain.cs:25
Barotrauma.GameMain.NetworkMember
static NetworkMember NetworkMember
Definition:
GameMain.cs:190
Barotrauma.NetworkSerialize
Marks fields and properties as to be serialized and deserialized by INetSerializableStruct....
Definition:
INetSerializableStruct.cs:40
Barotrauma.Networking.Client
Definition:
LuaBarotraumaAdditions.cs:11
Barotrauma.Networking.Client.SessionId
readonly byte SessionId
An ID for this client for the current session. THIS IS NOT A PERSISTENT VALUE. DO NOT STORE THIS LONG...
Definition:
BarotraumaShared/SharedSource/Networking/Client.cs:37
Barotrauma.Prefab.Identifier
readonly Identifier Identifier
Definition:
Prefab.cs:34
Barotrauma.TraitorEvent
Definition:
TraitorEvent.cs:10
Barotrauma.TraitorEvent.SecondaryTraitors
IEnumerable< Client > SecondaryTraitors
Definition:
TraitorEvent.cs:44
Barotrauma.TraitorEvent.Prefab
new TraitorEventPrefab Prefab
Definition:
TraitorEvent.cs:22
Barotrauma.TraitorEvent.Traitor
Client? Traitor
Definition:
TraitorEvent.cs:40
Barotrauma.TraitorEvent.State
State
Definition:
TraitorEvent.cs:12
Barotrauma.TraitorEvent.CurrentState
State? CurrentState
Definition:
TraitorEvent.cs:28
Barotrauma.TraitorEventPrefab.MoneyPenaltyForUnfoundedTraitorAccusation
readonly int MoneyPenaltyForUnfoundedTraitorAccusation
Money penalty if the crew votes a wrong player as the traitor
Definition:
TraitorEventPrefab.cs:258
Barotrauma.TraitorEventPrefab.AllowAccusingSecondaryTraitor
readonly bool AllowAccusingSecondaryTraitor
Does accusing a secondary traitor count as correctly identifying the traitor?
Definition:
TraitorEventPrefab.cs:253
Barotrauma.TraitorManager
Definition:
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs:9
Barotrauma.Networking
Definition:
LuaBarotraumaAdditions.cs:9
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma.TraitorManager.TraitorResults
Definition:
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs:11
Barotrauma.TraitorManager.TraitorResults.ObjectiveSuccessful
bool ObjectiveSuccessful
Definition:
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs:19
Barotrauma.TraitorManager.TraitorResults.GetTraitorClient
Client? GetTraitorClient()
Definition:
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs:42
Barotrauma.TraitorManager.TraitorResults.VotedCorrectTraitor
bool VotedCorrectTraitor
Definition:
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs:16
Barotrauma.TraitorManager.TraitorResults.MoneyPenalty
int MoneyPenalty
Definition:
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs:22
Barotrauma.TraitorManager.TraitorResults.TraitorResults
TraitorResults(Client? votedAsTraitor, TraitorEvent traitorEvent)
Definition:
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs:27
Barotrauma.TraitorManager.TraitorResults.TraitorEventIdentifier
Identifier TraitorEventIdentifier
Definition:
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs:25
Barotrauma.TraitorManager.TraitorResults.VotedAsTraitorClientSessionId
byte VotedAsTraitorClientSessionId
Definition:
BarotraumaShared/SharedSource/Traitors/TraitorManager.cs:13
Barotrauma
BarotraumaShared
SharedSource
Traitors
TraitorManager.cs
Generated by
1.9.1