Beispiel #1
0
        public void SendInitialTime(bool async = true)
        {
            Packet packet = new TimeUpdatePacket
            {
                Time = _player.World.Time
            };

            if (async)
                SendPacket(packet);
            else
                Send_Sync_Packet(packet);
        }
Beispiel #2
0
        public void SendInitialTime(bool async = true)
        {
            Packet packet = new TimeUpdatePacket
            {
                AgeWorld = 0, //Todo get Server or World time inTick
                Time = _player.World.Time
            };

            if (async)
                SendPacket(packet);
            else
                Send_Sync_Packet(packet);
        }
 private void OnTimeUpdate(TimeUpdatePacket p)
 {
     if (TimeUpdate != null) TimeUpdate.Invoke(this, new PacketEventArgs<TimeUpdatePacket>(p));
 }
Beispiel #4
0
        public void BroadcastTimeUpdate(IWorldManager world)
        {
            Client[] authClients = GetAuthenticatedClients() as Client[];

            if (authClients.Length == 0)
                return;

            TimeUpdatePacket packet = new TimeUpdatePacket {AgeOfWorld = 0, Time = world.Time};
            packet.SetShared(Logger, authClients.Length);
            Parallel.ForEach(authClients, (client) => client.SendPacket(packet));
        }
Beispiel #5
0
 public static void ReadTimeUpdate(TestClient client, PacketReader reader)
 {
     TimeUpdatePacket tu = new TimeUpdatePacket();
     tu.Read(reader);
 }