*CAN IGNORE MOST OF THIS/SKIP TO 2ND POST*
Category: Code.
Reproducibility: Always.
Online/Offline: Online for sure, offline unknown.
Summary: If a server is using a custom game mode (GameInfo mod), players will be kicked/dropped from the server when a map change occurs. They have to manually reconnect to the server to rejoin.
Description: I believe I also found the code that causes this bug. In the KFGame\Classes\KFGameInfo.uc class, in the SetGameType function:
I believe this piece of code causes it:
As you can see it reads the custom game class, but then uses the default class instead of the class on the commandline (unless I'm crazy lol). I'm guessing this mismatch between the client and server causes them to get dropped and have to reconnect. This could be tested and fixed through custom game mode overrides of this function (I think?). I'm working on a large mod and in a few days I plan on testing the recent changes I've made to it. I'll try changing that code too and seeing if it gets fixed when I test my mod in a few days, and reply back. Hopefully a dev could let us know if that is the problem, and fix it in the game .
Also, this is the bug mentioned [here] too. Although this is the actual bug (I believe) for that problem. They mentioned a fix but it appears to just work around the actual problem.
Category: Code.
Reproducibility: Always.
Online/Offline: Online for sure, offline unknown.
Summary: If a server is using a custom game mode (GameInfo mod), players will be kicked/dropped from the server when a map change occurs. They have to manually reconnect to the server to rejoin.
Description: I believe I also found the code that causes this bug. In the KFGame\Classes\KFGameInfo.uc class, in the SetGameType function:
Code:
/**
* Allows overriding of which gameinfo class to use.
* Called on the DefaultGameType from the ini, or the one specified on the command line (?game=xxx)
*/
static event class<GameInfo> SetGameType(string MapName, string Options, string Portal)
{
local string ThisMapPrefix;
local int i;
local class<GameInfo> NewGameType;
local string GameOption;
// if we're in the menu level, use the menu gametype
if ( class'WorldInfo'.static.IsMenuLevel(MapName) )
{
return class'KFGameInfo_Entry';
}
// allow commandline to override game type setting
GameOption = ParseOption( Options, "Game");
if ( GameOption != "" )
{
return Default.class;
}
// strip the UEDPIE_ from the filename, if it exists (meaning this is a Play in Editor game)
MapName = StripPlayOnPrefix( MapName );
ThisMapPrefix = left(MapName, InStr(MapName,"-"));
// change game type
for ( i=0; i < Default.DefaultMapPrefixes.Length; i++ )
{
if ( Default.DefaultMapPrefixes[i].Prefix ~= ThisMapPrefix )
{
NewGameType = class<GameInfo>(DynamicLoadObject(Default.DefaultMapPrefixes[i].GameType,class'Class'));
if ( NewGameType != None )
{
return NewGameType;
}
}
}
for ( i = 0; i < Default.CustomMapPrefixes.Length; i++ )
{
if ( Default.CustomMapPrefixes[i].Prefix ~= ThisMapPrefix )
{
NewGameType = class<GameInfo>(DynamicLoadObject(Default.CustomMapPrefixes[i].GameType,class'Class'));
if ( NewGameType != None )
{
return NewGameType;
}
}
}
return Default.class;
}
I believe this piece of code causes it:
Code:
// allow commandline to override game type setting
GameOption = ParseOption( Options, "Game");
if ( GameOption != "" )
{
return Default.class;
}
As you can see it reads the custom game class, but then uses the default class instead of the class on the commandline (unless I'm crazy lol). I'm guessing this mismatch between the client and server causes them to get dropped and have to reconnect. This could be tested and fixed through custom game mode overrides of this function (I think?). I'm working on a large mod and in a few days I plan on testing the recent changes I've made to it. I'll try changing that code too and seeing if it gets fixed when I test my mod in a few days, and reply back. Hopefully a dev could let us know if that is the problem, and fix it in the game .
Also, this is the bug mentioned [here] too. Although this is the actual bug (I believe) for that problem. They mentioned a fix but it appears to just work around the actual problem.
Last edited: