private string GetFailMessage(JobRequestError failReason) { switch (failReason) { case JobRequestError.InvalidUserID: return("Invalid User ID (server issue)."); case JobRequestError.InvalidPlayerID: return("Invalid Player ID."); case JobRequestError.RoundNotReady: return("New shift hasn't started yet."); case JobRequestError.JobBanned: return("You were previously fired from this position. [Job-banned]"); case JobRequestError.PositionsFilled: return("All positions for this profession have been filled."); case JobRequestError.InvalidScript: return("Invalid ViewerScript (server issue)."); default: return("Unspecified server error."); } }
public void ShowFailMessage(JobRequestError failReason) { waitForSpawnTimer = 0; ShowJobSelection(); errorReasonText.text = GetFailMessage(failReason); errorInfoWindow.SetActive(true); }
public static JobRequestFailedMessage SendTo(ConnectedPlayer recipient, JobRequestError failReason) { var msg = new JobRequestFailedMessage { FailReason = failReason, }; msg.SendTo(recipient); return(msg); }
public static NetMessage SendTo(ConnectedPlayer recipient, JobRequestError failReason) { var msg = new NetMessage { FailReason = failReason, }; SendTo(recipient, msg); return(msg); }
private void NotifyRequestRejected(JobRequestError error, string message) { Logger.Log($"Job request from {SentByPlayer} rejected: {message}.", Category.Jobs); JobRequestFailedMessage.SendTo(SentByPlayer, error); }
private void NotifyError(JobRequestError error, string message) { Logger.LogError($"Cannot process {SentByPlayer}'s {nameof(ClientRequestJobMessage)}: {message}.", Category.Jobs); JobRequestFailedMessage.SendTo(SentByPlayer, error); }
private void TargetNotifyJobRequestFailed(NetworkConnection target, JobRequestError failReason) { var jobWindow = UIManager.Display.jobSelectWindow.GetComponent <GUI_PlayerJobs>(); jobWindow.ShowFailMessage(failReason); }
private void NotifyJobRequestFailed(JobRequestError failReason) { TargetNotifyJobRequestFailed(connectionToClient, failReason); }