Initialize local project and fix ranch growth synchronization

This commit is contained in:
AttilaNet
2026-11-07 22:14:49 +08:00
commit 657f5f33b5
1417 changed files with 202171 additions and 0 deletions
@@ -0,0 +1,44 @@
package net.pixvi.myr.center
{
import net.pixvi.common.driver.ClockDriver;
import net.pixvi.myr.net.NetSystem;
import net.pixvi.pfw.utils.core.Singleton;
public class TimeCenter
{
private var onStartTimeSynchroComplete:Function;
public function TimeCenter()
{
super();
}
public static function getIns() : TimeCenter
{
return Singleton.getInstanceOrCreate(TimeCenter);
}
public static function get timestamp() : Number
{
return ClockDriver.getInstance().timestamp;
}
public function startTimeSynchro(onsynchroComplete:Function = null) : void
{
onStartTimeSynchroComplete = onsynchroComplete;
NetSystem.getIns().synchroTime(startTimeSynchroHandler);
}
private function startTimeSynchroHandler(timeSecond:Number) : void
{
ClockDriver.getInstance().timestamp = timeSecond;
if(onStartTimeSynchroComplete != null)
{
onStartTimeSynchroComplete();
onStartTimeSynchroComplete = null;
}
}
}
}