コード例 #1
0
        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.");
            }
        }
コード例 #2
0
        public void ShowFailMessage(JobRequestError failReason)
        {
            waitForSpawnTimer = 0;
            ShowJobSelection();

            errorReasonText.text = GetFailMessage(failReason);
            errorInfoWindow.SetActive(true);
        }
コード例 #3
0
        public static JobRequestFailedMessage SendTo(ConnectedPlayer recipient, JobRequestError failReason)
        {
            var msg = new JobRequestFailedMessage
            {
                FailReason = failReason,
            };

            msg.SendTo(recipient);
            return(msg);
        }
コード例 #4
0
        public static NetMessage SendTo(ConnectedPlayer recipient, JobRequestError failReason)
        {
            var msg = new NetMessage
            {
                FailReason = failReason,
            };

            SendTo(recipient, msg);
            return(msg);
        }
コード例 #5
0
 private void NotifyRequestRejected(JobRequestError error, string message)
 {
     Logger.Log($"Job request from {SentByPlayer} rejected: {message}.", Category.Jobs);
     JobRequestFailedMessage.SendTo(SentByPlayer, error);
 }
コード例 #6
0
 private void NotifyError(JobRequestError error, string message)
 {
     Logger.LogError($"Cannot process {SentByPlayer}'s {nameof(ClientRequestJobMessage)}: {message}.", Category.Jobs);
     JobRequestFailedMessage.SendTo(SentByPlayer, error);
 }
コード例 #7
0
    private void TargetNotifyJobRequestFailed(NetworkConnection target, JobRequestError failReason)
    {
        var jobWindow = UIManager.Display.jobSelectWindow.GetComponent <GUI_PlayerJobs>();

        jobWindow.ShowFailMessage(failReason);
    }
コード例 #8
0
 private void NotifyJobRequestFailed(JobRequestError failReason)
 {
     TargetNotifyJobRequestFailed(connectionToClient, failReason);
 }