aboutsummaryrefslogtreecommitdiff
path: root/src/network/clientpackethandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/clientpackethandler.cpp')
-rw-r--r--src/network/clientpackethandler.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp
index 5fee908a3..764f6569f 100644
--- a/src/network/clientpackethandler.cpp
+++ b/src/network/clientpackethandler.cpp
@@ -778,7 +778,7 @@ void Client::handleCommand_NodeDef(NetworkPacket* pkt)
decompressZlib(tmp_is, tmp_os);
// Deserialize node definitions
- m_nodedef->deSerialize(tmp_os);
+ m_nodedef->deSerialize(tmp_os, m_proto_ver);
m_nodedef_received = true;
}
@@ -797,7 +797,7 @@ void Client::handleCommand_ItemDef(NetworkPacket* pkt)
decompressZlib(tmp_is, tmp_os);
// Deserialize node definitions
- m_itemdef->deSerialize(tmp_os);
+ m_itemdef->deSerialize(tmp_os, m_proto_ver);
m_itemdef_received = true;
}
@@ -818,22 +818,18 @@ void Client::handleCommand_PlaySound(NetworkPacket* pkt)
*/
s32 server_id;
- std::string name;
- float gain;
+ SimpleSoundSpec spec;
u8 type; // 0=local, 1=positional, 2=object
v3f pos;
u16 object_id;
- bool loop;
- float fade = 0.0f;
- float pitch = 1.0f;
bool ephemeral = false;
- *pkt >> server_id >> name >> gain >> type >> pos >> object_id >> loop;
+ *pkt >> server_id >> spec.name >> spec.gain >> type >> pos >> object_id >> spec.loop;
try {
- *pkt >> fade;
- *pkt >> pitch;
+ *pkt >> spec.fade;
+ *pkt >> spec.pitch;
*pkt >> ephemeral;
} catch (PacketError &e) {};
@@ -841,17 +837,17 @@ void Client::handleCommand_PlaySound(NetworkPacket* pkt)
int client_id = -1;
switch(type) {
case 0: // local
- client_id = m_sound->playSound(name, loop, gain, fade, pitch);
+ client_id = m_sound->playSound(spec);
break;
case 1: // positional
- client_id = m_sound->playSoundAt(name, loop, gain, pos, pitch);
+ client_id = m_sound->playSoundAt(spec, pos);
break;
case 2:
{ // object
ClientActiveObject *cao = m_env.getActiveObject(object_id);
if (cao)
pos = cao->getPosition();
- client_id = m_sound->playSoundAt(name, loop, gain, pos, pitch);
+ client_id = m_sound->playSoundAt(spec, pos);
break;
}
default: