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
5757 }
5858
5959 void MetavoxelSystem::simulate(float deltaTime) {
60+ // simulate the clients
61+ foreach (MetavoxelClient* client, _clients) {
62+ client->simulate(deltaTime);
63+ }
64+
6065 _points.clear();
6166 _data.guide(_pointVisitor);
6267
@@ -114,7 +119,7 @@ void MetavoxelSystem::render() { · 51 unmodified lines
114119 void MetavoxelSystem::nodeAdded(Node* node) {
115120 if (node->getType() == NODE_TYPE_METAVOXEL_SERVER) {
116121 QMetaObject::invokeMethod(this, "addClient", Q_ARG(const QUuid&, node->getUUID()),
117− Q_ARG(const HifiSockAddr&, node->getPublicSocket()));
122+ Q_ARG(const HifiSockAddr&, node->getLocalSocket()));
118123 }
119124 }
120125
@@ -186,6 +191,11 @@ MetavoxelClient::MetavoxelClient(const HifiSockAddr& address) : · 65 unmodified lines
186191 connect(&_sequencer, SIGNAL(readyToRead(Bitstream&)), SLOT(readPacket(Bitstream&)));
187192 }
188193
194+void MetavoxelClient::simulate(float deltaTime) {
195+ Bitstream& out = _sequencer.startPacket();
196+ _sequencer.endPacket();
197+}
198+
189199 void MetavoxelClient::receivedData(const QByteArray& data, const HifiSockAddr& sender) {
190200 // save the most recent sender
191201 _address = sender;
@@ -199,4 +209,5 @@ void MetavoxelClient::sendData(const QByteArray& data) { · 7 unmodified lines
199209 }
200210
201211 void MetavoxelClient::readPacket(Bitstream& in) {
212+ qDebug("got packet from server!\n");
202213 }