Author Topic: Is it possible to pause processing of RFC calls?  (Read 4242 times)

damocles

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Is it possible to pause processing of RFC calls?
« on: January 02, 2014, 08:49:57 AM »
I'm having an issue with RFC calls where it's possible for one client to be behind the host in terms of game state (to do with how my game works, not TNet), but this can create issues where a RFC call comes in before the client is ready to deal with it.

Is it possible to tell TNet to hold off processing RFC calls until I tell it to resume?  So it would still receive and queue up the RFC calls, but not execute them until I tell it to proceed.

If this is not possible, could you say which source files would be best to rework?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is it possible to pause processing of RFC calls?
« Reply #1 on: January 02, 2014, 11:40:26 AM »
You may be able to achieve this by disabling the TNManager script... however I've never tried to do this myself.

damocles

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 18
    • View Profile
Re: Is it possible to pause processing of RFC calls?
« Reply #2 on: January 02, 2014, 12:46:04 PM »
If I disable the TNManager, will messages still arrive and be queued up, or will it disable everything?

Edit: Doesn't matter - I just added a suspension system to TNObject.  My game only uses one TNObject, so it was fairly simple to add a suspension and event queueing system which lets me suspend RFC execution for a given time.

Thanks for your help.
« Last Edit: January 02, 2014, 01:33:37 PM by damocles »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is it possible to pause processing of RFC calls?
« Reply #3 on: January 03, 2014, 06:01:28 AM »
Yes, TNManager is just a wrapper class that checks messages in its Update function. Disabling it will effectively pause all message retrieval. You can do that just by finding the TNManager script and disabling it, or adding the following function to it:
  1.         /// <summary>
  2.         /// You can pause TNManager's message processing if you like.
  3.         /// </summary>
  4.  
  5.         static public bool isActive
  6.         {
  7.                 get
  8.                 {
  9.                         return mInstance != null && mInstance.enabled;
  10.                 }
  11.                 set
  12.                 {
  13.                         if (mInstance != null) mInstance.enabled = value;
  14.                 }
  15.         }