Skip to content

Commit 9f89bf8

Browse files
NathanFlurryAngelOnFira
authored andcommitted
chore: refactor on to toolchain (#33)
1 parent 57745df commit 9f89bf8

1,907 files changed

Lines changed: 203946 additions & 1351 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,7 @@ Assets/Resources
8181
Assets/Resources.meta
8282

8383
# Remove asset-store-tools so they aren't redistributed
84-
Packages/com.unity.asset-store-tools
84+
Packages/com.unity.asset-store-tools
85+
86+
# OpenGB files
87+
.opengb/

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,10 @@
5656
"temp/": true,
5757
"Temp/": true
5858
},
59-
"dotnet.defaultSolution": "plugin-unity.sln"
59+
"dotnet.defaultSolution": "plugin-unity.sln",
60+
"dotnet.preferCSharpExtension": true,
61+
"cSpell.words": [
62+
"Newtonsoft",
63+
"subtarget"
64+
]
6065
}

Assets/Backend.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Backend/Backend.asmdef

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "Backend",
3+
"overrideReferences": true,
4+
"precompiledReferences": [
5+
"Newtonsoft.Json.dll"
6+
]
7+
}

Assets/Backend/Backend.asmdef.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Backend/Client.cs

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
// This file is auto-generated by the Open Game Backend (https://opengb.dev) build system.
2+
//
3+
// Do not edit this file directly.
4+
//
5+
// Generated at 2024-07-24T03:59:07.525Z
6+
7+
using System;
8+
using System.Collections.Generic;
9+
using System.Collections.ObjectModel;
10+
using System.Linq;
11+
using System.Net;
12+
using System.Net.Mime;
13+
using Backend.Client;
14+
using Backend.Model;
15+
16+
namespace Backend
17+
{
18+
/// <summary>
19+
/// Represents a collection of functions to interact with the API endpoints
20+
/// </summary>
21+
public partial class BackendClient : IDisposable
22+
{
23+
/// <summary>
24+
/// Initializes a new instance of the <see cref="BackendClient"/> class.
25+
/// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
26+
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>.
27+
/// </summary>
28+
/// <returns></returns>
29+
public BackendClient() : this((string)null)
30+
{
31+
}
32+
33+
/// <summary>
34+
/// Initializes a new instance of the <see cref="BackendClient"/> class.
35+
/// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
36+
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>.
37+
/// </summary>
38+
/// <param name="basePath">The target service's base path in URL format.</param>
39+
/// <exception cref="ArgumentException"></exception>
40+
/// <returns></returns>
41+
public BackendClient(string basePath)
42+
{
43+
this.Configuration = Backend.Client.Configuration.MergeConfigurations(
44+
Backend.Client.GlobalConfiguration.Instance,
45+
new Backend.Client.Configuration { BasePath = basePath }
46+
);
47+
this.ApiClient = new Backend.Client.ApiClient(this.Configuration.BasePath);
48+
this.AsynchronousClient = this.ApiClient;
49+
this.ExceptionFactory = Backend.Client.Configuration.DefaultExceptionFactory;
50+
}
51+
52+
/// <summary>
53+
/// Initializes a new instance of the <see cref="BackendClient"/> class using Configuration object.
54+
/// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
55+
/// It's better to reuse the <see href="https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#issues-with-the-original-httpclient-class-available-in-net">HttpClient and HttpClientHandler</see>.
56+
/// </summary>
57+
/// <param name="configuration">An instance of Configuration.</param>
58+
/// <exception cref="ArgumentNullException"></exception>
59+
/// <returns></returns>
60+
public BackendClient(Backend.Client.Configuration configuration)
61+
{
62+
if (configuration == null) throw new ArgumentNullException("configuration");
63+
64+
this.Configuration = Backend.Client.Configuration.MergeConfigurations(
65+
Backend.Client.GlobalConfiguration.Instance,
66+
configuration
67+
);
68+
this.ApiClient = new Backend.Client.ApiClient(this.Configuration.BasePath);
69+
this.AsynchronousClient = this.ApiClient;
70+
ExceptionFactory = Backend.Client.Configuration.DefaultExceptionFactory;
71+
}
72+
73+
/// <summary>
74+
/// Initializes a new instance of the <see cref="BackendClient"/> class
75+
/// using a Configuration object and client instance.
76+
/// </summary>
77+
/// <param name="asyncClient">The client interface for asynchronous API access.</param>
78+
/// <param name="configuration">The configuration object.</param>
79+
/// <exception cref="ArgumentNullException"></exception>
80+
public BackendClient(Backend.Client.IAsynchronousClient asyncClient, Backend.Client.IReadableConfiguration configuration)
81+
{
82+
if (asyncClient == null) throw new ArgumentNullException("asyncClient");
83+
if (configuration == null) throw new ArgumentNullException("configuration");
84+
85+
this.AsynchronousClient = asyncClient;
86+
this.Configuration = configuration;
87+
this.ExceptionFactory = Backend.Client.Configuration.DefaultExceptionFactory;
88+
}
89+
90+
/// <summary>
91+
/// Disposes resources if they were created by us
92+
/// </summary>
93+
public void Dispose()
94+
{
95+
this.ApiClient?.Dispose();
96+
}
97+
98+
/// <summary>
99+
/// Holds the ApiClient if created
100+
/// </summary>
101+
public Backend.Client.ApiClient ApiClient { get; set; } = null;
102+
103+
/// <summary>
104+
/// The client for accessing this underlying API asynchronously.
105+
/// </summary>
106+
public Backend.Client.IAsynchronousClient AsynchronousClient { get; set; }
107+
108+
/// <summary>
109+
/// Gets the base path of the API client.
110+
/// </summary>
111+
/// <value>The base path</value>
112+
public string GetBasePath()
113+
{
114+
return this.Configuration.BasePath;
115+
}
116+
117+
/// <summary>
118+
/// Gets or sets the configuration object
119+
/// </summary>
120+
/// <value>An instance of the Configuration</value>
121+
public Backend.Client.IReadableConfiguration Configuration { get; set; }
122+
123+
private Backend.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
124+
125+
/// <summary>
126+
/// Provides a factory method hook for the creation of exceptions.
127+
/// </summary>
128+
public Backend.Client.ExceptionFactory ExceptionFactory
129+
{
130+
get
131+
{
132+
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
133+
{
134+
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
135+
}
136+
return _exceptionFactory;
137+
}
138+
set { _exceptionFactory = value; }
139+
}
140+
141+
private Modules.UsersApi _users;
142+
public Modules.UsersApi Users => _users ??= new Modules.UsersApi(this.AsynchronousClient, this.Configuration);
143+
144+
private Modules.RateLimitApi _rate_limit;
145+
public Modules.RateLimitApi RateLimit => _rate_limit ??= new Modules.RateLimitApi(this.AsynchronousClient, this.Configuration);
146+
147+
private Modules.TokensApi _tokens;
148+
public Modules.TokensApi Tokens => _tokens ??= new Modules.TokensApi(this.AsynchronousClient, this.Configuration);
149+
150+
private Modules.LobbiesApi _lobbies;
151+
public Modules.LobbiesApi Lobbies => _lobbies ??= new Modules.LobbiesApi(this.AsynchronousClient, this.Configuration);
152+
153+
private Modules.RivetApi _rivet;
154+
public Modules.RivetApi Rivet => _rivet ??= new Modules.RivetApi(this.AsynchronousClient, this.Configuration);
155+
156+
157+
}
158+
}
159+
160+
161+
162+
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Backend/Client.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)