コード例 #1
0
        public override void Execute(INotification notification)
        {
            if (LastExecutuion > Time.time)
            {
                return;
            }

            LastExecutuion = Time.time + 1f; // PREVENT SPAM

            if (!Lock)
            {
                Lock = true;
                SiteClass[] Added   = SitesManager.Added();
                SiteClass[] Changed = SitesManager.Changed();
                int[]       Deleted = SitesManager.Deleted();

                bool IsSend = Added.Length != 0 | Changed.Length != 0 | Deleted.Length != 0;
                if (IsSend)
                {
                    NetworkManager.Send(NetworkConstants.UPDATE_SITE_DATA, new SubmitDataForUpdate()
                    {
                        Code    = ErrorCodes.SUCCESS,
                        Added   = Added,
                        Changed = Changed,
                        Deleted = Deleted,
                    });
                }
                Lock = false;
            }
        }