Client LuaCsForBarotrauma
ServerExecutableFile.cs
1
using
System;
2
using
Barotrauma
.
IO
;
3
4
namespace
Barotrauma
5
{
6
sealed
class
ServerExecutableFile
:
OtherFile
7
{
8
//This content type doesn't do very much on its own, it's handled manually by the Host Server menu
9
public
ServerExecutableFile
(
ContentPackage
contentPackage,
ContentPath
path) : base(contentPackage, path) { }
10
11
public
static
ContentPath
MutateContentPath
(
ContentPath
path)
12
{
13
if
(File.Exists(path.
FullPath
)) {
return
path; }
14
15
string
rawValueWithoutExtension()
16
=>
Barotrauma
.
IO
.
Path
.Combine(
17
Barotrauma
.
IO
.
Path
.GetDirectoryName(path.
RawValue
??
""
),
18
Barotrauma
.
IO
.
Path
.GetFileNameWithoutExtension(path.
RawValue
??
""
)).CleanUpPath();
19
20
path =
ContentPath
.
FromRaw
(path.
ContentPackage
, rawValueWithoutExtension());
21
if
(File.Exists(path.
FullPath
)) {
return
path; }
22
23
path =
ContentPath
.
FromRaw
(path.
ContentPackage
,
24
rawValueWithoutExtension() +
".exe"
);
25
return
path;
26
}
27
}
28
}
Barotrauma.ContentPackage
Definition:
ContentPackage.cs:18
Barotrauma.ContentPath
Definition:
ContentPath.cs:11
Barotrauma.ContentPath.ContentPackage
readonly? ContentPackage ContentPackage
Definition:
ContentPath.cs:21
Barotrauma.ContentPath.FullPath
string FullPath
Definition:
ContentPath.cs:71
Barotrauma.ContentPath.RawValue
readonly? string RawValue
Definition:
ContentPath.cs:19
Barotrauma.ContentPath.FromRaw
static ContentPath FromRaw(string? rawValue)
Barotrauma.IO.Path
Definition:
SafeIO.cs:209
Barotrauma.OtherFile
Definition:
OtherFile.cs:6
Barotrauma.ServerExecutableFile
Definition:
ServerExecutableFile.cs:7
Barotrauma.ServerExecutableFile.MutateContentPath
static ContentPath MutateContentPath(ContentPath path)
Definition:
ServerExecutableFile.cs:11
Barotrauma.ServerExecutableFile.ServerExecutableFile
ServerExecutableFile(ContentPackage contentPackage, ContentPath path)
Definition:
ServerExecutableFile.cs:9
Barotrauma.IO
Definition:
SafeIO.cs:14
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma
BarotraumaShared
SharedSource
ContentManagement
ContentFile
ServerExecutableFile.cs
Generated by
1.9.1