Skip to content

Commit 52db127

Browse files
author
doctorpangloss
committed
wip
1 parent 90c2b2f commit 52db127

File tree

15 files changed

+358
-197
lines changed

15 files changed

+358
-197
lines changed

.yarn/install-state.gz

-1 Bytes
Binary file not shown.

spellsource-client/src/unity

Submodule unity updated from b39cabb to bba9696

spellsource-graphql/graphql/shared/queries/getCollecitonCards.graphql renamed to spellsource-graphql/graphql/shared/queries/getCollectionCards.graphql

File renamed without changes.

spellsource-graphql/src/graphile.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const preset: GraphileConfig.Preset = {
2828
plugins: [PgOmitArchivedPlugin],
2929
grafserv: {
3030
graphiql: true,
31+
websockets: true,
3132
},
3233
schema: {
3334
dontSwallowErrors: true,

spellsource-protos/src/main/csharp/HiddenSwitch/Framework/Sources/Hiddenswitch.cs

Lines changed: 321 additions & 147 deletions
Large diffs are not rendered by default.

spellsource-protos/src/main/csharp/HiddenSwitch/Framework/Sources/Spellsource.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33898,7 +33898,10 @@ public Sprite Clone() {
3389833898
public const int NamedFieldNumber = 1;
3389933899
private string named_ = "";
3390033900
/// <summary>
33901-
/// The sprite name in the client.
33901+
/// The address to retrieve the sprite.
33902+
/// When this is a plain string, this corresponds to a sprite name inside the Unity client.
33903+
/// Otherwise, this is treated as a URL.
33904+
/// The server will reject art in untrusted domains.
3390233905
/// </summary>
3390333906
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
3390433907
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
@@ -33913,7 +33916,7 @@ public string Named {
3391333916
public const int PivotFieldNumber = 2;
3391433917
private global::Spellsource.Proto.Sprite.Types.SpritePivot pivot_ = global::Spellsource.Proto.Sprite.Types.SpritePivot.Bottom;
3391533918
/// <summary>
33916-
/// The sprite's pivor point.
33919+
/// The sprite's pivot point.
3391733920
///
3391833921
/// - BOTTOM: The center bottom of the sprite (i.e. 0.5, 1.0)
3391933922
/// - DIMETRIC_2X1_FLOOR: Calculates the pivot point by ascending one pixel from the bottom for every four pixels

spellsource-protos/src/main/proto/hiddenswitch.proto

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ message ServerConfiguration {
9595
}
9696

9797
message GraphQLConfiguration {
98-
string host = 1;
99-
int32 port = 2;
100-
string route = 3;
98+
string url = 5;
10199
}
102100

103101
PostgresConfiguration pg = 1;
@@ -123,7 +121,12 @@ message ClientConfiguration {
123121
string keycloakAccountManagementUrl = 2;
124122
}
125123

124+
message GraphQlConfiguration {
125+
string graphQlUrl = 1;
126+
}
127+
126128
AccountsConfiguration accounts = 1;
129+
GraphQlConfiguration graphQl = 2;
127130
}
128131

129132

spellsource-protos/src/main/proto/spellsource.proto

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,10 +1521,13 @@ message Sprite {
15211521
FLYING = 3;
15221522
}
15231523

1524-
// The sprite name in the client.
1524+
// The address to retrieve the sprite.
1525+
// When this is a plain string, this corresponds to a sprite name inside the Unity client.
1526+
// Otherwise, this is treated as a URL.
1527+
// The server will reject art in untrusted domains.
15251528
string named = 1;
15261529

1527-
// The sprite's pivor point.
1530+
// The sprite's pivot point.
15281531
//
15291532
// - BOTTOM: The center bottom of the sprite (i.e. 0.5, 1.0)
15301533
// - DIMETRIC_2X1_FLOOR: Calculates the pivot point by ascending one pixel from the bottom for every four pixels

spellsource-server/src/main/java/com/hiddenswitch/framework/Accounts.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,13 @@
5656
import static java.util.stream.Collectors.toMap;
5757

5858
/**
59-
* Implements the account services from {@link AccountsApi} against Keycloak, the open source Java identity management
60-
* application.
59+
* Implements the account services from {@link AccountsApi} against Keycloak, the open source Java identity management application.
6160
* <p>
6261
* In the server, a {@link Keycloak} instance is used to create and manage user accounts.
6362
* <p>
64-
* The client creates an account with {@link com.hiddenswitch.framework.rpc.VertxUnauthenticatedGrpcClient}. The access
65-
* token returned by the reply, {@link LoginOrCreateReply#getAccessTokenResponse()}'s
66-
* {@link AccessTokenResponse#getToken()}
63+
* The client creates an account with {@link com.hiddenswitch.framework.rpc.VertxUnauthenticatedGrpcClient}. The access token returned by the reply, {@link LoginOrCreateReply#getAccessTokenResponse()}'s {@link AccessTokenResponse#getToken()}
6764
* <p>
68-
* Keycloak manages the migration of the {@link com.hiddenswitch.framework.schema.keycloak.Keycloak} SQL schema. The
69-
* {@link com.hiddenswitch.framework.schema.keycloak.tables.UserEntity} table's
70-
* {@link com.hiddenswitch.framework.schema.keycloak.tables.UserEntity#ID} field is the user ID used throughout the
71-
* application.
65+
* Keycloak manages the migration of the {@link com.hiddenswitch.framework.schema.keycloak.Keycloak} SQL schema. The {@link com.hiddenswitch.framework.schema.keycloak.tables.UserEntity} table's {@link com.hiddenswitch.framework.schema.keycloak.tables.UserEntity#ID} field is the user ID used throughout the application.
7266
*/
7367
public class Accounts {
7468
public static final String SHOW_PREMADE_DECKS = "showPremadeDecks";
@@ -95,8 +89,7 @@ public class Accounts {
9589
* }
9690
* </pre>
9791
* <p>
98-
* Since vertx code is typically async, the GRPC context's data is only valid in the first scope of the GRPC server
99-
* implementation.
92+
* Since vertx code is typically async, the GRPC context's data is only valid in the first scope of the GRPC server implementation.
10093
*
10194
* @return A {@link UserEntity} SQL model of a user record
10295
* @see #userId() when the user ID will suffice
@@ -127,8 +120,7 @@ var record = await(dao.findOneById(userId));
127120
* }
128121
* </pre>
129122
* <p>
130-
* Since vertx code is typically async, the GRPC context's data is only valid in the first scope of the GRPC server
131-
* implementation.
123+
* Since vertx code is typically async, the GRPC context's data is only valid in the first scope of the GRPC server implementation.
132124
*
133125
* @return a user ID, or {@code null} if no token was retrieved
134126
*/
@@ -263,6 +255,9 @@ public Future<ClientConfiguration> getConfiguration(Empty request) {
263255
.setKeycloakResetPasswordUrl(URI.create(authUrl + KEYCLOAK_FORGOT_PASSWORD_PATH).normalize().toString())
264256
.setKeycloakAccountManagementUrl(URI.create(authUrl + KEYCLOAK_LOGIN_PATH).normalize().toString())
265257
.build())
258+
.setGraphQl(ClientConfiguration.GraphQlConfiguration
259+
.newBuilder()
260+
.setGraphQlUrl(config.getGraphql().getUrl()))
266261
.build());
267262
}
268263
}::bindAll;

spellsource-server/src/main/java/com/hiddenswitch/framework/Environment.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,17 +565,19 @@ public static NetworkInterface mainInterface() {
565565
var isSelfAssigned = false;
566566
var isHyperV = false;
567567
var isMacOSBridgeNet = false;
568+
var isTailscale = false;
568569
try {
569570
isSelfAssigned = ni.inetAddresses().anyMatch(i -> i.getHostAddress().startsWith("169"));
570571
isLoopback = ni.isLoopback();
571572
supportsMulticast = ni.supportsMulticast();
572573
isVirtualbox = ni.getDisplayName().contains("VirtualBox") || ni.getDisplayName().contains("Host-Only");
573574
isHyperV = ni.getDisplayName().contains("Hyper-V");
574575
isMacOSBridgeNet = ni.getDisplayName().startsWith("bridge");
576+
isTailscale = ni.getDisplayName().toLowerCase().contains("tailscale");
575577
} catch (IOException failure) {
576578
}
577579
var hasIPv4 = ni.getInterfaceAddresses().stream().anyMatch(ia -> ia.getAddress() instanceof Inet4Address);
578-
return supportsMulticast && !isSelfAssigned && !isLoopback && !ni.isVirtual() && hasIPv4 && !isVirtualbox && !isHyperV && !isMacOSBridgeNet;
580+
return supportsMulticast && !isSelfAssigned && !isLoopback && !ni.isVirtual() && hasIPv4 && !isVirtualbox && !isHyperV && !isMacOSBridgeNet && !isTailscale;
579581
}).sorted(Comparator.comparing(NetworkInterface::getName)).findFirst().orElse(null);
580582
}
581583

0 commit comments

Comments
 (0)