public final class TCPServer extends Server
| Constructor and Description |
|---|
TCPServer()
Initialize a default client that
will connect to local server at
default port 49305
|
TCPServer(int port)
Initialize a client with a custom port
that will connect to the specified server at the
specified port
|
TCPServer(String host,
int port)
Initialize a client that will connect
to the specified server at specified port
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
authors()
Karma source authors
|
void |
ban(String... macAddresses)
Ban an address from the server
|
void |
broadcast(MessageOutput data)
Send a message to each connected client
|
void |
close()
Close the connection
|
ml.karmaconfigs.api.common.Console |
console()
Get the source out
|
Server |
debug(boolean status)
Set the server debug status
|
String |
description()
Karma source description
|
void |
exportBans(Path destination)
Export the list of bans
|
Set<RemoteClient> |
getClients()
Get the connected clients
|
String |
getMAC()
Get the server MAC address
|
WorkLevel |
getWorkLevel()
Get the client work level
|
void |
kick(String... macAddresses)
Kick an address from the server
|
void |
loadBans(Path bans)
Load the list of bans
|
String |
name()
Karma source name
|
void |
redirect(String name,
MessageOutput data)
Redirect a message to the specified client
|
ml.karmaconfigs.api.common.timer.scheduler.LateScheduler<Boolean> |
start()
Try to start the server
|
ml.karmaconfigs.api.common.timer.scheduler.LateScheduler<Boolean> |
start(String accessKey)
Try to start the server
|
void |
unBan(String... macAddresses)
Unban an address from the server
|
String |
updateURL()
Karma source update URL
|
String |
version()
Karma source version
|
public TCPServer()
public TCPServer(int port)
port - the server portpublic TCPServer(String host, int port)
host - the serverport - the server portpublic Server debug(boolean status)
public ml.karmaconfigs.api.common.timer.scheduler.LateScheduler<Boolean> start()
public ml.karmaconfigs.api.common.timer.scheduler.LateScheduler<Boolean> start(String accessKey)
public String getMAC()
public Set<RemoteClient> getClients()
getClients in class Serverpublic WorkLevel getWorkLevel()
getWorkLevel in class Serverpublic void exportBans(Path destination)
exportBans in class Serverdestination - the file were to store
the ban listpublic void loadBans(Path bans)
public void broadcast(MessageOutput data)
public void redirect(String name, MessageOutput data)
public void ban(String... macAddresses)
public void kick(String... macAddresses)
public void unBan(String... macAddresses)
public String name()
public String version()
public String description()
public String[] authors()
public String updateURL()
public ml.karmaconfigs.api.common.Console console()
Copyright © 2022. All rights reserved.