2017-10-20 02:00:49 +00:00
|
|
|
Class MS_PC extends KFPlayerController;
|
|
|
|
|
|
|
|
var MS_PendingData TravelData;
|
|
|
|
var byte ConnectionCounter;
|
|
|
|
var bool bConnectionFailed;
|
|
|
|
|
|
|
|
simulated event ReceivedPlayer();
|
|
|
|
simulated function ReceivedGameClass(class<GameInfo> GameClass);
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
simulated function HandleNetworkError(bool bConnectionLost)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
ConsoleCommand("Disconnect");
|
|
|
|
}
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
event PlayerTick(float DeltaTime)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (ConnectionCounter<3 && ++ConnectionCounter==3)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (TravelData.PendingURL!="")
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
2021-01-15 09:02:32 +00:00
|
|
|
MS_HUD(myHUD).ShowProgressMsg("Connecting to "$TravelData.PendingURL); // TODO: Localization
|
2017-10-20 02:00:49 +00:00
|
|
|
ConsoleCommand("Open "$TravelData.PendingURL);
|
|
|
|
}
|
2020-11-28 20:12:58 +00:00
|
|
|
if (TravelData.PendingSong!=None)
|
2017-10-20 02:00:49 +00:00
|
|
|
StartMusicTrack(TravelData.PendingSong);
|
|
|
|
|
|
|
|
// Reset all cached data.
|
|
|
|
TravelData.Reset();
|
|
|
|
}
|
|
|
|
PlayerInput.PlayerInput(DeltaTime);
|
|
|
|
MS_HUD(myHUD).ActiveGame.UpdateMouse(PlayerInput.aTurn,PlayerInput.aLookUp);
|
|
|
|
}
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
simulated final function StartMusicTrack(SoundCue Music)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
local AudioComponent A;
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (WorldInfo.MusicComp!=None)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
WorldInfo.MusicComp.FadeOut(WorldInfo.CurrentMusicTrack.FadeOutTime,WorldInfo.CurrentMusicTrack.FadeOutVolumeLevel);
|
|
|
|
WorldInfo.MusicComp = None;
|
|
|
|
}
|
|
|
|
Music.SoundClass = 'Music'; // Force music group for this.
|
|
|
|
A = WorldInfo.CreateAudioComponent(Music,false,false,false,,false);
|
2020-11-28 20:12:58 +00:00
|
|
|
if (A!=None)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
// update the new component with the correct settings
|
|
|
|
A.bAutoDestroy = true;
|
|
|
|
A.bShouldRemainActiveIfDropped = true;
|
|
|
|
A.bIsMusic = true;
|
|
|
|
A.bAutoPlay = true;
|
|
|
|
A.bIgnoreForFlushing = false;
|
2020-11-28 20:04:55 +00:00
|
|
|
A.FadeIn(0.25, 1.f);
|
2017-10-20 02:00:49 +00:00
|
|
|
}
|
|
|
|
WorldInfo.MusicComp = A;
|
|
|
|
WorldInfo.CurrentMusicTrack.TheSoundCue = Music;
|
|
|
|
WorldInfo.CurrentMusicTrack.FadeInTime = 1;
|
|
|
|
WorldInfo.CurrentMusicTrack.FadeOutTime = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
final function AbortConnection()
|
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bConnectionFailed)
|
2017-10-20 02:00:49 +00:00
|
|
|
HandleNetworkError(false);
|
|
|
|
else
|
|
|
|
{
|
2021-01-15 09:02:32 +00:00
|
|
|
ShowConnectionProgressPopup(PMT_ConnectionFailure,"Connection aborted","User aborted connection...",true); // TODO: Localization
|
2017-10-20 02:00:49 +00:00
|
|
|
ConsoleCommand("Cancel");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
reliable client event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type, optional float MsgLifeTime );
|
2017-10-20 02:00:49 +00:00
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
reliable client event bool ShowConnectionProgressPopup(EProgressMessageType ProgressType, string ProgressTitle, string ProgressDescription, bool SuppressPasswordRetry = false)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bConnectionFailed)
|
2017-10-20 02:00:49 +00:00
|
|
|
return false;
|
2020-11-28 20:12:58 +00:00
|
|
|
switch (ProgressType)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
|
|
|
case PMT_ConnectionFailure:
|
|
|
|
case PMT_PeerConnectionFailure:
|
|
|
|
bConnectionFailed = true;
|
2021-01-15 09:02:32 +00:00
|
|
|
MS_HUD(myHUD).ShowProgressMsg("Connection Error: "$ProgressTitle$"|"$ProgressDescription$"|Disconnecting...",true); // TODO: Localization
|
2017-10-20 02:00:49 +00:00
|
|
|
SetTimer(4,false,'HandleNetworkError');
|
|
|
|
return true;
|
|
|
|
case PMT_DownloadProgress:
|
|
|
|
case PMT_AdminMessage:
|
|
|
|
MS_HUD(myHUD).ShowProgressMsg(ProgressTitle$"|"$ProgressDescription);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
exec function CustomStartFire(optional byte FireModeNum)
|
2017-10-20 02:00:49 +00:00
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (!MS_HUD(myHUD).ActiveGame.bGameStarted)
|
2017-10-20 02:00:49 +00:00
|
|
|
MS_HUD(myHUD).ActiveGame.StartGame();
|
|
|
|
}
|
|
|
|
|
|
|
|
exec function SelectNextWeapon()
|
|
|
|
{
|
|
|
|
MS_HUD(myHUD).ActiveGame.AdjustSensitivity(true);
|
|
|
|
}
|
2020-11-28 21:54:57 +00:00
|
|
|
|
2017-10-20 02:00:49 +00:00
|
|
|
exec function SelectPrevWeapon()
|
|
|
|
{
|
|
|
|
MS_HUD(myHUD).ActiveGame.AdjustSensitivity(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto state PlayerWaiting
|
|
|
|
{
|
|
|
|
ignores SeePlayer, HearNoise, NotifyBump, TakeDamage, PhysicsVolumeChange, NextWeapon, PrevWeapon, SwitchToBestWeapon;
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
reliable server function ServerChangeTeam(int N);
|
2017-10-20 02:00:49 +00:00
|
|
|
|
|
|
|
reliable server function ServerRestartPlayer();
|
|
|
|
|
|
|
|
function PlayerMove(float DeltaTime)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
|
|
|
InputClass=class'MS_Input'
|
|
|
|
|
|
|
|
Begin Object Class=MS_PendingData Name=UserPendingData
|
|
|
|
End Object
|
|
|
|
TravelData=UserPendingData
|
|
|
|
}
|