Legacy:LadderProfiles - Unreal Wiki

# Legacy:LadderProfiles

### From Unreal Wiki, The Unreal Engine Documentation Site

UT2003 :: Object >> Actor >> Info >> LadderProfiles ( Ladder1.46 )

1. //-----------------------------------------------------------
2. // Ladder.LadderProfiles
3. //
4. // Serveractor responsible for placing LadderGameRules into the
5. // GameRulesModifier linked list
6. //
7. // Also serves to clearly give admins indication of what version
8. // of Ladder is installed on the server
9. //-----------------------------------------------------------
10. class LadderProfiles extends Info config;
12. var const float VER;
13. const LOGNAME = 'LadderProfiles';
15. var localized string LPPropsDisplayText;
16. var localized string DisabledText;
18. var string LogLine[6];
19. var int LogWidth;
21. var bool bEnableProfileControl;
22. var config string DefaultProfileName;
23. var config string LadderProfileClass;
25. function PreBeginPlay()
26. {
27. local GameRules GR;
28. local MutLadderMenu LadderMenu;
29. local string StatusText;
30. local class<AutoLoader> LoaderClass;
31. local int i;
33. LoaderClass = class<AutoLoader>(DynamicLoadObject("LadderLoader.LadderLoader",class'Class',True));
34. if (LoaderClass != None && !LoaderClass.static.MatchesVersion(VER,True,"http://www.organized-evolution.com/Ladder/"))
35. {
36. Destroy();
37. return;
38. }
40. bEnableProfileControl = default.bEnableProfileControl;
42. class'LadderGameRules'.default.DefaultProfileName = DefaultProfileName;
43. if (!bEnableProfileControl)
44. {
45. for (i = 0; i < class'LadderGameRules'.default.Profiles.Length; i++)
46. if (class'LadderGameRules'.default.Profiles[i].bActive)
47. class'LadderGameRules'.default.Profiles[i].bActive = False;
49. class'LadderGameRules'.static.StaticSaveConfig();
50. StatusText = DisabledText;
51. }
53. else
54. {
55. for (GR=Level.Game.GameRulesModifiers;GR!=None;GR=GR.NextGameRules)
56. {
57. if (LadderGameRules(GR) != None)
58. {
59. LadderGameRules(GR).SetOwner(Self);
60. LadderGameRules(GR).LadderProfileClass = LadderProfileClass;
61. LadderGameRules(GR).DefaultProfileName = DefaultProfileName;
62. break;
63. }
64. }
66. if (GR == None)
67. {
68. GR = Spawn(class'LadderGameRules',Self);
69. if (Level.Game.GameRulesModifiers != None)
70. Level.Game.GameRulesModifiers.AddGameRules(GR);
71. else Level.Game.GameRulesModifiers = GR;
72. }
74. LadderMenu = Spawn(class'Ladder.MutLadderMenu', Self);
75. if (LadderMenu != None)
76. Level.Game.BaseMutator.AddMutator(LadderMenu);
77. else log("Error spawning MutLadderMenu!",LOGNAME);
78. }
80. LogLine[1] = "Ladder v"$VER@StatusText;
81. LogLine[2] = "Server Profile Management System";
82. LogLine[3] = "by Organized Evolution";
83. LogLine[4] = "http://www.organized-evolution.com/Ladder/";
85. BannerLog();
86. }
88. function BannerLog()
89. {
90. local int i;
91. local string TestString, BorderString;
92. local string Prefix, Suffix;
94. for (i = 0; i < ArrayCount(LogLine); i++)
95. if ( Len(LogLine[i]) > LogWidth )
96. LogWidth = Len(LogLine[i]);
98. LogWidth = LogWidth + 6; // Account for the [] on each side
99. for (BorderString = ""; Len(BorderString) < LogWidth; BorderString = BorderString $ "~");
100. log("",LOGNAME);
101. log(BorderString,LOGNAME);
103. for (i = 0; i < ArrayCount(LogLine); i++)
104. {
105. Prefix = "[] "; Suffix = " []";
106. TestString = Prefix $ LogLine[i] $ Suffix;
108. while ( Len(TestString) < LogWidth)
109. {
110. Prefix = Prefix $ " ";
111. if (LogWidth - Len(TestString) > 1)
112. Suffix = " " $ Suffix;
114. TestString = Prefix $ LogLine[i] $ Suffix;
115. }
117. log(TestString,LOGNAME);
118. }
120. log(BorderString,LOGNAME);
121. log("",LOGNAME);
122. }
124. static function FillPlayInfo(PlayInfo PI)
125. {
126. Super.FillPlayInfo(PI);
128. PI.AddSetting("Server", "DefaultProfileName", default.LPPropsDisplayText, 1, 10, "Text", "32");
129. }
132. defaultproperties
133. {
134. VER=1.5
135. LadderProfileClass="Ladder.ProfileConfigSet"
136. DisabledText="( Disabled )"
137. LPPropsDisplayText="Default Profile Name"
138. }

##### Views

- Legacy
- Discussion
- Current revision

##### Search