stuff
This commit is contained in:
@@ -353,10 +353,10 @@ public class MainGame extends Game implements ClientCallback {
|
||||
|
||||
@Override
|
||||
public void onDataReceived(Data data) {
|
||||
System.out.println("[MAINGAME CALLBACK] Got data: " + data.toString());
|
||||
System.out.println("[MAINGAME" + this.username + "] Got data: " + data.toString());
|
||||
if (data instanceof NameData) {
|
||||
this.username = ((NameData) data).getName();
|
||||
System.out.println("[MAINGAME CALLBACK] username is: " + username);
|
||||
System.out.println("[MAINGAME" + this.username + "] username is: " + username);
|
||||
} else if (data instanceof TeamData) {
|
||||
// check if it is not our own message
|
||||
if (!((TeamData) data).getUsername().equals(this.username)) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.badlogic.gdx.utils.TimeUtils;
|
||||
import netwerkprog.game.client.MainGame;
|
||||
import netwerkprog.game.client.game.GAMESTATE;
|
||||
import netwerkprog.game.util.data.Data;
|
||||
import netwerkprog.game.util.data.ReadyData;
|
||||
import netwerkprog.game.util.data.TeamData;
|
||||
import netwerkprog.game.util.game.Faction;
|
||||
import netwerkprog.game.util.game.GameCharacter;
|
||||
@@ -132,6 +133,7 @@ public class GameInputProcessor implements InputProcessor {
|
||||
// camera.translate(-400, 0);
|
||||
// mainGame.setGamestate(GAMESTATE.PLAYING);
|
||||
}
|
||||
mainGame.send(new ReadyData());
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
7
core/src/netwerkprog/game/util/data/ReadyData.java
Normal file
7
core/src/netwerkprog/game/util/data/ReadyData.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package netwerkprog.game.util.data;
|
||||
|
||||
public class ReadyData extends Data {
|
||||
public ReadyData() {
|
||||
super("ready");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user