Run Multiple Dedicated servers

I am trying to make a social media app in unity (I know its not the best option to be using unity, but im most familiar with it and I don’t want to learn a new type of programming) The way the social media app will run will be that you can create a party where you can invite friends and post inside that party. My issue is im not sure how I can run so many parties as individual servers and how it will have to create a new server every time. Also im not sure how I could keep the server running if the host of the party leaves the app. If anyone could think of some type of a solution it would be a lot of help. Thanks!

There are two main types of models you can do. Client-Server is where YOU own a server that runs the software and people connect. The other method is peer-to-peer, which involves passing around the “hosting” responsibilities automatically until nobody is left in the room. IE if person 3 was hosting the room and left, everyone would then connect to person 2 instead.

Keep in mind that you can have multiple groups on one physical server. Most MMOs have multiple areas and instances of people grouped up, but they all connect to the same server. It just redirects traffic. So don’t think in terms of multiple servers. You will probably only have one, and then divide people up into groups ON that server.

This is a lot of networking stuff that you would need to learn. If you are hard pressed to keep to Unity it can definitely be done. Just a heads up, the time to learn all the networking code and do it through a game engine will take significantly more time than learning a few web languages and following the more traditional route.

I would suggest something like this:

  • Allow each user to join any number of “Parties”; this can be stored on the server as a list of party-names, along with the user’s name and connectionID.

  • Users may send a message to any party they have joined. (However you might choose to do UI for this.)

  • This message is sent to the server, containing the text of the message, but, the client will automatically add the name of the destination party (like a header). Note: you may need to do some “encoding”, for this, e.g. specify the message sent from client to the server will always be of the format:

    partyname|somecookydelimeter|the text of the message

(Or better yet, include this information in your MessageBase derived class)

-When the message is recieved, the server then finds all the logged on users, that have joined this party, and send the message to ONLY these users. (e.g. Rather than use NetworkServer.SendToAll, you can use multiple calls to NetworkServer.SendToClient )

-Expand on the concept to allow sending a message to multiple-joined-parties, at once. e.g.

 partyname|pdel|party2|pdel|party3|somecookydelimeter|the text of the message

(Or better, add a List/< string /> member to your MessageBase derived class.)