Various minor UI/Net changes
This commit is contained in:
@@ -14,6 +14,7 @@ text.joingame=Join Game
|
|||||||
text.quit=Quit
|
text.quit=Quit
|
||||||
text.server.connected=A player has joined.
|
text.server.connected=A player has joined.
|
||||||
text.server.disconnected={0} has disconnected.
|
text.server.disconnected={0} has disconnected.
|
||||||
|
text.nohost=Can't host server on a custom map!
|
||||||
text.hostserver=Host Server
|
text.hostserver=Host Server
|
||||||
text.host=Host
|
text.host=Host
|
||||||
text.hosts.discovering=Discovering LAN games
|
text.hosts.discovering=Discovering LAN games
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import io.anuke.mindustry.resource.Item;
|
|||||||
import io.anuke.mindustry.resource.ItemStack;
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
import io.anuke.mindustry.resource.Weapon;
|
import io.anuke.mindustry.resource.Weapon;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.ucore.UCore;
|
|
||||||
import io.anuke.ucore.core.*;
|
import io.anuke.ucore.core.*;
|
||||||
import io.anuke.ucore.core.Inputs.Axis;
|
import io.anuke.ucore.core.Inputs.Axis;
|
||||||
import io.anuke.ucore.core.Inputs.DeviceType;
|
import io.anuke.ucore.core.Inputs.DeviceType;
|
||||||
@@ -33,7 +32,6 @@ import io.anuke.ucore.entities.EntityGroup;
|
|||||||
import io.anuke.ucore.graphics.Atlas;
|
import io.anuke.ucore.graphics.Atlas;
|
||||||
import io.anuke.ucore.modules.Module;
|
import io.anuke.ucore.modules.Module;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
import io.anuke.ucore.util.Bundles;
|
|
||||||
import io.anuke.ucore.util.Input;
|
import io.anuke.ucore.util.Input;
|
||||||
import io.anuke.ucore.util.InputProxy;
|
import io.anuke.ucore.util.InputProxy;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
@@ -76,7 +74,6 @@ public class Control extends Module{
|
|||||||
private InputProxy proxy;
|
private InputProxy proxy;
|
||||||
private float controlx, controly;
|
private float controlx, controly;
|
||||||
private boolean controlling;
|
private boolean controlling;
|
||||||
private Map map;
|
|
||||||
|
|
||||||
public Control(){
|
public Control(){
|
||||||
if(Mindustry.args.contains("-debug", false))
|
if(Mindustry.args.contains("-debug", false))
|
||||||
@@ -302,9 +299,7 @@ public class Control extends Module{
|
|||||||
|
|
||||||
Timers.run(18, ()-> ui.hideLoading());
|
Timers.run(18, ()-> ui.hideLoading());
|
||||||
|
|
||||||
this.map = map;
|
Mindustry.platforms.onSceneChange("Playing on map: " + map.name, "Wave 0", "fight");
|
||||||
|
|
||||||
Mindustry.platforms.onSceneChange(Bundles.get("text.playing", "Playing on map") + ": " + map.name, Bundles.get("text.wavenumber", "Wave") + " 0", "fight");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameMode getMode(){
|
public GameMode getMode(){
|
||||||
@@ -335,7 +330,7 @@ public class Control extends Module{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void runWave(){
|
public void runWave(){
|
||||||
Mindustry.platforms.onSceneChange(Bundles.get("text.playing", "Playing on map") + ": " + map.name, Bundles.get("text.wavenumber", "Wave") + " " + wave, "fight");
|
|
||||||
if(Net.client() && Net.active()){
|
if(Net.client() && Net.active()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -390,20 +385,9 @@ public class Control extends Module{
|
|||||||
|
|
||||||
wavetime = waveSpacing();
|
wavetime = waveSpacing();
|
||||||
extrawavetime = maxwavespace;
|
extrawavetime = maxwavespace;
|
||||||
}
|
|
||||||
|
|
||||||
void printEnemies(int wave){
|
Mindustry.platforms.onSceneChange("Playing on map: "
|
||||||
int total = 0;
|
+ Vars.world.getMap().name, "Wave " + wave, "fight");
|
||||||
for(EnemySpawn spawn : spawns){
|
|
||||||
int spawnamount = spawn.evaluate(wave, 0);
|
|
||||||
total += spawnamount;
|
|
||||||
|
|
||||||
if(spawnamount > 0){
|
|
||||||
UCore.log(ClassReflection.getSimpleName(spawn.type) + " t" + spawn.tier(wave, 0) + " x" + spawnamount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
UCore.log("Total: " + total);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enemyDeath(){
|
public void enemyDeath(){
|
||||||
|
|||||||
@@ -260,6 +260,10 @@ public class NetClient extends Module {
|
|||||||
Net.handle(Player.class, player -> {
|
Net.handle(Player.class, player -> {
|
||||||
player.add();
|
player.add();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Net.handle(ChatPacket.class, packet -> {
|
||||||
|
//TODO
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update(){
|
public void update(){
|
||||||
@@ -272,6 +276,12 @@ public class NetClient extends Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void handleSendMessage(String message){
|
||||||
|
ChatPacket packet = new ChatPacket();
|
||||||
|
packet.text = message;
|
||||||
|
Net.send(packet, SendMode.tcp);
|
||||||
|
}
|
||||||
|
|
||||||
public void handleShoot(Weapon weapon, float x, float y, float angle){
|
public void handleShoot(Weapon weapon, float x, float y, float angle){
|
||||||
ShootPacket packet = new ShootPacket();
|
ShootPacket packet = new ShootPacket();
|
||||||
packet.weaponid = (byte)weapon.ordinal();
|
packet.weaponid = (byte)weapon.ordinal();
|
||||||
|
|||||||
@@ -150,6 +150,18 @@ public class NetServer extends Module{
|
|||||||
|
|
||||||
Net.sendExcept(Net.getLastConnection(), packet, SendMode.tcp);
|
Net.sendExcept(Net.getLastConnection(), packet, SendMode.tcp);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Net.handleServer(ChatPacket.class, packet -> {
|
||||||
|
Player player = connections.get(Net.getLastConnection());
|
||||||
|
|
||||||
|
if(player == null)
|
||||||
|
return; //GHOSTS AAAA
|
||||||
|
|
||||||
|
//TODO add to chat fragment
|
||||||
|
|
||||||
|
packet.name = player.name;
|
||||||
|
Net.send(packet, SendMode.tcp);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO decide whether to use effects
|
//TODO decide whether to use effects
|
||||||
|
|||||||
@@ -312,7 +312,6 @@ public class UI extends SceneModule{
|
|||||||
updateItems();
|
updateItems();
|
||||||
|
|
||||||
build.end();
|
build.end();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showGameError(){
|
public void showGameError(){
|
||||||
|
|||||||
@@ -56,8 +56,13 @@ public class MenuDialog extends FloatingDialog{
|
|||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
|
|
||||||
content().addButton("$text.hostserver", () -> ui.showHostServer())
|
content().addButton("$text.hostserver", () ->{
|
||||||
.disabled(b -> Net.active() || (Net.active() && !Net.server()));
|
if(Vars.world.getMap().custom){
|
||||||
|
ui.showError("$text.nohost");
|
||||||
|
}else {
|
||||||
|
ui.showHostServer();
|
||||||
|
}
|
||||||
|
}).disabled(b -> Net.active() || (Net.active() && !Net.server()));
|
||||||
|
|
||||||
content().row();
|
content().row();
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,167 @@
|
|||||||
package io.anuke.mindustry.ui.fragments;
|
package io.anuke.mindustry.ui.fragments;
|
||||||
|
|
||||||
public class ChatFragment implements Fragment {
|
import com.badlogic.gdx.Gdx;
|
||||||
//TODO
|
import com.badlogic.gdx.graphics.Color;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
|
||||||
|
import com.badlogic.gdx.utils.Align;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import io.anuke.mindustry.Vars;
|
||||||
|
import io.anuke.ucore.core.Core;
|
||||||
|
import io.anuke.ucore.scene.Scene;
|
||||||
|
import io.anuke.ucore.scene.ui.Label;
|
||||||
|
import io.anuke.ucore.scene.ui.Label.LabelStyle;
|
||||||
|
import io.anuke.ucore.scene.ui.TextField;
|
||||||
|
import io.anuke.ucore.scene.ui.layout.Table;
|
||||||
|
|
||||||
|
import static io.anuke.ucore.core.Core.scene;
|
||||||
|
import static io.anuke.ucore.core.Core.skin;
|
||||||
|
|
||||||
|
public class ChatFragment extends Table implements Fragment{
|
||||||
|
private final static int messagesShown = 10;
|
||||||
|
private Array<ChatMessage> messages = new Array<>();
|
||||||
|
private float fadetime;
|
||||||
|
private float lastfadetime;
|
||||||
|
private boolean chatOpen = false;
|
||||||
|
private TextField chatfield;
|
||||||
|
private Label fieldlabel = new Label(">");
|
||||||
|
private BitmapFont font;
|
||||||
|
private GlyphLayout layout = new GlyphLayout();
|
||||||
|
private float offsetx = 4, offsety = 4, fontoffsetx = 2, chatspace = 50;
|
||||||
|
private float textWidth = 600;
|
||||||
|
private Color shadowColor = new Color(0,0,0,0.4f);
|
||||||
|
private float textspacing = 10;
|
||||||
|
|
||||||
|
public ChatFragment(){
|
||||||
|
super();
|
||||||
|
|
||||||
|
setFillParent(true);
|
||||||
|
font = Core.skin.getFont("pixel-font");
|
||||||
|
|
||||||
|
setup();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build() {
|
public void build() {
|
||||||
|
scene.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setup(){
|
||||||
|
fieldlabel.setStyle(new LabelStyle(fieldlabel.getStyle()));
|
||||||
|
fieldlabel.getStyle().font = font;
|
||||||
|
fieldlabel.setStyle(fieldlabel.getStyle());
|
||||||
|
fieldlabel.setFontScale(2);
|
||||||
|
chatfield = new TextField("", new TextField.TextFieldStyle(skin.get(TextField.TextFieldStyle.class)));
|
||||||
|
|
||||||
|
chatfield.getStyle().background = skin.getDrawable("blank");
|
||||||
|
chatfield.getStyle().fontColor = Color.WHITE;
|
||||||
|
chatfield.getStyle().font = skin.getFont("pixel-font-nomarkup");
|
||||||
|
|
||||||
|
bottom().left().marginBottom(offsety).marginLeft(offsetx*2).add(fieldlabel).padBottom(4f);
|
||||||
|
|
||||||
|
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Batch batch, float alpha){
|
||||||
|
|
||||||
|
batch.setColor(shadowColor);
|
||||||
|
if(chatOpen)
|
||||||
|
batch.draw(skin.getRegion("white"), offsetx, chatfield.getY(), Gdx.graphics.getWidth()-offsetx*2, chatfield.getHeight()-1);
|
||||||
|
|
||||||
|
font.getData().setScale(2f);
|
||||||
|
font.getData().down = -21.5f;
|
||||||
|
font.getData().lineHeight = 22f;
|
||||||
|
|
||||||
|
super.draw(batch, alpha);
|
||||||
|
|
||||||
|
|
||||||
|
float spacing = chatspace;
|
||||||
|
|
||||||
|
chatfield.setVisible(chatOpen);
|
||||||
|
fieldlabel.setVisible(chatOpen);
|
||||||
|
|
||||||
|
batch.setColor(shadowColor);
|
||||||
|
|
||||||
|
float theight = offsety + spacing;
|
||||||
|
for(int i = 0; i < messagesShown && i < messages.size && i < fadetime; i ++){
|
||||||
|
|
||||||
|
layout.setText(font, messages.get(i).formattedMessage, Color.WHITE, textWidth, Align.bottomLeft, true);
|
||||||
|
theight += layout.height+textspacing;
|
||||||
|
if(i == 0)theight -= textspacing+1;
|
||||||
|
|
||||||
|
font.getCache().clear();
|
||||||
|
font.getCache().addText(messages.get(i).formattedMessage, fontoffsetx + offsetx, offsety + theight, textWidth, Align.bottomLeft, true);
|
||||||
|
|
||||||
|
if(fadetime-i < 1f && fadetime-i >= 0f){
|
||||||
|
font.getCache().setAlphas(fadetime-i);
|
||||||
|
batch.setColor(0,0,0,shadowColor.a*(fadetime-i));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
batch.draw(skin.getRegion("white"), offsetx, theight-layout.height+1-4, textWidth, layout.height+textspacing);
|
||||||
|
batch.setColor(shadowColor);
|
||||||
|
|
||||||
|
font.getCache().draw(batch);
|
||||||
|
}
|
||||||
|
|
||||||
|
batch.setColor(Color.WHITE);
|
||||||
|
|
||||||
|
if(fadetime > 0 && !chatOpen)
|
||||||
|
fadetime -= Gdx.graphics.getDeltaTime()*60f/120f;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendMessage(){
|
||||||
|
String message = chatfield.getText();
|
||||||
|
chatfield.clearText();
|
||||||
|
|
||||||
|
if(message.replaceAll(" ", "").isEmpty()) return;
|
||||||
|
|
||||||
|
Vars.netClient.handleSendMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggle(){
|
||||||
|
Scene scene = getScene();
|
||||||
|
|
||||||
|
if(!chatOpen && (scene.getKeyboardFocus() == null || !scene.getKeyboardFocus().getParent().isVisible())){
|
||||||
|
scene.setKeyboardFocus(chatfield);
|
||||||
|
chatOpen = !chatOpen;
|
||||||
|
lastfadetime = fadetime;
|
||||||
|
fadetime = messagesShown+1;
|
||||||
|
}else if(chatOpen){
|
||||||
|
scene.setKeyboardFocus(null);
|
||||||
|
chatOpen = !chatOpen;
|
||||||
|
sendMessage();
|
||||||
|
fadetime = lastfadetime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean chatOpen(){
|
||||||
|
return chatOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addMessage(String message, String sender){
|
||||||
|
messages.insert(0, new ChatMessage(message, sender));
|
||||||
|
|
||||||
|
fadetime += 1f;
|
||||||
|
fadetime = Math.min(fadetime, messagesShown)+2f;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class ChatMessage{
|
||||||
|
public final String sender;
|
||||||
|
public final String message;
|
||||||
|
public final String formattedMessage;
|
||||||
|
|
||||||
|
public ChatMessage(String message, String sender){
|
||||||
|
this.message = message;
|
||||||
|
this.sender = sender;
|
||||||
|
if(sender == null){ //no sender, this is a server message
|
||||||
|
formattedMessage = message;
|
||||||
|
}else{
|
||||||
|
formattedMessage = "[ROYAL]["+sender+"]: [YELLOW]"+message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ public class DesktopLauncher {
|
|||||||
public void onSceneChange(String state, String details, String icon) {
|
public void onSceneChange(String state, String details, String icon) {
|
||||||
DiscordRPC lib = DiscordRPC.INSTANCE;
|
DiscordRPC lib = DiscordRPC.INSTANCE;
|
||||||
|
|
||||||
|
if(lib == null) return;
|
||||||
|
|
||||||
String applicationId = "397335883319083018";
|
String applicationId = "397335883319083018";
|
||||||
|
|
||||||
DiscordEventHandlers handlers = new DiscordEventHandlers();
|
DiscordEventHandlers handlers = new DiscordEventHandlers();
|
||||||
@@ -79,7 +81,7 @@ public class DesktopLauncher {
|
|||||||
DiscordRichPresence presence = new DiscordRichPresence();
|
DiscordRichPresence presence = new DiscordRichPresence();
|
||||||
presence.startTimestamp = System.currentTimeMillis() / 1000; // epoch second
|
presence.startTimestamp = System.currentTimeMillis() / 1000; // epoch second
|
||||||
presence.state = state;
|
presence.state = state;
|
||||||
//presence.details = details;
|
presence.details = details;
|
||||||
presence.largeImageKey = "logo";
|
presence.largeImageKey = "logo";
|
||||||
presence.largeImageText = details;
|
presence.largeImageText = details;
|
||||||
lib.Discord_UpdatePresence(presence);
|
lib.Discord_UpdatePresence(presence);
|
||||||
|
|||||||
Binary file not shown.
@@ -3,10 +3,7 @@ package io.anuke.kryonet;
|
|||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectSet;
|
import com.badlogic.gdx.utils.ObjectSet;
|
||||||
import com.esotericsoftware.kryonet.Client;
|
import com.esotericsoftware.kryonet.*;
|
||||||
import com.esotericsoftware.kryonet.Connection;
|
|
||||||
import com.esotericsoftware.kryonet.FrameworkMessage;
|
|
||||||
import com.esotericsoftware.kryonet.Listener;
|
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.net.Address;
|
import io.anuke.mindustry.net.Address;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
@@ -15,9 +12,12 @@ import io.anuke.mindustry.net.Net.SendMode;
|
|||||||
import io.anuke.mindustry.net.Packets.Connect;
|
import io.anuke.mindustry.net.Packets.Connect;
|
||||||
import io.anuke.mindustry.net.Packets.Disconnect;
|
import io.anuke.mindustry.net.Packets.Disconnect;
|
||||||
import io.anuke.mindustry.net.Registrator;
|
import io.anuke.mindustry.net.Registrator;
|
||||||
|
import io.anuke.ucore.UCore;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.DatagramPacket;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class KryoClient implements ClientProvider{
|
public class KryoClient implements ClientProvider{
|
||||||
@@ -25,6 +25,23 @@ public class KryoClient implements ClientProvider{
|
|||||||
|
|
||||||
public KryoClient(){
|
public KryoClient(){
|
||||||
client = new Client();
|
client = new Client();
|
||||||
|
client.setDiscoveryHandler(new ClientDiscoveryHandler() {
|
||||||
|
@Override
|
||||||
|
public DatagramPacket onRequestNewDatagramPacket() {
|
||||||
|
return new DatagramPacket(new byte[4], 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDiscoveredHost(DatagramPacket datagramPacket) {
|
||||||
|
//TODO doesn't send data
|
||||||
|
UCore.log("DATA HOST FOUND: " + Arrays.toString(datagramPacket.getData()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFinally() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
client.start();
|
client.start();
|
||||||
client.addListener(new Listener(){
|
client.addListener(new Listener(){
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ package io.anuke.kryonet;
|
|||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.utils.IntArray;
|
import com.badlogic.gdx.utils.IntArray;
|
||||||
import com.esotericsoftware.kryonet.Connection;
|
import com.esotericsoftware.kryonet.*;
|
||||||
import com.esotericsoftware.kryonet.FrameworkMessage;
|
|
||||||
import com.esotericsoftware.kryonet.Listener;
|
|
||||||
import com.esotericsoftware.kryonet.Server;
|
|
||||||
import com.esotericsoftware.kryonet.util.InputStreamSender;
|
import com.esotericsoftware.kryonet.util.InputStreamSender;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.net.Net.SendMode;
|
import io.anuke.mindustry.net.Net.SendMode;
|
||||||
@@ -19,6 +16,9 @@ import io.anuke.mindustry.net.Streamable.StreamChunk;
|
|||||||
import io.anuke.ucore.UCore;
|
import io.anuke.ucore.UCore;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.channels.DatagramChannel;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class KryoServer implements ServerProvider {
|
public class KryoServer implements ServerProvider {
|
||||||
@@ -27,6 +27,22 @@ public class KryoServer implements ServerProvider {
|
|||||||
|
|
||||||
public KryoServer(){
|
public KryoServer(){
|
||||||
server = new Server();
|
server = new Server();
|
||||||
|
server.setDiscoveryHandler(new ServerDiscoveryHandler() {
|
||||||
|
private ByteBuffer buffer = ByteBuffer.allocate(4);
|
||||||
|
|
||||||
|
{
|
||||||
|
buffer.putInt(987264236);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onDiscoverHost(DatagramChannel datagramChannel, InetSocketAddress fromAddress) throws IOException {
|
||||||
|
//TODO doesn't send data
|
||||||
|
UCore.log("SENDING DATA: " + Arrays.toString(buffer.array()));
|
||||||
|
datagramChannel.send(this.buffer, fromAddress);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Thread thread = new Thread(server, "Kryonet Server");
|
Thread thread = new Thread(server, "Kryonet Server");
|
||||||
thread.setDaemon(true);
|
thread.setDaemon(true);
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|||||||
Reference in New Issue
Block a user