xTeamRoster Floods into console

Тема в разделе "Кодинг", создана пользователем boom159, 19 мар 2017.

  1. boom159

    boom159 Новенький

    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'
    xTeamRoster KF-GIGAToilet_v1-6.xTeamRoster (Function Engine.TeamInfo.AddToTeam:016D) Accessed None 'PlayerReplicationInfo'

    I'm getting these logs, when some new player connects to the server, when match has began. Maybe some of you have the same problem, and know how to fix it? I can understand russian, so you can reply in russian language.
    Thank you!
     
  2. Flame

    Flame -Заслуженый кодер форума-

    You use bots or team gametype?

    What is your chain of inherited classes?
    TeamInfo -> UnrealTeamInfo -> xTeamRoster -> KFTeamDRF
    TeamInfo -> UnrealTeamInfo -> xTeamRoster -> KFStoryRoster
    TeamInfo -> UnrealTeamInfo -> xTeamRoster -> UT2K4TeamRoster
    or other (RO,...)?

    Due to the chain you should take the last element in the chain, copy all AddToTeam functions from parents, combine them in one AddToTeam (or execute them one by one) and add a PlayerReplicationInfo==none check

    For example, you are using KFStoryRoster. In this chain AddToTeam is in KFStoryRoster, UnrealTeamInfo, TeamInfo classes

    So, we copy AddToTeam from UnrealTeamInfo and TeamInfo to KFStoryRoster, rename these functions, replace call of Super by these new named functions and add none check into AddToTeamFromTeamInfo function (changes marked by "Flame" label)

    code:
    Код:
    class KFStoryRoster extends xTeamRoster;
    
    function bool AddToTeam( Controller Other )
    {
        if(Other.PlayerReplicationinfo == none)
        {
            return false;
        }
        return AddToTeamFromUnrealTeamInfo(Other);
    }
    
    function bool AddToTeamFromUnrealTeamInfo( Controller Other )
    {
        local bool bResult;
    
        bResult = AddToTeamFromTeamInfo(Other);
    
        if ( bResult && (Other.PawnClass != None) && !BelongsOnTeam(Other.PawnClass) )
            Other.PawnClass = DefaultPlayerClass;
    
        return bResult;
    }
    
    function bool AddToTeamFromTeamInfo( Controller Other )
    {
        local Controller P;
        local bool bSuccess;
    
        // make sure loadout works for this team
        if ( Other == None )
        {
            log("Added none to team!!!");
            return false;
        }
    
        if (MessagingSpectator(Other) != None)
        {
            log("Messaging spectator so returning false",'VoiceChat');
            return false;
        }
    
        //Flame
        if(Other.PlayerReplicationInfo==none)
            return false;
        //
        Size++;
        Other.PlayerReplicationInfo.Team = self;
        Other.PlayerReplicationInfo.NetUpdateTime = Level.TimeSeconds - 1;
    
        bSuccess = false;
        if ( Other.IsA('PlayerController') )
            Other.PlayerReplicationInfo.TeamID = 0;
        else
            Other.PlayerReplicationInfo.TeamID = 1;
    
        while ( !bSuccess )
        {
            bSuccess = true;
            for(P=Level.ControllerList; P!=None; P=P.nextController)
            {
                if    (
                        P.bIsPlayer
                        &&    P != Other
                        &&    P.PlayerReplicationInfo!=none    //Flame
                        &&    P.PlayerReplicationInfo.Team == Other.PlayerReplicationInfo.Team
                        &&    P.PlayerReplicationInfo.TeamId == Other.PlayerReplicationInfo.TeamId
                    )
                {
                    bSuccess = false;
                }
            }
            if ( !bSuccess )
                Other.PlayerReplicationInfo.TeamID = Other.PlayerReplicationInfo.TeamID + 1;
        }
        if ( PlayerController(Other) != None && Level.Game.VoiceReplicationInfo != None )
        {
            Level.Game.VoiceReplicationInfo.NotifyTeamChange(Other.PlayerReplicationInfo, TeamIndex);
        }
    
        return true;
    }
    

    This should help
    Or you can just leave this warnings alone, they do no harm :)

    P.S. I added two none checks in this example, but the first is not necessary, because we have this check in KFStoryRoster.AddToTeam function
     
    Последнее редактирование: 21 мар 2017
  3. boom159

    boom159 Новенький

    Sorry for actually really late response. I'm using my own gametype, which extends to KFGameType. I just checked all of my gametype file, and there's nothing that uses the TeamInfo ,UnrealTeamInfo, xTeamRoster,KFTeamDRF,KFStoryRoster,UT2K4TeamRoster.
    I know that those warnings do not harm, but it gives a lag spike in the server when someone is trying to connect to the server :/
     
  4. Essence

    Essence Moderator Команда форума

    Add in defaultproperties in your GameType:
    DefaultEnemyRosterClass="MyPackage.KFStoryRoster"
    Where MyPackage - package, in which the class lies your GameType.
    Create a KFStoryRoster.uc file and place it where your GameType lies.
    In KFStoryRoster.uc insert the Flame code.
    Compile your package.
     
    3xzet нравится это.
  5. boom159

    boom159 Новенький

    Thank you guys! It works! Have a great day!