+ else if(command == TOCLIENT_HUD_SET_PARAM)
+ {
+ std::string datastring((char *)&data[2], datasize - 2);
+ std::istringstream is(datastring, std::ios_base::binary);
+
+ u16 param = readU16(is);
+ std::string value = deSerializeString(is);
+
+ if(param == HUD_PARAM_HOTBAR_ITEMCOUNT && value.size() == 4) {
+ s32 hotbar_itemcount = readS32((u8*) value.c_str());
+ if(hotbar_itemcount > 0 && hotbar_itemcount <= HUD_HOTBAR_ITEMCOUNT_MAX)
+ player->hud_hotbar_itemcount = hotbar_itemcount;
+ }
+ else if (param == HUD_PARAM_HOTBAR_IMAGE) {
+ ((LocalPlayer *) player)->hotbar_image = value;
+ }
+ else if (param == HUD_PARAM_HOTBAR_SELECTED_IMAGE) {
+ ((LocalPlayer *) player)->hotbar_selected_image = value;
+ }
+ }
+ else if(command == TOCLIENT_SET_SKY)
+ {
+ std::string datastring((char *)&data[2], datasize - 2);
+ std::istringstream is(datastring, std::ios_base::binary);
+
+ video::SColor *bgcolor = new video::SColor(readARGB8(is));
+ std::string *type = new std::string(deSerializeString(is));
+ u16 count = readU16(is);
+ std::vector<std::string> *params = new std::vector<std::string>;
+
+ for(size_t i=0; i<count; i++)
+ params->push_back(deSerializeString(is));
+
+ ClientEvent event;
+ event.type = CE_SET_SKY;
+ event.set_sky.bgcolor = bgcolor;
+ event.set_sky.type = type;
+ event.set_sky.params = params;
+ m_client_event_queue.push_back(event);
+ }
+ else if(command == TOCLIENT_OVERRIDE_DAY_NIGHT_RATIO)
+ {
+ std::string datastring((char *)&data[2], datasize - 2);
+ std::istringstream is(datastring, std::ios_base::binary);
+
+ bool do_override = readU8(is);
+ float day_night_ratio_f = (float)readU16(is) / 65536;
+
+ ClientEvent event;
+ event.type = CE_OVERRIDE_DAY_NIGHT_RATIO;
+ event.override_day_night_ratio.do_override = do_override;
+ event.override_day_night_ratio.ratio_f = day_night_ratio_f;
+ m_client_event_queue.push_back(event);
+ }
+ else if(command == TOCLIENT_LOCAL_PLAYER_ANIMATIONS)
+ {
+ std::string datastring((char *)&data[2], datasize - 2);
+ std::istringstream is(datastring, std::ios_base::binary);
+
+ LocalPlayer *player = m_env.getLocalPlayer();
+ assert(player != NULL);
+
+ player->local_animations[0] = readV2S32(is);
+ player->local_animations[1] = readV2S32(is);
+ player->local_animations[2] = readV2S32(is);
+ player->local_animations[3] = readV2S32(is);
+ player->local_animation_speed = readF1000(is);
+ }
+ else if(command == TOCLIENT_EYE_OFFSET)
+ {
+ std::string datastring((char *)&data[2], datasize - 2);
+ std::istringstream is(datastring, std::ios_base::binary);
+
+ LocalPlayer *player = m_env.getLocalPlayer();
+ assert(player != NULL);
+
+ player->eye_offset_first = readV3F1000(is);
+ player->eye_offset_third = readV3F1000(is);
+ }