Ошибки:
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Parents'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Mother'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Father'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Similarity'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'SkinSimilarity'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Gender'
Cannot implicitly convert type 'Newtonsoft.Json.Linq.JValue' to 'int'. An explicit conversion exists (are you missing a cast?)
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Hair'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Color'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'HighlightColor'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'EyebrowColor'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'BeardColor'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'EyeColor'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'BlushColor'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'LipstickColor'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'ChestHairColor'
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Features'
Cannot implicitly convert type 'Newtonsoft.Json.Linq.JValue' to 'float'. An explicit conversion exists (are you missing a cast?)
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Appearance'
The name 'Value' is bound to a method and cannot be used like a property
'Newtonsoft.Json.Linq.JObject' does not contain a definition for 'Opacity'
Код:
public static void LoadCharacter(Player player, string character_name)
{
if (CustomPlayerData.ContainsKey(player)) CustomPlayerData.Remove(player);
using (MySqlConnection Mainpipeline = new MySqlConnection(Main.myConnectionString))
{
Mainpipeline.Open();
MySqlCommand query = new MySqlCommand("SELECT * FROM `characters` WHERE `name` = '" + character_name + "' LIMIT 1;", Mainpipeline);
using (MySqlDataReader reader = query.ExecuteReader())
{
string data2txt = string.Empty;
string datatxt = string.Empty;
while (reader.Read())
{
var character = API.Shared.FromJson(reader.GetString("char"));
CustomPlayerData.Add(player, new PlayerCustomization());
CustomPlayerData[player].Parents.Mother = (byte)character.Parents.Mother;
CustomPlayerData[player].Parents.Father = (byte)character.Parents.Father;
CustomPlayerData[player].Parents.Similarity = (float)character.Parents.Similarity;
CustomPlayerData[player].Parents.SkinSimilarity = (float)character.Parents.SkinSimilarity;
CustomPlayerData[player].Gender = character.Gender;
CustomPlayerData[player].Hair.Hair = character.Hair.Hair;
CustomPlayerData[player].Hair.Color = character.Hair.Color;
CustomPlayerData[player].Hair.HighlightColor = character.Hair.HighlightColor;
CustomPlayerData[player].EyebrowColor = character.EyebrowColor;
CustomPlayerData[player].BeardColor = character.BeardColor;
CustomPlayerData[player].EyeColor = character.EyeColor;
CustomPlayerData[player].BlushColor = character.BlushColor;
CustomPlayerData[player].LipstickColor = character.LipstickColor;
CustomPlayerData[player].ChestHairColor = character.ChestHairColor;
CustomPlayerData[player].ChestHairColor = character.ChestHairColor;
for (int i = 0; i < CustomPlayerData[player].Features.Length; i++) CustomPlayerData[player].Features[i] = character.Features[i];
for (int i = 0; i < CustomPlayerData[player].Appearance.Length; i++)
{
CustomPlayerData[player].Appearance[i].Value = (byte)character.Appearance[i].Value;
CustomPlayerData[player].Appearance[i].Color = (byte)character.Appearance[i].Color;
CustomPlayerData[player].Appearance[i].Opacity = character.Appearance[i].Opacity;
}
ApplyCharacter(player);
return;
}
}
}
CustomPlayerData.Add(player, new PlayerCustomization());
ApplyCharacter(player);
}
Айфон мало держит заряд, разбираемся с проблемой вместе с AppLab
Хотите улучшить этот вопрос? Добавьте больше подробностей и уточните проблему, отредактировав это сообщение
У меня есть native c++ dll, есть с++/cli враппер для нее (назовем эту длл-ку adaptordll)
Изначально моя программа принимала на вход CSV файл сохранённый в Unicode и нормально считывала с него данные, но пришлось перейти на Excel и вот...
Есть метод для изменения размера картинкиКак сделать чтобы он перезаписывал файл