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 madpoet0204 · Jan 25, 2013 at 05:12 AM · multiplayernetworkmasterservernat

Custom master server

I am able to connect to a master server using serverPort = 23466 and my MultiPlayer game runs nicely. I now want to host my own master server on my spare PC laptop. I installed the master server files provided by the very kind Riekelt found here: http://forum.unity3d.com/threads/144321-Pre-Compiled-Unity3D-masterserver!

But I believe my game is still using the Unity provided master server because when I shut down my pc which runs the master server, my game still connects.

The read me supplied with the master server installation states the following: MasterServer.ipAddress = "127.0.0.1"; MasterServer.port = 23466; Network.natFacilitatorIP = "127.0.0.1"; Network.natFacilitatorPort = 50005;

But in the star trooper demo, I only see a var for serverPort. Where would I define the other vars like IP?

Thx for any help!

Comment
Add comment · Show 2
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 madpoet0204 · Jan 25, 2013 at 02:10 PM 0
Share

So I pasted the following:

$$anonymous$$asterServer.ipAddress = "127.0.0.1"; $$anonymous$$asterServer.port = 23466; Network.natFacilitatorIP = "127.0.0.1"; Network.natFacilitatorPort = 50005;

in an Awake function in my $$anonymous$$asterServerGUI.js script and it compiled with no errors. I run the master server/facilitator on my pc laptop. Then on my mac, I build to my ipad2 and run the same project in the editor to test the master server connection of the game.

When I try to connect the games the console in the editor reports:

Failed to connect to master server at 127.0.0.1:23466

Could it be I need to enable/open ports on pc or mac?

avatar image madpoet0204 · Jan 25, 2013 at 04:17 PM 0
Share

i meant to post as comment..sorry

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Bunny83 · Jan 25, 2013 at 04:05 PM

It seems you don't know what 127.0.0.1 is. This IP will always address your own PC / Tablet / whatever. You need to host the masterserver on a real fix IP address so everyone connects to the same IP.

Comment
Add comment · Show 4 · 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 madpoet0204 · Jan 25, 2013 at 04:18 PM 0
Share

So now I installed facilitator and masterserver on my mac and closed my pc laptop for now. They run properly and I can see in the console that it connects by reporting connecting to connection tester at ....

connected to masterserver at ...... inco$$anonymous$$g host list...... then iget two errors failed to initialize network interface is the listener port already in use its not possible to register a host until it is running.

avatar image madpoet0204 · Jan 25, 2013 at 04:22 PM 0
Share

Does that mean it would never work with my current computer/network?

avatar image Bunny83 · Jan 27, 2013 at 03:48 AM 0
Share

Well, it seems you try to register your game at the masterserver before you actually called Network.InitializeServer on your server. There's not much we can say about that without seeing the code that produces those errors.

Btw, did you get those errors in Unity or in the $$anonymous$$asterServer console?

avatar image madpoet0204 · Jan 27, 2013 at 05:23 AM 0
Share

In Unity console. Thx Bunny!

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

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Setting up a Unity Masterserver - how to do it correctly? 3 Answers

How to solve networking issues? 0 Answers

NAT Punchthrough failed 0 Answers

are you sure the server can be connected to? 1 Answer

Multiplayer UNet doesn't use UnityEngine.Network anymore right? 2 Answers


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