Author Topic: Autosync not working, but RFCs do  (Read 2170 times)

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Autosync not working, but RFCs do
« on: February 11, 2015, 04:18:40 PM »
I have a gameobject that has an autosync on it. It's marked as important, only owner can sync, and save on server. It is set to send 10 updates per second. It seems to not do anything at all. I have transform rotation and position as the synced properties in that order. Using RFCs on these work fine.  Any idea what may be wrong?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Autosync not working, but RFCs do
« Reply #1 on: February 11, 2015, 09:58:23 PM »
AutoSync only works if you're actually in the channel. Check its PeriodicSync() function:
  1.         IEnumerator PeriodicSync ()
  2.         {
  3.                 for (; ; )
  4.                 {
  5.                         if (TNManager.isInChannel && updatesPerSecond > 0f)
  6.                         {
  7.                                 if (mList.size != 0 && (!onlyOwnerCanSync || tno.isMine) && Cache()) Sync();
  8.                                 yield return new WaitForSeconds(1f / updatesPerSecond);
  9.                         }
  10.                         else yield return new WaitForSeconds(0.1f);
  11.                 }
  12.         }

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Autosync not working, but RFCs do
« Reply #2 on: February 12, 2015, 12:04:07 PM »
That actually helped me figure out the cause. It turned out that was never getting called because of the game object being pooled so the coroutine was turned off. Thanks!