use of de.gg.game.systems.server.ServerProcessingSystem in project ProjektGG by eskalon.
the class AuthoritativeSession method init.
/**
* {@inheritDoc}
*/
@Override
public void init(HashMap<Short, LobbyPlayer> players, @Nullable SavedGame savedGame) {
for (LobbyPlayer player : players.values()) {
player.setReady(false);
}
super.init(players, savedGame);
// FIXME wenn man ein zweites mal ein spiel hostet, kann es passieren,
// dass während dem obigen init() der GameLoadingScreen fertig wird.
// Während dann die Modelle gesetzt werden, werden im init nochmals die
// Buildings verändert. -> zusammenlegen
// Setup the server processing systems
ServerProcessingSystem<Character> s;
s = new FirstCharacterEventWaveServerSystem(clientResultListeners);
s.init(world, sessionSetup.getSeed());
this.characterSystems.add(s);
s = new NpcActionSystem(clientResultListeners);
s.init(world, sessionSetup.getSeed());
this.characterSystems.add(s);
s = new NpcActionSystem2(clientResultListeners);
s.init(world, sessionSetup.getSeed());
this.characterSystems.add(s);
ServerProcessingSystem<Player> s2;
s2 = new FirstPlayerEventWaveServerSystem(clientResultListeners);
s2.init(world, sessionSetup.getSeed());
this.playerSystems.add(s2);
s2 = new IllnessDamageSystem(clientResultListeners);
s2.init(world, sessionSetup.getSeed());
this.playerSystems.add(s2);
// Load the systems states
if (savedGame != null) {
for (ProcessingSystem<Character> c : characterSystems) {
((ServerProcessingSystem<Character>) c).loadSavedState(savedGame.processingSystemStates.get(c.getClass().getSimpleName()));
}
for (ProcessingSystem<Player> p : playerSystems) {
((ServerProcessingSystem<Player>) p).loadSavedState(savedGame.processingSystemStates.get(p.getClass().getSimpleName()));
}
}
}
Aggregations