game = $game; $this->players = $game->getLib('beta5/player'); } function getPlayer() { if (is_null($this->data['player'])) return null; return $this->players->call('get', $this->data['player']); } function getSender() { return "Alliance [".utf8entities($this->data['tag']) . "]"; } function getSLink() { if (is_null($this->data['alliance'])) { return ""; } return "2,".$this->data['alliance']; } function getRecipient() { $name = $this->players->call('getName', $this->player); return utf8entities($name); } function getRLink() { return ""; } function getSubject() { $p = $this->getPlayer(); switch ($this->data['msg_type']) : case 0: $s = "A player has requested to join the alliance!"; break; case 1: $s = "A player has cancelled his request to join!"; break; case 2: $s = "You have been removed as " . utf8entities($p['name']) ."'s successor"; break; case 3: $s = "You have been made " . utf8entities($p['name']) . "'s successor"; break; case 4: $s = "[".utf8entities($this->data['tag'])."] has become a democracy"; break; case 5: $s = "[".utf8entities($this->data['tag'])."] has become a dictature"; break; case 6: $s = "You have stepped down from the head of [".utf8entities($this->data['tag'])."]"; break; case 7: $s = "You are the new leader of [".utf8entities($this->data['tag'])."]"; break; case 8: $s = "Leadership change in [".utf8entities($this->data['tag'])."]"; break; case 9: $s = "A player has left the alliance"; break; case 10: $s = "Request granted!"; break; case 11: $s = "A player has been accepted into the alliance"; break; case 12: $s = "Request rejected!"; break; case 13: $s = "A request to join has been denied"; break; case 14: $s = "Leadership change in [".utf8entities($this->data['tag'])."]"; break; case 15: $s = "[".utf8entities($this->data['tag'])."] no longer has a leader!"; break; case 16: $s = "New candidate for presidency"; break; case 17: $s = "A candidate is no longer running for the alliance's presidency"; break; case 18: $s = "You have taken the alliance's presidency"; break; case 19: $s = "Leadership change in [".utf8entities($this->data['tag'])."]"; break; case 20: $s = "New technology trading orders issued"; break; endswitch; return $s; } function getReplyLink() { return ""; } function getContents() { $p = $this->getPlayer(); switch ($this->data['msg_type']) : case 0: $s = "Player ".utf8entities($p['name'])." has sent a request to join the [".utf8entities($this->data['tag'])."] alliance."; // FIXME: link to admission page break; case 1: $s = "Player ".utf8entities($p['name'])." has cancelled his request to join the [".utf8entities($this->data['tag'])."] alliance."; break; case 2: $s = "You are no longer ".utf8entities($p['name'])."'s successor at the head of [".utf8entities($this->data['tag'])."]."; break; case 3: $s = "You have been designated by ".utf8entities($p['name'])." to be his successor at the head of [".utf8entities($this->data['tag'])."]. "; $s .= "If ".utf8entities($p['name'])." leaves the alliance, you will automatically be in charge."; break; case 4: $s = "By orders of ".utf8entities($p['name']).", the [".utf8entities($this->data['tag'])."] alliance has become a democracy."; break; case 5: $s = "By orders of ".utf8entities($p['name']).", the [".utf8entities($this->data['tag'])."] alliance has become a dictature."; break; case 6: $s = "You have stepped down from the head of the [".utf8entities($this->data['tag'])."] alliance.
".utf8entities($p['name']).","; $s .= "your successor, has assumed control of the alliance."; break; case 7: $s = "".utf8entities($p['name']).", who was the leader of the [".utf8entities($this->data['tag'])."] alliance, has stepped down from "; $s .= "power.
As his successor, you are the new leader of the alliance."; break; case 8: $s = "The leader of the [".utf8entities($this->data['tag'])."] alliance has stepped down from power.
"; $s .= "".utf8entities($p['name']).", his successor, is the new leader of the alliance."; break; case 9: $s = "".utf8entities($p['name'])." has left the [".utf8entities($this->data['tag'])."] alliance."; break; case 10: $s = "You have been accepted into the [".utf8entities($this->data['tag'])."] alliance."; break; case 11: $s = "Player ".utf8entities($p['name'])." has been accepted into the [".utf8entities($this->data['tag'])."] alliance."; break; case 12: $s = "Your request to join the [".utf8entities($this->data['tag'])."] alliance has been rejected."; break; case 13: $s = "The request from player ".utf8entities($p['name'])." to join the [".utf8entities($this->data['tag'])."] alliance has been rejected."; break; case 14: $s = "[".utf8entities($this->data['tag'])."]'s leader has left the alliance. His successor, ".utf8entities($p['name']).","; $s .= " has taken control of the alliance."; break; case 15: $s = "[".utf8entities($this->data['tag'])."]'s leader, ".utf8entities($p['name']).", has left the alliance. Since "; $s .= "[".utf8entities($this->data['tag'])."] no longer has a leader, all members can now vote to elect his successor."; break; case 16: $s = "".utf8entities($p['name'])." is now running for [".utf8entities($this->data['tag'])."]'s presidency."; break; case 17: $s = "".utf8entities($p['name'])." has cancelled his candidacy to [".utf8entities($this->data['tag'])."]'s presidency."; break; case 18: $s = "You have taken presidency of the [".utf8entities($this->data['tag'])."] alliance."; break; case 19: $s = "".utf8entities($p['name'])." has taken presidency of the [".utf8entities($this->data['tag'])."] alliance."; break; case 20: $s = "New technology trading orders have been issued!
You should check the alliance's technology trading page to find out how they affect you."; break; endswitch; return $s; } } ?>