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.


Topics - luvcraft

Pages: [1]
1
NGUI 3 Support / UICamera.fallThrough
« on: October 07, 2014, 02:11:38 PM »
Can you tell me why UICamera.fallThrough now gets set to UIRoot at UICamera.Start()?

Previously if nothing was hovered, it was nice to just get "null" from UICamera.hoveredObject, and also if there are multiple UIRoots in a scene it will default to whichever one started first, even if it's disabled, which is not ideal.

2
TNet 3 Support / TNSerializer bug
« on: August 25, 2014, 08:03:36 PM »
got another TNSerializer bug for ya! :)

line 752 should be
  1. bw.Write(elemType);
NOT
  1. bw.Write(type);
This one's been driving me nuts for a while (it kept failing to deserialize Lists, telling me that it couldn't covert List[List[foo]] to List[foo]), and I finally got around to digging into it this afternoon. This only affects ILists; you had the code setup correctly for TLists. :)

3
TNet 3 Support / MissingMethodExceptions in 1.9.6
« on: July 14, 2014, 02:26:14 PM »
I just updated to 1.9.6 and immediately got a bunch of MissingMethodExceptions trying to read my custom classes in from DataNodes, because apparently TNet now expects all custom classes' constructors to take exactly one int as an argument (my classes' constructors take no arguments). I fixed it by changing the Create function at TNSerializer line 272 to the following:

  1.    static public object Create (this Type type, int size)
  2.    {
  3.       try
  4.       {
  5.          return Activator.CreateInstance(type, size);
  6.       }
  7.       catch (Exception ex)
  8.       {
  9.             try
  10.             {
  11.                 return Activator.CreateInstance(type);
  12.             }
  13.             catch (Exception ex2)
  14.             {
  15.                 Debug.LogError(ex2.Message + " | " + ex2.GetType());
  16.                 return null;
  17.             }
  18.       }
  19.    }
  20.  

4
TNet 3 Support / DataNode Write bug
« on: June 26, 2014, 09:39:39 PM »
if you put an empty List or TNet.List in a DataNode, and then do a non-binary write, it'll write the name of the List, followed immediately by a tab and then the next variable in the DataNode. The DataNode will then break horribly when you try to load it.

For example:

  1. List<int> foo = new List<int>();
  2. int bar = 1;
  3.  

will write as:

  1.         foo     bar = 1
  2.  

the culprit is DataNode.cs line 483 and 497; in both of those cases, the
  1.                                                 writer.Write(" = ");
  2.                                                 writer.Write(Serialization.TypeToName(type));
  3.                                                 writer.Write('\n');
  4.  
should come before the
  1. if (list.Count > 0)

I haven't tested to see if this happens with a binary write.

5
TNet 3 Support / are RFCs guaranteed?
« on: June 23, 2014, 01:23:37 PM »
I'm fairly new to network programming, but I'm making a lot of great headway with TNet.

I have a couple of "newbie" questions, though:

  • Are RFCs guaranteed to reach all connected players on the channel? If I send out an RFC, can I safely assume that all connected players on the channel will receive it, or do I need to implement lots of fallbacks and desynch checks in case there's a missed RFC? Does whether or not the target is "saved" change the answer? (I know it would change the answer for players who connect after the RFC is sent, but does it matter for players who are already connected when the RFC is sent?)
  • Are all players guaranteed to receive RFCs in the same order? If multiple players send RFCs simultaneously, will all of the players receive those RFCs in the same order, or do I need to allow for the possibility of different players executing RFCs in a different order from each other?

A "yes" or "no" answer is OK, but I'd also love to know the reason for the yes or no so I can understand the system (and networking in general) better. Thanks!

EDIT: Based on this thread it looks like the answer to #2 is "yes", which probably means that #1 is "yes", too.

6
TNet 3 Support / RFCs not being called on inactive objects
« on: June 13, 2014, 01:25:12 PM »
I was getting the "Unable to execute function funcName. Did you forget an [RFC] prefix, perhaps?" error when I tried to call RFCs on inactive gameobjects, so I changed line 406 of TNObject.cs to:

      MonoBehaviour[] mbs = GetComponentsInChildren<MonoBehaviour>(true);

and that seems to have fixed it! Could you please apply this change to the project, or let me know if it's a bad idea? Thanks!

Pages: [1]