Author Topic: Channel close behavior tied to Player limit, not just persistent flag  (Read 1899 times)

harko12

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 8
    • View Profile
I have been trying to figure out why my channels keep getting closed on me, and I see now it's because of this logic
// Close the channel if it wasn't persistent
         if ((!persistent || playerLimit < 1) && players.size == 0)
         {
            closed = true;

            for (int i = 0; i < rfcs.size; ++i)
            {
               RFC r = rfcs;
               if (r.data != null) r.data.Recycle();
            }
            rfcs.Clear();

I did mark the channel persistent, but I didn't specify a playerlimit (0).  So because of that, when the last player leaves it closes.

My plan involves giving different players 'assigned channels' so they can leave and come back to the same one.  This close behavior kind of messes with that.  I can get around it probably just by artificially upping the player limit, but I was wondering what the reason was for that behavior?

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Channel close behavior tied to Player limit, not just persistent flag
« Reply #1 on: December 03, 2016, 10:12:40 PM »
Default player limit is 65535, not 0. You had to have set it to 0 at some point yourself, no?

harko12

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Channel close behavior tied to Player limit, not just persistent flag
« Reply #2 on: December 03, 2016, 11:45:13 PM »
Yeah, I did.  I took that limit out and everything works fine, I was just surprised that that logic was there.