Advertisement
Guest User

localtime.diff

a guest
Oct 29th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.52 KB | None | 0 0
  1. diff --git a/Main.as b/Main.as
  2. index 8df2f00..0102a0b 100644
  3. --- a/Main.as
  4. +++ b/Main.as
  5. @@ -129,11 +129,13 @@
  6.        
  7.        
  8.        public var kongAPI;
  9. +      public static var frames:Number = 0;
  10.        
  11.        public function Main()
  12.        {
  13.           super();
  14.           this.hideContextMenu();
  15. +         addEventListener(Event.ENTER_FRAME, function(e) { Main.frames++; });
  16.           if(stage)
  17.           {
  18.              this.init();
  19. diff --git a/package_6/CourseTimer.as b/package_6/CourseTimer.as
  20. index 074c704..b83a022 100644
  21. --- a/package_6/CourseTimer.as
  22. +++ b/package_6/CourseTimer.as
  23. @@ -12,6 +12,9 @@
  24.  
  25.         private var startTime: Number;
  26.  
  27. +       private var startTimeLocal: Number;
  28. +       private var startFrameLocal: Number;
  29. +
  30.         private var var_308: uint;
  31.  
  32.         private var target: Course;
  33. @@ -42,6 +45,14 @@
  34.             return this.time;
  35.         }
  36.  
  37. +       public function lapFramesLocal():Number {
  38. +           return Main.frames - this.startFrameLocal;
  39. +       }
  40. +
  41. +       public function lapTimeLocal():Number {
  42. +           return (Main.socket.getTime() - this.startTimeLocal) / 1000;
  43. +       }
  44. +
  45.         private function method_189(): Number {
  46.             return (Main.socket.getTime() - this.startTime) / 1000;
  47.         }
  48. @@ -97,6 +108,8 @@
  49.         }
  50.  
  51.         public function init(): * {
  52. +           this.startFrameLocal = Main.frames;
  53. +           this.startTimeLocal = Main.socket.getTime();
  54.             this.startTime = Main.socket.getTime();
  55.             this.method_425();
  56.         }
  57. diff --git a/package_6/DrawingInfo.as b/package_6/DrawingInfo.as
  58. index ff6ef28..07b1bfa 100644
  59. --- a/package_6/DrawingInfo.as
  60. +++ b/package_6/DrawingInfo.as
  61. @@ -1,4 +1,4 @@
  62. -package package_6
  63. +package package_6
  64.  {
  65.      import data.class_28; //+
  66.     import data.CommandHandler;
  67. @@ -129,6 +129,12 @@ package package_6
  68.              {
  69.                 _loc8_ = _loc8_ + " (gone)";
  70.              }
  71. +            else
  72. +            {
  73. +               if (!isNaN(Course.course.finishTimeLocal) && _loc4_.toLowerCase() == Main.loggedInAs.toLowerCase())
  74. +                  _loc8_ += " (" + class_28.formatTime(Course.course.finishTimeLocal,"decimal") +
  75. +                         "@" + Course.course.finishFrameLocal + ")";
  76. +            }
  77.              this.m.info1["timeBox" + _loc2_].text = this.m.info2["timeBox" + _loc2_].text = _loc8_;
  78.              this.m.info1["nameBox" + _loc2_].text = this.m.info2["nameBox" + _loc2_].text = _loc4_;
  79.              _loc2_++;
  80. diff --git a/package_6/Game.as b/package_6/Game.as
  81. index 5f3c885..d205baa 100644
  82. --- a/package_6/Game.as
  83. +++ b/package_6/Game.as
  84. @@ -332,6 +332,15 @@
  85.           }
  86.        }
  87.        
  88. +      public var finishTimeLocal:Number;
  89. +      public var finishFrameLocal:Number;
  90. +      
  91. +      public function recordLocalFinishTimes():void
  92. +      {
  93. +         this.finishTimeLocal = timer.lapTimeLocal();
  94. +         this.finishFrameLocal = timer.lapFramesLocal();
  95. +      }
  96. +
  97.        override public function finish(param1:int = -1, param2:int = 0, param3:int = 0) : *
  98.        {
  99.           if(!this.var_370)
  100. @@ -340,13 +349,14 @@
  101.              {
  102.                 if(param1 != -1)
  103.                 {
  104. +                  this.recordLocalFinishTimes();
  105.                    miniMap.removeFinish(param2,param3);
  106.                    Main.socket.write("objective_reached`" + param1 + "`" + param2 + "`" + param3);
  107.                 }
  108.              }
  109.              else
  110.              {
  111. +               this.recordLocalFinishTimes();
  112.                 Main.socket.write("finish_race`" + param1 + "`" + param2 + "`" + param3);
  113.                 if(this.gameMode != Modes.hat)
  114.                 {
  115.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement