Add Asset-related types and packets

This commit is contained in:
Ryan Huffman 2015-07-23 15:13:56 -07:00
parent 52e422198b
commit 0b2e896ea4
5 changed files with 18 additions and 3 deletions

View file

@ -52,6 +52,8 @@
#include <AccountManager.h>
#include <AddressManager.h>
#include <AssetClient.h>
#include <AssetScriptingInterface.h>
#include <CursorManager.h>
#include <AudioInjector.h>
#include <AutoUpdater.h>
@ -287,6 +289,8 @@ bool setupEssentials(int& argc, char** argv) {
auto autoUpdater = DependencyManager::set<AutoUpdater>();
auto pathUtils = DependencyManager::set<PathUtils>();
auto actionFactory = DependencyManager::set<InterfaceActionFactory>();
auto assetClient = DependencyManager::set<AssetClient>();
auto assetScriptingInterface = DependencyManager::set<AssetScriptingInterface>();
return true;
}
@ -494,7 +498,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
// tell the NodeList instance who to tell the domain server we care about
nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet() << NodeType::AudioMixer << NodeType::AvatarMixer
<< NodeType::EntityServer);
<< NodeType::EntityServer << NodeType::AssetServer);
// connect to the packet sent signal of the _entityEditSender
connect(&_entityEditSender, &EntityEditPacketSender::packetSent, this, &Application::packetSent);
@ -1738,6 +1742,7 @@ void Application::sendPingPackets() {
case NodeType::AvatarMixer:
case NodeType::AudioMixer:
case NodeType::EntityServer:
case NodeType::AssetServer:
return true;
default:
return false;
@ -3750,6 +3755,8 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri
qScriptRegisterMetaType(scriptEngine, RayToOverlayIntersectionResultToScriptValue,
RayToOverlayIntersectionResultFromScriptValue);
scriptEngine->registerGlobalObject("Assets", DependencyManager::get<AssetScriptingInterface>().data());
QScriptValue windowValue = scriptEngine->registerGlobalObject("Window", DependencyManager::get<WindowScriptingInterface>().data());
scriptEngine->registerGetterSetter("location", LocationScriptingInterface::locationGetter,
LocationScriptingInterface::locationSetter, windowValue);

View file

@ -27,6 +27,8 @@ Assignment::Type Assignment::typeForNodeType(NodeType_t nodeType) {
return Assignment::AgentType;
case NodeType::EntityServer:
return Assignment::EntityServerType;
case NodeType::AssetServer:
return Assignment::AssetServerType;
default:
return Assignment::AllTypes;
}

View file

@ -33,7 +33,8 @@ public:
UNUSED_1 = 4,
UNUSED_2 = 5,
EntityServerType = 6,
AllTypes = 7
AssetServerType = 7,
AllTypes = 8
};
enum Command {

View file

@ -23,6 +23,7 @@ namespace NodeType {
const NodeType_t Agent = 'I';
const NodeType_t AudioMixer = 'M';
const NodeType_t AvatarMixer = 'W';
const NodeType_t AssetServer = 'A';
const NodeType_t Unassigned = 1;
void init();

View file

@ -73,7 +73,11 @@ namespace PacketType {
EntityQuery,
EntityAdd,
EntityErase,
EntityEdit
EntityEdit,
AssetGet,
AssetGetReply,
AssetUpload,
AssetUploadReply,
};
};