Quellcode durchsuchen

- fixes #1044
- fixes to linux video player

Ivan Savenko vor 13 Jahren
Ursprung
Commit
94cfc99d7b

+ 4 - 1
client/CConfigHandler.cpp

@@ -72,7 +72,10 @@ void SettingsStorage::invalidateNode(const std::vector<std::string> &changedPath
 
 	savedConf.Struct().erase("session");
 	savedConf.minimize(schema);
-	std::ofstream file((GVCMIDirs.UserPath + "/config/settings.json").c_str(), std::ofstream::trunc | std::ofstream::out);
+
+	CResourceHandler::get()->createResource("CONFIG/settings.json");
+
+	std::ofstream file(CResourceHandler::get()->getResourceName(ResourceID("config/settings.json")), std::ofstream::trunc);
 	file << savedConf;
 }
 

+ 3 - 3
client/CVideoHandler.cpp

@@ -622,11 +622,11 @@ static si64 lod_seek(URLContext *context, si64 pos, int whence)
 {
 	CVideoPlayer *video = (CVideoPlayer *)context->priv_data;
 
-	// Not sure what the parameter whence is. Assuming it always
-	// indicates an absolute value;
+	if (whence & AVSEEK_SIZE)
+		return video->length;
+
 	video->offset = pos;
 	vstd::amin(video->offset, video->length);
-
 	return -1;//video->offset;
 }
 

+ 2 - 1
config/filesystem.json

@@ -42,7 +42,8 @@
 		],
 		"CONFIG/":
 		[
-			{"type" : "dir",  "path" : "ALL/Config", "writeable": true}
+			{"type" : "dir",  "path" : "GLOBAL/Config",} // separate to avoid overwriting global resources
+			{"type" : "dir",  "path" : "LOCAL/Config", "writeable": true}
 		],
 		"MAPS/":
 		[

+ 0 - 4
lib/Filesystem/CFilesystemLoader.cpp

@@ -45,10 +45,6 @@ bool CFilesystemLoader::createEntry(std::string filename)
 	if (fileList.find(res) != fileList.end())
 		return false;
 
-	std::ofstream file(baseDirectory + '/' + filename);
-	if (!file.good())
-		return false;
-
 	fileList[res] = filename;
 	return true;
 }