mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
Added layerset parsing
This commit is contained in:
parent
a56eec5d32
commit
ba1b8aadfb
2 changed files with 49 additions and 12 deletions
55
deps/datReader/DatCategories/bg/lgb.h
vendored
55
deps/datReader/DatCategories/bg/lgb.h
vendored
|
@ -161,35 +161,72 @@ public:
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum LayerSetReferencedType
|
||||||
|
{
|
||||||
|
All = 0x0,
|
||||||
|
Include = 0x1,
|
||||||
|
Exclude = 0x2,
|
||||||
|
Undetermined = 0x3,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct LayerSetReferenced
|
||||||
|
{
|
||||||
|
uint32_t LayerSetID;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct LayerSetReferencedList
|
||||||
|
{
|
||||||
|
LayerSetReferencedType ReferencedType;
|
||||||
|
int LayerSets;
|
||||||
|
int LayerSetCount;
|
||||||
|
};
|
||||||
|
|
||||||
struct LGB_GROUP_HEADER
|
struct LGB_GROUP_HEADER
|
||||||
{
|
{
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
int32_t groupNameOffset;
|
int32_t groupNameOffset;
|
||||||
int32_t entriesOffset;
|
int32_t entriesOffset;
|
||||||
int32_t entryCount;
|
int32_t entryCount;
|
||||||
uint32_t unknown2;
|
int8_t ToolModeVisible;
|
||||||
uint32_t unknown3;
|
int8_t ToolModeReadOnly;
|
||||||
uint32_t unknown4;
|
int8_t IsBushLayer;
|
||||||
uint32_t unknown5;
|
int8_t PS3Visible;
|
||||||
uint32_t unknown6;
|
int32_t LayerSetRef;
|
||||||
uint32_t unknown7;
|
uint16_t FestivalID;
|
||||||
uint32_t unknown8;
|
uint16_t FestivalPhaseID;
|
||||||
uint32_t unknown9;
|
int8_t IsTemporary;
|
||||||
uint32_t unknown10;
|
int8_t IsHousing;
|
||||||
|
uint16_t VersionMask;
|
||||||
|
uint32_t Reserved;
|
||||||
|
int32_t OBSetReferencedList;
|
||||||
|
int32_t OBSetReferencedList_Count;
|
||||||
|
int32_t OBSetEnableReferencedList;
|
||||||
|
int32_t OBSetEnableReferencedList_Count;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LGB_GROUP
|
struct LGB_GROUP
|
||||||
{
|
{
|
||||||
LGB_FILE* parent;
|
LGB_FILE* parent;
|
||||||
LGB_GROUP_HEADER header;
|
LGB_GROUP_HEADER header;
|
||||||
|
LayerSetReferencedList layerSetReferencedList;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::vector< std::shared_ptr< LgbEntry > > entries;
|
std::vector< std::shared_ptr< LgbEntry > > entries;
|
||||||
|
std::vector< LayerSetReferenced > refs;
|
||||||
|
|
||||||
LGB_GROUP( char* buf, LGB_FILE* parentStruct, size_t offset )
|
LGB_GROUP( char* buf, LGB_FILE* parentStruct, size_t offset )
|
||||||
{
|
{
|
||||||
parent = parentStruct;
|
parent = parentStruct;
|
||||||
header = *reinterpret_cast< LGB_GROUP_HEADER* >( buf + offset );
|
header = *reinterpret_cast< LGB_GROUP_HEADER* >( buf + offset );
|
||||||
name = std::string( buf + offset + header.groupNameOffset );
|
name = std::string( buf + offset + header.groupNameOffset );
|
||||||
|
|
||||||
|
layerSetReferencedList = *reinterpret_cast< LayerSetReferencedList* >( buf + offset + header.LayerSetRef );
|
||||||
|
|
||||||
|
if( layerSetReferencedList.LayerSetCount > 0 )
|
||||||
|
{
|
||||||
|
refs.resize( layerSetReferencedList.LayerSetCount );
|
||||||
|
memcpy( (char*)&refs[0], buf + offset + header.LayerSetRef + layerSetReferencedList.LayerSets, layerSetReferencedList.LayerSetCount * sizeof( LayerSetReferenced ) );
|
||||||
|
}
|
||||||
|
|
||||||
const auto entriesOffset = offset + header.entriesOffset;
|
const auto entriesOffset = offset + header.entriesOffset;
|
||||||
for( auto i = 0; i < header.entryCount; ++i )
|
for( auto i = 0; i < header.entryCount; ++i )
|
||||||
{
|
{
|
||||||
|
|
|
@ -907,10 +907,10 @@ namespace Sapphire::Network::Packets::Server
|
||||||
{
|
{
|
||||||
uint16_t serverId;
|
uint16_t serverId;
|
||||||
uint16_t zoneId;
|
uint16_t zoneId;
|
||||||
uint16_t unknown1;
|
uint16_t zoneIndex;
|
||||||
uint16_t contentfinderConditionId;
|
uint16_t contentfinderConditionId;
|
||||||
uint32_t unknown3;
|
uint32_t layerSetId;
|
||||||
uint32_t unknown4;
|
uint32_t layoutId;
|
||||||
uint8_t weatherId;
|
uint8_t weatherId;
|
||||||
uint8_t bitmask;
|
uint8_t bitmask;
|
||||||
uint8_t bitmask1;
|
uint8_t bitmask1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue