Omni-Replay #280
@ -22,10 +22,7 @@ package de.steamwar.fightsystem.record;
|
|||||||
import de.steamwar.fightsystem.Config;
|
import de.steamwar.fightsystem.Config;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.io.DataInputStream;
|
import java.io.*;
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.StandardCopyOption;
|
import java.nio.file.StandardCopyOption;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -37,11 +34,13 @@ public class FileSource extends PacketSource {
|
|||||||
if(Config.replayserver())
|
if(Config.replayserver())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
InputStream input = de.steamwar.sql.Fight.getReplay(Config.ReplayID);
|
||||||
try {
|
try {
|
||||||
Files.copy(
|
Files.copy(
|
||||||
de.steamwar.sql.Fight.getReplay(Config.ReplayID),
|
input,
|
||||||
FileRecorder.getFile().toPath(),
|
FileRecorder.getFile().toPath(),
|
||||||
StandardCopyOption.REPLACE_EXISTING);
|
StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
input.close();
|
||||||
new FileSource(FileRecorder.getFile());
|
new FileSource(FileRecorder.getFile());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new SecurityException("Could not start replay", e);
|
throw new SecurityException("Could not start replay", e);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren