Skip to content

Commit

Permalink
updated api url
Browse files Browse the repository at this point in the history
  • Loading branch information
JustMarfix committed Oct 8, 2024
1 parent b59c01d commit 52849d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ public class Config : IConfig
[Description("Debug включён? (bool)")]
public bool Debug { get; set; } = false;

[Description("Токен для авторизации на justmeow.ru")]
[Description("Токен для авторизации на API")]
public string AuthToken { get; set; } = "";

[Description("BaseUrl для API")]
public string BaseApiUrl { get; set; } = "http://proxy.justmarfix.ru:9000";

[Description("Список вещей для СБ (Dictionary<string, List<ItemType>>)")]
public Dictionary<string, List<ItemType>> SecurityItems { get; set; } = new Dictionary<string, List<ItemType>>
{
Expand Down
4 changes: 2 additions & 2 deletions PrisonController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static bool SendToPrison(Exiled.API.Features.Player player, int durationS
var json = JsonConvert.SerializeObject(data);
HttpContent content = new StringContent(json, Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", VeryUsualDay.Instance.Config.AuthToken);
var response = client.PostAsync($"http://justmeow.ru:9000/aban", content).Result;
var response = client.PostAsync($"{VeryUsualDay.Instance.Config.BaseApiUrl}/aban", content).Result;
if (response.IsSuccessStatusCode && VeryUsualDay.Instance.IsEnabledInRound)
{
player.Role.Set(RoleTypeId.Tutorial);
Expand Down Expand Up @@ -58,7 +58,7 @@ public static (bool, int, string) CheckIfPlayerInPrison(Exiled.API.Features.Play
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", VeryUsualDay.Instance.Config.AuthToken);
var response = client.GetAsync($"http://justmeow.ru:9000/aban?steamId={player.UserId}").Result;
var response = client.GetAsync($"{VeryUsualDay.Instance.Config.BaseApiUrl}/aban?steamId={player.UserId}").Result;
var content = response.Content.ReadAsStringAsync().Result;
var json = JsonConvert.DeserializeObject<List<string>>(content);
return (response.IsSuccessStatusCode, int.Parse(json[0]), json[1]);
Expand Down
4 changes: 2 additions & 2 deletions VeryUsualDay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class VeryUsualDay : Plugin<Config>
public override string Author => "JustMarfix";
public override string Name => "VeryUsualDay (FX Version)";

public override Version Version => new Version(5, 2, 0);
public override Version Version => new Version(5, 2, 1);

public bool IsEnabledInRound { get; set; }
public bool IsLunchtimeActive { get; set; }
Expand Down Expand Up @@ -326,7 +326,7 @@ private static async Task<string> HttpGetUser(string steamid)
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Instance.Config.AuthToken);
var content = await client.GetStringAsync($"http://justmeow.ru:9000/get_user/{steamid}");
var content = await client.GetStringAsync($"{Instance.Config.BaseApiUrl}/get_user/{steamid}");
return content;
}
}
Expand Down

0 comments on commit 52849d4

Please sign in to comment.