Added automatic updating an sending data for the server

This commit is contained in:
MickWerf
2020-06-07 14:31:15 +02:00
parent a971c3c44e
commit d913138cda
2 changed files with 6 additions and 1 deletions

View File

@@ -161,6 +161,10 @@ public class SessionController extends Controller implements DataCallback {
@Override
public void onDataReceived(Data data, DataSource source) {
for (ServerClient client: clients) {
if (!client.getName().equals(source.getName())){
client.writeData(data);
}
}
}
}

View File

@@ -2,4 +2,5 @@ package netwerkprog.game.util.data;
public interface DataSource {
void writeData(Data data);
String getName();
}