Server Initialization and Serverside Galaxy/Zone Delivery
Made the master server connect to the database and now it's listening for and responding correctly to GalaxyRequestMessages and ZoneRequestMessages, generating the zone contents if they do not yet exist.
This commit is contained in:
parent
95947355c2
commit
f8a6582154
34 changed files with 845 additions and 115 deletions
|
|
@ -3,6 +3,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using LiteNetLib;
|
||||
using MessagePack;
|
||||
using Unity.Mathematics;
|
||||
|
||||
[Union(0,typeof(PingMessage))]
|
||||
[Union(1,typeof(LoginMessage))]
|
||||
|
|
@ -75,4 +76,35 @@ public class ChatBroadcastMessage : Message
|
|||
public class ChangeNameMessage : Message
|
||||
{
|
||||
[Key(0)] public string Name;
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class GalaxyRequestMessage : Message { }
|
||||
|
||||
[MessagePackObject]
|
||||
public class GalaxyResponseMessage : Message
|
||||
{
|
||||
[Key(0)] public GalaxyResponseZone[] Zones;
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class GalaxyResponseZone
|
||||
{
|
||||
[Key(0)] public Guid ZoneID;
|
||||
[Key(1)] public Guid[] Links;
|
||||
[Key(2)] public string Name;
|
||||
[Key(3)] public float2 Position;
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class ZoneRequestMessage : Message
|
||||
{
|
||||
[Key(0)] public Guid ZoneID;
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public class ZoneResponseMessage : Message
|
||||
{
|
||||
[Key(0)] public ZoneData Zone;
|
||||
[Key(1)] public DatabaseEntry[] Contents;
|
||||
}
|
||||
Loading…
Reference in a new issue