GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
CrashDump Class Reference

Public Member Functions

 __construct (Server $server)
 
 getPath ()
 
 getEncodedData ()
 
 getData ()
 
 addLine ($line="")
 
 add ($str)
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( Server  $server)

CrashDump constructor.

Parameters
Server$server
54  {
55  $this->time = time();
56  $this->server = $server;
57  $this->path = $this->server->getCrashPath() . "CrashDump_" . date("D_M_j-H.i.s-T_Y", $this->time) . ".log";
58  $this->fp = @fopen($this->path, "wb");
59  if(!is_resource($this->fp)){
60  throw new \RuntimeException("Could not create Crash Dump");
61  }
62  $this->data["time"] = $this->time;
63  $this->addLine($this->server->getName() . " Crash Dump " . date("D M j H:i:s T Y", $this->time));
64  $this->addLine();
65  try{
66  $this->baseCrash();
67  }catch(\Exception $e){
68  //Attempt to fix incomplete crashdumps
69  $this->addLine("CrashDump crashed while generating base crash data");
70  $this->addLine();
71  }
72 
73  $this->generalData();
74  $this->pluginsData();
75 
76  $this->extraData();
77 
78  //$this->encodeData();
79  }

Member Function Documentation

◆ add()

add (   $str)
Parameters
$str
270  {
271  fwrite($this->fp, $str);
272  }

◆ addLine()

addLine (   $line = "")
Parameters
string$line
263  {
264  fwrite($this->fp, $line . PHP_EOL);
265  }

◆ getData()

getData ( )
Returns
array
98  {
99  return $this->data;
100  }

◆ getEncodedData()

getEncodedData ( )
Returns
null
91  {
92  return $this->encodedData;
93  }

◆ getPath()

getPath ( )
Returns
string
84  {
85  return $this->path;
86  }

The documentation for this class was generated from the following file: