예제 #1
0
파일: Client.Send.cs 프로젝트: OBASI/c-raft
        public void SendInitialTime(bool async = true)
        {
            Packet packet = new TimeUpdatePacket
            {
                Time = _player.World.Time
            };

            if (async)
                SendPacket(packet);
            else
                Send_Sync_Packet(packet);
        }
예제 #2
0
파일: Client.Send.cs 프로젝트: Nirad/c-raft
        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);
        }
예제 #3
0
 private void OnTimeUpdate(TimeUpdatePacket p)
 {
     if (TimeUpdate != null) TimeUpdate.Invoke(this, new PacketEventArgs<TimeUpdatePacket>(p));
 }
예제 #4
0
파일: Server.cs 프로젝트: TheaP/c-raft
        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));
        }
예제 #5
0
 public static void ReadTimeUpdate(TestClient client, PacketReader reader)
 {
     TimeUpdatePacket tu = new TimeUpdatePacket();
     tu.Read(reader);
 }