2020-08-13 19:46:16 +00:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using UnityEngine.Networking;
|
2020-02-14 21:14:24 +00:00
|
|
|
|
|
2020-11-03 17:56:48 +00:00
|
|
|
|
namespace QSB.TimeSync.Events
|
2020-02-15 19:48:02 +00:00
|
|
|
|
{
|
2020-08-09 20:46:51 +00:00
|
|
|
|
public class ServerTimeMessage : PlayerMessage
|
2020-02-15 19:48:02 +00:00
|
|
|
|
{
|
2020-02-28 21:07:39 +00:00
|
|
|
|
public float ServerTime { get; set; }
|
2020-03-13 19:44:32 +00:00
|
|
|
|
public int LoopCount { get; set; }
|
2020-02-14 21:14:24 +00:00
|
|
|
|
|
2020-02-15 19:48:02 +00:00
|
|
|
|
public override void Deserialize(NetworkReader reader)
|
|
|
|
|
{
|
2020-08-10 16:17:54 +00:00
|
|
|
|
base.Deserialize(reader);
|
2020-02-28 21:07:39 +00:00
|
|
|
|
ServerTime = reader.ReadSingle();
|
2020-03-13 19:44:32 +00:00
|
|
|
|
LoopCount = reader.ReadInt16();
|
2020-02-14 21:14:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 19:48:02 +00:00
|
|
|
|
public override void Serialize(NetworkWriter writer)
|
|
|
|
|
{
|
2020-08-10 16:17:54 +00:00
|
|
|
|
base.Serialize(writer);
|
2020-02-28 21:07:39 +00:00
|
|
|
|
writer.Write(ServerTime);
|
2020-03-13 19:44:32 +00:00
|
|
|
|
writer.Write(LoopCount);
|
2020-02-14 21:14:24 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|