• 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 AndreasC · Jun 19, 2014 at 09:22 PM · networkingnetworkmasterserverhosting

Changing the custom master servers default port ?

Hey !

I've just downloaded the custom master server to host my multiplayer game with. But I don't want to use the default ports: 23466/50005 (Master Server/Facilitator). How do I change these ? Do I need to change these in Visual Studio ?

I haven't seen any documentation of this, so any answer is appreciated.

Thanks in advance !

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by DarKTower · Jun 20, 2014 at 12:01 AM

If you open MasterServer.h in Visual Studio, you will find this:

 #pragma once
 
 // Network packet types
 enum {
         // Master server messages start at 200, is reflected in the Unity message types
         ID_DATABASE_ROWID = 200,
         ID_MASTERSERVER_REDIRECT,
         ID_MASTERSERVER_MSG
 };
 
 static const int NATINDEX = 4;
 static const int IPINDEX = 9;
 static const int PORTINDEX = 10;
 static const int GUIDINDEX = 12;
 
 static const char* VERSION = "2.0.1f1";
 static const int DEFAULTPORT = 23466;

Change the last line there to the port you would like it to be. I am not as familiar with the Facilitator (As I just downloaded the MasterServer and looked at it myself the other day), but I assume it would be in about the same location.

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 Bunny83 · Jun 20, 2014 at 12:08 AM 0
Share

As far as i know the masterserver supports a commandline argument to change the port, but not sure. It's been a while since i worked with the master server ;)

edit
Just looked at my "old" $$anonymous$$asterServer source (version 2.0.1) there is the commandline switch "-p" which allows you to specify a port when you start the masterserver.

ps: try using "-?" as parameter ;)

avatar image DarKTower · Jun 20, 2014 at 12:20 AM 0
Share

Ah, and then there's that ;) But you would have to do that everytime you launch the $$anonymous$$asterServer, am I right? Unless my method doesn't work at all (I have not tested it in the slightest, so I have absolutely no idea if it does or not), they both could be used to the same effect. ;)

avatar image AndreasC · Jun 20, 2014 at 11:25 AM 0
Share

This works correctly, thanks :). But one thing more, I still wanna change the Facilitator listen port. So if anyone knows how to change that port, please respond.

avatar image FuzzyQuills · Aug 26, 2014 at 11:06 AM 0
Share

Try doing same instructions you do with masterserver: as far as I know, same switch, different software!

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

FPS drops to 30 when I use MasterServer.RegisterHost, WHY!? 1 Answer

Unexpected `MasterServerEvent.RegistrationSucceeded` on player connect/disconnect 1 Answer

Port not opening? 3 Answers

NAT Punchthrough failed 0 Answers

Is there any way a "Failed to Connect to Master Server" error can happen other than the master server being down? 0 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