Beispiel #1
0
        public UUID NewBear(string OwnerName, string OwnerKey, string Breed, string type, string Region, string Position, string Rotation)
        {
            /* OwnerName=Zayne%20Exonar&OwnerKey=faaf0c17%2D1432%2D4886%2Da17f%2D5e286324943b&Breed=&type=Grizzly%20Bear&Region=Gigli%20Portico&Position=%3C24%2E17173%2C%2037%2E28614%2C%2034%2E46193%3E&Rotation=%3C0%2E00000%2C%200%2E00000%2C%200%2E00000%2C%201%2E00000%3E&*/
            UUID ID = new UUID();
            Random r = new Random();
            Vector3D v3D = new Vector3D(Position);
            ID.GenerateUUID("BearStatus");
            using (MySqlConnection mySqlConnection = new MySqlConnection(MyConString))
            {
                mySqlConnection.Open();
                using (MySqlCommand mySqlCommand = new MySqlCommand("INSERT INTO BearStatus " +
            "(`BearID`,`Hunger`,`Thirst`,`Fun`,`Health`,`Depression`,`BearName`,`Age`,`Breed`,`Gender`,`Type`,`serveraddress`)" +
            "VALUES ('"+ID.UUIDs+"', '50', '50', '50', '100', '0', 'EcoLife-Bear', '0', '"+Breed+"', '"+ (r.Next(1, 2) == 2 ? "Male" : "Female") +"', '"+type+"', 'NULL')", mySqlConnection))
                {
                    mySqlCommand.CommandType = System.Data.CommandType.Text;

                    mySqlCommand.ExecuteNonQuery();

                }
                mySqlConnection.Close();
            }

            //command.CommandText =
            using (MySqlConnection mySqlConnection = new MySqlConnection(MyConString))
            {
                mySqlConnection.Open();
                using (MySqlCommand mySqlCommand = new MySqlCommand("INSERT INTO BearLocation " +
            "(`BearID`,`Region`,`position`,`rotation`,`slurl`)" +
            "VALUES ('" + ID.UUIDs + "','" + Region + "', '" + Position + "', '" + Rotation + "', 'http://slurl.com/secondlife/"
            + Region + "/" + v3D.X + "/" + v3D.Y + "/" + v3D.Z + "')", mySqlConnection))
                {
                    mySqlCommand.CommandType = System.Data.CommandType.Text;
                    mySqlCommand.ExecuteNonQuery();
                }
                mySqlConnection.Close();
            }

            using (MySqlConnection mySqlConnection = new MySqlConnection(MyConString))
            {
                mySqlConnection.Open();
                using (MySqlCommand mySqlCommand = new MySqlCommand("INSERT INTO `BearOwner` " +
            "(`BearID`,`OwnerName`,`OwnerKey`)" +
            "VALUES ('" + ID.UUIDs + "', '" + OwnerName + "', '" + OwnerKey + "')", mySqlConnection))
                {
                    mySqlCommand.CommandType = System.Data.CommandType.Text;
                    mySqlCommand.ExecuteNonQuery();
                }
                mySqlConnection.Close();
            }
            return ID;
        }
Beispiel #2
0
 public Vector3D(Vector3D vec)
 {
     X = vec.X;
     Y = vec.Y;
     Z = vec.Z;
 }