Search Unity

Server Overseer - UNet Server Management

Discussion in 'Assets and Asset Store' started by Yukichu, Apr 14, 2016.

  1. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420

    So I was trying to make a MMO-lite for years and really liked how you could perform P2P functionality between service instances using uLink. Well, no one really supports uLink, and while their stuff works, it was becoming tedious for what I wanted.

    I needed each server instance to track who was online: add them when connected, remove them when disconnected, transfer them when they switched scenes. With uLink, I'd have to send an RPC from scene A to scene B, B then sends RPC to C and D, then C and D respond via RPC to B, and B responds via RPC to A. Brain can almost handle this when I have 4 scenes, but when I get more... brain... asplode.

    I decided this UNet stuff can't be that hard right? I'll use LLAPI and make it all sweet. Wrong. Eventually after sifting through a ton of documentation, more google searches than I'd like to mention, and a lot of experimentation... it's pretty much complete: the Server Overseer.

    I used HLAPI but not the parts that require your client/scene to be the same project. I currently have 3 different Unity projects (running different scenes) connecting to each other. The spaghetti RPC fun is replaced with a 'wheel and spoke' system where the Server Overseer is the center and respond accordingly, which also allows authoritative setup if it's something you desire.

    is this for everyone? Nope, probably not. Has it been tested on mobile? Nope. Will I test it on Mobile? Nope. It has the same limitations of standard UNet HLAPI so if that works, this will work. There is no extra magic involved.
    • Easy to Read Code
    • Well Documented
    • Authoritative
    • Limit Player Connections to All Hosts
    • Password Protect Master Server
    • Password Protect Hosts
    • Inter-Host Communication
    • Track Players in Each Host
    • Get Lists of All Players from All Hosts
    • Examples
    Example scenario:
    You have a lobby scene, town scene, church scene, and village scene.
    Each scene starts. As they start, they register with SO (Server Overseer, I've typed it too much by now)
    Player A logs in to Lobby.
    SO will check if he exists in other registered scenes.
    Okay, he's nowhere to be found, Lobby is notified, allows him to login.
    Player A is now registered to Scene Lobby.
    Player A moves to town scene.
    SO is notified and changes location scene to town.

    Well, the better magic comes in when you want Player A to send a message to Player B who are in different scenes. SO knows where they are and can send a PM/tell/whisper/whateverYouCallIt between them.
    • Does it have rooms? No, but they wouldn't be hard to add. Right now it works solely on the concept of 'hosts' and 'players'
    • Will I add rooms? Probably not because they aren't really the reason for this.
    • What is a room? Just a name for something. The 'hosts' are a connection per host, but you could, in theory, just create multiple hosts and pretend someone renamed 'rooms' in your brain to 'hosts'
    • Am I going to make a ton of updates? Probably not, it's mostly complete. The player PM thing needs a little bit of code to work and then it's about it.
    • Is this a good learning tool for HLAPI? For some parts of it. There's decent documentation, comments, and examples to check out.
    • Are I going to respond to my own post precisely every 3 days with an 'announcement' about how the price changed, there's a sale, no one was interested in the sale so I'm upping the price, hey look I got a review, look how much you need my code and you'd be stupid to not just give me free money. Nope.
    If you think it might help, it probably will. As stated, I know it's not for everyone in every situation. I went from trying to write 'multiple login protection' in about 8 different ways using Bolt / uLink / saving to database / etc. and this has finally made it work correctly for tracking multiple players across multiple scenes.

    Comments / suggestions / feedback / random chitchat, all welcome.

     
    Last edited: Apr 14, 2016
    ThinhHB and ElroyUnity like this.
  2. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Found an issue when trying to connect to a server that doesn't exist. Fixed it. Also, one example I apparently didn't have set up correctly. Fixed, submitted update. Made sure it still works with 5.2.2. It should work with stuff a little earlier, but the Networking stuff being so new... who knows, you're probably updating versions to resolve other networking issues anyhow.
     
    ThinhHB likes this.
  3. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Update is out. Love the turnaround time for updates lately, it's been great.
     
  4. vet-cat

    vet-cat

    Joined:
    May 29, 2013
    Posts:
    37
    great job!
     
  5. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Submitted update which adds the ability for client to request a list of all connected hosts. Pretty essential, can't believe I didn't have it there. Has an example too. Yay, happy holidays!
     
  6. Muhamad_Faizol

    Muhamad_Faizol

    Joined:
    Jan 21, 2017
    Posts:
    47
    Hi,

    I just found out about your asset. Copying from your asset page;
    "ServerOverseer is a 'MasterServer' built upon UNet HLAPI. It can be used for mobile, though it was intended for standalone Unity scene instanced to communicate with each other."

    Can you elaborate a bit more about "It can be used for mobile" feature? It would be awesome if you have some youtube videos to show it as well.

    Thank you.

    Cheers,
     
  7. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Heya. I don't make youtube videos, sorry. I'm sure they would be awesome, but for a 10 dollar asset, which honestly has made so few sales it will either be free/$2/$5 soon, just not worth making a video for.

    As for mobile, I state that it's in theory. It hasn't been tested. It should work, because it uses Unity's new native networking stuff, which all works on mobile. I haven't done anything strange under the hood that should prevent that; however, I haven't tested it and won't really support troubleshooting it.

    Honestly, if you want to try it out and decide if it's worth your money, drop me an email and I'll send you the package.
     
  8. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Made sure it works in Unity 2017, did just fine. Sales have been abysmal, so I just made it free.
     
  9. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Well, submission accepted. I see I got a totally crap review a month ago, maybe that's why there's no sales. Ah well, whatever. It's free now. Hope someone finds it useful.
     
  10. Minemega_19

    Minemega_19

    Joined:
    Mar 5, 2015
    Posts:
    11
    It's a really great asset ! Thank's you !
     
  11. Yukichu

    Yukichu

    Joined:
    Apr 2, 2013
    Posts:
    420
    Glad someone likes it :) Probably even better now that it's free!
     
  12. shindig82

    shindig82

    Joined:
    Dec 30, 2015
    Posts:
    5
    just got this error when i tried running the server example scene, am i doing something wrong...

    NetworkManager detected a script reload in the editor. This has caused the network to be shut down.
    UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()