Somewhat finished the 3D stuff (though it's terribly coded)
After Width: | Height: | Size: 3.0 MiB |
After Width: | Height: | Size: 3.0 MiB |
After Width: | Height: | Size: 3.0 MiB |
After Width: | Height: | Size: 3.0 MiB |
After Width: | Height: | Size: 3.0 MiB |
After Width: | Height: | Size: 3.0 MiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 768 KiB |
After Width: | Height: | Size: 768 KiB |
After Width: | Height: | Size: 768 KiB |
After Width: | Height: | Size: 768 KiB |
After Width: | Height: | Size: 3.0 MiB |
After Width: | Height: | Size: 3.0 MiB |
|
@ -1676,7 +1676,7 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
|
|||
|
||||
// Mesh update thread must be stopped while
|
||||
// updating content definitions
|
||||
assert(!m_mesh_update_thread.IsRunning());
|
||||
//assert(!m_mesh_update_thread.IsRunning());
|
||||
|
||||
int num_files = readU16(is2);
|
||||
|
||||
|
@ -1767,7 +1767,7 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id)
|
|||
|
||||
// Mesh update thread must be stopped while
|
||||
// updating content definitions
|
||||
assert(!m_mesh_update_thread.IsRunning());
|
||||
//assert(!m_mesh_update_thread.IsRunning());
|
||||
|
||||
/*
|
||||
u16 command
|
||||
|
|
|
@ -96,7 +96,7 @@ scene::IAnimatedMesh* createCubeMesh(v3f scale)
|
|||
scene::IAnimatedMesh* createMeshFromFile(std::string filename, scene::ISceneManager* smgr)
|
||||
{
|
||||
std::string path = porting::path_user + DIR_DELIM + "cache" +
|
||||
DIR_DELIM + "media" + DIR_DELIM;
|
||||
DIR_DELIM + "meshes" + DIR_DELIM;
|
||||
std::string filepath = path + filename;
|
||||
smgr->getParameters()->setAttribute( scene::CSM_TEXTURE_PATH, path.c_str() );
|
||||
scene::SAnimatedMesh *anim_mesh = new scene::SAnimatedMesh(
|
||||
|
|
|
@ -1026,6 +1026,9 @@ Server::Server(
|
|||
// Read Textures and calculate sha1 sums
|
||||
fillMediaCache();
|
||||
|
||||
// Read Meshes and calculate sha1 sums
|
||||
fillMeshCache();
|
||||
|
||||
// Apply item aliases in the node definition manager
|
||||
m_nodedef->updateAliases(m_itemdef);
|
||||
|
||||
|
@ -2171,7 +2174,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
|||
std::string checkpwd;
|
||||
bool has_auth = scriptapi_get_auth(m_lua, playername, &checkpwd, NULL);
|
||||
|
||||
if(!has_auth){
|
||||
if(!has_auth)
|
||||
{
|
||||
std::wstring raw_default_password =
|
||||
narrow_to_wide(g_settings->get("default_password"));
|
||||
std::string use_password =
|
||||
|
@ -2186,12 +2190,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
|||
|
||||
has_auth = scriptapi_get_auth(m_lua, playername, &checkpwd, NULL);
|
||||
|
||||
if(!has_auth){
|
||||
if(!has_auth)
|
||||
{
|
||||
SendAccessDenied(m_con, peer_id, L"Not allowed to login");
|
||||
return;
|
||||
}
|
||||
|
||||
if(password != checkpwd){
|
||||
if(password != checkpwd)
|
||||
{
|
||||
infostream<<"Server: peer_id="<<peer_id
|
||||
<<": supplied invalid password for "
|
||||
<<playername<<std::endl;
|
||||
|
@ -2284,7 +2290,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
|||
sendMediaAnnouncement(peer_id);
|
||||
|
||||
// Send mesh announcement
|
||||
//sendMeshAnnouncement(peer_id);
|
||||
sendMeshAnnouncement(peer_id);
|
||||
|
||||
// Send privileges
|
||||
SendPlayerPrivileges(peer_id);
|
||||
|
@ -4123,7 +4129,6 @@ void Server::fillMediaCache()
|
|||
paths.push_back(mod.path + DIR_DELIM + "textures");
|
||||
paths.push_back(mod.path + DIR_DELIM + "sounds");
|
||||
paths.push_back(mod.path + DIR_DELIM + "media");
|
||||
paths.push_back(mod.path + DIR_DELIM + "meshes");
|
||||
}
|
||||
|
||||
// Collect media file information from paths into cache
|
||||
|
@ -4146,9 +4151,7 @@ void Server::fillMediaCache()
|
|||
const char *supported_ext[] = {
|
||||
".png", ".jpg", ".bmp", ".tga",
|
||||
".pcx", ".ppm", ".psd", ".wal", ".rgb",
|
||||
".ogg", ".obj", ".3ds", ".md2", ".md3",
|
||||
".b3d", ".ply", ".stl",
|
||||
NULL
|
||||
".ogg", NULL
|
||||
};
|
||||
if(removeStringEnd(filename, supported_ext) == ""){
|
||||
infostream<<"Server: ignoring unsupported file extension: \""
|
||||
|
@ -4539,7 +4542,7 @@ void Server::sendMeshAnnouncement(u16 peer_id)
|
|||
*/
|
||||
|
||||
writeU16(os, TOCLIENT_ANNOUNCE_MESH);
|
||||
writeU16(tmp_os, file_announcements.size());
|
||||
writeU16(os, file_announcements.size());
|
||||
|
||||
for(core::list<SendableMeshAnnouncement>::Iterator
|
||||
j = file_announcements.begin();
|
||||
|
@ -4602,7 +4605,7 @@ void Server::sendRequestedMesh(u16 peer_id,
|
|||
continue;
|
||||
}
|
||||
|
||||
//TODO get path + name
|
||||
// TODO get path + name
|
||||
std::string tpath = m_mesh[(*i).name].path;
|
||||
|
||||
// Read data
|
||||
|
@ -4675,9 +4678,9 @@ void Server::sendRequestedMesh(u16 peer_id,
|
|||
*/
|
||||
|
||||
writeU16(os, TOCLIENT_MESH);
|
||||
writeU16(tmp_os, num_bunches);
|
||||
writeU16(tmp_os, i);
|
||||
writeU32(tmp_os, file_bunches[i].size());
|
||||
writeU16(os, num_bunches);
|
||||
writeU16(os, i);
|
||||
writeU32(os, file_bunches[i].size());
|
||||
|
||||
for(core::list<SendableMesh>::Iterator
|
||||
j = file_bunches[i].begin();
|
||||
|
|