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 - phoenix

Pages: [1] 2 3 4
1
TNet 3 Support / UDP only connection
« on: April 08, 2017, 11:09:17 PM »
So I am messing around with azure and I am having trouble opening up a tcp port and getting TNet working when I noticed that TNManager.Connect ends up only calling a ConnectToTcpEndPoint

Is it possible to use TNManager to connect to a udp endpoint?

Is it as simple as mSocket = new Socket(tcpEndPoint.AddressFamily, SocketType.Stream, ProtocolType.Udp);

Are there unintended consequences of using the Udp protocol as an endpoint for TNManager?

Is it possible to use TNet as UDP only without any TCP connectivity?

2
TNet 3 Support / Re: future Tnet direction questions
« on: February 06, 2017, 06:08:34 PM »
If you might want to reconsider web sockets they are part of unity now.
I tested on device, ios, android, webgl, mac, windows and all work.
It seems like it might be straightforward to include this in TNet

https://www.assetstore.unity3d.com/en/#!/content/38367


Also, how can I be added to the git for Tnet?

3
TNet 3 Support / future Tnet direction questions
« on: January 20, 2017, 07:04:52 PM »
1) WebSockets ever/WebGL support? Forge has it, Unity has it, Photon has it,  the only reason for it is webgl, any chance you will ever add it so that TNet supports webgl?

2) Can you refactor the TNManager to move the loadlevel and loadlevel async to one function only?
I have my own custom loadlevel system and need to rewrite that code every upgrade and it is in lots of functions within TNManager making it a little tedious.

3) you previously mentioned being able to serialize the compiled runtime back to the editor scene
http://www.tasharen.com/forum/index.php?topic=14156.msg64968#msg64968
now I am using this asset
https://www.assetstore.unity3d.com/en/#!/content/61863
to accomplish it but I am interested in your solution as part of a full debugging system.

4
TNet 3 Support / Re: TNet 3 - Send RFC messages
« on: January 11, 2017, 07:01:40 AM »
I do it this way

TNManager.Instantiate(1, "name", false);

Where name is the Prefab you want to instantiate and you have a copy of the Prefab in the resources folder.

5
TNet 3 Support / Re: GetEnUsCulture error on mono
« on: December 01, 2016, 11:08:17 PM »
I commented this out and it still worked
//Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes");
//System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");

I tried your function but that did not work. same error.

so far this is only thing working for mono backend for ios
      return new System.Globalization.CultureInfo("en-US");

I only use mono on ios because it build so much faster and I use a debug tool to serialize build to editor,

il2cpp works with original function

6
TNet 3 Support / Re: GetEnUsCulture error on mono
« on: November 28, 2016, 11:48:54 PM »
I also added the following to an Awake statement based on a forum post and have not traced the true fix yet

Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes");
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");

7
TNet 3 Support / Re: GetEnUsCulture error on mono
« on: November 28, 2016, 11:38:53 PM »
TNTools

static public System.Globalization.CultureInfo englishUSCulture = GetEnUsCulture();

   static System.Globalization.CultureInfo GetEnUsCulture ()
   {
      return new System.Globalization.CultureInfo("en-US");
      //var thread = Thread.CurrentThread;
      //var culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
      //culture.NumberFormat.CurrencyDecimalSeparator = ".";
      //if (thread != null) thread.CurrentCulture = culture;
      //return culture;
   }

8
TNet 3 Support / rfcName is null in SendRFC
« on: November 28, 2016, 03:11:36 AM »
ArgumentNullException: Argument cannot be null.

I had to add a little code here because I still use bytes only to send RFC's

void SendRFC (byte rfcID, string rfcName, Target target, bool reliable, params object[] objs)
   {
#if UNITY_EDITOR
      if (!Application.isPlaying) return;
#endif
      if (parent == null)
      {
         if (hasBeenDestroyed || !enabled) return;

#if UNITY_EDITOR
         if (rebuildMethodList) RebuildMethodList();

         CachedFunc ent;
         
         if(rfcName==null){
            if (!mDict0.TryGetValue(rfcID, out ent))
            {
               Debug.LogWarning("RFC " + rfcID + " is not present on " + name, this);
               return;
            }
         }
         else if (!mDict1.TryGetValue(rfcName, out ent))
         {
            Debug.LogWarning("RFC " + rfcName + " is not present on " + name, this);
            return;
         }

9
TNet 3 Support / Re: GetEnUsCulture error on mono
« on: November 28, 2016, 02:21:57 AM »
I changed the function to this
return new System.Globalization.CultureInfo("en-US");
and that fixed it.

10
TNet 3 Support / GetEnUsCulture error on mono
« on: November 28, 2016, 02:06:38 AM »
When I compile ios and choose backend as mono then I am getting the following error.

ExecutionEngineException: Attempting to JIT compile method 'CultureInfo__TypeMetadata:.ctor ()' while running with --aot-only.

  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
  at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.CreateMemberTypeMetadata (System.Type type) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata, System.Object& data) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter writer) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00000] in <filename unknown>:0
  at System.Threading.Thread.set_CurrentCulture (System.Globalization.CultureInfo value) [0x00000] in <filename unknown>:0
  at TNet.Tools.GetEnUsCulture () [0x00000] in <filename unknown>:0
  at TNet.Tools..cctor () [0x00000] in <filename unknown>:0
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for TNet.Tools

12
TNet 3 Support / Re: Sound question
« on: November 06, 2016, 04:55:07 PM »
I have the daikon forge package working with TNET2 but it is not working well enough for production. Also the asset is abandoned.
This open source code on github is very similar

https://github.com/DwayneBull/UnityVOIP

13
TNet 3 Support / Re: adventures in upgrading from Tnet2 to Tnet3
« on: October 23, 2016, 03:22:17 PM »
I had to change the function

static public List<IPAddress> localAddresses
the line of code
if (ni == null || ni.OperationalStatus != OperationalStatus.Up) continue;

changed to
                     if (ni == null || ni.OperationalStatus != OperationalStatus.Up){
                        if(ni==null){
                           continue;
                        }
                        else{
                        }
                     }
This is not good code but shows where the problem is

14
TNet 3 Support / adventures in upgrading from Tnet2 to Tnet3
« on: October 19, 2016, 09:34:50 PM »
Hi Aren,
I just wanted to document my adventures upgrading from Tnet2 to Tnet 3

The first issue I came across and resolved was the create methods
Tnet2
TNManager.Create(PrefabGameObject,false);
Tnet3
TNManager.Instantiate("OnCreate1",PrefabGameObject.name,false);

Now I need to put the PrefabGameObject in the resources folder whereas before I had an array of GameObjects on TNManager. I gather from the examples that this is the preferred/best way to instantiate in Tnet3?

The next Issue I had was getting the local IP, on my Mac my network interface status comes up as unknown for some reason so I had to change the code
for TNTools static public List<NetworkInterface> networkInterfaces and add

(ni.OperationalStatus == OperationalStatus.Up ||
ni.OperationalStatus == OperationalStatus.Unknown))

Not sure why this was changed from Tnet2 to Tnet3 but I personally need to include  OperationalStatus.Unknown
                  

TNServerInstance is a  MonoBehaviour
which I had to comment out  TNServerInstance {// : MonoBehaviour
This is the same in Tnet2 and Tnet3, is there any particular reason why TNServerInstance is a monobehavior?


And then replaced all the broadcast function handlers to handle the events directly (easy)

Now as per our discussion in this http://www.tasharen.com/forum/index.php?topic=14881.0 I have realized that the new Channels functionality solves the need for the rest of my Tnet 2 customization's and the next step will be to get back to the main Tnet3 code base with only the minor modifications noted above.

15
TNet 3 Support / Re: DataNode serialization limitations
« on: September 30, 2016, 11:50:21 PM »
Vexe writes some amazing code
Here is his serializable-dictionary

https://forum.unity3d.com/threads/finally-a-serializable-dictionary-for-unity-extracted-from-system-collections-generic.335797/

And in his github project vfw he has a more robust framework for all kinds of serialization

https://github.com/vexe/VFW

Pages: [1] 2 3 4