SteamWar/FightSystem
Archiviert
13
1

RecordSystem (Beta) #199

Manuell gemergt
Lixfel hat 40 Commits von recordSystem nach master 2020-11-01 20:11:45 +01:00 zusammengeführt
Nur Änderungen aus Commit 66b6e5a6dd werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -22,9 +22,7 @@ package de.steamwar.fightsystem.record;
import de.steamwar.fightsystem.Config;
import org.bukkit.Bukkit;
import java.io.BufferedOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.*;
import java.net.Socket;
import java.util.logging.Level;
@ -32,11 +30,15 @@ public class SpectateConnection extends Recorder{
private Socket socket;
private DataOutputStream outputStream;
private PipedInputStream inputStream;
SpectateConnection(){
super();
try {
this.socket = new Socket(Config.spectateIP, Config.spectatePort);
socket.setSoTimeout(1); // Wait a maximum of 1ms on a blocking operation (flush)
socket.setSoLinger(true, 1); // Wait a maximum of 1ms on close
socket.setTcpNoDelay(true); // Don't wait always on ack
this.outputStream = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));
} catch (IOException e) {
Bukkit.getLogger().log(Level.SEVERE, "Could not init connection", e);