Skip to content

Commit 4c790af

Browse files
committed
fixed use of obsolete methods
1 parent 7bfadc4 commit 4c790af

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
using RestSharp;
2+
using RestSharp.Interceptors;
23

34
namespace FModel.ViewModels.ApiEndpoints;
45

56
public abstract class AbstractApiProvider
67
{
78
protected readonly RestClient _client;
9+
protected readonly Interceptor _interceptor;
810

911
protected AbstractApiProvider(RestClient client)
1012
{
1113
_client = client;
14+
_interceptor = new CompatibilityInterceptor
15+
{
16+
OnBeforeDeserialization = resp => { resp.ContentType = "application/json; charset=utf-8"; }
17+
};
1218
}
1319
}

FModel/ViewModels/ApiEndpoints/DynamicApiEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public async Task<JToken> GetRequestBody(CancellationToken token, string url)
6666
{
6767
var request = new FRestRequest(url)
6868
{
69-
OnBeforeDeserialization = resp => { resp.ContentType = "application/json; charset=utf-8"; }
69+
Interceptors = [_interceptor]
7070
};
7171
var response = await _client.ExecuteAsync(request, token).ConfigureAwait(false);
7272
Log.Information("[{Method}] [{Status}({StatusCode})] '{Resource}'", request.Method, response.StatusDescription, (int) response.StatusCode, response.ResponseUri?.OriginalString);

FModel/ViewModels/ApiEndpoints/FortniteCentralApiEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public async Task<Dictionary<string, Dictionary<string, string>>> GetHotfixesAsy
1515
{
1616
var request = new FRestRequest("https://fortnitecentral.genxgames.gg/api/v1/hotfixes")
1717
{
18-
OnBeforeDeserialization = resp => { resp.ContentType = "application/json; charset=utf-8"; }
18+
Interceptors = [_interceptor]
1919
};
2020
request.AddParameter("lang", language);
2121
var response = await _client.ExecuteAsync<Dictionary<string, Dictionary<string, string>>>(request, token).ConfigureAwait(false);

FModel/Views/Snooper/Models/SkeletalModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public override void RenderCollision(Shader shader)
153153

154154
GL.Disable(EnableCap.DepthTest);
155155
GL.Disable(EnableCap.CullFace);
156-
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
156+
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Line);
157157
foreach (var collision in Collisions)
158158
{
159159
var boneMatrix = Matrix4x4.Identity;
@@ -162,7 +162,7 @@ public override void RenderCollision(Shader shader)
162162

163163
collision.Render(shader, boneMatrix);
164164
}
165-
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
165+
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Fill);
166166
GL.Enable(EnableCap.CullFace);
167167
GL.Enable(EnableCap.DepthTest);
168168
}

FModel/Views/Snooper/Models/StaticModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ public override void RenderCollision(Shader shader)
148148
base.RenderCollision(shader);
149149

150150
GL.Disable(EnableCap.CullFace);
151-
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
151+
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Line);
152152
foreach (var collision in Collisions)
153153
{
154154
collision.Render(shader, Matrix4x4.Identity);
155155
}
156-
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
156+
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Fill);
157157
GL.Enable(EnableCap.CullFace);
158158
}
159159
}

FModel/Views/Snooper/Models/UModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public virtual void Render(Shader shader, Texture checker = null, bool outline =
255255
}
256256

257257
Vao.Bind();
258-
GL.PolygonMode(MaterialFace.FrontAndBack, ShowWireframe ? PolygonMode.Line : PolygonMode.Fill);
258+
GL.PolygonMode(TriangleFace.FrontAndBack, ShowWireframe ? PolygonMode.Line : PolygonMode.Fill);
259259
foreach (var section in Sections)
260260
{
261261
if (!section.Show) continue;
@@ -275,7 +275,7 @@ public virtual void Render(Shader shader, Texture checker = null, bool outline =
275275

276276
GL.DrawElementsInstanced(PrimitiveType.Triangles, section.FacesCount, DrawElementsType.UnsignedInt, section.FirstFaceIndexPtr, TransformsCount);
277277
}
278-
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
278+
GL.PolygonMode(TriangleFace.FrontAndBack, PolygonMode.Fill);
279279
Vao.Unbind();
280280

281281
if (IsSelected)

0 commit comments

Comments
 (0)