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

Pages: [1] 2
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 / 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.

3
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;
         }

4
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

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

6
TNet 3 Support / Coding Style Question
« on: September 22, 2016, 06:14:00 PM »
I was wondering why you make so much of the Client static ?

I am upgrading now and I prefer not to have a static TNManager or TNObject or TNLobby(s).

It is not too difficult for me to change it except that you are using TNManager.isPaused in the TNet/Server and I wanted to find a way to decouple the Server from the Client?

TNManager.isPaused is the only dependency in the TNet/Server


7
TNet 3 Support / "Connection Refused" packet.Error
« on: June 19, 2016, 11:31:10 PM »
I get a "Connection Refused" packet.Error when trying to create a LAN connection very intermittently, sometimes the connection works, sometimes I get this error.

I am curious as to what the cause of the connection refused packet.error could be???



9
TNet 3 Support / OnPlayerJoined
« on: March 21, 2016, 07:49:30 PM »
Player 1 is the host and Player 2 is the client for a LAN connection.

Does OnPlayerJoined only get called on the host or does it sometimes get called on the client depending on network timing?
Because sometimes the host is reporting OnPlayerJoined and sometimes the client reports OnPlayerJoined and I do not understand this behavior.

Is it possible that the Player 1 host which creates the GameServer and then joins the GameServer becomes  the client because of the rare timing of Player 2 joining the GameServer first?
So that it does not matter that Player 1 created the GameServer?
How can I ensure that Player1 is the host?

Also, the list of players seems to only includes the other player so it is always 1 even though there are 2 players in the channel the host and the client.

Should the host and the client both be in the list of players and should they be the same on the host and client TNManager?




10
TNet 3 Support / Hard coded multicastIP purpose
« on: November 25, 2015, 12:53:17 AM »
I am curious, I found this line in the UdpProtocol class

// Cached broadcast end-point
static IPAddress multicastIP = IPAddress.Parse("224.168.100.17");

Which is used here

IPEndPoint endPoint = mMulticast ? mMulticastEndPoint : mBroadcastEndPoint;


And I cannot understand why that IPAddress is hard coded? And what is it used for?


The bigger issue I am dealing with is that when I am running Unity Editor in iOS mode on my mac computer
and Unity Editor on my Windows 7 computer
then When the PC is the Host the Mac Client can connect
But when the Mac is Host the PC cannot find the Host.

That was when I have set
static public bool useMulticasting = false;
Based on your previous posts mention that iOS cannot use multicast

If I change it to
static public bool useMulticasting = true;
And change the Mac to android then PC android and Mac android can both host and client.

I found some weirdness for windows broadcast, I am not sure if it is related

https://social.technet.microsoft.com/Forums/windows/en-US/72e7387a-9f2c-4bf4-a004-c89ddde1c8aa/how-to-fix-the-global-broadcast-address-255255255255-behavior-on-windows?forum=w7itpronetworking

So I guess my second question is, is there a way to get Unity Editor PC running Android and Unity Editor MAC running as iOS to talk to each other properly on a LAN?

11
TNet 3 Support / il2cpp error on Disconnect
« on: November 18, 2015, 02:00:34 AM »
I am receiving this error when I try to stop a game server.

NotSupportedException: /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Threading/Thread.cpp(367) : Unsupported internal call for IL2CPP:Thread::Abort_internal - "Thread abortion is currently not implemented on IL2CPP; it is recommended to use safer mechanisms to terminate threads."
  at TNet.GameServer.Stop () [0x00000] in <filename unknown>:0
  at TNServerInstance.Disconnect () [0x00000] in <filename unknown>:0

Accoring to this post, it looks like unity is not going to support Thread.Abort
http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551/page-16

And according to this post maybe we can call interrupt instead?
http://stackoverflow.com/questions/3632149/question-about-terminating-a-thread-cleanly-in-net/3632642#3632642

Any suggestions on stopping a game server for ios il2cpp?

12
TNet 3 Support / iphone android connection problem
« on: October 22, 2015, 12:47:21 AM »
I am testing connectivity with Tnet 2.1.1 on a local lan

I run 2 projects one as iphone the other as android

Unity 1__________Unity 2
---------------------------------
Android__________Iphone
---------------------------------
Host :) __________Client :)
Client   cannot see   Host
---------------------------------
Android_________Android
---------------------------------
Host :)  _________Client :)
Client :) _________Host :)
---------------------------------
Iphone__________Android
---------------------------------
Host  is not shown to Client
Client :) _________Host :)
---------------------------------
Iphone__________Iphone
---------------------------------
Host :)  ________Client :)
Client :) ________Host :)



13
TNet 3 Support / Zeroconf and Bonjour
« on: August 03, 2015, 04:08:56 PM »
I was wondering if there is any plans for adding support for the Zeroconf protocol over Bonjour?
https://github.com/mono/Mono.Zeroconf

I was able to successfully get this asset running https://www.assetstore.unity3d.com/en/#!/content/14197
Although it is not worth the $ imho

I would like to use TNet with either this zeroconf bonjour system or make my own or hopefully you will add support for it in the future?

Ideally, I would be able to connect with the zeroconf system and then be able to "tell" Tnet about the connection and then be able to use the RFC which I already have.

Is this possible?

Once the computers know about each other and the protocol and ports to use etc, can I pass this information into TNET and then start using TNET from there?


14
I just updated xcode from 6.3 to 6.4 which then forced me to update my device from iOS 8.3 to 8.4 to even build unity anymore projects anymore.

Then TNet stopped being able to send CodeStage.AntiCheat.ObscuredTypes.ObscuredInt

Wait there is more, if it was 0 it sent a null which barfed right away so I tried sending 1
which sent but complained about the mismatched parameters.

OK so I changed to int and it all works BUT I would like to be able to send CodeStage.AntiCheat.ObscuredTypes.ObscuredInt
again as I was doing for the past year!

 [TNet] Failed to call TNO # RFC # on Script: failed to convert parameters
Expected args: CodeStage.AntiCheat.ObscuredTypes.ObscuredInt
Received args: System.Int32

15
TNet 3 Support / cron job to test server availability
« on: June 19, 2015, 04:33:50 AM »
I am looking for a way to test if a TNetServer is up and running, some kind of echo or ping I could send to the the TnetServer and get a response so I know if the server is up and running and receiving data or not.

Any one have any ideas about the best way to keep an automated system running which keeps tests whether servers are available?

Ideally, I would be able to use some standard shell commands to interface with TnetServer.

Pages: [1] 2