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

Pages: [1] 2 3 ... 5
1
NGUI 3 Support / Re: Deleting and adding items to ScrollView - weird bug
« on: November 10, 2014, 02:17:06 AM »
I'm running into a similar (if not the same issue). I'm using OnEnabled() on my Grid gameobject to populate my scroll view with the most recent data. The first time I switch to the tab with the scroll view, everything is great. However, if I click on another tab (disabling the scroll grid list) and then clicking the scroll grid list again, multiple UIRoots are created.

Any idea what's up?

Thanks

2
TNet 3 Support / Re: TNet/RFC Debugging
« on: July 23, 2014, 09:17:06 PM »
I started working on this, but am having issues getting a basic connection going. It connects and then times out. Here's where I'm at:

  1. public class AdminMain
  2. {
  3.     static Thread mThread;
  4.     static GameClient mClient;
  5.  
  6.         /// <summary>
  7.         /// Application entry point -- parse the parameters.
  8.         /// </summary>
  9.  
  10.         static int Main (string[] args)
  11.         {
  12.         mClient = new GameClient();
  13.         TcpProtocol tcp = new TcpProtocol();
  14.         IPEndPoint endPoint = TNet.Tools.ResolveEndPoint("127.0.0.1", 5127);
  15.         tcp.Connect(endPoint);
  16.  
  17.  
  18.         mThread = new Thread(ThreadFunction);
  19.         mThread.Start();
  20.  
  21.         return 0;
  22.         }
  23.  
  24.     static void ThreadFunction()
  25.     {
  26.         for (; ; )
  27.         {
  28.             mClient.ProcessPackets();
  29.         }
  30.     }
  31. }
  32.  
  33.  

3
TNet 3 Support / Re: TNet/RFC Debugging
« on: July 22, 2014, 09:40:42 PM »
Awesome! Thanks.

As for the c# standalone server monitoring app, do we want to connect to the server as a client/player? Or do we want to create a modified server that tells us more info than the default one does?

I'm looking into the "connect as another player" design right now. Is this possible to do without any of the files in TNet/Client? (since those are all Unity dependent). Looks possible, but didn't know if there are any "gotchas" I should know about. For example, I was able to connect to a server using just TNTcpProtocol, but failed the verification since I didn't actually create a player and increase the static player count, etc.

What's the best approach?

4
TNet 3 Support / Re: TNet/RFC Debugging
« on: July 22, 2014, 06:58:53 PM »
For #3, I'm specifically talking about when the server tells the client to disconnect b/c the client sends a malformed packet. In this case I'd like to kick the user to my main menu screen. I assumed force closing the server gave me similar results on the client side. Is that gonna be the same thing?


5
TNet 3 Support / Re: TNet/RFC Debugging
« on: July 21, 2014, 10:20:43 PM »
1. I'm still a little confused on TNTcpProtocol. It's used on both the server and client, but what functions are used on which ends? ProcessBuffer, OnReceive, Close all seem to be Client side functions. It seems like the clients send a Disconnect request packet to the server in the Close function. Can you go into a little bit more detail on this script?

2. If I wanted to build a separate app to monitor the server, channels, players, player actions, would it be better to do it in Unity or create another c# script like the TNet server?

3. I'm noticing that OnNetworkDisconnect() isn't called when I have a client connected to the server and then I close the server. The Close() function is called in TNTcpProtocol, but the OnNetworkDisconnect() doesn't seemed to be fired. Is that by design? Or am I missing something.

4. Would having multiple clients running on the same machine cause issues? Since they are both sharing the same TCP port on the client?

6
TNet 3 Support / Re: TNet/RFC Debugging
« on: July 18, 2014, 08:08:09 AM »
I've been setting up my server only w/ the -tcp option. I thought udp packets were sent on a randomized udp port and the -udp option was for lobby server stuff?

7
If only the top TNObject's id matters, does TNet know which sub-tnobject game object to call the RFC on?

8
NGUI 3 Support / How to handle multiple in-game 3D UIs
« on: July 18, 2014, 06:16:53 AM »
Hey there,

I plan on having some for of NGUI UI above each player's avatar. However, I'm not sure the best way to go about this as it seems that every NGUI widget must be a child of the UIRoot object. Should I be using multiple UIRoots (I've read multiple places you don't recommend this)? Should I just update the UI positions manually while they are all a child a UIRoot?

Whats the best way to do something like this?

Thanks

9
TNet 3 Support / Re: TNet/RFC Debugging
« on: July 17, 2014, 08:19:54 AM »
I totally didn't realize I was in the TNTcpProtocol file...so not being able to throw out the packet makes sense.

Quote
That said, why would everyone get disconnected in this case? Only the player who sent the malformed packet should get booted.

1. If Player A sends out a malformed TCP packet to everybody, wouldn't everybody have to close the connection? I don't understand why the sender would be booted from the way the code is written. The Close() calls are in OnReceive and OnProcessBuffer(). Is there a way on the client to debug and see who the sender is and possibly what RFC it was trying to send?

2. Also, can you explain why we Close if if (bytes == 0) in OnReceive()?

3. More possible symptoms, that I thought were unrelated but you never know...

  1. Failed to call RFC VRC_EventDispatcherRFC._TriggerAudioSource: failed to convert parameters
  2.   Expected args: System.Int32, System.String
  3.   Received args: System.Byte[], System.Int32
  4.  

I understand that it says the passed params and expected params aren't matching up, but it doesn't happen all the time. I've checked and double checked to make sure our function params and RFC caller params are in sync.

4. Quick shower thought, could something be happening to TCP packets when a ton of UDP is being sent at the same time? At the time of the crash, we a number of TCP packets being sent on repeat (maybe not a good idea?) as well as all the voice UDP. I've know I've heard about issues using both TCP and UDP at the same time...

10
TNet 3 Support / Re: TNet/RFC Debugging
« on: July 16, 2014, 10:37:17 PM »
Ran into the same issue again tonight. We had 15 people all singing "Happy Birthday" and sending UDP voice every which way . Had a couple cases where the expected number of bytes is invalid, where we hit

  1. if (mExpected < 0 || mExpected > 16777216)
  2.  

and also ran into one where bytes == 0.

  1.         void OnReceive (IAsyncResult result)
  2.         {
  3.                 if (stage == Stage.NotConnected) return;
  4.                 int bytes = 0;
  5.  
  6.                 try
  7.                 {
  8.                         bytes = mSocket.EndReceive(result);
  9.                 }
  10.                 catch (System.Exception ex)
  11.                 {
  12.                         Error(ex.Message);
  13.                         Disconnect();
  14.                         return;
  15.                 }
  16.                 lastReceivedTime = DateTime.Now.Ticks / 10000;
  17.  
  18.                 if (bytes == 0)
  19.                 {
  20.                         UnityEngine.Debug.Log ("OnReceive called Close(true) 1");
  21.                         Close(true);
  22.                 }

It seems a malformed packet is being sent to all players, causing them to disconnect. Why do we call Close() in these cases of bad packets instead of just throwing the bad packet out?

Some other info, when everybody gets disconnected, the other player's do not leave the channel, I don't think. From my point of view in the game, everybody's avatar is frozen in the state they were in when everybody was disconnected (when the malformed packet is sent). When I exit the channel and rejoin the same channel (or even close the application and rejoin), everybody is still frozen in their last state. It's as if the player's were booted but never removed from the channel.

11
TNet 3 Support / Re: TNet/RFC Debugging
« on: July 09, 2014, 09:14:50 PM »
Just experienced a mass disconnect of all players in a channel. I managed to snag a log from one of them and figured out where Close() is called on the client by putting Logs everywhere. Logs printed in this order:

  1. ProcessBuffer called close(true)
  2.  
  3. OnReceive called Close(true) 3
  4.  
  5. Close called w/ notify: True
  6.  
  7. Received Packet.Disconnect from Server.
  8.  



Here are where those were printed.

In TNTcpProtocol.cs ~line 588 UnityEngine.Debug.Log ("OnReceive called Close(true) 3");
In TNTcpProtocol.cs ~line 617 "UnityEngine.Debug.Log ("ProcessBuffer called close(true)")


  1.        
  2. void OnReceive (IAsyncResult result)
  3.         {
  4.                 if (stage == Stage.NotConnected) return;
  5.                 int bytes = 0;
  6.  
  7.                 try
  8.                 {
  9.                         bytes = mSocket.EndReceive(result);
  10.                 }
  11.                 catch (System.Exception ex)
  12.                 {
  13.                         Error(ex.Message);
  14.                         Disconnect();
  15.                         return;
  16.                 }
  17.                 lastReceivedTime = DateTime.Now.Ticks / 10000;
  18.  
  19.                 if (bytes == 0)
  20.                 {
  21.                         UnityEngine.Debug.Log ("OnReceive called Close(true) 1");
  22.                         Close(true);
  23.                 }
  24.                 else if (ProcessBuffer(bytes))
  25.                 {
  26.                         if (stage == Stage.NotConnected) return;
  27.  
  28.                         try
  29.                         {
  30.                                 // Queue up the next read operation
  31.                                 mSocket.BeginReceive(mTemp, 0, mTemp.Length, SocketFlags.None, OnReceive, null);
  32.                         }
  33.                         catch (System.Exception ex)
  34.                         {
  35.                                 Error(ex.Message);
  36.                                 UnityEngine.Debug.Log ("OnReceive called Close(false) 2");
  37.                                 Close(false);
  38.                         }
  39.                 }
  40.                 else
  41.                 {
  42.                         UnityEngine.Debug.Log ("OnReceive called Close(true) 3");
  43.                         Close(true);
  44.                 }
  45.         }
  46.  
  47.         /// <summary>
  48.         /// See if the received packet can be processed and split it up into different ones.
  49.         /// </summary>
  50.  
  51.         bool ProcessBuffer (int bytes)
  52.         {
  53.                 if (mReceiveBuffer == null)
  54.                 {
  55.                         // Create a new packet buffer
  56.                         mReceiveBuffer = Buffer.Create();
  57.                         mReceiveBuffer.BeginWriting(false).Write(mTemp, 0, bytes);
  58.                 }
  59.                 else
  60.                 {
  61.                         // Append this data to the end of the last used buffer
  62.                         mReceiveBuffer.BeginWriting(true).Write(mTemp, 0, bytes);
  63.                 }
  64.  
  65.                 for (int available = mReceiveBuffer.size - mOffset; available >= 4; )
  66.                 {
  67.                         // Figure out the expected size of the packet
  68.                         if (mExpected == 0)
  69.                         {
  70.                                 mExpected = mReceiveBuffer.PeekInt(mOffset);
  71.  
  72.                                 if (mExpected < 0 || mExpected > 16777216)
  73.                                 {
  74.                                         Close(true);
  75.                                         UnityEngine.Debug.Log ("ProcessBuffer called close(true)");
  76.                                         return false;
  77.                                 }
  78.                         }
  79.  


In TNGameClient.cs ProcessPacket() case Packet.Disconnect  is hit.

Any idea what's going on?

12
TNet 3 Support / Re: TNet/RFC Debugging
« on: June 25, 2014, 11:13:54 PM »
Where would i want to look if everybody is disconnected from the server a few at a time and then a whole bunch of people get kicked? Does the server ever tell the client to disconnect? What about vice versa? When does this happen?

Ran into this issue again tonight w/ around 20 people in a channel. Happened after 30 minutes and then people couldn't even connect to server. Restarted server and all was well for about 30 minutes and then happened again. What could kick someone from server and then not let them reconnect?

And the worst part is I can't reproduce reliably...so i can't debug properly. So frustrating :(

13
TNet 3 Support / Re: TNet/RFC Debugging
« on: June 25, 2014, 09:46:27 AM »
2. I only need to worry about this when using UDP packets, yes? Will TCP be okay?

And thanks!

14
TNet 3 Support / Re: TNet/RFC Debugging
« on: June 24, 2014, 10:59:30 AM »
1. Will deleting the server.dat while the server is running cause issues? Or will I need to restart it?

2. This is bizarre. I've had this issue since I first got TNet and have finally found out what's going on. Let's say I'm syncing player's positions 15 times a second via UDP.
  • Player A is in channel A.
  • Player B is in channel B.
  • Player A moves 10m to left of where he spawned in channel A and joins channel B.
  • Player B is moved 10m to the left in channel B when Player A joins channel B.

What in the world is happening? It seems like the initial packets are over flowing from channel to channel.
Note: This only happens to the first player to join a channel and when other people join (usually only the second player to join).

UPDATE: After hours of debugging, I decided to include the channelID in the RFC call to update player position. Turns out, the very first packet in the new room is from the old channel. Do I need to call LeaveChannel before I call JoinChannel? I'm using the same packet ordering methods you use in your TNet Space Fighter Game kit.

Quick Fix: I kept the channelID in the RFC call and just ignored any packets where the packet's channel ID and TNMangaer.channelID didn't match.

3. Do saved RFCs from a player get removed when that player leaves the channel?

15
TNet 3 Support / Re: TNet/RFC Debugging
« on: June 24, 2014, 08:20:00 AM »
Does persistent data include any data in a non persistent room? I don't create persistent rooms either.

Although deleting it may actually be helping. I noticed when I pulled you repo to the server last night everything seemed to work smoothly, even when restarting the server script didn't help.

Pages: [1] 2 3 ... 5