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

Pages: 1 2 [3] 4 5 ... 7
31
TNet 3 Support / Re: Server Time Assistance
« on: August 09, 2015, 01:36:17 PM »
if you are not connected TNManager.servertime will be your localtime.  Otherwise it is from the server.

Attached is a demo.



edit: Execute your code when 'OnNetworkConnect' fires and it should display correctly.

This example is not working for me.  Nor is the one that I provided.  Even updating it with OnNetworkConnect.  At least it doesn't work on a Mac to a Windows 2008 remote server with a blank project with only NGUI and TNET.




As you can see, it is only displaying the local time even though the remote server time is three hours different.  Another note is the actual local time is 815, not 1815.

32
TNet 3 Support / Re: Server Time Assistance
« on: August 08, 2015, 02:27:24 PM »
Thanks.

  1. using UnityEngine;
  2. using System;
  3. using TNet;
  4.  
  5. public class MultiplayerEvents : TNBehaviour {
  6.  
  7.         public long currentServerTime;
  8.  
  9.         void Start() {
  10.                 currentServerTime = TNManager.serverTime * 10000;
  11.  
  12.                 TimeSpan onedayTicks = new TimeSpan (1,0,0,0);
  13.                 DateTime currentServerDate = new DateTime (currentServerTime);
  14.                 DateTime nextServerDate = new DateTime(currentServerTime + onedayTicks.Ticks );
  15.  
  16.                 print ("server date is " + currentServerDate);
  17.                 print ("next update date is " + nextServerDate);
  18.  
  19.         }
  20. }

This seems to display the results in the editor properly.  However, once I connect to a remote server the results still show the time on my local PC and not the remote server.  Would you have thoughts on this?

33
TNet 3 Support / Server Time Assistance
« on: August 07, 2015, 02:36:17 PM »
I'm looking to have random daily/weekly events.  I am thinking I need to check the time on the server so its consistent for all players. 

Would you have any example usage for TnManager.servertime?  I am getting some massive numbers with TnManager.servertime. Would you suggest this be the starting point in implementing something like this?

Any assistance would be appreciated.  Thanks.

34
TNet 3 Support / Re: Functionality Suggestions
« on: August 07, 2015, 02:28:58 PM »
3) Maybe make a list of players for each specific group.  Send a chat RFC to each player in the list.

35
TNet 3 Support / Re: Vehicle (Photon ---> TNet)Transfer Ownership
« on: July 28, 2015, 02:33:12 PM »
I change owners with vehicles as well.

Change this first in TNObject.cs:

  1. /// <summary>
  2.     /// ID of the player that owns this object.
  3.     /// </summary>
  4.  
  5.     public int ownerID
  6.     {
  7.         get
  8.         {
  9.             return mOwner;
  10.         }
  11.         set
  12.         {
  13.             if (mOwner != value)
  14.             {
  15.                 mOwner = value;
  16.                 Send("SetOwner", Target.Others, value);
  17.             }
  18.         }
  19.     }
  20.  
  21.     [RFC] void SetOwner (int val) { mOwner = val; }

Then you can use it something like this:

  1.         void SetNewCarOwner(int _newOwner) {
  2.                 tno.ownerID = _newOwner;
  3.         }

36
TNet 3 Support / Re: App is live! Neon Dance
« on: July 11, 2015, 02:07:36 PM »
It would be much easier to download.  With a download link  ;)

37
TNet 3 Support / Re: TnServer crashing
« on: July 04, 2015, 03:42:58 PM »
Remote server.  Windows Server 2008.

I haven't updated Tnet in awhile.  I am uploading all my builds back onto Steam shortly.  Hopefully, those issues go away.

38
TNet 3 Support / Re: TnServer crashing
« on: June 30, 2015, 04:07:43 PM »
I can't say I've ever seen that, but even if an error does occur in OnSend, the client will simply get disconnected and should never crash. Are you able to reproduce this easily? Make sure your TNet is up to date.

Its crashing daily.  The game is on Steam Early Access, so users are logging in every day and I keep having to restart TNserver.  I am on Unity 5.1.1f1.  Just updated TNet and NGUI and will report.

Let me know if you have thoughts on this.

39
TNet 3 Support / TnServer crashing
« on: June 29, 2015, 04:07:58 AM »
Unhandled Exception: System.InvalidOperationException: Queue empty.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resour
ce)
   at System.Collections.Generic.Queue`1.Dequeue()
   at TNet.TcpProtocol.OnSend(IAsyncResult result)
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
   at System.Net.ContextAwareResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr u
serToken)
   at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32
 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Any assistance?

Most recent version of Unity.

40
NGUI 3 Support / Current multiple resolutions
« on: June 24, 2015, 04:45:16 AM »
Most of my google searches yield information back in 2012 and 2013 in regards to multiple screen resolutions.  What is currently the best way to set up the GUI so it can cater towards multiple resolutions?

I made my GUI for iOS devices initially and it centered nice.  Now, on PC/MAC quite a bit of content is getting cut off.  I am hoping I won't have to redo the GUI entirely, but I can't seem to find some info on where to start/fix a GUI that will scale properly for different resolutions.

Advice?

41
TNet 3 Support / Network Usage
« on: June 23, 2015, 05:39:37 AM »
How do you monitor it?  Unity networking shows your stats in the editor.  And for iOS, Xcode shows your stats.

But for PC/Mac/Linux how do you go about viewing your network stats?

42
TNet 3 Support / Re: TNObject.RebuildMethodList ()
« on: May 06, 2015, 04:17:03 AM »
Yes, that would be a problem. You are modifying a list that TNet is iterating through.

Wait until Start(), wait a frame, or just disable the component. Don't destroy it so early on.

Fixed now.  :)

43
TNet 3 Support / Re: TNObject.RebuildMethodList ()
« on: May 04, 2015, 12:46:04 PM »
I only have one.

Line 424 for me is:

System.Type type = mb.GetType();

  1.         void RebuildMethodList ()
  2.         {
  3.                 rebuildMethodList = false;
  4.                 mRFCs.Clear();
  5.                 MonoBehaviour[] mbs = GetComponentsInChildren<MonoBehaviour>(true);
  6.  
  7.                 for (int i = 0, imax = mbs.Length; i < imax; ++i)
  8.                 {
  9.                         MonoBehaviour mb = mbs[i];
  10.                         System.Type type = mb.GetType();
  11.  
  12.                         MethodInfo[] methods = type.GetMethods(
  13.  

On a new import of TNET in a new project that line would be line 417.

I do destroy some MonoBehaviours.  For instance, I have an LOD system, that the main player doesn't need to use on itself, so I destroy it. Is that the problem?

44
TNet 3 Support / Re: Send RFC on exit
« on: May 02, 2015, 04:33:12 PM »
Thanks guys.  Those are good recommendations.  With that, I'm certain I'll be able to figure it out now.

Thanks again.

45
TNet 3 Support / Send RFC on exit
« on: May 01, 2015, 03:53:48 PM »
What's the best way to send an RFC call, say a player abruptly exits?

For instance, I have a vehicle that a character enters.  I send RFCs to update the other players with the characters info (animations, positions, is the car being driven, etc).  However, if the character just turns off the game instantly, I need him to send one last RFC to everyone letting them know that the player is not in the vehicle anymore, so the vehicle can still be of use to other players.  Otherwise, the players still think the player is in the vehicle and no one can use it.

Does this make sense?

Is there a way to send out RFC if the player abruptly quits?

Pages: 1 2 [3] 4 5 ... 7