Move MessageID to ClientServerUtils

This commit is contained in:
Ryan Huffman 2017-01-20 16:43:11 -08:00
parent ad70431c26
commit e9c6e9dd5c
8 changed files with 29 additions and 8 deletions

View file

@ -27,6 +27,7 @@
#include "NodeType.h"
#include "SendAssetTask.h"
#include "UploadAssetTask.h"
#include <ClientServerUtils.h>
const QString ASSET_SERVER_LOGGING_TARGET_NAME = "asset-server";

View file

@ -21,6 +21,7 @@
#include <udt/Packet.h>
#include "AssetUtils.h"
#include "ClientServerUtils.h"
SendAssetTask::SendAssetTask(QSharedPointer<ReceivedMessage> message, const SharedNodePointer& sendToNode, const QDir& resourcesDir) :
QRunnable(),

View file

@ -18,6 +18,8 @@
#include <NodeList.h>
#include <NLPacketList.h>
#include "ClientServerUtils.h"
UploadAssetTask::UploadAssetTask(QSharedPointer<ReceivedMessage> receivedMessage, SharedNodePointer senderNode,
const QDir& resourcesDir) :

View file

@ -11,8 +11,6 @@
#include "EntityScriptServer.h"
#include "EntityScriptUtils.h"
#include <AudioConstants.h>
#include <AudioInjectorManager.h>
#include <EntityScriptingInterface.h>
@ -26,6 +24,7 @@
#include <UUID.h>
#include <WebSocketServerClass.h>
#include "ClientServerUtils.h"
#include "../entities/AssignmentParentFinder.h"
int EntityScriptServer::_entitiesScriptEngineCount = 0;

View file

@ -21,6 +21,7 @@
#include <DependencyManager.h>
#include "AssetUtils.h"
#include "ClientServerUtils.h"
#include "LimitedNodeList.h"
#include "Node.h"
#include "ReceivedMessage.h"

View file

@ -19,7 +19,6 @@
#include <QtCore/QByteArray>
#include <QtCore/QUrl>
using MessageID = uint32_t;
using DataOffset = int64_t;
using AssetPath = QString;
@ -27,8 +26,6 @@ using AssetHash = QString;
using AssetMapping = std::map<AssetPath, AssetHash>;
using AssetPathList = QStringList;
const MessageID INVALID_MESSAGE_ID = 0;
const size_t SHA256_HASH_LENGTH = 32;
const size_t SHA256_HASH_HEX_LENGTH = 64;
const uint64_t MAX_UPLOAD_SIZE = 1000 * 1000 * 1000; // 1GB
@ -66,4 +63,4 @@ bool isValidFilePath(const AssetPath& path);
bool isValidPath(const AssetPath& path);
bool isValidHash(const QString& hashString);
#endif
#endif // hifi_AssetUtils_h

View file

@ -0,0 +1,21 @@
//
// ClientServerUtils.h
// libraries/networking/src
//
// Created by Ryan Huffman on 2017/01/20
// Copyright 2017 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_ClientServerUtils_h
#define hifi_ClientServerUtils_h
#include <cstdint>
using MessageID = uint32_t;
const MessageID INVALID_MESSAGE_ID = 0;
#endif // hifi_ClientServerUtils_h

View file

@ -12,6 +12,7 @@
#ifndef hifi_EntityScriptClient_h
#define hifi_EntityScriptClient_h
#include "ClientServerUtils.h"
#include "LimitedNodeList.h"
#include "ReceivedMessage.h"
#include "AssetUtils.h"
@ -20,8 +21,6 @@
#include <DependencyManager.h>
#include <unordered_map>
using MessageID = uint32_t;
using GetScriptStatusCallback = std::function<void(bool responseReceived, bool isRunning, EntityScriptStatus status, QString errorInfo)>;
class GetScriptStatusRequest : public QObject {