diff --git a/core/assets/music/menu.ogg b/core/assets/music/menu.ogg index 90dfbb6378..c23fe679fb 100644 Binary files a/core/assets/music/menu.ogg and b/core/assets/music/menu.ogg differ diff --git a/net/src/io/anuke/mindustry/net/ArcNetServer.java b/net/src/io/anuke/mindustry/net/ArcNetServer.java index 40481be085..2fab122500 100644 --- a/net/src/io/anuke/mindustry/net/ArcNetServer.java +++ b/net/src/io/anuke/mindustry/net/ArcNetServer.java @@ -103,6 +103,34 @@ public class ArcNetServer implements ServerProvider{ return null; } + @Override + public void sendStream(int id, Streamable stream){ + ArcConnection connection = getByID(id); + if(connection == null) return; + + connection.connection.addListener(new InputStreamSender(stream.stream, 512){ + int id; + + @Override + protected void start(){ + //send an object so the receiving side knows how to handle the following chunks + StreamBegin begin = new StreamBegin(); + begin.total = stream.stream.available(); + begin.type = Registrator.getID(stream.getClass()); + connection.connection.sendTCP(begin); + id = begin.id; + } + + @Override + protected Object next(byte[] bytes){ + StreamChunk chunk = new StreamChunk(); + chunk.id = id; + chunk.data = bytes; + return chunk; //wrap the byte[] with an object so the receiving side knows how to handle it. + } + }); + } + @Override public void host(int port) throws IOException{ connections.clear();