mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-12 10:28:05 +00:00
fix: Extend saved ugc id to 64 bits (#1885)
Tetsed that ugc models are saved and loaded with the correct bits
This commit is contained in:
@@ -23,7 +23,7 @@ public:
|
|||||||
// Inserts a new UGC model into the database.
|
// Inserts a new UGC model into the database.
|
||||||
virtual void InsertNewUgcModel(
|
virtual void InsertNewUgcModel(
|
||||||
std::stringstream& sd0Data,
|
std::stringstream& sd0Data,
|
||||||
const uint32_t blueprintId,
|
const uint64_t blueprintId,
|
||||||
const uint32_t accountId,
|
const uint32_t accountId,
|
||||||
const LWOOBJID characterId) = 0;
|
const LWOOBJID characterId) = 0;
|
||||||
|
|
||||||
|
@@ -83,7 +83,7 @@ public:
|
|||||||
void InsertNewMail(const MailInfo& mail) override;
|
void InsertNewMail(const MailInfo& mail) override;
|
||||||
void InsertNewUgcModel(
|
void InsertNewUgcModel(
|
||||||
std::stringstream& sd0Data,
|
std::stringstream& sd0Data,
|
||||||
const uint32_t blueprintId,
|
const uint64_t blueprintId,
|
||||||
const uint32_t accountId,
|
const uint32_t accountId,
|
||||||
const LWOOBJID characterId) override;
|
const LWOOBJID characterId) override;
|
||||||
std::vector<MailInfo> GetMailForPlayer(const LWOOBJID characterId, const uint32_t numberOfMail) override;
|
std::vector<MailInfo> GetMailForPlayer(const LWOOBJID characterId, const uint32_t numberOfMail) override;
|
||||||
|
@@ -46,7 +46,7 @@ void MySQLDatabase::RemoveUnreferencedUgcModels() {
|
|||||||
|
|
||||||
void MySQLDatabase::InsertNewUgcModel(
|
void MySQLDatabase::InsertNewUgcModel(
|
||||||
std:: stringstream& sd0Data, // cant be const sad
|
std:: stringstream& sd0Data, // cant be const sad
|
||||||
const uint32_t blueprintId,
|
const uint64_t blueprintId,
|
||||||
const uint32_t accountId,
|
const uint32_t accountId,
|
||||||
const LWOOBJID characterId) {
|
const LWOOBJID characterId) {
|
||||||
const std::istream stream(sd0Data.rdbuf());
|
const std::istream stream(sd0Data.rdbuf());
|
||||||
|
@@ -81,7 +81,7 @@ public:
|
|||||||
void InsertNewMail(const MailInfo& mail) override;
|
void InsertNewMail(const MailInfo& mail) override;
|
||||||
void InsertNewUgcModel(
|
void InsertNewUgcModel(
|
||||||
std::stringstream& sd0Data,
|
std::stringstream& sd0Data,
|
||||||
const uint32_t blueprintId,
|
const uint64_t blueprintId,
|
||||||
const uint32_t accountId,
|
const uint32_t accountId,
|
||||||
const LWOOBJID characterId) override;
|
const LWOOBJID characterId) override;
|
||||||
std::vector<MailInfo> GetMailForPlayer(const LWOOBJID characterId, const uint32_t numberOfMail) override;
|
std::vector<MailInfo> GetMailForPlayer(const LWOOBJID characterId, const uint32_t numberOfMail) override;
|
||||||
|
@@ -47,7 +47,7 @@ void SQLiteDatabase::RemoveUnreferencedUgcModels() {
|
|||||||
|
|
||||||
void SQLiteDatabase::InsertNewUgcModel(
|
void SQLiteDatabase::InsertNewUgcModel(
|
||||||
std::stringstream& sd0Data, // cant be const sad
|
std::stringstream& sd0Data, // cant be const sad
|
||||||
const uint32_t blueprintId,
|
const uint64_t blueprintId,
|
||||||
const uint32_t accountId,
|
const uint32_t accountId,
|
||||||
const LWOOBJID characterId) {
|
const LWOOBJID characterId) {
|
||||||
const std::istream stream(sd0Data.rdbuf());
|
const std::istream stream(sd0Data.rdbuf());
|
||||||
|
@@ -192,7 +192,7 @@ void TestSQLDatabase::InsertNewMail(const MailInfo& mail) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestSQLDatabase::InsertNewUgcModel(std::stringstream& sd0Data, const uint32_t blueprintId, const uint32_t accountId, const LWOOBJID characterId) {
|
void TestSQLDatabase::InsertNewUgcModel(std::stringstream& sd0Data, const uint64_t blueprintId, const uint32_t accountId, const LWOOBJID characterId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@ class TestSQLDatabase : public GameDatabase {
|
|||||||
void InsertNewMail(const MailInfo& mail) override;
|
void InsertNewMail(const MailInfo& mail) override;
|
||||||
void InsertNewUgcModel(
|
void InsertNewUgcModel(
|
||||||
std::stringstream& sd0Data,
|
std::stringstream& sd0Data,
|
||||||
const uint32_t blueprintId,
|
const uint64_t blueprintId,
|
||||||
const uint32_t accountId,
|
const uint32_t accountId,
|
||||||
const LWOOBJID characterId) override;
|
const LWOOBJID characterId) override;
|
||||||
std::vector<MailInfo> GetMailForPlayer(const LWOOBJID characterId, const uint32_t numberOfMail) override;
|
std::vector<MailInfo> GetMailForPlayer(const LWOOBJID characterId, const uint32_t numberOfMail) override;
|
||||||
|
@@ -621,7 +621,6 @@ void PropertyManagementComponent::Load() {
|
|||||||
//BBB property models need to have extra stuff set for them:
|
//BBB property models need to have extra stuff set for them:
|
||||||
if (databaseModel.lot == 14) {
|
if (databaseModel.lot == 14) {
|
||||||
LWOOBJID blueprintID = databaseModel.ugcId;
|
LWOOBJID blueprintID = databaseModel.ugcId;
|
||||||
GeneralUtils::SetBit(blueprintID, eObjectBits::CHARACTER);
|
|
||||||
|
|
||||||
settings.push_back(new LDFData<LWOOBJID>(u"blueprintid", blueprintID));
|
settings.push_back(new LDFData<LWOOBJID>(u"blueprintid", blueprintID));
|
||||||
settings.push_back(new LDFData<int>(u"componentWhitelist", 1));
|
settings.push_back(new LDFData<int>(u"componentWhitelist", 1));
|
||||||
|
@@ -2588,8 +2588,7 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream& inStream, Entity* ent
|
|||||||
LWOOBJID newIDL = newID;
|
LWOOBJID newIDL = newID;
|
||||||
GeneralUtils::SetBit(newIDL, eObjectBits::CHARACTER);
|
GeneralUtils::SetBit(newIDL, eObjectBits::CHARACTER);
|
||||||
|
|
||||||
uint32_t blueprintIDSmall = ObjectIDManager::GenerateRandomObjectID();
|
LWOOBJID blueprintID = ObjectIDManager::GenerateRandomObjectID();
|
||||||
LWOOBJID blueprintID = blueprintIDSmall;
|
|
||||||
GeneralUtils::SetBit(blueprintID, eObjectBits::CHARACTER);
|
GeneralUtils::SetBit(blueprintID, eObjectBits::CHARACTER);
|
||||||
|
|
||||||
//We need to get the propertyID: (stolen from Wincent's propertyManagementComp)
|
//We need to get the propertyID: (stolen from Wincent's propertyManagementComp)
|
||||||
@@ -2614,12 +2613,12 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream& inStream, Entity* ent
|
|||||||
// Recompress the data and save to the database
|
// Recompress the data and save to the database
|
||||||
sd0.FromData(reinterpret_cast<const uint8_t*>(newLxfml.data()), newLxfml.size());
|
sd0.FromData(reinterpret_cast<const uint8_t*>(newLxfml.data()), newLxfml.size());
|
||||||
auto sd0AsStream = sd0.GetAsStream();
|
auto sd0AsStream = sd0.GetAsStream();
|
||||||
Database::Get()->InsertNewUgcModel(sd0AsStream, blueprintIDSmall, entity->GetCharacter()->GetParentUser()->GetAccountID(), entity->GetCharacter()->GetID());
|
Database::Get()->InsertNewUgcModel(sd0AsStream, blueprintID, entity->GetCharacter()->GetParentUser()->GetAccountID(), entity->GetCharacter()->GetID());
|
||||||
|
|
||||||
//Insert into the db as a BBB model:
|
//Insert into the db as a BBB model:
|
||||||
IPropertyContents::Model model;
|
IPropertyContents::Model model;
|
||||||
model.id = newIDL;
|
model.id = newIDL;
|
||||||
model.ugcId = blueprintIDSmall;
|
model.ugcId = blueprintID;
|
||||||
model.position = newCenter;
|
model.position = newCenter;
|
||||||
model.rotation = NiQuaternion(0.0f, 0.0f, 0.0f, 0.0f);
|
model.rotation = NiQuaternion(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
model.lot = 14;
|
model.lot = 14;
|
||||||
|
Reference in New Issue
Block a user