Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CloudSocialModule.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
using
rail;
3
using
Terraria.Social.Base
;
4
5
namespace
Terraria.Social.WeGame
;
6
7
public
class
CloudSocialModule
:
Terraria
.Social.Base.
CloudSocialModule
8
{
9
private
object
ioLock
=
new
object();
10
11
public
override
void
Initialize
()
12
{
13
}
14
15
public
override
void
Shutdown
()
16
{
17
}
18
19
public
override
IEnumerable<string>
GetFiles
()
20
{
21
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
22
lock
(
ioLock
)
23
{
24
uint
fileCount
=
rail_api
.RailFactory().RailStorageHelper().GetFileCount();
25
List<string>
list =
new
List<string>
((
int
)
fileCount
);
26
ulong num = 0
uL
;
27
string
item =
default
(
string
);
28
for
(uint
num2
= 0
u
;
num2
<
fileCount
;
num2
++)
29
{
30
rail_api
.RailFactory().RailStorageHelper().GetFileNameAndSize(
num2
,
ref
item,
ref
num);
31
list.Add(item);
32
}
33
return
list;
34
}
35
}
36
37
public
override
bool
Write
(
string
path
,
byte
[] data,
int
length)
38
{
39
lock
(
ioLock
)
40
{
41
bool
result =
true
;
42
IRailFile
val =
null
;
43
val = ((!
rail_api
.RailFactory().RailStorageHelper().IsFileExist(
path
)) ?
rail_api
.RailFactory().RailStorageHelper().CreateFile(
path
) :
rail_api
.RailFactory().RailStorageHelper().OpenFile(
path
));
44
if
(val !=
null
)
45
{
46
val.Write(data, (uint)length);
47
val.Close();
48
}
49
else
50
{
51
result =
false
;
52
}
53
return
result;
54
}
55
}
56
57
public
override
int
GetFileSize
(
string
path
)
58
{
59
lock
(
ioLock
)
60
{
61
IRailFile
val =
rail_api
.RailFactory().RailStorageHelper().OpenFile(
path
);
62
if
(val !=
null
)
63
{
64
int
size = (int)val.GetSize();
65
val.Close();
66
return
size;
67
}
68
return
0;
69
}
70
}
71
72
public
override
void
Read
(
string
path
,
byte
[] buffer,
int
size)
73
{
74
lock
(
ioLock
)
75
{
76
IRailFile
val =
rail_api
.RailFactory().RailStorageHelper().OpenFile(
path
);
77
if
(val !=
null
)
78
{
79
val.Read(buffer, (uint)size);
80
val.Close();
81
}
82
}
83
}
84
85
public
override
bool
HasFile
(
string
path
)
86
{
87
lock
(
ioLock
)
88
{
89
return
rail_api
.RailFactory().RailStorageHelper().IsFileExist(
path
);
90
}
91
}
92
93
public
override
bool
Delete
(
string
path
)
94
{
95
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
96
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
97
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
98
//IL_0024: Invalid comparison between Unknown and I4
99
lock
(
ioLock
)
100
{
101
RailResult
val =
rail_api
.RailFactory().RailStorageHelper().RemoveFile(
path
);
102
return
(
int
)val == 0;
103
}
104
}
105
106
public
override
bool
Forget
(
string
path
)
107
{
108
return
Delete
(
path
);
109
}
110
}
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
Terraria.Social.WeGame.CloudSocialModule.Forget
override bool Forget(string path)
Definition
CloudSocialModule.cs:106
Terraria.Social.WeGame.CloudSocialModule.Shutdown
override void Shutdown()
Definition
CloudSocialModule.cs:15
Terraria.Social.WeGame.CloudSocialModule.Write
override bool Write(string path, byte[] data, int length)
Definition
CloudSocialModule.cs:37
Terraria.Social.WeGame.CloudSocialModule.Read
override void Read(string path, byte[] buffer, int size)
Definition
CloudSocialModule.cs:72
Terraria.Social.WeGame.CloudSocialModule.GetFileSize
override int GetFileSize(string path)
Definition
CloudSocialModule.cs:57
Terraria.Social.WeGame.CloudSocialModule.Initialize
override void Initialize()
Definition
CloudSocialModule.cs:11
Terraria.Social.WeGame.CloudSocialModule.HasFile
override bool HasFile(string path)
Definition
CloudSocialModule.cs:85
Terraria.Social.WeGame.CloudSocialModule.Delete
override bool Delete(string path)
Definition
CloudSocialModule.cs:93
Terraria.Social.WeGame.CloudSocialModule.ioLock
object ioLock
Definition
CloudSocialModule.cs:9
Terraria.Social.WeGame.CloudSocialModule.GetFiles
override IEnumerable< string > GetFiles()
Definition
CloudSocialModule.cs:19
Terraria.Social.WeGame.CloudSocialModule
Definition
CloudSocialModule.cs:8
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
Terraria.Social.Base
Definition
AchievementsSocialModule.cs:1
Terraria.Social.WeGame
Definition
AchievementsSocialModule.cs:6
Terraria
Definition
Achievement.cs:7
source
Terraria.Social.WeGame
CloudSocialModule.cs
Generated by
1.10.0