當前位置: 首頁>>代碼示例>>C#>>正文


C# RegionSettings.SpawnPoints方法代碼示例

本文整理匯總了C#中OpenSim.Framework.RegionSettings.SpawnPoints方法的典型用法代碼示例。如果您正苦於以下問題:C# RegionSettings.SpawnPoints方法的具體用法?C# RegionSettings.SpawnPoints怎麽用?C# RegionSettings.SpawnPoints使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Framework.RegionSettings的用法示例。


在下文中一共展示了RegionSettings.SpawnPoints方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SaveSpawnPoints

 private void SaveSpawnPoints(RegionSettings rs)
 {
     string sql = @"DELETE FROM spawn_points WHERE ""RegionUUID"" = :RegionUUID";
     using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
     using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
     {
         cmd.Parameters.Add(_Database.CreateParameter("RegionUUID", rs.RegionUUID));
         conn.Open();
         cmd.ExecuteNonQuery();
     }
     foreach (SpawnPoint p in rs.SpawnPoints())
     {
         sql = @"INSERT INTO spawn_points (""RegionUUID"", ""Yaw"", ""Pitch"", ""Distance"") VALUES (:RegionUUID, :Yaw, :Pitch, :Distance)";
         using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
         using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
         {
             cmd.Parameters.Add(_Database.CreateParameter("RegionUUID", rs.RegionUUID));
             cmd.Parameters.Add(_Database.CreateParameter("Yaw", p.Yaw));
             cmd.Parameters.Add(_Database.CreateParameter("Pitch", p.Pitch));
             cmd.Parameters.Add(_Database.CreateParameter("Distance", p.Distance));
             conn.Open();
             cmd.ExecuteNonQuery();
         }
     }
 }
開發者ID:TomDataworks,項目名稱:opensim,代碼行數:25,代碼來源:PGSQLSimulationData.cs

示例2: StoreSpawnPoints

        public void StoreSpawnPoints(RegionSettings rs)
        {
            lock (ds)
            {
                // DataTable spawnpoints = ds.Tables["spawn_points"];

                // remove region's spawnpoints
                using (
                    SqliteCommand cmd =
                        new SqliteCommand("delete from spawn_points where RegionID=:RegionID",
                                          m_conn))
                {

                    cmd.Parameters.Add(new SqliteParameter(":RegionID", rs.RegionUUID.ToString()));
                    cmd.ExecuteNonQuery();
                }
            }

            foreach (SpawnPoint sp in rs.SpawnPoints())
            {
                using (SqliteCommand cmd = new SqliteCommand("insert into spawn_points(RegionID, Yaw, Pitch, Distance)" +
                                                              "values ( :RegionID, :Yaw, :Pitch, :Distance)", m_conn))
                {
                    cmd.Parameters.Add(new SqliteParameter(":RegionID", rs.RegionUUID.ToString()));
                    cmd.Parameters.Add(new SqliteParameter(":Yaw", sp.Yaw));
                    cmd.Parameters.Add(new SqliteParameter(":Pitch", sp.Pitch));
                    cmd.Parameters.Add(new SqliteParameter(":Distance", sp.Distance));
                    cmd.ExecuteNonQuery();
                }
            }
        }
開發者ID:p07r0457,項目名稱:opensim,代碼行數:31,代碼來源:SQLiteSimulationData.cs

示例3: SaveSpawnPoints

 private void SaveSpawnPoints(RegionSettings rs)
 {
     string sql = "DELETE FROM spawn_points WHERE RegionUUID = @RegionUUID";
     using (SqlConnection conn = new SqlConnection(m_connectionString))
     using (SqlCommand cmd = new SqlCommand(sql, conn))
     {
         cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID));
         conn.Open();
         cmd.ExecuteNonQuery();
     }
     foreach (SpawnPoint p in rs.SpawnPoints())
     {
         sql = "INSERT INTO spawn_points (RegionUUID, Yaw, Pitch, Distance) VALUES (@RegionUUID, @Yaw, @Pitch, @Distance)";
         using (SqlConnection conn = new SqlConnection(m_connectionString))
         using (SqlCommand cmd = new SqlCommand(sql, conn))
         {
             cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID));
             cmd.Parameters.Add(_Database.CreateParameter("@Yaw", p.Yaw));
             cmd.Parameters.Add(_Database.CreateParameter("@Pitch", p.Pitch));
             cmd.Parameters.Add(_Database.CreateParameter("@Distance", p.Distance));
             conn.Open();
             cmd.ExecuteNonQuery();
         }
     }
 }
開發者ID:BogusCurry,項目名稱:arribasim-dev,代碼行數:25,代碼來源:MSSQLSimulationData.cs

示例4: Serialize

        public static string Serialize(RegionSettings settings)
        {
            StringWriter sw = new StringWriter();
            XmlTextWriter xtw = new XmlTextWriter(sw);
            xtw.Formatting = Formatting.Indented;
            xtw.WriteStartDocument();
            
            xtw.WriteStartElement("RegionSettings");
            
            xtw.WriteStartElement("General");
            xtw.WriteElementString("AllowDamage", settings.AllowDamage.ToString());
            xtw.WriteElementString("AllowLandResell", settings.AllowLandResell.ToString());
            xtw.WriteElementString("AllowLandJoinDivide", settings.AllowLandJoinDivide.ToString());
            xtw.WriteElementString("BlockFly", settings.BlockFly.ToString());
            xtw.WriteElementString("BlockLandShowInSearch", settings.BlockShowInSearch.ToString());
            xtw.WriteElementString("BlockTerraform", settings.BlockTerraform.ToString());
            xtw.WriteElementString("DisableCollisions", settings.DisableCollisions.ToString());
            xtw.WriteElementString("DisablePhysics", settings.DisablePhysics.ToString());
            xtw.WriteElementString("DisableScripts", settings.DisableScripts.ToString());
            xtw.WriteElementString("MaturityRating", settings.Maturity.ToString());
            xtw.WriteElementString("RestrictPushing", settings.RestrictPushing.ToString());
            xtw.WriteElementString("AgentLimit", settings.AgentLimit.ToString());
            xtw.WriteElementString("ObjectBonus", settings.ObjectBonus.ToString());
            xtw.WriteEndElement();

            xtw.WriteStartElement("GroundTextures");
            xtw.WriteElementString("Texture1", settings.TerrainTexture1.ToString());
            xtw.WriteElementString("Texture2", settings.TerrainTexture2.ToString());
            xtw.WriteElementString("Texture3", settings.TerrainTexture3.ToString());
            xtw.WriteElementString("Texture4", settings.TerrainTexture4.ToString());
            xtw.WriteElementString("ElevationLowSW", settings.Elevation1SW.ToString());
            xtw.WriteElementString("ElevationLowNW", settings.Elevation1NW.ToString());
            xtw.WriteElementString("ElevationLowSE", settings.Elevation1SE.ToString());
            xtw.WriteElementString("ElevationLowNE", settings.Elevation1NE.ToString());
            xtw.WriteElementString("ElevationHighSW", settings.Elevation2SW.ToString());
            xtw.WriteElementString("ElevationHighNW", settings.Elevation2NW.ToString());
            xtw.WriteElementString("ElevationHighSE", settings.Elevation2SE.ToString());
            xtw.WriteElementString("ElevationHighNE", settings.Elevation2NE.ToString());
            xtw.WriteEndElement();
            
            xtw.WriteStartElement("Terrain");
            xtw.WriteElementString("WaterHeight", settings.WaterHeight.ToString());
            xtw.WriteElementString("TerrainRaiseLimit", settings.TerrainRaiseLimit.ToString());
            xtw.WriteElementString("TerrainLowerLimit", settings.TerrainLowerLimit.ToString());
            xtw.WriteElementString("UseEstateSun", settings.UseEstateSun.ToString());
            xtw.WriteElementString("FixedSun", settings.FixedSun.ToString());
            xtw.WriteElementString("SunPosition", settings.SunPosition.ToString());
            // Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which
            // calculates it automatically according to the date and other factors.
            xtw.WriteEndElement();

            xtw.WriteStartElement("Telehub");
            if (settings.TelehubObject != UUID.Zero)
            {
                xtw.WriteElementString("TelehubObject", settings.TelehubObject.ToString());
                foreach (SpawnPoint sp in settings.SpawnPoints())
                    xtw.WriteElementString("SpawnPoint", sp.ToString());
            }
            xtw.WriteEndElement();
            
            xtw.WriteEndElement();
            
            xtw.Close();
            sw.Close();
            
            return sw.ToString();
        }
開發者ID:CassieEllen,項目名稱:opensim,代碼行數:67,代碼來源:RegionSettingsSerializer.cs


注:本文中的OpenSim.Framework.RegionSettings.SpawnPoints方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。