Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brendanashworth/messagingsdk
Software Development Kit for LilyPad messaging
https://github.com/brendanashworth/messagingsdk
Last synced: 9 days ago
JSON representation
Software Development Kit for LilyPad messaging
- Host: GitHub
- URL: https://github.com/brendanashworth/messagingsdk
- Owner: brendanashworth
- License: mit
- Created: 2014-08-03T18:10:10.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-03T18:24:59.000Z (over 10 years ago)
- Last Synced: 2023-04-10T02:50:28.273Z (over 1 year ago)
- Language: Java
- Size: 97.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MessagingSDK
-----> In order to use the MessagingSDK, please download it and add it as a dependency for your build. At the moment, there is no Maven repository to automatically download it from.
### Example Usage
```java
import net.boboman13.messagingsdk.MessagingSDK;
...public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
MessagingSDK.sendMessageToPlayer("boboman13", "This is a private message");
MessagingSDK.broadcastMessage("This message is broadcasted to all servers");
MessagingSDK.broadcastMessageToServer("This message is broadcasted to one server", "myServer");
}}
```### Documentation
All methods come through the `MessagingSDK` facade. If you want to access the backend, use:
```java
Pigeon pigeon = MessagingSDK.getPigeon();
```This will give you the `Pigeon` singleton that the MessagingSDK uses to send messages.
#### Send a private message
```java
public static void sendMessageToPlayer(String playername, String message);
```It takes the first argument as the playername, and the second as the message. This will send a private message to the player (no matter where he/she is on the network; no server must be specified).
#### Broadcast a global message
```java
public static void broadcastMessage(String message);
```This broadcasts a message across all servers on the LilyPad network. No servers must be specified. The message is a `String`.
#### Broadcast a specific-server message
```java
public static void broadcastMessageToServer(String message, String server);
```This broadcasts a message to an entire server, but not all servers on the network. It must be specified as the second argument (taken as a `String`).
### License
[MIT License](./LICENSE)