Server Update

Changed some LiteNetLib settings, hopefully this allows the client to actually connect
This commit is contained in:
hyperion51 2020-03-27 17:26:26 +00:00
commit 0bbe56f4a1
8 changed files with 707 additions and 498 deletions

View file

@ -8,6 +8,7 @@ public class LoginScreen : MonoBehaviour
{
public FlatButton LoginButton;
public FlatButton RegisterButton;
public TMP_InputField Server;
public TMP_InputField EmailUsername;
public TMP_InputField Email;
public TMP_InputField Username;
@ -18,6 +19,7 @@ public class LoginScreen : MonoBehaviour
void Start()
{
CultClient.Connect(Server.text);
Error.text = " ";
LoginButton.CurrentState = FlatButtonState.Selected;
CultClient.AddMessageListener<LoginSuccessMessage>(success => SceneManager.LoadScene("Main"));

View file

@ -7,8 +7,8 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Galaxy Background
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_Name: Galaxy
m_Shader: {fileID: 4800000, guid: 73bb08f97646de94f864b995369f37c2, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
@ -56,7 +56,28 @@ Material:
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- Arms: 4
- CoreBoost: 1
- CoreBoostOffset: 0
- CoreBoostPower: 1
- EdgeReduction: 5
- GalaxyAmplitude: 0.33
- GlowAmount: 0.5
- GlowOffset: 0
- GlowPower: 2
- NoiseAmplitude: 0.25
- NoiseFrequency: 1
- NoiseGain: 1
- NoiseLacunarity: 2
- NoiseOffset: 0
- NoisePosition: 0
- SpokeOffset: 0.96
- SpokeScale: 1
- StarBoost: 0
- Twist: 4.54
- TwistPower: 2
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
@ -70,8 +91,15 @@ Material:
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _CloudColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _GlowColor: {r: 1, g: 1, b: 1, a: 1}

View file

@ -7,7 +7,7 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Zone Background
m_Name: Zone
m_Shader: {fileID: 4800000, guid: 0ec0ecdb30ff1614698ae885ebcd873d, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4

File diff suppressed because it is too large Load diff

View file

@ -1767,6 +1767,18 @@ MonoBehaviour:
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &1323369352 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4451361956630297308, guid: cde91a528214ecc4081092fcad3cc981,
type: 3}
m_PrefabInstance: {fileID: 1323369348}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1323369350}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2da0c512f12947e489f739169773d7ca, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1557138400
GameObject:
m_ObjectHideFlags: 0
@ -2189,6 +2201,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
LoginButton: {fileID: 307958568}
RegisterButton: {fileID: 1081417164}
Server: {fileID: 1323369352}
EmailUsername: {fileID: 801471838}
Email: {fileID: 660015790}
Username: {fileID: 603582396}

View file

@ -92,8 +92,7 @@ public static class CultClient {
_client = new NetManager(listener)
{
// UnsyncedEvents = true,
// MergeEnabled = true,
// NatPunchEnabled = true
NatPunchEnabled = true
};
_client.Start(3074);
_peer = _client.Connect(host, port, "aetheria-cc65a44d");

View file

@ -89,9 +89,9 @@ namespace ChatApp.Server
};
// Get data from RethinkDB
GetTable("Items", connection, cache);
GetTable("Galaxy", connection, cache);
GetTable("Users", connection, cache);
await GetTable("Items", connection, cache);
await GetTable("Galaxy", connection, cache);
await GetTable("Users", connection, cache);
// Subscribe to changes from RethinkDB
SubscribeTable("Items", connection, cache);
@ -223,19 +223,16 @@ namespace ChatApp.Server
});
}
private static void GetTable(string table, Connection connection, DatabaseCache cache)
private static async Task GetTable(string table, Connection connection, DatabaseCache cache)
{
Task.Run(async () =>
var result = await R.Db("Aetheria").Table(table).RunCursorAsync<DatabaseEntry>(connection);
while (await result.MoveNextAsync())
{
var result = await R.Db("Aetheria").Table(table).RunCursorAsync<DatabaseEntry>(connection);
while (await result.MoveNextAsync())
{
var entry = result.Current;
_logger.Log(LogLevel.Information,
$"Received {table} entry from RethinkDB: {entry.GetType()} {(entry as INamedEntry)?.EntryName ?? ""}:{entry.ID}");
cache.Add(entry, true);
}
});
var entry = result.Current;
_logger.Log(LogLevel.Information,
$"Received {table} entry from RethinkDB: {entry.GetType()} {(entry as INamedEntry)?.EntryName ?? ""}:{entry.ID}");
cache.Add(entry, true);
}
}
}
}

View file

@ -67,10 +67,8 @@ using Microsoft.Extensions.Logging;
EventBasedNetListener listener = new EventBasedNetListener();
_netManager = new NetManager(listener)
{
// UnsyncedEvents = true,
// MergeEnabled = true,
// NatPunchEnabled = true,
// DiscoveryEnabled = true
UnsyncedEvents = true,
NatPunchEnabled = true,
};
_netManager.Start(3075);