File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/Module/Admin/View/Overview Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 44
55namespace Stu \Module \Admin \View \Overview ;
66
7- use Stu \Component \Image \ImageCreationInterface ;
87use Stu \Module \Config \StuConfigInterface ;
98use Stu \Module \Control \GameControllerInterface ;
109use Stu \Module \Control \ViewControllerInterface ;
1110
1211final class Overview implements ViewControllerInterface
1312{
1413 public function __construct (
15- private readonly ImageCreationInterface $ imageCreation ,
1614 private readonly StuConfigInterface $ config
1715 ) {}
1816
@@ -31,19 +29,20 @@ private function setWeatherReport(GameControllerInterface $game): void
3129 // load event map from file
3230 $ historyFolder = $ this ->config ->getGameSettings ()->getTempDir () . '/history ' ;
3331
32+ $ fileName = $ historyFolder . '/ionstorm_map_layer_2.gif ' ;
3433 // check if file exists
35- if (!file_exists ($ historyFolder . ' /ionstorm_map_layer_2.gif ' )) {
34+ if (!file_exists ($ fileName )) {
3635 return ;
3736 }
3837
39- $ graph = imagecreatefromgif ( $ historyFolder . ' /ionstorm_map_layer_2.gif ' );
40- if ($ graph === false ) {
38+ $ fileContent = file_get_contents ( $ fileName );
39+ if ($ fileContent === false ) {
4140 return ;
4241 }
4342
4443 $ game ->setTemplateVar (
4544 'ION_STORM_MAP ' ,
46- '<img src="data:image/gif;base64, ' . base64_encode (file_get_contents ( $ historyFolder . ' /ionstorm_map_layer_2.gif ' ) ) . '"/> '
45+ '<img src="data:image/gif;base64, ' . base64_encode ($ fileContent ) . '"/> '
4746 );
4847 }
4948}
You can’t perform that action at this time.
0 commit comments