60 lines
1.7 KiB
Java
60 lines
1.7 KiB
Java
package earth.krakatao;
|
|
|
|
import earth.krakatao.events.KraSocketClientEventInitiater;
|
|
import earth.krakatao.events.KraSocketClientEventInterface;
|
|
import earth.krakatao.protocol.KraSocketClientProtocol;
|
|
import earth.krakatao.protocol.KraSocketClientProtocolMessage;
|
|
import java.net.URI;
|
|
import java.net.URISyntaxException;
|
|
import lombok.Getter;
|
|
|
|
public class KraSocketClient {
|
|
|
|
private KraSocketClientConfig kraSocketClientConfig;
|
|
@Getter
|
|
private final SocketClient socketClient;
|
|
private KraSocketClientEventInitiater kraSocketClientEventInitiater;
|
|
|
|
public KraSocketClient(KraSocketClientConfig kraSocketClientConfig, KraSocketClientEventInterface kraSocketClientEventInterface, KraSocketClientProtocol kraSocketClientProtocol) throws URISyntaxException {
|
|
this.kraSocketClientConfig = kraSocketClientConfig;
|
|
|
|
this.kraSocketClientEventInitiater = new KraSocketClientEventInitiater();
|
|
this.kraSocketClientEventInitiater.addListener(kraSocketClientEventInterface);
|
|
|
|
this.socketClient = new SocketClient(new URI(this.kraSocketClientConfig.getWebSocketProtocol() +"://" + this.kraSocketClientConfig.getWebSocketHost() + ":" + this.kraSocketClientConfig.getWebSocketPort() + "/ws?ak=" + this.kraSocketClientConfig.getWebSocketAccessKey() + "&s="+ this.kraSocketClientConfig.getWebSocketServerName()), kraSocketClientEventInitiater, kraSocketClientProtocol);
|
|
}
|
|
|
|
public void sendMsg(KraSocketClientProtocolMessage kraProtocolMessage) {
|
|
this.socketClient.send("");
|
|
}
|
|
|
|
public void sendTest() {
|
|
|
|
}
|
|
|
|
public void sendTestNumberTwo() {
|
|
|
|
}
|
|
|
|
public void sendLookHere() {
|
|
|
|
}
|
|
|
|
public void sendHereCanberry() {
|
|
|
|
}
|
|
|
|
public void sendMeCanberry() {
|
|
|
|
}
|
|
|
|
public void sendYourCanberries() {
|
|
|
|
}
|
|
|
|
public void sendBerndsCanberry() {
|
|
|
|
}
|
|
|
|
}
|