Giter Site home page Giter Site logo

scr_mm_emptymap crashes server about codam_miscmod HOT 4 CLOSED

 avatar commented on August 27, 2024
scr_mm_emptymap crashes server

from codam_miscmod.

Comments (4)

 avatar commented on August 27, 2024

All seem fixed after replacing the func by this one:

_timerStuck()
{
    if (!isDefined(game["maprestarts"]))
    {
        game["maprestarts"] = 0;
    }

    for(;;)
    {
        wait 60;

        players = getEntArray("player", "classname");

        if (players.size == 0)
        {
            emptymap = codam\utils::getVar("scr_mm", "emptymap", "string", 0, "");

            if (emptymap != "")
            {
                if (emptymap == level.mmmapname)
                {
                    if (game["maprestarts"] > 7)
                    {
                        [[level.gtd_call]]("map_restart", false);
                    }
                    else
                    {
                        game["maprestarts"]++;
                        [[level.gtd_call]]("map_restart", true);
                    }
                }
                else
                {
                    setCvar("sv_mapRotationCurrent", "gametype " + level.mmgametype + " map " + emptymap);
                    wait 1;

                    level.mapended = true;
                    game["state"] = "intermission";
                    level notify("intermission");
                    [[level.gtd_call]]("exitLevel", false);
                }
            }
            else
            {
                if (game["maprestarts"] > 7)
                {
                    level notify("end_map");
                }
                else
                {
                    game["maprestarts"]++;
                    [[ level.gtd_call ]]("map_restart", true);
                }
            }
        }
        else
        {
            if (game["maprestarts"] != 0)
            {
                game["maprestarts"] = 0;
            }
        }
    }
}

from codam_miscmod.

cato-a avatar cato-a commented on August 27, 2024

Hi, when an issue is solved for you it doesn't mean it's solved for MiscMod. This issue I presume is only when you run server with developer 1, as bdz said he tested this and it was without issue, maybe he did not test it fully.

Can you test the following (similar to yours) code with developer 1 for inclusion into MiscMod?

_timerStuck() // tip by Jona
{
    if(!isDefined(game["maprestarts"]))
        game["maprestarts"] = 0;

    for(;;) {
        wait 60;

        players = getEntArray("player", "classname");
        if(players.size == 0) {
            emptymap = codam\utils::getVar("scr_mm", "emptymap", "string", 0, "");
            if(emptymap != "") {
                if(emptymap != level.mmmapname) {
                    setCvar("sv_mapRotationCurrent", "gametype " + level.mmgametype + " map " + emptymap);
                    wait 1;
                    level.mapended = true;
                    game["state"] = "intermission";
                    level notify("intermission");
                    [[ level.gtd_call ]]("exitLevel", false);
                } else
                    [[ level.gtd_call ]]("map_restart", false);
            } else {
                if(game["maprestarts"] > 7) {
                    level notify("end_map"); // idea is to just rotate the map
                    return;
                }

                game["maprestarts"]++;
                [[ level.gtd_call ]]("map_restart", true); // true playerinfo retained
            }
        } else {
            if(game["maprestarts"] != 0)
                game["maprestarts"] = 0;
        }
    }
}

from codam_miscmod.

 avatar commented on August 27, 2024

I would now let you close issues I opened even if I think I posted a fix

After replacing the code I posted by yours:

-started server with developer 1, joined game
-rotated to an other map, disconnected client

After about 1 minute, the server rotated to the scr_mm_emptymap

I did not notice any issue/error message
Thank you

from codam_miscmod.

cato-a avatar cato-a commented on August 27, 2024

Thanks for testing. Commit: 7231751.

If you want to submit code to MiscMod you need to follow the STYLE guide:

https://github.com/cato-a/CoDaM_MiscMod/blob/main/STYLE.md

from codam_miscmod.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.