Skip to content
This repository has been archived by the owner on Sep 5, 2022. It is now read-only.

Commit

Permalink
Fixed stats endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek-R-S committed Apr 20, 2021
1 parent 24ea9e0 commit db546e5
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,14 @@ async void PingServers()

for (int i = 0; i < keys.Count; i++)
{
if(!await HealthCheckNode(keys[i].endpointAddress, keys[i].endpointPort))

var stats = await RequestStatsFromNode(keys[i].endpointAddress, keys[i].endpointPort);

if (stats.HasValue)
{
availableRelayServers[keys[i]] = stats.Value;
}
else
{
Logger.ForceLogMessage($"Server {keys[i].address}:{keys[i].port} failed a health check, removing from load balancer.", ConsoleColor.Red);
availableRelayServers.Remove(keys[i]);
Expand Down
118 changes: 62 additions & 56 deletions UnityProject/Assets/LRMTestScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,64 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 45, y: 180, z: 0}
--- !u!1 &126344731
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 126344733}
- component: {fileID: 126344732}
m_Layer: 0
m_Name: LRM - Connector
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &126344732
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 126344731}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0110f245bfcfc7d459681f7bd9ebc590, type: 3}
m_Name:
m_EditorClassIdentifier:
port: 7778
maxMessageSize: 16384
handshakeMaxSize: 3000
noDelay: 1
sendTimeout: 5000
receiveTimeout: 20000
serverMaxMessagesPerTick: 10000
clientMaxMessagesPerTick: 1000
batchSend: 1
waitBeforeSend: 0
clientUseWss: 0
sslEnabled: 0
sslCertJson: ./cert.json
sslProtocols: 3072
_logLevels: 0
--- !u!4 &126344733
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 126344731}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1282001518}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &171810013
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1125,59 +1183,6 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1282001518}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1230990396
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1230990398}
- component: {fileID: 1230990397}
m_Layer: 0
m_Name: LRM - Connector
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1230990397
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1230990396}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6b0fecffa3f624585964b0d0eb21b18e, type: 3}
m_Name:
m_EditorClassIdentifier:
Port: 7777
NoDelay: 1
Interval: 10
FastResend: 2
CongestionWindow: 0
SendWindowSize: 4096
ReceiveWindowSize: 4096
debugLog: 0
statisticsGUI: 0
statisticsLog: 0
--- !u!4 &1230990398
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1230990396}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1282001518}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1282001517
Expand Down Expand Up @@ -1211,8 +1216,8 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1230990398}
- {fileID: 1226094909}
- {fileID: 126344733}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -1290,8 +1295,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7064b1b1d0671194baf55fa8d5f564d6, type: 3}
m_Name:
m_EditorClassIdentifier:
clientToServerTransport: {fileID: 1230990397}
serverIP: 172.105.109.117
clientToServerTransport: {fileID: 126344732}
serverIP: 127.0.0.1
serverPort: 7777
endpointServerPort: 8080
heartBeatInterval: 3
connectOnAwake: 1
Expand Down

0 comments on commit db546e5

Please sign in to comment.