Example #1
0
        public static RPType GetRPRR()
        {
            var server = ServerTest.GetServer();
            var zone   = ZoneTest.GetZone();

            var record = zone.GetRecords().FirstOrDefault(i => i.OwnerName == "rp." + zone.Name);

            if (record == null)
            {
                record = RPType.CreateInstanceFromPropertyData(server, server.Name, zone.Name, "rp." + zone.Name, DNSManagement.RR.ResourceRecord.RecordClassEnum.IN, null, "rpmb", "domain1");
            }
            return((RPType)record.UnderlyingRecord);
        }
Example #2
0
 static RenderPipelineInfo()
 {
     if (GraphicsSettings.renderPipelineAsset == null)
     {
         Type = RPType.Standard;
         ForceUseRenderTextures = false;
         DefaultShaderName      = "Standard";
         ColorPropertyID        = Shader.PropertyToID("_Color");
         MainTexturePropertyID  = Shader.PropertyToID("_MainTex");
     }
     else
     {
         Type pipelineType = GraphicsSettings.renderPipelineAsset.GetType();
         if (pipelineType.Name == "UniversalRenderPipelineAsset")
         {
             Type = RPType.URP;
             ForceUseRenderTextures   = false;
             m_msaaProperty           = pipelineType.GetProperty("msaaSampleCount");
             DefaultShaderName        = "Universal Render Pipeline/Lit";
             DefaultTerrainShaderName = "Universal Render Pipeline/Terrain/Lit";
             ColorPropertyID          = Shader.PropertyToID("_BaseColor");
             MainTexturePropertyID    = Shader.PropertyToID("_BaseMap");
         }
         else if (pipelineType.Name == "HDRenderPipelineAsset")
         {
             Type = RPType.HDRP;
             ForceUseRenderTextures   = false;
             m_msaaProperty           = pipelineType.GetProperty("msaaSampleCount");
             DefaultShaderName        = "HDRP/Lit";
             DefaultTerrainShaderName = "HDRP/TerrainLit";
             ColorPropertyID          = Shader.PropertyToID("_BaseColor");
             MainTexturePropertyID    = Shader.PropertyToID("_BaseColorMap");
         }
         else
         {
             Debug.Log(GraphicsSettings.renderPipelineAsset.GetType());
             Type                  = RPType.Unknown;
             ColorPropertyID       = Shader.PropertyToID("_Color");
             MainTexturePropertyID = Shader.PropertyToID("_MainTex");
         }
     }
 }
Example #3
0
 static RenderPipelineInfo()
 {
     if (GraphicsSettings.renderPipelineAsset == null)
     {
         Type = RPType.Legacy;
         DefaultShaderName = "Standard";
     }
     else if (GraphicsSettings.renderPipelineAsset.GetType().Name == "LightweightPipelineAsset")
     {
         Type = RPType.LWRP;
         DefaultShaderName = "Lightweight Render Pipeline/Lit";
     }
     else if (GraphicsSettings.renderPipelineAsset.GetType().Name == "HDRenderPipelineAsset")
     {
         Type = RPType.HDRP;
         DefaultShaderName = "HD Render Pipeline/Lit";
     }
     else
     {
         Type = RPType.Unknown;
     }
 }
 static RenderPipelineInfo()
 {
     if (GraphicsSettings.renderPipelineAsset == null)
     {
         Type = RPType.Legacy;
         DefaultShaderName = "Standard";
         MSAASampleCount   = QualitySettings.antiAliasing;
     }
     else
     {
         Type pipelineType = GraphicsSettings.renderPipelineAsset.GetType();
         if (pipelineType.Name == "LightweightRenderPipelineAsset")
         {
             Type              = RPType.LWRP;
             MSAASampleCount   = GetMSAASampleCount(pipelineType);
             DefaultShaderName = "Lightweight Render Pipeline/Lit";
         }
         else if (pipelineType.Name == "UniversalRenderPipelineAsset")
         {
             Type              = RPType.URP;
             MSAASampleCount   = GetMSAASampleCount(pipelineType);
             DefaultShaderName = "Universal Render Pipeline/Lit";
         }
         else if (pipelineType.Name == "HDRenderRenderPipelineAsset")
         {
             Type              = RPType.HDRP;
             MSAASampleCount   = GetMSAASampleCount(pipelineType);
             DefaultShaderName = "HD Render Pipeline/Lit";
         }
         else
         {
             Debug.Log(GraphicsSettings.renderPipelineAsset.GetType());
             Type            = RPType.Unknown;
             MSAASampleCount = 0;
         }
     }
 }
Example #5
0
        void SetControlValues()
        {
            PatientDisplayNameLabel.Text = PatientDisplayName;

            if (AppointmentDate.HasValue)
            {
                AppointmentDateLabel.Text = AppointmentDate.Value.ToLongDateString();
            }

            PatientMRNLabel.Text = PatientMRN;

            string fs = string.Format("{0} year{1}old, {2} month{3}since surgery",
                                      PatientAge,
                                      HandlePlural(PatientAge),
                                      MonthsSinceSurgery,
                                      HandlePlural(MonthsSinceSurgery));

            PatientAgeLabel.Text = fs;

            if (!string.IsNullOrEmpty(RPType))
            {
                RPTypeDateLabel.Text = RPType.ToString();
            }


            if (RPDate.HasValue)
            {
                RPTypeDateLabel.Text += (" on " + RPDate.Value.ToShortDateString());
            }


            if (!string.IsNullOrEmpty(CurrentPSA))
            {
                CurrentPSALabel.Text = CurrentPSA;
            }

            GleasonScoreLabel.Text      = string.Format("Gleason {0} + {1}", PathPrimaryGleason, PathSecondaryGleason);
            PathologicalStageLabel.Text = PathStage;

            if (!string.IsNullOrEmpty(PreSurgeryPSA))
            {
                PreSurgeryPSALabel.Text = PreSurgeryPSA;
            }

            if (LastSurveyDate.HasValue)
            {
                int    surveyWeeksAgo = (int)Math.Round((DateTime.Now - LastSurveyDate.Value).Days / 7.0, 0);
                string s;

                if (surveyWeeksAgo == 0)
                {
                    s = "Less than one week ago";
                }
                else
                {
                    s = string.Format("{0} week{1}ago", surveyWeeksAgo, HandlePlural(surveyWeeksAgo));
                }

                string longDate = LastSurveyDate.Value.ToLongDateString();

                LastSurveyDateLabel.Text = "Most Recent Survey: " + longDate + ". " + s;
            }
        }
Example #6
0
        /// <summary>
        /// Uploads rich presence for a variety of situations.
        /// <param name="inp">Type of RP event to upload.</param>
        /// </summary>
        public void UploadRichPresence(RPType inp = RPType.Auto)
        {
            if (inp == RPType.Auto)
            {
                if (!Ready) inp = RPType.None;
                else if (Lobby != null && Lobby.state == CSODOTALobby.State.RUN) inp = RPType.Play;
                else inp = RPType.Init;
            }

            // Update rich presence
            var kv = new KeyValue("RP");
            switch (inp)
            {
                case RPType.None:
                    break;
                // todo: implement playing rich presence
                case RPType.Play:
                case RPType.Queue:
                case RPType.Init:
                    kv.Children.Add(new KeyValue("status", "#DOTA_RP_INIT"));
                    kv.Children.Add(new KeyValue("num_params", "0"));
                    kv.Children.Add(new KeyValue("engine", ((uint) Engine).ToString()));
                    if (Lobby != null)
                        kv.Children.Add(new KeyValue("lobby",
                            "lobby_id: " + Lobby.lobby_id + " lobby_state: " + Lobby.state.ToString("G") + " password: "******"false" : "true") + " game_mode: " +
                            ((DOTA_GameMode) Lobby.game_mode).ToString("G") + " member_count: " + Lobby.members.Count +
                            " max_member_count: " + (Lobby.custom_max_players == 0 ? 10 : Lobby.custom_max_players) +
                            " name: \"" + Lobby.game_name + "\""));
                    break;
            }
            var rpup = new ClientMsgProtobuf<CMsgClientRichPresenceUpload>(EMsg.ClientRichPresenceUpload);
            using (var ms = new MemoryStream())
            {
                kv.SaveToStream(ms, true);
                rpup.Body.rich_presence_kv = ms.ToArray();
            }
            var friends = Client.GetHandler<SteamFriends>();
            for (var i = 0; i < friends.GetFriendCount(); i++)
            {
                var sid = friends.GetFriendByIndex(i);
                var relationship = friends.GetFriendRelationship(sid);
                if (relationship == EFriendRelationship.Friend &&
                    friends.GetFriendGamePlayed(sid) == (new GameID((uint) GameID)))
                    rpup.Body.steamid_broadcast.Add(sid.ConvertToUInt64());
            }
            Client.Send(rpup);
        }
Example #7
0
        /// <summary>
        /// Uploads rich presence for a variety of situations.
        /// <param name="inp">Type of RP event to upload.</param>
        /// </summary>
        public void UploadRichPresence(RPType inp = RPType.Auto)
        {
            if (inp == RPType.Auto)
            {
                if (!Ready)
                {
                    inp = RPType.None;
                }
                else if (Lobby != null && Lobby.state == CSODOTALobby.State.RUN)
                {
                    inp = RPType.Play;
                }
                else
                {
                    inp = RPType.Auto;
                }
            }

            // Update rich presence
            var kv = new KeyValue("RP");

            switch (inp)
            {
            case RPType.None:
                break;

            // todo: implement playing rich presence
            case RPType.Play:
            case RPType.Queue:
            case RPType.Init:
                kv.Children.Add(new KeyValue("status", "#DOTA_RP_INIT"));
                kv.Children.Add(new KeyValue("num_params", "0"));
                kv.Children.Add(new KeyValue("engine", ((uint)Engine).ToString()));
                if (Lobby != null)
                {
                    kv.Children.Add(new KeyValue("lobby",
                                                 "lobby_id: " + Lobby.lobby_id + " lobby_state: " + Lobby.state.ToString("G") + " password: "******"false" : "true") + " game_mode: " +
                                                 ((DOTA_GameMode)Lobby.game_mode).ToString("G") + " member_count: " + Lobby.members.Count +
                                                 " max_member_count: " + (Lobby.custom_max_players == 0 ? 10 : Lobby.custom_max_players) +
                                                 " name: \"" + Lobby.game_name + "\""));
                }
                break;
            }
            var rpup = new ClientMsgProtobuf <CMsgClientRichPresenceUpload>(EMsg.ClientRichPresenceUpload);

            using (var ms = new MemoryStream())
            {
                kv.SaveToStream(ms, true);
                rpup.Body.rich_presence_kv = ms.ToArray();
            }
            var friends = Client.GetHandler <SteamFriends>();

            for (var i = 0; i < friends.GetFriendCount(); i++)
            {
                var sid          = friends.GetFriendByIndex(i);
                var relationship = friends.GetFriendRelationship(sid);
                if (relationship == EFriendRelationship.Friend &&
                    friends.GetFriendGamePlayed(sid) == (new GameID((uint)GameID)))
                {
                    rpup.Body.steamid_broadcast.Add(sid.ConvertToUInt64());
                }
            }
            Client.Send(rpup);
        }