WriteTime() public method

Writes the current local time to a message; readable (and convertable to local time) by the remote host using ReadTime()
public WriteTime ( bool highPrecision ) : void
highPrecision bool
return void
        private void WritePlayerState(NetBuffer buffer, Player p)
        {
            bool alive = p.IsAlive;
            buffer.Write(alive);
            if (alive)
            {
                buffer.Write(p.px);
                buffer.Write(p.py);
                buffer.Write(p.IsMoving());
                buffer.Write((byte)p.direction);
                buffer.Write(p.GetSpeed());

                // powerups
                int powerupsCount = (int)Powerups.Count;
                for (int i = 0; i < powerupsCount; ++i)
                {
                    bool hasPower = p.powerups.HasPowerup(i);
                    buffer.Write(hasPower);
                    if (hasPower)
                    {
                        buffer.Write((byte)p.powerups.GetCount(i));
                    }
                }

                // diseases
                int diseasesCount = DiseaseList.diseaseArray.Length;
                for (int i = 0; i < diseasesCount; ++i)
                {
                    bool infected = p.diseases.IsInfected(i);
                    buffer.Write(infected);
                    if (infected)
                    {
                        buffer.WriteTime(NetTime.Now + p.diseases.GetInfectedRemains(i), false);
                    }
                }
            }

            Bomb[] bombs = p.bombs.array;
            for (int i = 0; i < bombs.Length; ++i)
            {
                WriteBombState(buffer, bombs[i]);
            }
        }
 private void WriteBombState(NetBuffer msg, Bomb b)
 {
     msg.Write(b.isActive);
     if (b.isActive)
     {
         msg.WriteTime(NetTime.Now + b.timeRemains, false);
         msg.Write(b.px);
         msg.Write(b.py);
         msg.Write((byte)b.direction);
         msg.Write(b.GetSpeed());
         msg.Write(b.IsJelly());
         msg.Write(b.IsTrigger());
     }
 }