Maintenance: Forced maintainer submission (resubmission of 14678 after td sync to 8deac7a3; replaces 14460 and 14473). Native-run fix
Batch #14681 by ragnarok-clanker: forced by an admin (6 lower score(s), 70 changed function(s)); checked with 555 compiled unit(s), including every includer of Source/Client/Mode/CLoginMode.h, Source/Client/Session.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/GrannyGameActor.h, Source/Contents/Actors/Pc.h, Source/Contents/Actors/RenderObject.h, Source/Contents/EffectResourceSwitcher.h, Source/Contents/Effects/CartCannon.h, Source/Contents/Effects/EZ2STREffectEx.h, Source/Contents/Effects/EffectActor.h, Source/Contents/Effects/MonsterSkillEffects.h, Source/Contents/Effects/RagEffect.h, Source/Contents/Effects/RectUpEffect.h, Source/Contents/Ground/GroundGeometry.h, Source/Network/Connection/Connection.h, Source/Resource/Audio/WaveResource.h, Source/Resource/Bitmap/BitmapResource.h, Source/Resource/EZeffectResource.h, Source/Resource/EmblemResource.h, Source/Resource/GifResource.h, Source/Resource/ImfResource.h, Source/Resource/Models/AnimatedModelResource.h, Source/Resource/Models/GrannyModelResource.h, Source/Resource/Models/ModelResource.h, Source/Resource/PaletteResource.h, Source/Resource/RmaResource.h, Source/Resource/Sprites/ActionResource.h, Source/Resource/Sprites/SpriteResource.h, Source/Resource/World/GroundResource.h, Source/Resource/World/TerrainResource.h, Source/Resource/World/WorldResource.h, Source/UI/Buttons/UIBmpRadioBtn.h, Source/UI/Buttons/UITextButton.h, Source/UI/Item/UIItemPurchaseWnd.h, Source/UI/Item/UIItemSellWnd.h, Source/UI/Item/UIItemSellWnd2.h, Source/UI/Item/UIItemStoreWnd.h, Source/UI/Item/UIItemWnd.h, Source/UI/Item/UIParaItemShopWnd.h, Source/UI/Items/UIItemRepairWnd.h, Source/UI/Items/UIMakeTargetListWnd.h, Source/UI/Items/UIMakeTargetProcessWnd.h, Source/UI/Items/UIWeaponRefineWnd.h, Source/UI/Rodex/UIRodexInboxWnd.h, Source/UI/Shop/UIMerchantItemShopWnd.h, Source/UI/Shop/UIMerchantMirrorItemWnd.h, Source/UI/Shop/UIMerchantShopMakeWnd.h, Source/UI/StylingShop/UIStylingShopWnd.h, Source/UI/UIChangeMaterialWnd.h, Source/UI/UIIngredientInfoWnd.h, Source/UI/UIItemReformWnd.h, Source/UI/UILapineScrollBar.h, Source/UI/Window/UIHotKeyWnd.h, Source/UI/Window/UINewSelectCharWnd.h.
This commit is contained in:
parent
8deac7a3e0
commit
ffbeee0f2a
142 changed files with 709 additions and 435 deletions
|
|
@ -79,10 +79,6 @@ void BsonDecodeOptionsConstruct();
|
|||
void JsonDecodeOptionsConstruct();
|
||||
void JsonOptionsCommonDestroy();
|
||||
void JsonDefaultParsingHandler();
|
||||
void* __cdecl JsonDecodeBsonStream(JsonValue* out, std::ifstream* file, JsonCppLoaderBsonOptions* options);
|
||||
void* __cdecl JsonDecodeBsonBuffer(JsonValue* out, const std::vector<unsigned char>* buffer, JsonCppLoaderBsonOptions* options);
|
||||
void* __cdecl JsonParseStream(JsonValue* out, std::ifstream* file, JsonCppLoaderJsonOptions* options, JsonCppLoaderJsonHandler handler);
|
||||
void* __cdecl JsonParseString(JsonValue* out, const unsigned char* data, JsonCppLoaderJsonOptions* options, JsonCppLoaderJsonHandler handler);
|
||||
void JsonSwap();
|
||||
void JsonDestroy();
|
||||
void JsonCopyConstruct();
|
||||
|
|
@ -99,12 +95,28 @@ static JsonValue CopyNullJsonValue() {
|
|||
struct JsonCppLoaderParsedValue {
|
||||
JsonValue value;
|
||||
|
||||
// INLINED
|
||||
JsonCppLoaderParsedValue& operator=(JsonCppLoaderParsedValue&& other) {
|
||||
if (this != &other) {
|
||||
reinterpret_cast<void(__thiscall*)(JsonValue*, JsonValue*)>(JsonSwap)(&this->value, &other.value);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// INLINED
|
||||
~JsonCppLoaderParsedValue() {
|
||||
reinterpret_cast<void(__thiscall*)(JsonValue*)>(JsonDestroy)(&this->value);
|
||||
}
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
JsonCppLoaderParsedValue __cdecl JsonDecodeBsonStream(std::ifstream* file, JsonCppLoaderBsonOptions* options);
|
||||
JsonCppLoaderParsedValue __cdecl JsonDecodeBsonBuffer(const std::vector<unsigned char>* buffer, JsonCppLoaderBsonOptions* options);
|
||||
JsonCppLoaderParsedValue __cdecl JsonParseStream(std::ifstream* file, JsonCppLoaderJsonOptions* options, JsonCppLoaderJsonHandler handler);
|
||||
JsonCppLoaderParsedValue __cdecl JsonParseString(const unsigned char* data, JsonCppLoaderJsonOptions* options, JsonCppLoaderJsonHandler handler);
|
||||
}
|
||||
|
||||
struct JsonCppLoaderJsonOptionsGuard {
|
||||
JsonCppLoaderJsonOptions* options;
|
||||
|
||||
|
|
@ -125,13 +137,7 @@ bool JsonCppLoader::LoadBson(const std::string& path) {
|
|||
|
||||
JsonCppLoaderBsonOptions optionStorage;
|
||||
JsonCppLoaderBsonOptions* options = reinterpret_cast<JsonCppLoaderBsonOptions*(__thiscall*)(JsonCppLoaderBsonOptions*, int)>(BsonDecodeOptionsConstruct)(&optionStorage, 1);
|
||||
{
|
||||
JsonCppLoaderParsedValue parsed;
|
||||
JsonValue* result = static_cast<JsonValue*>(JsonDecodeBsonStream(&parsed.value, &file, options));
|
||||
if (&this->document != result) {
|
||||
reinterpret_cast<void(__thiscall*)(JsonValue*, JsonValue*)>(JsonSwap)(&this->document, result);
|
||||
}
|
||||
}
|
||||
reinterpret_cast<JsonCppLoaderParsedValue&>(this->document) = JsonDecodeBsonStream(&file, options);
|
||||
file.close();
|
||||
} catch (const std::exception& exception) {
|
||||
this->Fail("error : JsonCppLoader::LoadBson failed (reason : %s)", exception.what());
|
||||
|
|
@ -152,13 +158,7 @@ bool JsonCppLoader::LoadJson(const std::string& path) {
|
|||
|
||||
JsonCppLoaderJsonOptions optionStorage;
|
||||
JsonCppLoaderJsonOptionsGuard options{reinterpret_cast<JsonCppLoaderJsonOptions*(__thiscall*)(JsonCppLoaderJsonOptions*, int)>(JsonDecodeOptionsConstruct)(&optionStorage, 1)};
|
||||
{
|
||||
JsonCppLoaderParsedValue parsed;
|
||||
JsonValue* result = static_cast<JsonValue*>(JsonParseStream(&parsed.value, &file, options.options, JsonCppLoaderJsonHandler{}));
|
||||
if (&this->document != result) {
|
||||
reinterpret_cast<void(__thiscall*)(JsonValue*, JsonValue*)>(JsonSwap)(&this->document, result);
|
||||
}
|
||||
}
|
||||
reinterpret_cast<JsonCppLoaderParsedValue&>(this->document) = JsonParseStream(&file, options.options, JsonCppLoaderJsonHandler{});
|
||||
file.close();
|
||||
} catch (const std::exception& exception) {
|
||||
this->Fail("error : JsonCppLoader::LoadJson failed (reason : %s)", exception.what());
|
||||
|
|
@ -202,11 +202,7 @@ __declspec(noinline) bool JsonCppLoader::LoadBson(std::vector<unsigned char>& bu
|
|||
try {
|
||||
JsonCppLoaderBsonOptions optionStorage;
|
||||
JsonCppLoaderBsonOptions* options = reinterpret_cast<JsonCppLoaderBsonOptions*(__thiscall*)(JsonCppLoaderBsonOptions*, int)>(BsonDecodeOptionsConstruct)(&optionStorage, 1);
|
||||
JsonCppLoaderParsedValue parsed;
|
||||
JsonValue* result = static_cast<JsonValue*>(JsonDecodeBsonBuffer(&parsed.value, &buffer, options));
|
||||
if (&this->document != result) {
|
||||
reinterpret_cast<void(__thiscall*)(JsonValue*, JsonValue*)>(JsonSwap)(&this->document, result);
|
||||
}
|
||||
reinterpret_cast<JsonCppLoaderParsedValue&>(this->document) = JsonDecodeBsonBuffer(&buffer, options);
|
||||
} catch (const std::exception& exception) {
|
||||
this->Fail("error : JsonCppLoader::LoadBson failed (reason : %s)", exception.what());
|
||||
return false;
|
||||
|
|
@ -231,11 +227,7 @@ __declspec(noinline) bool JsonCppLoader::LoadJson(std::vector<unsigned char>& bu
|
|||
try {
|
||||
JsonCppLoaderJsonOptions optionStorage;
|
||||
JsonCppLoaderJsonOptionsGuard options{reinterpret_cast<JsonCppLoaderJsonOptions*(__thiscall*)(JsonCppLoaderJsonOptions*, int)>(JsonDecodeOptionsConstruct)(&optionStorage, 1)};
|
||||
JsonCppLoaderParsedValue parsed;
|
||||
JsonValue* result = static_cast<JsonValue*>(JsonParseString(&parsed.value, buffer.data(), options.options, JsonCppLoaderJsonHandler{}));
|
||||
if (&this->document != result) {
|
||||
reinterpret_cast<void(__thiscall*)(JsonValue*, JsonValue*)>(JsonSwap)(&this->document, result);
|
||||
}
|
||||
reinterpret_cast<JsonCppLoaderParsedValue&>(this->document) = JsonParseString(buffer.data(), options.options, JsonCppLoaderJsonHandler{});
|
||||
} catch (const std::exception& exception) {
|
||||
this->Fail("error : JsonCppLoader::LoadJson failed (reason : %s)", exception.what());
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue