コード:エラーコンパイル中:DASD.cs(109195):エラーCS1503
private void Executing(PlayerSession Player, string response, int code)
{
switch (code)
{
case 0:
Debug.LogError("Api does not responded to a request");
break;
case 200:
Dictionary<string, object> Response = JsonConvert.DeserializeObject<Dictionary<string, object>>(response, new KeyValuesConverter());
if (Response != null)
{
switch (Convert.ToInt32(Response["code"]))
{
case 100:
int i = 0;
List<object> data = Response["data"] as List<object>;
foreach (object pair in data)
{
if (i >= 14)
{
hurt.SendChatMessage(Player, $"Вы не можете получить больше 14 предметов за раз.");
return;
}
Dictionary<string, object> iteminfo = pair as Dictionary<string, object>;
if(iteminfo.ContainsKey("command"))
{
string command = iteminfo["command"].ToString().Replace('\n', '|').ToLower().Trim('\"').Replace("%steamid%", Player.SteamId.m_SteamID.ToString()).Replace("%username%", Player.Name);
String[] CommandArray = command.Split('|');
foreach (var substring in CommandArray)
{
ConsoleManager.Instance.ExecuteCommand(substring);
}
hurt.SendChatMessage(Player, $"Получен товар из магазина: <color=lime>\"{iteminfo["name"]}\"</color>.");
SendGived(new Dictionary<string, string>() { { "gived", "true" }, { "id", $"{iteminfo["id"]}" } }, Player);
return;
}
int ItemID = Convert.ToInt32(iteminfo["item_id"]);
int Amount = Convert.ToInt32(iteminfo["amount"]);
ItemInstance Item = new ItemInstance(GlobalItemManager.Instance.GetItem(ItemID), Amount);
if (Player.WorldPlayerEntity.GetComponent<Inventory>().GiveItemServer(Item))
{
Singleton<AlertManager>.Instance.GenericTextNotificationServer($"Получен товар из магазина: \"{iteminfo["name"]}\" в количестве {Amount}", session.Player);
} else {
hurt.SendChatMessage(Player, $"В инвентаре недостаточно места для получения <color=lime>\"{iteminfo["name"]}\"</color>");
return;
}
i++;
}
break;
case 104:
hurt.SendChatMessage(Player, $"Ваша корзина пуста!");
break;
}
}
else
Debug.LogWarning(response);
break;
case 404:
Debug.LogError("Response code: 404, please check your configurations");
break;
}
}
エラーライン
Singleton<AlertManager>.Instance.GenericTextNotificationServer($"Получен товар из магазина: \"{iteminfo["name"]}\" в количестве {Amount}", Player);
エラー:
Error while compiling: DASD.cs(109,195): error CS1503: Argument '#2' cannot convert 'PlayerSession' expression to type 'uLink.NetworkPlayer'
エラー_tell_何が問題なのですか? – Clonkex