Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Jeston · Sep 10, 2010 at 09:09 PM · networkingmasterserverpeer-peer

Is it possible to connect to two servers at same time?

To prelude, I am using Unity3D with primarily C#/.NET development.

And so we have a rather complicated design in our game concept, but the essence boils down to connecting to 2 different servers at the same time. There is a master server which manages players and does various stateless operations, and then there are client hosted matches (peer-peer). I would like to be pipe data to the master server while a client is connected to another client.

My guess is that the master server might have to be written as a dll / separate .net app? Any suggestions on approaching this architecture would be greatly useful.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by jashan · Sep 11, 2010 at 12:55 PM

With Unity's built-in networking, you cannot connect to multiple servers. That's one of the most severe limitations I see with Unity's built-in networking. The reason you can't connect to multiple servers is because the API provided by Unity simply doesn't provide entities for multiple servers (many of the method calls are static, so ... there can only be one). Of course, the advantage is that setting up networking is quite a bit easier for noobs (the kind that dreams of doing the next great MMO) - but that simplicity comes at the cost of flexibility (no MMO with Unity's built-in networking for now ;-) ).

MasterServer is a term that's used quite a bit in the context of Unity's built-in networking ... in that context, it's basically the server that matches clients with servers (it doesn't really do much "communication-stuff" ... just match-making).

However, as you're saying you're primarily doing .NET development, you are likely using sockets and in that case, you can do pretty much anything you like.

Be warned, though: When you're doing Web players (which is kind of likely), Unity 3 will add some security features that makes things a bit more complicated to set up. In particular, it might get pretty difficult to connect directly between different clients (peer-to-peer). This restriction doesn't apply to standalones, though.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by qJake · Sep 10, 2010 at 09:12 PM

If you're using Unity's networking, I have no idea. If you're rolling your own networking, of course you can connect to two servers at once, in fact, you can connect to as many servers as you want. For each server, just initiate a new TCP (or UDP) connection.

Without knowing the specifics of your networking setup, or what libraries you're using, I can't help you more. All I can say is that it's 100% possible, in fact, the concept that you could only initiate one TCP/UDP connection at one time is rather laughable.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by DaveA · Sep 11, 2010 at 01:24 AM

You could have that master server just be a LAMP or whatever you like, and send HTTP requests at it to record scores, no? My app talks to video servers, robotic control servers, the master server, and peers all at once. Using the WWW it's easy.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Penny · Nov 29, 2010 at 01:52 AM 0
Share

Hi Could you give some detail resolutions? I means using WWW to implement Peer2Peer resolution. I do the Peer2Peer using .NET socket, but on webplayer version, there is a security problem. I have no idea to do this with .NET Socket. Could you gimme some suggestion?

Penny

avatar image DaveA · Nov 29, 2010 at 06:06 PM 0
Share

Yeah, 3.0 introduced security. You need to put a small xml file on each server that you want to get info from. Pretty much the same as Flash. I got clues on this here: http://kb2.adobe.com/cps/142/tn_14213.html

$$anonymous$$y crossdomain.xml file looks like this:

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Master server list shows local (192.168...) IP 0 Answers

Unity networking tutorial? 6 Answers

How to pass values between networked players? 1 Answer

MasterServer with Unet ? 1 Answer

UDP Server Or Master Server 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges