@@ -755,27 +755,12 @@ public static TimeSpan CheckIdlesInterval {
755755
756756
757757 private static void CheckIdles ( SchedulerTask task ) {
758-
759758 Player [ ] tempPlayerList = Players ;
760759 for ( int i = 0 ; i < tempPlayerList . Length ; i ++ ) {
761760 Player player = tempPlayerList [ i ] ;
762761
763762 if ( player . Supports ( CpeExt . MessageType ) ) {
764- //double speed = (Math.Sqrt(player.Position.DistanceSquaredTo(player.lastSolidPos)) / 32);
765- //player.Send(Packet.Message((byte)MessageType.Announcement, string.Format("&eSpeed: &f{0:N2} &eBlocks/s", speed), player.UseFallbackColors));
766- string bottomRight2 = player . Position . ToBlockCoordsRaw ( ) + "&S[" + compassString ( player . Position . R ) + "&S]" ;
767- if ( bottomRight2 != player . lastBottomRight2 ) {
768- player . lastBottomRight2 = bottomRight2 ;
769- player . Send ( Packet . Message ( ( byte ) MessageType . BottomRight2 , bottomRight2 , player ) ) ;
770- }
771-
772- if ( player . LastDrawOp != null && ! player . IsPlayingCTF )
773- if ( player . LastDrawOp . PercentDone < 100 ) {
774- player . Send ( Packet . Message ( ( byte ) MessageType . Status3 , player . LastDrawOp . Description +
775- " percent done: &f" + player . LastDrawOp . PercentDone + "&S%" , player ) ) ;
776- } else if ( player . LastDrawOp . PercentDone == 100 || player . LastDrawOp . IsDone ) {
777- player . Send ( Packet . Message ( ( byte ) MessageType . Status3 , "" , player ) ) ;
778- }
763+ UpdateStatusMessages ( player ) ;
779764 }
780765 CTF . PrintCtfState ( player ) ;
781766 player . lastSolidPos = player . Position ;
@@ -809,6 +794,28 @@ private static void CheckIdles(SchedulerTask task) {
809794 UpdateTabList ( false ) ;
810795 }
811796
797+ static void UpdateStatusMessages ( Player player ) {
798+ //double speed = (Math.Sqrt(player.Position.DistanceSquaredTo(player.lastSolidPos)) / 32);
799+ //player.Send(Packet.Message((byte)MessageType.Announcement, string.Format("&eSpeed: &f{0:N2} &eBlocks/s", speed), player.UseFallbackColors));
800+ string bottomRight2 = player . Position . ToBlockCoordsRaw ( ) + "&S[" + compassString ( player . Position . R ) + "&S]" ;
801+ if ( bottomRight2 != player . lastBottomRight2 ) {
802+ player . lastBottomRight2 = bottomRight2 ;
803+ player . Send ( Packet . Message ( ( byte ) MessageType . BottomRight2 , bottomRight2 , player ) ) ;
804+ }
805+
806+ if ( player . LastDrawOp != null && ! player . IsPlayingCTF ) {
807+ if ( player . LastDrawOp . PercentDone < 100 ) {
808+ player . Send ( Packet . Message ( ( byte ) MessageType . Status3 , player . LastDrawOp . Description +
809+ " percent done: &f" + player . LastDrawOp . PercentDone + "&S%" , player ) ) ;
810+ } else if ( player . LastDrawOp . PercentDone == 100 || player . LastDrawOp . IsDone ) {
811+ if ( ! player . AnnouncedLastDrawOpFinished ) {
812+ player . Send ( Packet . Message ( ( byte ) MessageType . Status3 , "" , player ) ) ;
813+ player . AnnouncedLastDrawOpFinished = true ;
814+ }
815+ }
816+ }
817+ }
818+
812819 public static string compassString ( int rot ) {
813820 if ( rot > 240 || rot < 15 ) {
814821 return "&1S" ;
0 commit comments