world,
world.AddPlayer(master.GetInterfaceConf().player_name, player_id)
)
+, chunk_receiver(world.Chunks())
, chunk_renderer(*interface.GetPlayer().chunks)
, skeletons()
, loop_timer(16)
void InteractiveState::Update(int dt) {
loop_timer.Update(dt);
master.Update(dt);
+ chunk_receiver.Update(dt);
interface.Update(dt);
int world_dt = 0;
state->MergePlayerCorrection(pack_seq, corrected_state);
}
+void MasterState::On(const Packet::ChunkBegin &pack) {
+ if (!state) {
+ cout << "got chunk data, but the world has not been created yet" << endl;
+ cout << "great, this will totally screw up everything :(" << endl;
+ return;
+ }
+ state->GetChunkReceiver().Handle(pack);
+}
+
+void MasterState::On(const Packet::ChunkData &pack) {
+ if (!state) {
+ cout << "got chunk data, but the world has not been created yet" << endl;
+ cout << "great, this will totally screw up everything :(" << endl;
+ return;
+ }
+ state->GetChunkReceiver().Handle(pack);
+}
+
}
}