more voxelEctomy

This commit is contained in:
ZappoMan 2014-12-30 20:24:27 -08:00
parent 95bb125e48
commit 5cef7d0e9d
10 changed files with 24 additions and 123 deletions

View file

@ -410,99 +410,5 @@
"advanced": true
}
]
},
{
"name": "voxel_server_settings",
"label": "Voxel Server Settings",
"assignment-types": [3],
"settings": [
{
"name": "persistFilename",
"label": "Persistant Filename",
"help": "the filename for your voxels",
"placeholder": "resources/voxels.svo",
"default": "resources/voxels.svo",
"advanced": true
},
{
"name": "persistInterval",
"label": "Persist Interval",
"help": "Interval between persist checks in msecs.",
"placeholder": "30000",
"default": "30000",
"advanced": true
},
{
"name": "NoPersist",
"type": "checkbox",
"help": "Don't persist your voxels to a file.",
"default": false,
"advanced": true
},
{
"name": "backupExtensionFormat",
"label": "Backup File Extension Format:",
"help": "Format used to create the extension for the backup of your persisted voxels.",
"placeholder": ".backup.%Y-%m-%d.%H:%M:%S.%z",
"default": ".backup.%Y-%m-%d.%H:%M:%S.%z",
"advanced": true
},
{
"name": "backupInterval",
"label": "Backup Interval",
"help": "Interval between backup checks in msecs.",
"placeholder": "1800000",
"default": "1800000",
"advanced": true
},
{
"name": "NoBackup",
"type": "checkbox",
"help": "Don't regularly backup your persisted voxels to a backup file.",
"default": false,
"advanced": true
},
{
"name": "statusHost",
"label": "Status Hostname",
"help": "host name or IP address of the server for accessing the status page",
"placeholder": "",
"default": "",
"advanced": true
},
{
"name": "statusPort",
"label": "Status Port",
"help": "port of the server for accessing the status page",
"placeholder": "",
"default": "",
"advanced": true
},
{
"name": "clockSkew",
"label": "Clock Skew",
"help": "Number of msecs to skew the server clock by to test clock skew",
"placeholder": "0",
"default": "0",
"advanced": true
},
{
"name": "sendEnvironments",
"type": "checkbox",
"help": "send environmental data",
"default": false,
"advanced": true
},
{
"name": "minimalEnvironment",
"type": "checkbox",
"help": "send minimal environmental data if sending environmental data",
"default": false,
"advanced": true
}
]
}
}
]

View file

@ -550,7 +550,8 @@ void DomainServer::populateDefaultStaticAssignmentsExcludingTypes(const QSet<Ass
defaultedType != Assignment::AllTypes;
defaultedType = static_cast<Assignment::Type>(static_cast<int>(defaultedType) + 1)) {
if (!excludedTypes.contains(defaultedType)
&& defaultedType != Assignment::UNUSED
&& defaultedType != Assignment::UNUSED_0
&& defaultedType != Assignment::UNUSED_1
&& defaultedType != Assignment::AgentType) {
// type has not been set from a command line or config file config, use the default
// by clearing whatever exists and writing a single default assignment with no payload

View file

@ -313,7 +313,7 @@ void Stats::display(
horizontalOffset = _lastHorizontalOffset + _generalStatsWidth +1;
if (Menu::getInstance()->isOptionChecked(MenuOption::TestPing)) {
int pingAudio = -1, pingAvatar = -1, pingVoxel = -1, pingVoxelMax = -1;
int pingAudio = -1, pingAvatar = -1, pingVoxel = -1, pingOctreeMax = -1;
NodeList* nodeList = NodeList::getInstance();
SharedNodePointer audioMixerNode = nodeList->soloNodeOfType(NodeType::AudioMixer);
@ -323,22 +323,22 @@ void Stats::display(
pingAvatar = avatarMixerNode ? avatarMixerNode->getPingMs() : -1;
// Now handle voxel servers, since there could be more than one, we average their ping times
unsigned long totalPingVoxel = 0;
int voxelServerCount = 0;
unsigned long totalPingOctree = 0;
int octreeServerCount = 0;
nodeList->eachNode([&totalPingVoxel, &pingVoxelMax, &voxelServerCount](const SharedNodePointer& node){
nodeList->eachNode([&totalPingOctree, &pingOctreeMax, &octreeServerCount](const SharedNodePointer& node){
// TODO: this should also support entities
if (node->getType() == NodeType::VoxelServer) {
totalPingVoxel += node->getPingMs();
voxelServerCount++;
if (pingVoxelMax < node->getPingMs()) {
pingVoxelMax = node->getPingMs();
if (node->getType() == NodeType::EntityServer) {
totalPingOctree += node->getPingMs();
octreeServerCount++;
if (pingOctreeMax < node->getPingMs()) {
pingOctreeMax = node->getPingMs();
}
}
});
if (voxelServerCount) {
pingVoxel = totalPingVoxel/voxelServerCount;
if (octreeServerCount) {
pingVoxel = totalPingOctree / octreeServerCount;
}
lines = _expanded ? 4 : 3;
@ -366,9 +366,9 @@ void Stats::display(
char voxelAvgPing[30];
if (pingVoxel >= 0) {
sprintf(voxelAvgPing, "Voxel avg ping: %d", pingVoxel);
sprintf(voxelAvgPing, "Entities avg ping: %d", pingVoxel);
} else {
sprintf(voxelAvgPing, "Voxel avg ping: --");
sprintf(voxelAvgPing, "Entities avg ping: --");
}
verticalOffset += STATS_PELS_PER_LINE;
@ -381,7 +381,7 @@ void Stats::display(
if (_expanded) {
char voxelMaxPing[30];
if (pingVoxel >= 0) { // Average is only meaningful if pingVoxel is valid.
sprintf(voxelMaxPing, "Voxel max ping: %d", pingVoxelMax);
sprintf(voxelMaxPing, "Voxel max ping: %d", pingOctreeMax);
} else {
sprintf(voxelMaxPing, "Voxel max ping: --");
}

View file

@ -25,8 +25,6 @@ Assignment::Type Assignment::typeForNodeType(NodeType_t nodeType) {
return Assignment::AvatarMixerType;
case NodeType::Agent:
return Assignment::AgentType;
case NodeType::VoxelServer:
return Assignment::VoxelServerType;
case NodeType::EntityServer:
return Assignment::EntityServerType;
case NodeType::MetavoxelServer:
@ -133,8 +131,8 @@ const char* Assignment::getTypeName() const {
return "avatar-mixer";
case Assignment::AgentType:
return "agent";
case Assignment::VoxelServerType:
return "voxel-server";
case Assignment::EntityServerType:
return "entity-server";
case Assignment::MetavoxelServerType:
return "metavoxel-server";
default:

View file

@ -29,8 +29,8 @@ public:
AudioMixerType,
AvatarMixerType,
AgentType,
VoxelServerType,
UNUSED,
UNUSED_0,
UNUSED_1,
MetavoxelServerType,
EntityServerType,
AllTypes

View file

@ -28,13 +28,11 @@ namespace NodeType {
void NodeType::init() {
TypeNameHash.insert(NodeType::DomainServer, "Domain Server");
TypeNameHash.insert(NodeType::VoxelServer, "Voxel Server");
TypeNameHash.insert(NodeType::EntityServer, "Entity Server");
TypeNameHash.insert(NodeType::MetavoxelServer, "Metavoxel Server");
TypeNameHash.insert(NodeType::Agent, "Agent");
TypeNameHash.insert(NodeType::AudioMixer, "Audio Mixer");
TypeNameHash.insert(NodeType::AvatarMixer, "Avatar Mixer");
TypeNameHash.insert(NodeType::AnimationServer, "Animation Server");
TypeNameHash.insert(NodeType::Unassigned, "Unassigned");
}

View file

@ -30,14 +30,12 @@ typedef quint8 NodeType_t;
namespace NodeType {
const NodeType_t DomainServer = 'D';
const NodeType_t VoxelServer = 'V';
const NodeType_t EntityServer = 'o'; // was ModelServer
const NodeType_t MetavoxelServer = 'm';
const NodeType_t EnvironmentServer = 'E';
const NodeType_t Agent = 'I';
const NodeType_t AudioMixer = 'M';
const NodeType_t AvatarMixer = 'W';
const NodeType_t AnimationServer = 'a';
const NodeType_t Unassigned = 1;
void init();

View file

@ -30,7 +30,7 @@ public:
static const int DEFAULT_PACKETS_PER_SECOND = 1;
static const int NO_SERVER_CHECK_RATE = 60; // if no servers yet detected, keep checking at 60fps
JurisdictionListener(NodeType_t type = NodeType::VoxelServer);
JurisdictionListener(NodeType_t type = NodeType::EntityServer);
virtual bool process();

View file

@ -31,7 +31,7 @@ public:
};
// standard constructors
JurisdictionMap(NodeType_t type = NodeType::VoxelServer); // default constructor
JurisdictionMap(NodeType_t type = NodeType::EntityServer); // default constructor
JurisdictionMap(const JurisdictionMap& other); // copy constructor
// standard assignment

View file

@ -27,7 +27,7 @@ class JurisdictionSender : public ReceivedPacketProcessor {
public:
static const int DEFAULT_PACKETS_PER_SECOND = 1;
JurisdictionSender(JurisdictionMap* map, NodeType_t type = NodeType::VoxelServer);
JurisdictionSender(JurisdictionMap* map, NodeType_t type = NodeType::EntityServer);
~JurisdictionSender();
void setJurisdiction(JurisdictionMap* map) { _jurisdictionMap = map; }