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

Pages: [1]
1
TNet 3 Support / Saving Entire Object Hierarchies with data node..!
« on: November 16, 2016, 04:48:58 AM »
hi.
I want to add some gameobject in my game a couple of month after release . i see there is option with data node to saving entire object hierarchies .
is that usable with android games ?

2
TNet 3 Support / Connection problem on VPS..
« on: August 04, 2016, 02:55:08 AM »
Hi . i run tnserver.exe on local and there is no problem even i see this on tnserver :

[2016/08/04 12:13:11] UPnP: Unable to open UDP port 5129
[2016/08/04 12:13:11] UPnP: Unable to open TCP port 5127
[2016/08/04 12:13:11] UPnP: Unable to open UDP port 5128

when i start tnserver.exe on a vps same messages appears but i cant connect to tnserver .
i turned off firewall and vps windows has upnp enabled. what is wrong ?

[Edit]
solved....

3
TNet 3 Support / Re: how to make a login system ?
« on: July 18, 2016, 10:43:34 PM »
I wouldn't make players email addresses visible to other players. There could be some privacy / security concerns in doing that.

I think what you're looking for is session management. TCP already does this, so why not identify players by their socket? But, if you really want to keep track of which email addresses are currently logged in, why not keep a server-side List<string> that's added to when a user logs in (and removed from when they log out)? Very, very important that it's server-side only. I'd suggest a full security audit before releasing your game, just in case. Users like to use the same email and password on multiple services, so you've got to handle sensitive information like that with great care, even if it is just a video game ;)
thanks for reply .
i am really care about security and i encrypted everythings that transports through network and i use encrypted version of everything even a simple health variable . i asked that as example . i wanted to use encrypted email address in my codes to make sure players wont login into game by same account at the same time.
i wanna my players can join the game from multiple device but not in the same time . can u show me an example of a server-side List<string> ?
If i could change Tnmanager.PlayerName for connected Player i can solve my problem but it doesn't change..

4
TNet 3 Support / Re: how to make a login system ?
« on: July 18, 2016, 06:13:42 AM »
I wouldn't do it like this.

I suggest adding a custom packet to the server that will send an encrypted password (never send raw passwords over the network!). Inside this packet handling on the server read the encrypted password (don't decrypt it!), read a file associated with the player (for example "Players/PlayerNameOrID.login"), and match the encrypted password to the contents of the file. If the file doesn't exist, then it's a new player. If the encrypted password strings don't match, the login fails.

For the encryption itself don't use some static key as anyone that gains access to the server-side file will then be able to decrypt the passwords. You can use the password itself as the key for encryption -- encrypt the password value with the key being based on the password value itself. This way no one will be able to retrieve the original password without actually knowing the password to begin with.
thanks for your support .
i made my own login system and it's working good and of course i did it by encryption.
now my question is how can i check if another user already logged in with same email and password ? i set players email as TNmanager.playername cause it's unique so i need to check if this player name already exist on the server (not in specific channel) .
1- how can i check how much players has playername "1@1.com" for example ?
2- is that possible to change TNmanager.playername for connected player ?

is there any better suggestion for this purpose ?

5
TNet 3 Support / how to make a login system ?
« on: July 13, 2016, 06:09:35 AM »
hi.
i am going to make a login system that stores all players login info into a dataNode file on server .
i tried to load that file in the login screen and read data to check if player entered user name and password correctly .
this process is ok .
to register new player i load the file and player enters required info and i check if it's not already exist then addchild to dataNode and parse everything then save the file again but with this process every player loads that file and save that file completely so think if players that register new user name increase then the size of the file increases more and more.
am i doing something wrong ? or is there any better way to make a login system ?

6
TNet 3 Support / Re: How can i check player data file saved ?
« on: July 12, 2016, 06:22:13 AM »
There's no need to check. All packets are processed in a sequence. What is it you're trying to do that you need to wait for the op to finish?
let me ask another question please. a player sets data and saves that in a file by using :
  1. TNManager.SetPlayerSave ("data box/data.dat"); //set player data save path
  2. TNManager.SetPlayerData ("data1", "my data value" );
  3.  
how can i access this data and read "my data value" in "data1" key ? i think i have to use :
  1. TNManager.GetPlayerData<string>("Path/to/node);
but how ?

7
TNet 3 Support / How can i check player data file saved ?
« on: July 10, 2016, 11:45:00 PM »
hi
i setting player data and save the file to server :
  1. TNManager.SetPlayerSave ("data box/data.dat"); //set player data save path
  2. TNManager.SetPlayerData ("data1", "my data value" );
  3.  
file writes on server but it take a little time . how can i check if this file creation finished on server ?

8
TNet 3 Support / Instantiate object !
« on: July 06, 2016, 06:09:24 AM »
hi .
I don't know why this code instantiate more than one object ? is there any problem with this ?
  1.  
  2. using UnityEngine;
  3. using System.Collections;
  4. using TNet;
  5.  
  6.         public class PlayBTNque : MonoBehaviour
  7.         {
  8.  
  9.                 /// <summary>
  10.                 /// Prefab to instantiate.
  11.                 /// </summary>
  12.  
  13.                 public string prefabPath;
  14.  
  15.                 /// <summary>
  16.                 /// Whether the instantiated object will remain in the game when the player that created it leaves.
  17.                 /// Set this to 'false' for the player's avatar.
  18.                 /// </summary>
  19.  
  20.                 public bool persistent = false;
  21.  
  22.         IEnumerator Start ()
  23.         {
  24.                 TNManager.JoinChannel (2, true, true);
  25.                 while (TNManager.isJoiningChannel) yield return null;
  26.  
  27.                 TNManager.Instantiate (2, "CreateAtPosition", prefabPath, persistent, transform.position, transform.rotation);
  28.                 Debug.Log ("Object created");
  29.                 Destroy (gameObject);
  30.                                
  31.                                         }
  32.  
  33.                 [RCC]
  34.                 static GameObject CreateAtPosition (GameObject prefab, Vector3 pos, Quaternion rot)
  35.                 {
  36.                         // Instantiate the prefab
  37.                         GameObject go = prefab.Instantiate();
  38.  
  39.                         // Set the position and rotation based on the passed values
  40.                         Transform t = go.transform;
  41.                         t.position = pos;
  42.                         t.rotation = rot;
  43.                         return go;
  44.                 }
  45.         }
  46.  
  47.  

Debug.Log ("Object created") prints in console just one time but more than one network object instantiates !.

9
TNet 3 Support / Re: TNserver does not open ports (no firewall)..!
« on: June 18, 2016, 06:06:26 AM »
TNet can only open ports if UPnP is accessible. If the router doesn't support it, or if there is no router, then the ports can't be opened. If the router doesn't support UPnP, you will need to forward ports manually. If there is no router, then you don't need to do anything. Since you mention that you turned off the firewall, it sounds like you don't need to worry about it.

The crashing was resolved with 3.0.2b. It wasn't a crash per say, just an uncaught exception that was only showing up on non-Windows platforms.
Thanx but what can i do now ? i am using my pc that is connected to my Office LAN and my laptop that has no connectin (no internet and no other network) but i still have the problem . my windows is 7 and i have enabled network discovery that i think enables UPNP .

10
TNet 3 Support / Re: TNserver does not open ports (no firewall)..!
« on: June 14, 2016, 06:41:53 AM »
It happens sometimes for me too but it resolves if i restart my router.
no this is not the answer...! did not worked.i run it local to test and what router do u mean ?

11
TNet 3 Support / TNserver does not open ports (no firewall)..!
« on: June 14, 2016, 02:30:18 AM »
hi Tnserver.exe does not open ports (i turned off firewall on my PC) and shows this :

No arguments specified, assuming default values.
In the future you can specify your own ports like so:

Local IPs: 1
  1: 192.168.1.25 (Primary)

[2016/06/14 11:49:56] Checking UPnP status on 192.168.1.25...
[2016/06/14 11:49:58] UPnP.WaitForThreads() took too long -- aborting.
[2016/06/14 11:49:58] External IP: 217.219.180.112
[2016/06/14 11:49:58] UDP Lobby Server started on port 5129 using interface 0.0.
0.0
[2016/06/14 11:49:58] Admins: 0
[2016/06/14 11:49:58] Bans: 0
[2016/06/14 11:49:58] Game server started on port 5127 using protocol version 20
160207
[2016/06/14 11:49:58] Loaded server.dat
[2016/06/14 11:50:00] UPnP.WaitForThreads() took too long -- aborting.
[2016/06/14 11:50:00] Press 'q' followed by ENTER when you want to quit.

[2016/06/14 11:50:01] UPnP Gateway: Not found
[2016/06/14 11:50:01] UPnP: Unable to open UDP port 5128
[2016/06/14 11:50:01] UPnP: Unable to open UDP port 5129
[2016/06/14 11:50:01] UPnP: Unable to open TCP port 5127

---------------------------------------------------
And when i try to shut it down it crashes..!


Pages: [1]