Сеть, со стороны сервера

This commit is contained in:
2025-02-09 12:05:10 +06:00
parent 42f6869afd
commit 871b03632e
12 changed files with 814 additions and 244 deletions

View File

@@ -99,7 +99,7 @@ public:
.Voxel = {
.Chunk = Pos::Local16_u(beg.x, beg.y, beg.z),
.Index = static_cast<uint32_t>(iter),
.Id = cube.Material
.Id = cube.VoxelId
}
};
@@ -113,7 +113,7 @@ public:
}
EntityId_t pushEntity(Entity &entity) {
LocalEntityId_t pushEntity(Entity &entity) {
for(size_t iter = 0; iter < Entityes.size(); iter++) {
Entity &obj = Entityes[iter];
@@ -130,19 +130,19 @@ public:
return Entityes.size()-1;
}
return EntityId_t(-1);
return LocalEntityId_t(-1);
}
};
class World {
WorldId_t Id;
DefWorldId_t DefId;
public:
std::vector<Pos::GlobalRegion> NeedToLoad;
std::unordered_map<Pos::GlobalRegion, std::unique_ptr<Region>> Regions;
public:
World(WorldId_t id);
World(DefWorldId_t defId);
~World();
/*
@@ -155,6 +155,8 @@ public:
void onCEC_RegionsLost(ContentEventController *cec, const std::vector<Pos::GlobalRegion> &lost);
Region* forceLoadOrGetRegion(Pos::GlobalRegion pos);
DefWorldId_t getDefId() const { return DefId; }
};