I wrote a bit of code that will ban a player from playing your game. If you want to ban them for certain reason to you.
You can using the below code if you want to use it.
In the file GFxUTFrontEnd_MainMenu.uc in the function OnViewLoaded() add in this code.
//ban items to use for banning players
var private const array<string> BannedSteamIds;
var private const array<string> BanSteamIdsMessage;
var private int BanMessageInt;
function OnViewLoaded()
{
local bool IsSteamIdBan;
local OnlineSubsystemSteamworks OSS;
Super.OnViewLoaded();
OSS = OnlineSubsystemSteamworks(PC.OnlineSub);
//`log("GFxPBFrontEnd_MainMenu::AreYouSteamIdBan() OSS = "$OSS);
IsSteamIdBan = false;
//`log("GFxPBFrontEnd_MainMenu::AreYouSteamIdBan OSS.LoggedInStatus = "$OSS.LoggedInStatus);
if(OSS.LoggedInStatus == LS_LoggedIn)
{
IsSteamIdBan = AreYouSteamIdBan(OSS);//check to see if they are steam id ban
}
else if( (OSS.LoggedInStatus == LS_NotLoggedIn) || (OSS.LoggedInStatus == LS_UsingLocalProfile) )
{
PC.SetTimer(0.7, false, 'SteamLoadMsg', self); return;
}
if(IsSteamIdBan)
{
PC.SetTimer(0.7, false, 'SteamBanLoadMsg', self);
return;
}
//more code here to login, if you have login code or how ever you start the menu.
}
function SteamLoadMsg()
{
local GFxPBFrontEnd_InfoDialog SteamMsgDialogMC;
MenuManager.CurViewAlias="SteamworksLoadMsg";
SteamMsgDialogMC = GFxPBFrontEnd_InfoDialog(MenuManager.SpawnDialog('InfoDialog'));
SteamMsgDialogMC.SetTitle("Steams Not Running");
SteamMsgDialogMC.SetInfo("You are not logged into Steam, please login to Steam to play this game");
SteamMsgDialogMC.SetBackButtonLabel("CANCEL");
SteamMsgDialogMC.SetAcceptButtonLabel("OK");
SteamMsgDialogMC.SetAcceptButton_OnPress(SteamMsgDialog_SelectOK);
SteamMsgDialogMC.SetBackButton_OnPress(SteamMsgDialog_SelectBack);
}
function SteamMsgDialog_SelectOK( GFxClikWidget.EventData ev )
{
MenuManager.PopView();
PC.exitGameCalled();
}
function SteamMsgDialog_SelectBack( GFxClikWidget.EventData ev )
{
MenuManager.PopView();
PC.exitGameCalled();
}
function bool AreYouSteamIdBan(OnlineSubsystemSteamworks OSS)
{
local bool IsGameBan;
local string PlayersID;
IsGameBan = false;
PlayersID = OSS.UniqueNetIdToInt64(OSS.LoggedInPlayerId);
IsGameBan = CheckifBan(PlayersID);
//`log("GFxPBFrontEnd_MainMenu::AreYouSteamIdBan IsGameBan = "$ IsGameBan);
return IsGameBan;
}
function bool CheckifBan(string InPlayerId)
{
local int i;
local bool IsPlayerBan;
IsPlayerBan = false;
for(i=0; i<Default.BannedSteamIds.length; i++)
{
if(InPlayerId == Default.BannedSteamIds*)
{
//`log("GFxPBFrontEnd_MainMenu::CheckifBan() The Ban players Name is = "$OSS.LoggedInPlayerName);
//`log("GFxPBFrontEnd_MainMenu::CheckifBan() The Ban players SteamID is = "$InPlayerId);
BanMessageInt = i;
IsPlayerBan = true;
break;
}
}
return IsPlayerBan;
}
function SteamBanLoadMsg()
{
local GFxPBFrontEnd_InfoDialog SteamMsgDialogMC;
MenuManager.CurViewAlias="SteamworksBanMsg";
SteamMsgDialogMC = GFxPBFrontEnd_InfoDialog(MenuManager.SpawnDialog('InfoDialog'));
SteamMsgDialogMC.SetTitle("Ban from the Full-On Paintball Game");
SteamMsgDialogMC.SetInfo(Default.BanSteamIdsMessage[BanMessageInt]);
SteamMsgDialogMC.SetBackButtonLabel("CANCEL");
SteamMsgDialogMC.SetAcceptButtonLabel("OK");
SteamMsgDialogMC.SetAcceptButton_OnPress(SteamMsgDialog_SelectOK);
SteamMsgDialogMC.SetBackButton_OnPress(SteamMsgDialog_SelectBack);
}
function SteamMsgDialog_SelectOK( GFxClikWidget.EventData ev )
{
MenuManager.PopView();
PC.exitGameCalled();
}
function SteamMsgDialog_SelectBack( GFxClikWidget.EventData ev )
{
MenuManager.PopView();
PC.exitGameCalled();
}
defaultproperties()
{
//you can get steam ids from that players page on steam.
BannedSteamIds[0]="PlayersSteamId"//personaname > playersname ;never remove
BannedSteamIds[1]=""
BannedSteamIds[2]=""
BannedSteamIds[3]=""
BannedSteamIds[4]=""
BannedSteamIds[5]=""
BannedSteamIds[6]=""
//Message to display why they were ban or what ever you want to put in for why they were ban!
BanSteamIdsMessage[0]="Enjoy your permanent game ban!"
BanSteamIdsMessage[1]="Enjoy your permanent game ban!"
BanSteamIdsMessage[2]="Enjoy your permanent game ban!"
BanSteamIdsMessage[3]="Enjoy your permanent game ban!"
BanSteamIdsMessage[4]="Enjoy your permanent game ban!"
BanSteamIdsMessage[5]="Enjoy your permanent game ban!"
BanSteamIdsMessage[6]="Enjoy your permanent game ban!"
}