History

Communication between client and server.

Andrzej Kapolka committed 12 years ago

Commit ecd9c9f1 parent f70670d14 files · +159 −184Browse files

Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 14 files). Show all

Unified · Split

interface/src/MetavoxelSystem.cpp+12−1
@@ -57,6 +57,11 @@ void MetavoxelSystem::processData(const QByteArray& data, const HifiSockAddr& se · 56 unmodified lines
57}57}
58 58
59void MetavoxelSystem::simulate(float deltaTime) {59void MetavoxelSystem::simulate(float deltaTime) {
60 // simulate the clients
61 foreach (MetavoxelClient* client, _clients) {
62 client->simulate(deltaTime);
63 }
64
60 _points.clear();65 _points.clear();
61 _data.guide(_pointVisitor);66 _data.guide(_pointVisitor);
62 67
@@ -114,7 +119,7 @@ void MetavoxelSystem::render() { · 51 unmodified lines
114void MetavoxelSystem::nodeAdded(Node* node) {119void MetavoxelSystem::nodeAdded(Node* node) {
115 if (node->getType() == NODE_TYPE_METAVOXEL_SERVER) {120 if (node->getType() == NODE_TYPE_METAVOXEL_SERVER) {
116 QMetaObject::invokeMethod(this, "addClient", Q_ARG(const QUuid&, node->getUUID()),121 QMetaObject::invokeMethod(this, "addClient", Q_ARG(const QUuid&, node->getUUID()),
117 Q_ARG(const HifiSockAddr&, node->getPublicSocket()));122 Q_ARG(const HifiSockAddr&, node->getLocalSocket()));
118 }123 }
119}124}
120 125
@@ -186,6 +191,11 @@ MetavoxelClient::MetavoxelClient(const HifiSockAddr& address) : · 65 unmodified lines
186 connect(&_sequencer, SIGNAL(readyToRead(Bitstream&)), SLOT(readPacket(Bitstream&)));191 connect(&_sequencer, SIGNAL(readyToRead(Bitstream&)), SLOT(readPacket(Bitstream&)));
187}192}
188 193
194void MetavoxelClient::simulate(float deltaTime) {
195 Bitstream& out = _sequencer.startPacket();
196 _sequencer.endPacket();
197}
198
189void MetavoxelClient::receivedData(const QByteArray& data, const HifiSockAddr& sender) {199void MetavoxelClient::receivedData(const QByteArray& data, const HifiSockAddr& sender) {
190 // save the most recent sender200 // save the most recent sender
191 _address = sender;201 _address = sender;
@@ -199,4 +209,5 @@ void MetavoxelClient::sendData(const QByteArray& data) { · 7 unmodified lines
199}209}
200 210
201void MetavoxelClient::readPacket(Bitstream& in) {211void MetavoxelClient::readPacket(Bitstream& in) {
212 qDebug("got packet from server!\n");
202}213}