<commit_before>// For conditions of distribution and use, see copyright notice in license.txt

#include "StableHeaders.h"
#include "DebugOperatorNew.h"
#include "AssetModule.h"
#include "LocalAssetProvider.h"
#include "HttpAssetProvider.h"
#include "HttpAssetStorage.h"
#include "Framework.h"
#include "Profiler.h"
#include "CoreException.h"
#include "AssetAPI.h"
#include "LocalAssetStorage.h"
#include "ConsoleAPI.h"
#include "Application.h"

#include "KristalliProtocolModule.h"
#include "TundraLogicModule.h"
#include "TundraMessages.h"
#include "Client.h"
#include "Server.h"
#include "UserConnectedResponseData.h"
#include "UserConnection.h"
#include "MsgAssetDeleted.h"
#include "MsgAssetDiscovery.h"

#include "kNetBuildConfig.h"
#include "kNet/MessageConnection.h"

#include <QDir>
#include "MemoryLeakCheck.h"

namespace Asset
{
    AssetModule::AssetModule()
    :IModule("Asset")
    {
    }

    AssetModule::~AssetModule()
    {
    }

    void AssetModule::Initialize()
    {
        boost::shared_ptr<HttpAssetProvider> http = boost::shared_ptr<HttpAssetProvider>(new HttpAssetProvider(framework_));
        framework_->Asset()->RegisterAssetProvider(boost::dynamic_pointer_cast<IAssetProvider>(http));
        
        boost::shared_ptr<LocalAssetProvider> local = boost::shared_ptr<LocalAssetProvider>(new LocalAssetProvider(framework_));
        framework_->Asset()->RegisterAssetProvider(boost::dynamic_pointer_cast<IAssetProvider>(local));
        
        QString systemAssetDir = Application::InstallationDirectory() + "data/assets";
        local->AddStorageDirectory(systemAssetDir, "System", true);
        // Set asset dir as also as AssetAPI property
        framework_->Asset()->setProperty("assetdir", systemAssetDir);
        framework_->Asset()->setProperty("inbuiltassetdir", systemAssetDir);
        
        QString jsAssetDir = Application::InstallationDirectory() + "jsmodules";
        local->AddStorageDirectory(jsAssetDir, "Javascript", true);

        QString ogreAssetDir = Application::InstallationDirectory() + "media";
        local->AddStorageDirectory(ogreAssetDir, "Ogre Media", true);

        framework_->RegisterDynamicObject("assetModule", this);<commit_msg>Deleted old temp workaround code to hardcodedly expose the system asset dir to scripts - use the asset api directly instead.<commit_after>// For conditions of distribution and use, see copyright notice in license.txt

#include "StableHeaders.h"
#include "DebugOperatorNew.h"
#include "AssetModule.h"
#include "LocalAssetProvider.h"
#include "HttpAssetProvider.h"
#include "HttpAssetStorage.h"
#include "Framework.h"
#include "Profiler.h"
#include "CoreException.h"
#include "AssetAPI.h"
#include "LocalAssetStorage.h"
#include "ConsoleAPI.h"
#include "Application.h"

#include "KristalliProtocolModule.h"
#include "TundraLogicModule.h"
#include "TundraMessages.h"
#include "Client.h"
#include "Server.h"
#include "UserConnectedResponseData.h"
#include "UserConnection.h"
#include "MsgAssetDeleted.h"
#include "MsgAssetDiscovery.h"

#include "kNetBuildConfig.h"
#include "kNet/MessageConnection.h"

#include <QDir>
#include "MemoryLeakCheck.h"

namespace Asset
{
    AssetModule::AssetModule()
    :IModule("Asset")
    {
    }

    AssetModule::~AssetModule()
    {
    }

    void AssetModule::Initialize()
    {
        boost::shared_ptr<HttpAssetProvider> http = boost::shared_ptr<HttpAssetProvider>(new HttpAssetProvider(framework_));
        framework_->Asset()->RegisterAssetProvider(boost::dynamic_pointer_cast<IAssetProvider>(http));
        
        boost::shared_ptr<LocalAssetProvider> local = boost::shared_ptr<LocalAssetProvider>(new LocalAssetProvider(framework_));
        framework_->Asset()->RegisterAssetProvider(boost::dynamic_pointer_cast<IAssetProvider>(local));
        
        QString systemAssetDir = Application::InstallationDirectory() + "data/assets";
        local->AddStorageDirectory(systemAssetDir, "System", true);

        QString jsAssetDir = Application::InstallationDirectory() + "jsmodules";
        local->AddStorageDirectory(jsAssetDir, "Javascript", true);

        QString ogreAssetDir = Application::InstallationDirectory() + "media";
        local->AddStorageDirectory(ogreAssetDir, "Ogre Media", true);

        framework_->RegisterDynamicObject("assetModule", this);
{'fraction_non_alphanumeric': 0.12494215640906987, 'fraction_numerical': 0.0, 'mean_word_length': 5.265217391304348, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2121107', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1241, 'n_words': 240}