@@ -30,15 +30,15 @@ public function setEndAt($timestamp) {
30
30
}
31
31
32
32
public function setServerStats () {
33
- $ this ->serverStats = Cache::get ("stat_server_ {$ this ->startAt }" );
33
+ $ this ->serverStats = Cache::store ( ' file ' )-> get ("stat_server_ {$ this ->startAt }" );
34
34
$ this ->serverStats = json_decode ($ this ->serverStats , true ) ?? [];
35
35
if (!is_array ($ this ->serverStats )) {
36
36
$ this ->serverStats = [];
37
37
}
38
38
}
39
39
40
40
public function setUserStats () {
41
- $ this ->userStats = Cache::get ("stat_user_ {$ this ->startAt }" );
41
+ $ this ->userStats = Cache::store ( ' file ' )-> get ("stat_user_ {$ this ->startAt }" );
42
42
$ this ->userStats = json_decode ($ this ->userStats , true ) ?? [];
43
43
if (!is_array ($ this ->userStats )) {
44
44
$ this ->userStats = [];
@@ -95,7 +95,7 @@ public function statServer($serverId, $serverType, $u, $d)
95
95
} else {
96
96
$ this ->serverStats [$ serverType ][$ serverId ] = [$ u , $ d ];
97
97
}
98
- Cache::set ("stat_server_ {$ this ->startAt }" , json_encode ($ this ->serverStats ));
98
+ Cache::store ( ' file ' )-> set ("stat_server_ {$ this ->startAt }" , json_encode ($ this ->serverStats ));
99
99
}
100
100
101
101
public function statUser ($ rate , $ userId , $ u , $ d )
@@ -107,7 +107,7 @@ public function statUser($rate, $userId, $u, $d)
107
107
} else {
108
108
$ this ->userStats [$ rate ][$ userId ] = [$ u , $ d ];
109
109
}
110
- Cache::set ("stat_user_ {$ this ->startAt }" , json_encode ($ this ->userStats ));
110
+ Cache::store ( ' file ' )-> set ("stat_user_ {$ this ->startAt }" , json_encode ($ this ->userStats ));
111
111
}
112
112
113
113
public function getStatUserByUserID ($ userId ): array
@@ -165,12 +165,12 @@ public function getStatServer()
165
165
166
166
public function clearStatUser ()
167
167
{
168
- Cache::forget ("stat_user_ {$ this ->startAt }" );
168
+ Cache::store ( ' file ' )-> forget ("stat_user_ {$ this ->startAt }" );
169
169
}
170
170
171
171
public function clearStatServer ()
172
172
{
173
- Cache::forget ("stat_server_ {$ this ->startAt }" );
173
+ Cache::store ( ' file ' )-> forget ("stat_server_ {$ this ->startAt }" );
174
174
}
175
175
176
176
public function getStatRecord ($ type )
0 commit comments