Still figuring out initial matchmaking hang (FROSTBITE). Lots of other changes.
- Added missing room images
- Removed internal rooms and disallow cloning some rooms
- License fixes
- Switched target to 20200306
- Socket header fixes
- Sockets are closed upon shutdown
* Sockets persist after being destroyed, fix
- Config changes for 20200306
- Settings initialized
- Name generation words cannot be longer than 9 characters
- Dorm generation changes and fixes
- Added some settings keys
- Matchmaking additions
* Instances are not yet updated to be or not to be in-progress
- Instance fixes and logging
- Image operation fixes
- DisplayName route start
- Challenge route start
- Default Amplitude key (i can see althe Amplitude requests are ignored
- Rate limiting ease
- GameConfigs properly queried and sent
- Many 'bulk' endpoints were added in or around 20200306
- Objective routes started
- DormRoom redirection in v2/name
- Client doesn't care if it gets 200 when setting prefs
- Balance/storefronts started
- Matchmaking goto/room timer and fixes
- Selfhosted Photon addition on the client sends matchmaking /photonregionpings, ignore since Photon is only one server in one region
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Galvanic Corrosion - Rec Room custom server for communities.
|
||||
<https://gitea.proxnet.dev/zombieb-galvanic-corrosion>
|
||||
<https://gitea.proxnet.dev/zombieb/galvanic-corrosion>
|
||||
Copyright (C) 2025 @zombieb (Discord / proxnet Gitea)
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@@ -44,7 +44,7 @@ export class SignalRSocketHandler {
|
||||
|
||||
#Targets: Map<string, SocketTarget> = new Map();
|
||||
|
||||
#PresenceUpdateId: number;
|
||||
#PeriodicalId: number;
|
||||
|
||||
constructor(socket: WebSocket, player: Profile) {
|
||||
|
||||
@@ -57,9 +57,12 @@ export class SignalRSocketHandler {
|
||||
|
||||
this.#Targets.set('SubscribeToPlayers', new PlayerSocketSubscriptionTarget());
|
||||
|
||||
this.#PresenceUpdateId = setInterval(async () => {
|
||||
const pres = await Presence.get(this.#profile);
|
||||
this.sendNotification("PresenceUpdate", await pres.export());
|
||||
this.#PeriodicalId = setInterval(async () => {
|
||||
if (this.#socket.readyState !== this.#socket.CLOSED) {
|
||||
const pres = await Presence.get(this.#profile);
|
||||
this.sendNotification("PresenceUpdate", await pres.export());
|
||||
this.sendRaw({ type: 6 });
|
||||
}
|
||||
}, 8000);
|
||||
|
||||
}
|
||||
@@ -83,7 +86,7 @@ export class SignalRSocketHandler {
|
||||
this.sendRaw({});
|
||||
return;
|
||||
} else {
|
||||
this.#log.d(`CLIENT MESSAGE\n Type: ${message.data.type} (${SignalMessageType[message.data.type]})\n ${JSON.stringify(message.data)}`);
|
||||
//this.#log.d(`CLIENT MESSAGE\n Type: ${message.data.type} (${SignalMessageType[message.data.type]})\n ${JSON.stringify(message.data)}`);
|
||||
if (message.data.type == SignalMessageType.Invocation && message.data.invocationId) { // don't send completion messages for nonblocking invocations
|
||||
const res = await this.#dispatchTarget(message.data.target, message.data.arguments[0]); // rec room only uses the first index
|
||||
if (res.type == TargetResultType.Success) {
|
||||
@@ -145,18 +148,19 @@ export class SignalRSocketHandler {
|
||||
|
||||
destroy(sock: SignalRSocketHandler) {
|
||||
return () => {
|
||||
clearInterval(sock.#PresenceUpdateId);
|
||||
clearInterval(sock.#PeriodicalId);
|
||||
sock.sendRaw({ type: 7, error: "Socket closed" });
|
||||
sock.#socket.close();
|
||||
sock.#log.i(`Closed hub socket`);
|
||||
sock.#log.i(`Closed socket`);
|
||||
sock.#profile.clearSocketHandler();
|
||||
}
|
||||
}
|
||||
|
||||
sendRaw(data: object) {
|
||||
this.#socket.send(`${JSON.stringify(data)}\u001e`);
|
||||
// todo sometime: make this less confusing
|
||||
const type = `Type: ${JSON.stringify(data) == '{}' ? 'Protocol Message' : `${(data as SignalRMessage).type} (${SignalMessageType[(data as SignalRMessage).type]})`}`;
|
||||
this.#log.d(`SERVER MESSAGE\n ${type}\n ${JSON.stringify(data as SignalRMessage)}`);
|
||||
// todo sometime: make the below less confusing
|
||||
//const type = `Type: ${JSON.stringify(data) == '{}' ? 'Protocol Message' : `${(data as SignalRMessage).type} (${SignalMessageType[(data as SignalRMessage).type]})`}`;
|
||||
//this.#log.d(`SERVER MESSAGE\n ${type}\n ${JSON.stringify(data as SignalRMessage)}`);
|
||||
}
|
||||
|
||||
sendNotification(id: PushNotificationId | string, args: object) {
|
||||
|
||||
Reference in New Issue
Block a user