Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - harko12

Pages: [1]
1
Yeah, I did.  I took that limit out and everything works fine, I was just surprised that that logic was there.

2
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.

3
TNet 3 Support / Re: DataNode serialization limitations
« on: October 05, 2016, 10:28:42 AM »
Quote
TNServerInstance.Start() will have access to your game classes as you're running it from within your game.

I hadn't been able to get it to work within my game, I could only get it to work by putting the class file in the server.exe solution and rebuilding like you suggested.  Today I dug into why, and it turns out it wasn't that the class wasn't available, that was just the message sent back, the real problem came from UnityTools.GetTypeEx(string).  On line 294 it's doing an Application.IsPlaying check, and that is throwing an exception:
  1. get_isPlaying can only be called from the main thread.
  2. Constructors and field initializers will be executed from the loading thread when loading a scene.
  3. Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
  4. UnityEngine.Application:get_isPlaying()

By commenting out that if, I was able to get it to work.  Maybe that check shouldn't be there?

4
TNet 3 Support / Re: DataNode serialization limitations
« on: October 01, 2016, 08:21:22 AM »
If you're putting them into a DataNode, then yes -- the server will need to have your client side classes to serialize them.

If you're just passing them as RFC parameters, then you don't need anything. The server will just forward them on as raw data.
Any suggestions on the best way to get the server to know about my classes?  I tried running a server from inside my game with TNServerInstance.Start() thinking that would have access to the classes since it was in the same game.  But no, same problem.  Do I need to do the classes as a separate project, and then make sure the dll is in the same dir as my executable?

5
TNet 3 Support / Re: DataNode serialization limitations
« on: September 30, 2016, 03:57:02 PM »
I have marked my class as System.Serializable, but I'm still getting the Unable to resolve type error.  Does the standalone server need to have a reference to my client classes?  I wouldn't have thought so since it would all be seriialzed by the time the server gets it.

6
TNet 3 Support / Re: Soup to nuts for saving player data to the server
« on: September 11, 2016, 11:25:12 PM »
I had tried it a couple ways, using load, not using load.  I fell into the trap of trying more than one new thing at once, and switched over to TNManager.player.Get<>() for my gets, and sets, and I think that was where I went wrong.  Those behave different than the TNManager.GetPlayerData() methods, and don't seem to force a save of the file.

I managed to get it all going now, but doing the TNManager.SetPlayerSave() then starting a coroutine to wait for that callback to come back, then looking for the player data I want, it seems to be working.

Thanks for the reply!

7
TNet 3 Support / Soup to nuts for saving player data to the server
« on: September 11, 2016, 08:54:14 PM »
Hi there.  I've been struggling for days now trying to get my server to save and then re-load the player data that I'm setting for my player.  I have read all the posts I can find, and followed the advice, but still it doesn't work.

Can somebody post from connect to disconnect what steps you would have to take to create a player save file, save data, then reload it next time you connected?  Maybe what I'm missing will jump out at me. 

Thanks.

8
NGUI 3 Support / Re: Switch between SD and HD atlas with a script!
« on: August 28, 2012, 01:25:12 AM »
I had this same problem, and it turned out to be ( I think) because the material, texture and atlas are all named the same, and the .Load method can't figure out which one you want.  I used this code:

      IconAtlas = Resources.Load("Art Assets/Atlases/HackenSlash Icons", typeof(UIAtlas)) as UIAtlas;

and it loaded in correctly.

Pages: [1]