From 5753db627ca17f07b1bcbb001bc8401f2d417e91 Mon Sep 17 00:00:00 2001 From: Michael Yoo Date: Fri, 11 Jan 2013 11:09:57 +0900 Subject: [PATCH 1/4] Added chat API to ChatAPI.php --- src/API/ChatAPI.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/API/ChatAPI.php b/src/API/ChatAPI.php index 204a26df1..d0fc9f656 100644 --- a/src/API/ChatAPI.php +++ b/src/API/ChatAPI.php @@ -26,6 +26,8 @@ the Free Software Foundation, either version 3 of the License, or */ class ChatAPI{ - - + + public function chat($a, $b){ + $this->server->chat($a, $b); + return true; } \ No newline at end of file From d86bf37defd44fb645f7519308b5a31f03a6bd77 Mon Sep 17 00:00:00 2001 From: Michael Yoo Date: Fri, 11 Jan 2013 11:25:42 +0900 Subject: [PATCH 2/4] Added and Fixed chat function in chat API. Tested --- src/API/ChatAPI.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/API/ChatAPI.php b/src/API/ChatAPI.php index d0fc9f656..079f6a747 100644 --- a/src/API/ChatAPI.php +++ b/src/API/ChatAPI.php @@ -26,8 +26,17 @@ the Free Software Foundation, either version 3 of the License, or */ class ChatAPI{ + private $server; + function __construct(PocketMinecraftServer $server){ + $this->server = $server; + } - public function chat($a, $b){ + public function init(){ + + } + + public function chat($a, $b){//a == name of owner. b == message $this->server->chat($a, $b); return true; + } } \ No newline at end of file From f3e9d4df3128f108bcb852f4da5f68f5ab13d39b Mon Sep 17 00:00:00 2001 From: Michael Yoo Date: Fri, 11 Jan 2013 11:56:34 +0900 Subject: [PATCH 3/4] New Documentation for PlayerAPI - Alpha --- PlayerAPI Documentation.txt | 92 +++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 PlayerAPI Documentation.txt diff --git a/PlayerAPI Documentation.txt b/PlayerAPI Documentation.txt new file mode 100644 index 000000000..bec7d8268 --- /dev/null +++ b/PlayerAPI Documentation.txt @@ -0,0 +1,92 @@ + - + / \ + / \ + / PocketMine \ +/ MP \ +|\ @shoghicp /| +|. \ / .| +| .. \ / .. | +| .. | .. | +| .. | .. | +\ | / + \ | / + \ | / + \ | / + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +#Authored By: sekjun9878 +#Author's Email: sekjun9878@gmail.com +# +#PlayerAPI Function Documentation. +# +#Version Alpha +#Revision Alpha + +public function teleport($name, $target) + Description: + Teleports a player to another player on the map. + Parameters: + $name = Name of the player to teleport. + $target = Name of the target player. + Return Values: + true = If teleported successfully + false = If teleporting failed. + +tppos// + +public function get($name) + Description: + Returns data about a player using a player's username. + Parameters: + $name = Username to return data about. + Return Values: + An array of data about a particular player. + +public function getAll() + Description: + Returns an two-dimentional array of data about all player on the server. + Parameters: + None + Return Values: + Two Dimentional Array of Data. + Examples: + foreach($this->api->player->getAll() as $c){ + //TODO: Do whatever you want with $c + //Example: $c->username will give you username of every player on the server. + } + +public function getByEID($eid) + Description: + Returns data about a player using a player's EID. + Parameters: + $eid = EID of a user to return data about. + Return Values: + An array of data about a particular player. + +public function getByClientID($clientID) + Description: + Returns data about a player using a player's ClientID. + Parameters: + $name = clientID of a user to return data about. + Return Values: + An array of data about a particular player. + +public function online() + Description: + Returns usernames all player on the server. + Parameters: + None + Return Values: + An array of strings containing usernames. + +public function getOffline($name) + Description: + Returns data about a player's last status before disconnecting using a player's username. + Parameters: + $name = name of a user to return data about. + Return Values: + An array of data about a particular player. \ No newline at end of file From 09c2c1b2ee4f80b3571e44e289b88a672457029b Mon Sep 17 00:00:00 2001 From: Michael Yoo Date: Fri, 11 Jan 2013 21:34:21 +0900 Subject: [PATCH 4/4] Changed chat to send. Documentation included --- documentation/BlockAPI.txt | 40 +++++++++++++++++++ .../PlayerAPI.txt | 0 src/API/ChatAPI.php | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 documentation/BlockAPI.txt rename PlayerAPI Documentation.txt => documentation/PlayerAPI.txt (100%) diff --git a/documentation/BlockAPI.txt b/documentation/BlockAPI.txt new file mode 100644 index 000000000..69bedeaa7 --- /dev/null +++ b/documentation/BlockAPI.txt @@ -0,0 +1,40 @@ + - + / \ + / \ + / PocketMine \ +/ MP \ +|\ @shoghicp /| +|. \ / .| +| .. \ / .. | +| .. | .. | +| .. | .. | +\ | / + \ | / + \ | / + \ | / + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +#Authored By: sekjun9878 +#Author's Email: sekjun9878@gmail.com +# +#BlokAPI Function Documentation. +# +#Version Alpha +#Revision Alpha + +public function blockBreak($data, $event) + Description: + Breajs a block on the map. + Parameters: + $name = Array of + $data["x"] = x coordinate + $data["y"] = y coordinate + $data["z"] = z coordinate + $event // + Return Values: + true = If the block is unbreakable + \ No newline at end of file diff --git a/PlayerAPI Documentation.txt b/documentation/PlayerAPI.txt similarity index 100% rename from PlayerAPI Documentation.txt rename to documentation/PlayerAPI.txt diff --git a/src/API/ChatAPI.php b/src/API/ChatAPI.php index 079f6a747..14e9d5c1e 100644 --- a/src/API/ChatAPI.php +++ b/src/API/ChatAPI.php @@ -35,7 +35,7 @@ class ChatAPI{ } - public function chat($a, $b){//a == name of owner. b == message + public function send($a, $b){//a == name of owner. b == message $this->server->chat($a, $b); return true; }