Results 1 to 8 of 8

Thread: Problem with manymaps

  1. #1
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    29
    Thanked 14 Times in 13 Posts

    Problem with manymaps

    I got a problem with manymaps. The problem is that it deletes some iwd files even though they are not links. My server is setup on ubuntu 18.04.5 LTS. At the moment i run 2 cod2 servers and each one has its own fs_game folder. In each fs_game i have a Library folder with the custom maps i use. Inside fs_game i also have 2 iwd files needed at all times by the client. They are 000empty.iwd and zzzmod.iwd (client part of my mod). Each fs_game is represented by its own folder on my apache server. So far so good no problem it works ok. The problem begun when i tried to use symlinks so i don't have to keep multiple copies of the same files. So i created o folder on my apache server with all the required files(lets call it maps). I linked the maps folder to the Library folder on each fs_game folder and i also linked maps folder to fs_game on apache. So far not an issue. Each cod server sees the maps fine. If i put 000empty.iwd and zzzmod.iwd in the maps folder then the physical copies in the server fs_game folder get deleted when i start the cod2 servers. I tried to mess with permissions and ownerships without any luck. Any suggestions?

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,725
    Thanks
    17
    Thanked 1,080 Times in 682 Posts
    >If i put 000empty.iwd and zzzmod.iwd in the maps folder then the physical copies in the server fs_game folder get deleted when i start the cod2 servers

    Please specify this a bit. Are you putting your mod.iwd and empty.iwd in your Library folder? Why?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (5th February 2021)

  4. #3
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,014
    Thanks
    2,110
    Thanked 1,086 Times in 753 Posts
    Please always say which version you are using, since manymaps differs:

    https://github.com/kungfooman/libcod...bcod.cpp#L2082
    https://github.com/voron00/libcod/bl...bcod.cpp#L1171

    The original version (my repo) ignores .iwd's which contain either "zzz_" or "Empty", but I don't see this is a problem in your case anyway (since it seemed to work before and your symlinks are causing the issue).

    The code is not checking if it deletes a symlink or real file (simple access(file, F_OK) != -1; in both repos)

    So you could add a symlink check, if that's the problem
    timescale 0.01

  5. The Following User Says Thank You to kung foo man For This Useful Post:

    agribilos (5th February 2021)

  6. #4
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,725
    Thanks
    17
    Thanked 1,080 Times in 682 Posts
    tl;dr:

    https://github.com/voron00/libcod/bl...bcod.cpp#L1230

    Voron's libcod deletes anything that's inside your library folder. So, dont put your mod in your library folder (nor your empty.iwd file)
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  7. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    agribilos (5th February 2021),kung foo man (6th February 2021)

  8. #5
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    29
    Thanked 14 Times in 13 Posts
    Sorry for not specifying the version. I thought that they functioned the same way. I use voron's version. I actually put my 000empty.iwd and zzzmod.iwd in the maps folder. The maps folder is then linked to fs_game within apache. So when the client tries to download, the server redirects to fs_game in apache. If they don't exist there then fast download fails and goes back to slow (server) mode. But it only does this check once during my tests. So if a client connects for the first time and there is a custom map running then the map will be downloaded at slow speed and the client will probably go away. I tried to change ownership to root to prevent it from deleting and chmod 444 but it still deletes the files. Libcod is run from a normal non root account. I can't understand how it is possible to get permission to delete. I guess i will have to go with multiple copies for the moment until i find a solution.

  9. #6
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,725
    Thanks
    17
    Thanked 1,080 Times in 682 Posts
    Quote Originally Posted by agribilos View Post
    Sorry for not specifying the version. I thought that they functioned the same way. I use voron's version. I actually put my 000empty.iwd and zzzmod.iwd in the maps folder. The maps folder is then linked to fs_game within apache. So when the client tries to download, the server redirects to fs_game in apache. If they don't exist there then fast download fails and goes back to slow (server) mode. But it only does this check once during my tests. So if a client connects for the first time and there is a custom map running then the map will be downloaded at slow speed and the client will probably go away. I tried to change ownership to root to prevent it from deleting and chmod 444 but it still deletes the files. Libcod is run from a normal non root account. I can't understand how it is possible to get permission to delete. I guess i will have to go with multiple copies for the moment until i find a solution.
    I use something like this for my download url:


    PHP Code:
    <?php
    if(substr($_GET["file"], 0strlen('/JumpersHeaven')) === '/JumpersHeaven'
    {
        if(
    substr($_GET["file"], 0strlen('/JumpersHeaven/zzz_')) === '/JumpersHeaven/zzz_' || substr($_GET["file"], 0strlen('/JumpersHeaven/000')) === '/JumpersHeaven/000'//cod2 mod files
            
    $url $url '/mods/cod2' substr($_GET["file"], strlen('/JumpersHeaven'));
        else
            
    $url $url '/maps/cod2' substr($_GET["file"], strlen('/JumpersHeaven')); //cod2 map files
    }
    else if(
    substr($_GET["file"], 0strlen('/usermaps')) === '/usermaps'//cod4 map files
        
    $url $url '/maps/cod4' substr($_GET["file"], strlen('/usermaps'));
    else if(
    substr($_GET["file"], 0strlen('/mods/jh')) === '/mods/jh'//cod4 mod files
        
    $url $url '/mods/cod4' substr($_GET["file"], strlen('/mods/jh'));
    else
        
    $url $url $_GET["file"];
    header('Location: '$urltrue302);
    die();
    ?>
    as "index.php", with wwwbaseurl set to "mydomain.com/index.php?file="
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  10. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    agribilos (5th February 2021),kung foo man (6th February 2021)

  11. #7
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    29
    Thanked 14 Times in 13 Posts
    Thanks i will give it a try probably tomorrow. Seems like a good solution.

  12. The Following User Says Thank You to agribilos For This Useful Post:

    kung foo man (6th February 2021)

  13. #8
    Private
    Join Date
    Apr 2020
    Posts
    66
    Thanks
    29
    Thanked 14 Times in 13 Posts
    It finally works as intended! Thank you again!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •