Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function parse()
- {
- $this->data->version = $this->readLong();
- if ($this->data->version == 0 || $this->data->version == 1) {
- $this->data->subVersion = $this->data->version;
- } else {
- $this->data->subVersion = $this->readLong();
- }
- if ($this->data->subVersion == 1) {
- $this->data->mainCustomCodeComment = $this->readString();
- $this->data->mainCustomCode = $this->readTriggerStruct();
- } elseif ($this->data->subVersion == 0) {
- $this->data->mainCustomCodeComment = '';
- $this->data->mainCustomCode = '';
- } else {
- throw new \Exception("Unexpected version value of '{$this->data->version}'");
- }
- if ($this->data->version <= 1) {
- $this->skip(4);
- }
- $this->data->customTriggers = [];
- while (!$this->endOfFile()) {
- $this->data->customTriggers[] = $this->readTriggerStruct();
- }
- }
- public function readTriggerStruct()
- {
- $length = $this->readLong();
- if ($length == 0) {
- return null;
- }
- return $this->readString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement