Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Cross.Net is now free, It will help setup unet and more

Discussion in 'UNet' started by LevonRavel, Aug 25, 2015.

  1. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    Hello everyone,

    Cross.Net is a mixture of Unet’s lower level network API, UPNP, Mysql Database and includes easy to use methods to get your game up and running.

    The key idea behind Cross.Net is to bring independent developers an affordable option for service hosting. With Cross.Net you can host many games in one database and list vast amounts of information for your lobbies.

    Setting up Cross.Net should not take you longer than 1 hour, within this time you should have a running LocalHost and client connection.

    Many hosting providers have a monthly fee ranging between ($50-180 USD) a month!! Cross.Net strips this and places the options into your hands. You can find a WebHosting service that prices anywhere between (FREE-$60 USD) a year. (This solution removes the CCU limits found on many providers sites.)

    Management: Once you upload Cross.Net’s php file to the site and setup a database, you can forget about managing as Cross.Net will handle the rest for you (setting up MySql will take about 10 minutes). That’s it!

    Cross.Net - NumbApple.Com
    Links are found at the bottom of the video tutorials...



    " Free isn't always what people want because a lot of people like to pay knowing there's paid support there, that they'll be able to get answers. With free, well you get what you pay for! " -
    hippocoder

    Unfortunately I do not mandate being paid to keep the project up or even to maintain it, I do however maintain the project due to donations, a professional stand point and I personally use it in ongoing projects. Also I do my best to answer any questions regarding Cross.Net I have had more then 20 emails with personal questions and I have replied to all of them.
    If there is something wrong with the project I do my best to fix any issues that are found. Remember I also use this solution so if I find an alternative that makes life easier the package becomes updated. I depend on feedback from everyone currently using CrossNet, without feedback I will never find all the bugs or issues.


    “Action speaks louder than words but not nearly as often.” - Mark Twain
    *Updates*


    (2015/08/30)
    Added a fix for crossnet. Some reason there was a bug that wouldnt allow the sqlentries to populate it can be found below the original download file. Just replace Crossnet.cs with the fixed one.


    (2015/09/11)
    I have had a few requests for an example to show how to save player data to a mysql database
    I uploaded a file to my website called Mysql player data storing example. Pretty long name but figured it should be descriptive.. Inside of the zip you will find a php file to handle the incoming data requests and the actual data script I took it from one of the games I am currently making. There is a few commentary lines to figure out what is going on if you need help please message me here or on my website

    (2015/09/13)
    *Thanks goes out to arcady87*

    With information that he will be providing we will now see a better crypto method for passing data to Mysql, You wanted more security and you will be getting it very shortly.

    (2015/09/14)
    *ax0079 from china has found that the UpNp script was not finding his router.
    In turn I will be working closely with his router and releasing a fix, I should be done in the next few days due to time differences.

    *virror has noted my house cleaning (haha)
    Whilst working on the UpNp fix I will clean up the warnings that have been left behind in the
    editor.

    (2015/09/16)
    *
    Conclusion on Upnp for router Model (MiWifi)
    This routers firmware will not support UpNp, after an update on ax0079 router we found that
    the manufacture had removed the UpNp functionality, which in turn leads me to believe that the router could not support this option. So if you have this router model I am sorry to inform everyone that UpNp is not possible. This test and code editing took about 6 - 8 hours the conclusion was drawn today.

    On a better note - Later today I will be releasing a new version with cleaned up warnings.

    (2015/09/17)
    House cleaning on the project has now been completed / uploaded, also while I was working on CrossNet I noticed that Mac's have a problem with socket.ShutDown. I revised the way the socket closes, now there should not be any problems with usage as the UpNp will actually complete its cycle..(I also merged the CrossNet fix into same package)

    (2015/9/25)
    DreamNetworking -
    The thread has been started here

    (2015/9/29)
    It has been a long time without reported issues I am going out on a limb here and saying that CrossNet (MYSQL) is finished without any issues. Thank you all who are participating in the project. It has been a long journey and cannot wait to start pushing CrossNet(Cloud) which in my opinion will be the cherry of networking.

    (2015/10/07)
    There is an issue with Windows Phones but I think this patch should clear things up for CrossNet

    Put this code in a Start Method and create a Playerpref then inside Crossnet.cs do a check to make sure the installation was completed before running anything else.. or you could even make a different scene called patch scene then run this patch there once its done Playerpref so the scene wont run again then load the CrossNet scene.

    Code (CSharp):
    1. using System.Diagnostics;
    2.  
    3.         Process installer = new Process ();
    4.         installer.StartInfo.FileName = "packagemanager";
    5.         installer.StartInfo.Arguments = "Install-Package Microsoft.Net.Http";
    6.         installer.Start ();
    this has not been tested yet so please if someone is willing to try it and see if the process starts that would be great.. also this should run in the background and unseen. If it doesnt work please reply either to this thread or my website under contacts.


    Best Regards
    Levon Ravel.
     
    Last edited: Oct 8, 2015
  2. arcady87

    arcady87

    Joined:
    Jul 24, 2013
    Posts:
    25
    @LevonRavel - hello! personally speaking i do not need this plugin. however i keep an eye on it with pleasure, it looks an impressive work! congratulations!

    you asked for bump XD now, you have my support!

    best regards
    -arcady87
     
  3. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    Thank you very much, I also sent a private message but figured there should be a post here also to let others know that I do actively participate in conversations. If everyone who downloaded it, could help fill me in on how its working out for them that would be amazing. Also if there is anything wrong let me know I will be more then happy to apply fixes to the asset, This is definitely not for my benefit as the package is free without any gotchas.

    Best Regards
    Levon Ravel.
     
  4. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    Crossnet has been updated once again please get the latest release from the site.
     
  5. Xuzon

    Xuzon

    Joined:
    Mar 21, 2014
    Posts:
    83
    Can you skip the 100 CCU that unity has right now with this?
     
  6. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    Yes there is no CCU as the Mysql will be the MatchMaker.
     
  7. Xuzon

    Xuzon

    Joined:
    Mar 21, 2014
    Posts:
    83
    And can you connect through NAT also?
     
  8. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    I would not see a reason you would need to as the port is forwarded through my UpNp script. Basically what happens is this, once the game is loaded the UpNp is initialized. If the script is able to find a router with UpNp enabled it will forward the ports in the router to what you have set for port and webport. If the script cannot find the router for any reason the hosting button should not be enabled as there is no means to open the port to allow connections to the host.
     
  9. Xuzon

    Xuzon

    Joined:
    Mar 21, 2014
    Posts:
    83
    Wow, great work, sincerely F***ing great work, maybe I'll use it, but if I use it you will get my donation!!!
     
  10. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    I really appreciate it, If you run into any problems please let me know so I can fix what ever is going on. There has been 50 downloads without any response so I am guessing its working out pretty well for everyone. Also I did forget to mention even if the UpNp cannot find a router to forward the client can still join games.
     
    Last edited: Sep 10, 2015
  11. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    543 views / 50 downloads for something that is free to use? So confused right now.. If I saw a networking solution that was placed here for free I would at least try it out. I even think the tutorials are in depth, wonder whats the problem? Well in any case thats my thought of the day.
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    1. Don't bump and delete your bumps. Mods see it. I understand in this case it made a lot of sense to gain noise for something free and good. But please add valid content with bumps.

    2. Free isn't always what people want because a lot of people like to pay knowing there's paid support there, that they'll be able to get answers. With free, well you get what you pay for!

    I commend what you are doing, I think its a great initiative so please keep it up. Hopefully more people will comment on it. But not everyone will bother leaving a reply unfortunately!
     
    LevonRavel likes this.
  13. jaybdemented

    jaybdemented

    Joined:
    Sep 2, 2013
    Posts:
    112
    So in theory i could use this with mysql on 000webs and have a completely free networking solution.
    Does this also come with a backend option for saving player data or is it just for connecting.
    I'm going to give it a try this weekend.
     
  14. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    Yes you can use 000web free hosting and get away with a free server. I can provide code on my website for and example on how to store user data.. The file on the web site will be called Mysql player data storing example, You will have to overview how stuff is being saved and then implement the data you need into it. I will need a few minutes to upload some files.

    Best Regards
    Levon Ravel
     
    Last edited: Sep 11, 2015
  15. sfoust

    sfoust

    Joined:
    May 18, 2011
    Posts:
    26
    This is super awesome sounding! I'm just now starting on a prototype for a multiplayer project. I'll definitely be checking out this project when I get to the point. Thanks for such an awesome looking setup (and donations will be coming at that time because amazing work need to supported and rewarded).
     
  16. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    Thank you, I have asked others if you find something that is not working the way it should please feel free to let me know what is not working. Right now I am trying to find other means to send packets from the client / host to the Mysql Database that way its a bit more protected. The usage will not change but the security will be increased.

    Best Regards
    Levon Ravel.
     
    Last edited: Sep 13, 2015
  17. ax0079

    ax0079

    Joined:
    Jul 3, 2015
    Posts:
    7
    Is crossnet must setup the upnp if you want to host a server. I have follow all the steps, it still not working. Nothing appear in the Database. Is it possible to connect with dedicated server?
     
  18. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    The answer to the upnp question is yes upnp must find a router with upnp enabled to host games, to join games the upnp process is not required. Also yes you should be able to have a dedicated server listed in the database although I wonder why you would want a dedicated server listed.. In your situation I would just forward the ports to the dedicated server and allow traffic that way.

    Do you have skype? my skype id is levon.ravel I can easily help you over teamviewer and will note what happened along the way as it might help others too. If you do not have teamviewer i can still guide you through it over a screencast..

    Best Regards
    Levon Ravel.
     
    Last edited: Sep 14, 2015
  19. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Looks interesting for sure, will have a look at the code, might be exactly what im looking for.
    Saving custom stuff seems quite complicated, might be worth looking into adding some kind of wrapper api for that stuff?

    Edit: Btw, you should remove Library folder from your zip, just taking up space : )
     
    Last edited: Sep 14, 2015
  20. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    Sure I can manage that, I will add that to my todo list.
     
  21. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Cool, seems like a nice tool!
    And please try to remove all the warnings as well : )
     
  22. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    Will do what were your warnings? could you do me a favor and post a screenshot so I can clean them up.

    Best Regards
    Levon Ravel.
     
  23. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Sent you a pm instead : )
     
  24. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    awesome, Thank you for the pm
     
  25. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    I have the new network solution almost completed and will be releasing it shortly, I am call it CrossNet Cloud my thread for the network solution can be found Here
     
    Dreamaster likes this.
  26. MartinGiaco

    MartinGiaco

    Joined:
    Jul 24, 2013
    Posts:
    11
    Hi Levon!

    We tried cross.net in one of our games, because we hoped we would have true cross-plattform compatibility (WinPhone!). Everything worked well, but as we tried to make a Windows build, we saw that cross.net uses system.net and other libraries, that doesn't seem to work with Windows builds. We should have looked earlier...all the work for nothing.

    Any chance we get your solution running on WinPhone and Windows Store?
     
  27. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    I was mentioning earlier that system.net was only for crossnets listener but its not i use it in upnp also.. I will check around see if theres a work around. At this point not looking good..

    **Edit..8:00am
    I found a work around but need to figure out how to run a command at the package manager..

    Install-PackageMicrosoft.Net.Http

    ** for now maybe you might be able to verify if it fixes the issue find package manager console and run that command.. if the game starts after you run this command I might be able to start the Process and run the command and playerpref that it has been completed. That way it wont keep running everytime the game starts.

    if this is ran from inside the game you will be good to go i need a bit to make it work and you will have to test it out as i do not have means to a windows phone. So im kind of going in blind right now.

    **Edit 8:26am
    put this code in a Start Method and create a playerpref then inside Crossnet.cs do a check to make sure the installation was completed before running anything else.. or you could even make a different scene called patch scene then run this patch there once its done playerpref so the scene wont run again then load the CrossNet scene.

    Code (CSharp):
    1. using System.Diagnostics;
    2.  
    3.         Process installer = new Process ();
    4.         installer.StartInfo.FileName = "packagemanager";
    5.         installer.StartInfo.Arguments = "Install-Package Microsoft.Net.Http";
    6.         installer.Start ();
    Besst Regards
    Levon Ravel.
     
    Last edited: Oct 7, 2015
  28. Linearch

    Linearch

    Joined:
    Apr 1, 2015
    Posts:
    33
    Hi,
    I know this is an old thread and you don't support CrossNet anymore, but maybe you're still willing to help. I'm trying the mysql tutorial (or should I go for crossnet tutorial first?). Host-ed is somewhat down, I can't open the cart page, it says 403 forbidden, so I tried 000webhost and hostinger. Well, the thing is, neither works. I clicked on "grab data" and get array index error. This happened because "getInfo" is empty. I did just like in the tutorial. Also copy-pasted stuff like you did, to make sure there's no typo. I didn't forget the '?'. The only thing different is the php data handler. I'm very unfamilliar with php and mysql, so I have no idea where did things go wrong.

    Thanks
     
    Last edited: Jul 17, 2016
  29. Linearch

    Linearch

    Joined:
    Apr 1, 2015
    Posts:
    33
    Ah, nvm. Turns out I haven't changed the host address from the PDO stuff.
    Your tutorial didn't say to change the host address yet it said not to edit anything below those you specified.
    Also, you put some variables in a quote, passing the literal variable name to PDO, I think.
    I'll play around with this. Btw is it always possible to join a game via 3G? You already said in your site that people can still join a game even though they can't host when they don't have upnp, but I just want to be sure.

    Thanks


    ===================

    Ok so I don't have upnp. People on the internet say that having upnp enabled creates a big risk, so it's safe to say that most people would have upnp disabled and they won't be able to host?
     
    Last edited: Jul 18, 2016
  30. LevonRavel

    LevonRavel

    Joined:
    Feb 26, 2014
    Posts:
    179
    Linearch, This solution has been depreciated by Playnet but.. Mobile can join any games hosted by someone behind a router. The issue with Crossnet is mobile networks dont use routers they use switches and you cant punch a hole in that. I am working on something called playnet which fixes all the issues mentioned here plus will have a ton of goodies. I will post back with a link to Playnet once its finished up. There will be a cost though :(

    -----------------------------

    Also yes upnp is an issue but 90 percent of routers come with it enabled, a normal consumer would not adjust the factory settings so i would say about 85 percent of routers will have upnp enabled and those who did adjust upnp would be able to resolve the issue and give back that 5 percent.