Page MenuHomeFeedback Tracker

Pass server mission path parameter within Mission CreateMission(string path);
Assigned, UrgentPublic

Description

Currently when you join an MP session, the 5_Mission module contains someMission.c which is responsible on running the correct Mission class for client.
The parameter passed string path is invalid when joining a MP session, the path contains mpmissions\__cur_mp.terrainname\mission.c

I understand that the server no longer transfers the mission to clients, however could you resolve this path to at least contain the mission name from server? Mission name would be folder name within mpmissions on the server. Eg; mpmissions\hardcore.terrainname\mission.c

Passing correct data with path string as parameter would allow for custom modules that change the entry point to Mission module to a custom function which handles what mission class to run. This cannot be resolved via RPCs because client won't receive any during the connect process up-until a mission instance is created which is too late.

Example use case;

Mission CreateMissionType(string path)
{
    //Assuming path is: mpmissions\hardcore.chernarus\mission.c
    //"hardcore.chernarus" is exactly the mission name on the server.

    //Currently "string path" during MP will only contain the following:
    //mpmissions\__cur_mp.chernarusplus\mission.c
    //Note that the terrain / world name is correct according to server.

    Print("[CreateMissionType] Creating Mission: "+ path);
    g_Game.SetMissionPath(path);

    if (path.Contains("hardcore"))
    {
       return new HardCoreMission;
    }
    else if (path.Contains("easy"))
    {
       return new EasyModeMission;
    }
    return new DummyMission;
};

Details

Severity
Tweak
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
Latest
Category
General

Event Timeline

markkoky44 renamed this task from Fix mission path parameter within Mission CreateMission(string path); to Pass server mission path parameter within Mission CreateMission(string path);.Jul 4 2021, 1:38 PM
markkoky44 changed Severity from Block to Tweak.
Geez changed the task status from New to Assigned.Jul 8 2021, 10:49 AM