codex-5.2: ресурсы
This commit is contained in:
@@ -499,15 +499,15 @@ AssetsManager::Out_applyResourceChange AssetsManager::applyResourceChange(const
|
||||
PreparedNodeState nodestate = _nodestate;
|
||||
|
||||
// Ресолвим модели
|
||||
for(const auto& [lKey, lDomain] : nodestate.LocalToModelKD) {
|
||||
nodestate.LocalToModel.push_back(lock->getId(EnumAssets::Nodestate, lDomain, lKey));
|
||||
for(const auto& [lDomain, lKey] : nodestate.LocalToModelKD) {
|
||||
nodestate.LocalToModel.push_back(lock->getId(EnumAssets::Model, lDomain, lKey));
|
||||
}
|
||||
|
||||
// Сдампим для отправки клиенту (Кеш в пролёте?)
|
||||
Resource res(nodestate.dump());
|
||||
|
||||
// На оповещение
|
||||
result.NewOrChange[(int) EnumAssets::Model].push_back({resId, res});
|
||||
result.NewOrChange[(int) EnumAssets::Nodestate].push_back({resId, res});
|
||||
|
||||
// Запись в таблице ресурсов
|
||||
data.emplace(ftt, res, domain, key);
|
||||
@@ -717,4 +717,4 @@ AssetsManager::Out_applyResourceChange AssetsManager::applyResourceChange(const
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,6 +258,10 @@ public:
|
||||
std::tuple<AssetsNodestate, std::vector<AssetsModel>, std::vector<AssetsTexture>>
|
||||
getNodeDependency(const std::string& domain, const std::string& key)
|
||||
{
|
||||
if(domain == "core" && key == "none") {
|
||||
return {0, {}, {}};
|
||||
}
|
||||
|
||||
auto lock = LocalObj.lock();
|
||||
AssetsNodestate nodestateId = lock->getId(EnumAssets::Nodestate, domain, key+".json");
|
||||
|
||||
@@ -301,4 +305,4 @@ private:
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -862,7 +862,6 @@ void GameServer::BackingAsyncLua_t::run(int id) {
|
||||
Pos::bvec64u nodePos(x, y, z);
|
||||
auto &node = out.Nodes[Pos::bvec4u(nodePos >> 4).pack()][Pos::bvec16u(nodePos & 0xf).pack()];
|
||||
node.NodeId = id;
|
||||
node.Meta = 0;
|
||||
|
||||
if(x == 0 && z == 0)
|
||||
node.NodeId = 1;
|
||||
@@ -876,7 +875,7 @@ void GameServer::BackingAsyncLua_t::run(int id) {
|
||||
else if(x == 0 && y == 1)
|
||||
node.NodeId = 0;
|
||||
|
||||
// node.Meta = 0;
|
||||
node.Meta = uint8_t((x + y + z + int(node.NodeId)) & 0x3);
|
||||
}
|
||||
}
|
||||
// else {
|
||||
@@ -1445,12 +1444,7 @@ void GameServer::init(fs::path worldPath) {
|
||||
|
||||
{
|
||||
sol::table t = LuaMainState.create_table();
|
||||
Content.CM.registerBase(EnumDefContent::Node, "test", "test0", t);
|
||||
Content.CM.registerBase(EnumDefContent::Node, "test", "test1", t);
|
||||
Content.CM.registerBase(EnumDefContent::Node, "test", "test2", t);
|
||||
Content.CM.registerBase(EnumDefContent::Node, "test", "test3", t);
|
||||
Content.CM.registerBase(EnumDefContent::Node, "test", "test4", t);
|
||||
Content.CM.registerBase(EnumDefContent::Node, "test", "test5", t);
|
||||
Content.CM.registerBase(EnumDefContent::Node, "core", "none", t);
|
||||
Content.CM.registerBase(EnumDefContent::World, "test", "devel_world", t);
|
||||
}
|
||||
|
||||
@@ -2364,7 +2358,9 @@ void GameServer::stepSyncContent() {
|
||||
|
||||
auto region = Expanse.Worlds[0]->Regions.find(rPos);
|
||||
if(region != Expanse.Worlds[0]->Regions.end()) {
|
||||
region->second->Nodes[cPos.pack()][nPos.pack()].NodeId = 4;
|
||||
Node& n = region->second->Nodes[cPos.pack()][nPos.pack()];
|
||||
n.NodeId = 4;
|
||||
n.Meta = uint8_t((int(nPos.x) + int(nPos.y) + int(nPos.z)) & 0x3);
|
||||
region->second->IsChunkChanged_Nodes |= 1ull << cPos.pack();
|
||||
}
|
||||
}
|
||||
@@ -2379,7 +2375,9 @@ void GameServer::stepSyncContent() {
|
||||
|
||||
auto region = Expanse.Worlds[0]->Regions.find(rPos);
|
||||
if(region != Expanse.Worlds[0]->Regions.end()) {
|
||||
region->second->Nodes[cPos.pack()][nPos.pack()].NodeId = 0;
|
||||
Node& n = region->second->Nodes[cPos.pack()][nPos.pack()];
|
||||
n.NodeId = 0;
|
||||
n.Meta = 0;
|
||||
region->second->IsChunkChanged_Nodes |= 1ull << cPos.pack();
|
||||
}
|
||||
}
|
||||
@@ -2493,4 +2491,4 @@ void GameServer::stepSyncContent() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user