|
@@ -8,7 +8,7 @@ public class Zone
|
|
|
{
|
|
|
public uint id { get; set; }
|
|
|
public uint location_id { get; set; }
|
|
|
- public string name { get; set; }
|
|
|
+ public string name = "";
|
|
|
public float start_width { get; set; }
|
|
|
public float start_height { get; set; }
|
|
|
public float end_width { get; set; }
|
|
@@ -25,7 +25,11 @@ public class Zone
|
|
|
list.AddRange(BitConverter.GetBytes(end_width));
|
|
|
list.AddRange(BitConverter.GetBytes(end_height));
|
|
|
list.AddRange(BitConverter.GetBytes(location_id));
|
|
|
- Debug.Log($"zone save id {id} x {start_width} z {start_height} x2 {end_width} z2 {end_height} location_id {location_id}");
|
|
|
+ var bname = System.Text.Encoding.UTF8.GetBytes(name);
|
|
|
+ var namelen = (ushort) bname.Length;
|
|
|
+ list.AddRange(BitConverter.GetBytes(namelen));
|
|
|
+ list.AddRange(bname);
|
|
|
+ Debug.Log($"zone save id {id} x {start_width} z {start_height} x2 {end_width} z2 {end_height} location_id {location_id} namelen {namelen} name {name}");
|
|
|
|
|
|
var tosend = Client.ConstructVariablePacket(53, list.ToArray());
|
|
|
Client.SendEnqueue(tosend);
|
|
@@ -33,7 +37,6 @@ public class Zone
|
|
|
|
|
|
public static void SaveAll(uint lid)
|
|
|
{
|
|
|
- Debug.Log("Zone count " + WallCreate.Zones.Count);
|
|
|
if (WallCreate.Zones.Count > 0)
|
|
|
{
|
|
|
List<byte> list = new List<byte>();
|
|
@@ -45,6 +48,11 @@ public class Zone
|
|
|
list.AddRange(BitConverter.GetBytes(z.start_height));
|
|
|
list.AddRange(BitConverter.GetBytes(z.end_width));
|
|
|
list.AddRange(BitConverter.GetBytes(z.end_height));
|
|
|
+ list.AddRange(BitConverter.GetBytes(z.location_id));
|
|
|
+ var bname = System.Text.Encoding.UTF8.GetBytes(z.name);
|
|
|
+ var namelen = (ushort)bname.Length;
|
|
|
+ list.AddRange(BitConverter.GetBytes(namelen));
|
|
|
+ list.AddRange(bname);
|
|
|
Debug.Log($"zone save id {z.id} x {z.start_width} z {z.start_height} x2 {z.end_width} z2 {z.end_height}");
|
|
|
}
|
|
|
|