config for important persons
This commit is contained in:
parent
cb6a0e28c3
commit
9a0163491c
@ -1,4 +1,10 @@
|
|||||||
Class MskGsMut extends KFMutator;
|
Class MskGsMut extends KFMutator
|
||||||
|
config(MskGs);
|
||||||
|
|
||||||
|
var const int SteamIDLen;
|
||||||
|
var const int UniqueIDLen;
|
||||||
|
|
||||||
|
var config array<string> ImportantPersonList;
|
||||||
|
|
||||||
simulated event PostBeginPlay()
|
simulated event PostBeginPlay()
|
||||||
{
|
{
|
||||||
@ -17,6 +23,11 @@ simulated event PostBeginPlay()
|
|||||||
|
|
||||||
function Initialize()
|
function Initialize()
|
||||||
{
|
{
|
||||||
|
local MskGsVoteCollector VoteCollector;
|
||||||
|
local OnlineSubsystem steamworks;
|
||||||
|
local string Person;
|
||||||
|
local UniqueNetId PersonUID;
|
||||||
|
|
||||||
if (MyKFGI == None || MyKFGI.MyKFGRI == None)
|
if (MyKFGI == None || MyKFGI.MyKFGRI == None)
|
||||||
{
|
{
|
||||||
SetTimer(2.f, false, nameof(Initialize));
|
SetTimer(2.f, false, nameof(Initialize));
|
||||||
@ -26,6 +37,30 @@ function Initialize()
|
|||||||
MyKFGI.KFGFxManagerClass = class'MskGsGFxMoviePlayer_Manager';
|
MyKFGI.KFGFxManagerClass = class'MskGsGFxMoviePlayer_Manager';
|
||||||
MyKFGI.MyKFGRI.VoteCollectorClass = class'MskGsVoteCollector';
|
MyKFGI.MyKFGRI.VoteCollectorClass = class'MskGsVoteCollector';
|
||||||
MyKFGI.MyKFGRI.PostBeginPlay();
|
MyKFGI.MyKFGRI.PostBeginPlay();
|
||||||
|
|
||||||
|
steamworks = class'GameEngine'.static.GetOnlineSubsystem();
|
||||||
|
VoteCollector = MskGsVoteCollector(MyKFGI.MyKFGRI.VoteCollector);
|
||||||
|
|
||||||
|
if (VoteCollector == None)
|
||||||
|
{
|
||||||
|
`Log("[MskGsMut] ERROR: VoteCollector is None!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ImportantPersonList(Person)
|
||||||
|
{
|
||||||
|
if (Len(Person) == UniqueIDLen && steamworks.StringToUniqueNetId(Person, PersonUID))
|
||||||
|
{
|
||||||
|
if (VoteCollector.ImportantPersonList.Find('Uid', PersonUID.Uid) == -1)
|
||||||
|
VoteCollector.ImportantPersonList.AddItem(PersonUID);
|
||||||
|
}
|
||||||
|
else if (Len(Person) == SteamIDLen && steamworks.Int64ToUniqueNetId(Person, PersonUID))
|
||||||
|
{
|
||||||
|
if (VoteCollector.ImportantPersonList.Find('Uid', PersonUID.Uid) == -1)
|
||||||
|
VoteCollector.ImportantPersonList.AddItem(PersonUID);
|
||||||
|
}
|
||||||
|
else `Log("[MskGsMut] WARN: Can't add person:"@Person);
|
||||||
|
}
|
||||||
|
|
||||||
`Log("[MskGsMut] Mutator loaded.");
|
`Log("[MskGsMut] Mutator loaded.");
|
||||||
}
|
}
|
||||||
@ -43,4 +78,6 @@ function AddMutator(Mutator Mut)
|
|||||||
|
|
||||||
defaultproperties
|
defaultproperties
|
||||||
{
|
{
|
||||||
|
SteamIDLen=17
|
||||||
|
UniqueIDLen=18
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
class MskGsVoteCollector extends KFVoteCollector;
|
class MskGsVoteCollector extends KFVoteCollector;
|
||||||
|
|
||||||
var private const array<string> ImportantPersonList;
|
var public array<UniqueNetId> ImportantPersonList;
|
||||||
var private array<KFPlayerController> PunishList;
|
var private array<KFPlayerController> PunishList;
|
||||||
|
|
||||||
function ServerStartPunishment()
|
function ServerStartPunishment()
|
||||||
@ -36,15 +36,15 @@ function bool ImportantKickee(PlayerReplicationInfo PRI_Kickee, PlayerReplicatio
|
|||||||
{
|
{
|
||||||
local string PunishMessage;
|
local string PunishMessage;
|
||||||
local KFPlayerController KFPC_Kicker;
|
local KFPlayerController KFPC_Kicker;
|
||||||
|
|
||||||
if (ImportantPersonList.Find(class'OnlineSubsystem'.Static.UniqueNetIdToString(PRI_Kickee.UniqueId)) != -1)
|
if (ImportantPersonList.Find('Uid', PRI_Kickee.UniqueId.Uid) != -1)
|
||||||
{
|
{
|
||||||
KFPC_Kicker = KFPlayerController(PRI_Kicker.Owner);
|
KFPC_Kicker = KFPlayerController(PRI_Kicker.Owner);
|
||||||
if (PunishList.Find(KFPC_Kicker) == -1)
|
if (PunishList.Find(KFPC_Kicker) == -1)
|
||||||
{
|
{
|
||||||
PunishMessage = PRI_Kicker.PlayerName@"tried to kick"@PRI_Kickee.PlayerName@", but sat down on the bottle instead (^_^)";
|
PunishMessage = PRI_Kicker.PlayerName@"tried to kick"@PRI_Kickee.PlayerName@", but sat down on the bottle instead.";
|
||||||
WorldInfo.Game.Broadcast(KFPC_Kicker, PunishMessage);
|
WorldInfo.Game.Broadcast(KFPC_Kicker, PunishMessage);
|
||||||
|
|
||||||
PunishList.AddItem(KFPC_Kicker);
|
PunishList.AddItem(KFPC_Kicker);
|
||||||
SetTimer(2.0f, false, 'ServerStartPunishment', self);
|
SetTimer(2.0f, false, 'ServerStartPunishment', self);
|
||||||
}
|
}
|
||||||
@ -235,7 +235,4 @@ function int GetNextMap()
|
|||||||
|
|
||||||
DefaultProperties
|
DefaultProperties
|
||||||
{
|
{
|
||||||
ImportantPersonList.Add("0x0110000103143A23") // Spazm*
|
|
||||||
ImportantPersonList.Add("0x011000010276FBCB") // GenZmeY
|
|
||||||
ImportantPersonList.Add("0x011000010F661D88") // Janis
|
|
||||||
}
|
}
|
||||||
|
2
make.sh
2
make.sh
@ -159,7 +159,7 @@ echo "Map=\"KF-Outpost\"
|
|||||||
Game=\"KFGameContent.KFGameInfo_Survival\"
|
Game=\"KFGameContent.KFGameInfo_Survival\"
|
||||||
Difficulty=\"0\"
|
Difficulty=\"0\"
|
||||||
GameLength=\"0\"
|
GameLength=\"0\"
|
||||||
Mutators=\"TAWOD.TAWODMut\"
|
Mutators=\"MskGs.MskGsMut\"
|
||||||
Args=\"\"" > "$MutTestingIni"
|
Args=\"\"" > "$MutTestingIni"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user