// Apply item aliases in the node definition manager
m_nodedef->updateAliases(m_itemdef);
+ // Apply texture overrides from texturepack/override.txt
+ std::string texture_path = g_settings->get("texture_path");
+ if (texture_path != "" && fs::IsDir(texture_path))
+ m_nodedef->applyTextureOverrides(texture_path + DIR_DELIM + "override.txt");
+
m_nodedef->setNodeRegistrationStatus(true);
// Perform pending node name resolutions
static_cast<RemotePlayer*>(m_env->getPlayer(playername.c_str()));
// If failed, cancel
- if((playersao == NULL) || (player == NULL)) {
- if(player && player->peer_id != 0) {
- errorstream<<"Server: "<<playername<<": Failed to emerge player"
- <<" (player allocated to an another client)"<<std::endl;
+ if ((playersao == NULL) || (player == NULL)) {
+ if (player && player->peer_id != 0) {
+ actionstream << "Server: Failed to emerge player \"" << playername
+ << "\" (player allocated to an another client)" << std::endl;
DenyAccess_Legacy(peer_id, L"Another client is connected with this "
L"name. If your client closed unexpectedly, try again in "
L"a minute.");
} else {
- errorstream<<"Server: "<<playername<<": Failed to emerge player"
- <<std::endl;
+ errorstream << "Server: " << playername << ": Failed to emerge player"
+ << std::endl;
DenyAccess_Legacy(peer_id, L"Could not allocate player.");
}
return NULL;
if (hotbar_itemcount <= 0 || hotbar_itemcount > HUD_HOTBAR_ITEMCOUNT_MAX)
return false;
+ player->setHotbarItemcount(hotbar_itemcount);
std::ostringstream os(std::ios::binary);
writeS32(os, hotbar_itemcount);
SendHUDSetParam(player->peer_id, HUD_PARAM_HOTBAR_ITEMCOUNT, os.str());
return true;
}
+s32 Server::hudGetHotbarItemcount(Player *player) {
+ if (!player)
+ return 0;
+ return player->getHotbarItemcount();
+}
+
void Server::hudSetHotbarImage(Player *player, std::string name) {
if (!player)
return;
+ player->setHotbarImage(name);
SendHUDSetParam(player->peer_id, HUD_PARAM_HOTBAR_IMAGE, name);
}
+std::string Server::hudGetHotbarImage(Player *player) {
+ if (!player)
+ return "";
+ return player->getHotbarImage();
+}
+
void Server::hudSetHotbarSelectedImage(Player *player, std::string name) {
if (!player)
return;
+ player->setHotbarSelectedImage(name);
SendHUDSetParam(player->peer_id, HUD_PARAM_HOTBAR_SELECTED_IMAGE, name);
}
+std::string Server::hudGetHotbarSelectedImage(Player *player) {
+ if (!player)
+ return "";
+
+ return player->getHotbarSelectedImage();
+}
+
bool Server::setLocalPlayerAnimations(Player *player, v2s32 animation_frames[4], f32 frame_speed)
{
if (!player)
return false;
+ player->setLocalAnimations(animation_frames, frame_speed);
SendLocalPlayerAnimations(player->peer_id, animation_frames, frame_speed);
return true;
}
if (!player)
return false;
+ player->eye_offset_first = first;
+ player->eye_offset_third = third;
SendEyeOffset(player->peer_id, first, third);
return true;
}
if (!player)
return false;
+ player->setSky(bgcolor, type, params);
SendSetSky(player->peer_id, bgcolor, type, params);
return true;
}
if (!player)
return false;
+ player->overrideDayNightRatio(do_override, ratio);
SendOverrideDayNightRatio(player->peer_id, do_override, ratio);
return true;
}
}
}
}
-
-