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); }
public UUID NewStorageUnit(string OwnerName, string OwnerKey, string StorageType, string amount, string Loss) { UUID ID = new UUID(); ID.GenerateUUID("BearFood"); using (MySqlConnection mySqlConnection = new MySqlConnection(MyConString)) { mySqlConnection.Open(); using (MySqlCommand mySqlCommand = new MySqlCommand("INSERT INTO `BearFood` " + "(`StorageID`,`OwnerName`,`OwnerKey`, `StorageType`, `Amount`, `Loss`)" + "VALUES ('" + ID.UUIDs + "', '" + OwnerName + "', '" + OwnerKey + "', '" + StorageType + "', '" + amount + "', '" + Loss + "')", mySqlConnection)) { mySqlCommand.CommandType = System.Data.CommandType.Text; mySqlCommand.ExecuteNonQuery(); } mySqlConnection.Close(); } return(ID); }
public UUID NewStorageUnit(string OwnerName, string OwnerKey, string StorageType, string amount, string Loss) { UUID ID = new UUID(); ID.GenerateUUID("BearFood"); using (MySqlConnection mySqlConnection = new MySqlConnection(MyConString)) { mySqlConnection.Open(); using (MySqlCommand mySqlCommand = new MySqlCommand("INSERT INTO `BearFood` " + "(`StorageID`,`OwnerName`,`OwnerKey`, `StorageType`, `Amount`, `Loss`)" + "VALUES ('" + ID.UUIDs + "', '" + OwnerName + "', '" + OwnerKey + "', '" + StorageType + "', '" + amount + "', '" + Loss + "')", mySqlConnection)) { mySqlCommand.CommandType = System.Data.CommandType.Text; mySqlCommand.ExecuteNonQuery(); } mySqlConnection.Close(); } return ID; }
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; }