Search Unity

Master Server Framework

Discussion in 'Assets and Asset Store' started by alvyxaz, Sep 11, 2016.

  1. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    how to check the port and firewall on a ubuntu server?
    I have using the old version and the port 90-100 are working
    Also when i changes the ports to 90 its not working.
    My gameserver cant connect to the master server.
     
  2. icewiski

    icewiski

    Joined:
    Feb 25, 2017
    Posts:
    7
    thank you ,alvyxaz, great asset
    could you add a demo with UNET lobby manager in next version
    lots of the moba,rts ,top-down shooter,fight game,which multi part is based on unet will be easily to fit.
     
  3. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    have somone using this asset with a server ? Game server ?
    Master server?
    And its working ?
    Linux?
     
  4. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    used on linux headless and mac with graphic build for servers and it all works perfectly
     
    Liminal-Ridges likes this.
  5. Sorn

    Sorn

    Joined:
    Jul 17, 2013
    Posts:
    14
    I have to blunt here. If you're unable to look @ the code to determine what the problem is, you might be in over your head. This asset provides a very solid API over the uNet transport, but it's not magic and requires some level of familiarity with c#.
    This is what I would do:
    Insert a console log before the GS attempts to send it's registration packet to the MS.
    Insert a console log before the MS accepts said registration packet.
    Depending upon which, if either, of these dings, you should be able to pinpoint the problem further.
    @ this point, continue to scrutinize the code, adding logs or checks to see what may be the problem.
     
  6. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    and how you start your game server? what your commands?on the headless linux?
    its possible to start more master server on 1 vps server?
    And its possible that game server 1 connect to master 1 and game 2 to master 2.
     
  7. yumianhuli1

    yumianhuli1

    Joined:
    Mar 14, 2015
    Posts:
    92
    Hello!The QuickSetup demo is great.And where can i find the "Matchmaking"demo!Thank U!
     
  8. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Is there a concrete reason why this asset went from payed to Open Source / free?
    Not that I don't like that but I was pretty surprised when I saw it in the AssetStore yesterday.

    What will happen to support like for having questions / tips in configuring etc? I did not see @alvyxaz for quite some time in this thread anymore.

    Really looking forward to use this Asset as my main network solution for creating playerhubs and perhaps instanced worlds in the future.

    Cheers
    Ronny
     
  9. yumianhuli1

    yumianhuli1

    Joined:
    Mar 14, 2015
    Posts:
    92
    Yes,I also want to know the reason.^-^
     
  10. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    He is getting married, give him some time.
     
  11. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    good to now :)
    Hope he come back need really his help .
    Because every user that buy this asset for 50€ there is no support :/
     
  12. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    No support? I see people answering questions here, and also in the Discord chat, and also in the github issues list. This is a community supported package.

    It's open source. Come, join us, learn, and contribute.
     
  13. HiddenFace

    HiddenFace

    Joined:
    Feb 13, 2016
    Posts:
    12
    Hello, i am a buyer of the non free version, but i'm not angry ! I hope this asset will progress a lot.

    Just a request : is it possible to add an exemple with animation sync (with standard asset model maybe) and not only transform and rotation sync (cube). I think this could be useful.
     
  14. MrGky93

    MrGky93

    Joined:
    Feb 27, 2014
    Posts:
    281
    there is no soupport i was in the discord and there is no one that anweser my question :/
    Its only a simple question
    Why my game server cant connect to the master and its possible to run more master server on 1 vps server and its possible to connect to the right master server port ?
    But discord there is no Support my question was i think 3 days ago ?!!
     
  15. yumianhuli1

    yumianhuli1

    Joined:
    Mar 14, 2015
    Posts:
    92
    Yes,the animation sync need to be shown by making a demo!
     
  16. alvyxaz

    alvyxaz

    Joined:
    Mar 21, 2013
    Posts:
    103
    @Rayleigh2116 - I do provide support to those who paid for the asset. At the moment, I'm very busy and only help to those who provide a full report, with information about what they're trying to do, what doesn't work and what they've tried to fix it :)

    To anyone wondering -
    I avoid reading unity forums and PM's, so if you want to contact me - do it through GitHub page. Thank you!:
    https://github.com/alvyxaz/barebones-masterserver
     
    tequyla likes this.
  17. drewdough

    drewdough

    Joined:
    Oct 5, 2016
    Posts:
    57
    hi all,

    question - if we don't need to spawn a new game server for every single game (imagine a card game, where a single game would have 1 player vs 1 other player with turn based traffic), does this Master/Spawner/GameServer model still fit? It seems like it may be a lot of overhead to spawn a new instance of the Game Server process every single time someone plays a new game. I could be wrong though?

    The alternative design would be that a game server would host many actual games and keep track of which players are in which game. Is anyone doing this kind of design? Wondering if you ran into any headaches with UNet or your networking API with it?

    Thank you!
     
  18. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    I've been getting

    Failed to confirm access token

    Happening on and off during my server deployments. For example some of my users can connect and some can't getting this error. Can anyone shed some light on the possible causes?

    What i have found is that if a user can't connect then it deterministic-ally always doing that on their machine.
     
  19. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    I'm trying to use the new PostgresSQL plugin but getting the following error on attempted registration of username, password and email

    [Error | Logs] System.MissingMethodException: Method not found: 'Npgsql.NpgsqlParameterCollection.AddWithValue'.
    at Barebones.MasterServer.AuthModule.HandleRegister (IIncommingMessage message) [0x00248] in C:\Unity Projects\VirtuosoServer 0.4.4\Assets\Barebones\Msf\Scripts\Modules\Authentication\AuthModule.cs:442

    I have followed the setup procedure, creating the Postre SQL Db Factory into a new child game object under Databases. And removed the old one.

    Any ideas what it could be. I have installed postgres SQL on windows 10 and created the tables under my own database vgs_vlr_auth

    My connection string is Server=127.0.0.1;Uid=root;Pwd=vgsvlr;Database=vgs_vlr_auth;
     
  20. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    People on Discord dont answers, Alvydas dont answers even to paid customers.
    Is this project dead ? The average guys has no chance to use this tool at all as he will get no help.
    The 2-3 times i had answers, it helped me a lot to understand the framework, but to use it properly, i need more answers or a better documentation.

    BTW is this forum topic dead too ? Last time someone answered it was Alvydas one month ago...

    @Arcanor
    you say: "It's open source. Come, join us, learn, and contribute."
    I ask questions people like you would take 10 sec to answer and unlock the situation. so as @Rayleigh2116 said, it is very close to no support.
     
  21. lazalong

    lazalong

    Joined:
    Oct 13, 2009
    Posts:
    139
    Paradoks, read the first post which is saying:

    To anyone wondering - I avoid reading unity forums and PM's, so if you want to contact me - do it through GitHub page. Thank you!:
    https://github.com/alvyxaz/barebones-masterserver

    Also before using this Asset it could be worth for you to read this: Is This Asset For you?

    I am sure alvyxaz would love you to help him make this *free* asset more responsive.
     
  22. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    75
    Is possible to take all the MsfSecurity class and adapt to PHP ?

    In other words, how i can do the same PBKDF2-HMAC-SHA1 implementation in PHP ?

    All i need to know is the steps for encryptying new users passwords,for example:
    - Generate AES Key (Maybe this will work for PHP: http://www.movable-type.co.uk/scripts/aes-php.html)
    - Read Bytes / Create the _salt
    - Encrypt PBKDF2
    - Generate Final Hash (PBKDF2_ITERATIONS : base_64(salt) : base_64(hash))

    This is the steps i already "tracked down" but i really don't know how this working for real


    EDIT
    Solved my problem using this PHP Class: https://github.com/defuse/password-hashing
     
    Last edited: Jun 23, 2017
  23. xMikex

    xMikex

    Joined:
    Nov 3, 2013
    Posts:
    2
    Hello. Good Asset.

    But you need to add the code to the AuthModule.cs file:

    If (account! = Null && LoggedInUsers.ContainsKey (account.Username))
    {
    Message.Respond ("This User already logged!", ResponseStatus.Unauthorized);
    Return;
    }

    If the user is reauthorized in another client, then the authorization system starts to work incorrectly.

    So it will be correct:

    Action<IAccountData> finalizeLogin = account =>
    {
    if (account == null)
    {
    message.Respond("Invalid request", ResponseStatus.Unauthorized);
    return;
    }

    if (account != null && LoggedInUsers.ContainsKey(account.Username))
    {
    message.Respond("This User already logged!", ResponseStatus.Unauthorized);
    return;
    }

    // Setup auth extension
    var extension = message.Peer.AddExtension(CreateUserExtension(message.Peer));
    extension.Load(account);
    var infoPacket = extension.CreateInfoPacket();

    // Finalize login
    FinalizeLogin(extension);

    message.Respond(infoPacket.ToBytes(), ResponseStatus.Success);
    };
     
  24. DarHor

    DarHor

    Joined:
    Apr 14, 2014
    Posts:
    4
    It is possible to configure this kit to not lunch a game server ? Or to lunch game server on master server ?
     
  25. lazalong

    lazalong

    Joined:
    Oct 13, 2009
    Posts:
    139
  26. Kalle801

    Kalle801

    Joined:
    Mar 3, 2013
    Posts:
    80
    How do i add my scene to this pls?

    private void OnConnectedToMaster()
    {
    if (!Msf.Args.IsProvided(Msf.Args.LoadScene))
    {
    Logs.Error("A scene to load was not provided");
    return;
    }

    SceneManager.LoadScene(Msf.Args.LoadScene);
    }

    }
     
    Last edited: Sep 13, 2017
  27. Deleted User

    Deleted User

    Guest

    What are some learning resources for this framework?
     
  28. Broonee

    Broonee

    Joined:
    Apr 6, 2017
    Posts:
    3
     
  29. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    80
    Hey I already have database and authentication set up for my game, and am only going to be using MSF for one of the multiplayer features (it's a mobile game). How would I go about using my pre-existing authentication and user info from my database within MSF? Do I have to create custom Auth and Database modules?

    e.g. I don't want to handle registering and logging in (as that will already be done prior to accessing the master server), but I want to retrieve user data from my own database and use it within the game servers that msf will spawn (perhaps as profiles?)
     
  30. wonkathi

    wonkathi

    Joined:
    Jan 18, 2018
    Posts:
    1
    I'm reading the document. It seems to be great. Thank you so much bro, keep it up!!!!
     
  31. ANIMAPRO

    ANIMAPRO

    Joined:
    Nov 11, 2017
    Posts:
    5
    Hi
    Can I create game without rooms? I would like to have game when players after login go to scene with game without creating and choosing room. If I can do this, witch one demo I must use? I know how to programming UNET but I don't have good know about servers. I understand your demo with rooms but I don't know how to create "world game".
    For example: I would like to create high score in simple game. I created sqlite database on server and tables with score on clients but I done this on your "demo scenes" with creating rooms.
     
    Last edited: Jan 24, 2018
  32. ANIMAPRO

    ANIMAPRO

    Joined:
    Nov 11, 2017
    Posts:
    5

    Edit: It will be WorldDemo scenes?
     
  33. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    417
    Tried RoomsDemo using a windows build for the master, spawner and server and webgl for client and it doesnt work, says in webgl it doesnt support webgl, "webgl cannot use match maker", it seems this is the default unity message but actually doesnt work but if i use the windows build the client works
     
  34. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    417
    The game server crashes always after some time. The output log shows me :

    UnloadTime: 6.616401 ms
    System memory in use before: 15.2 MB.
    System memory in use after: 15.0 MB.

    Unloading 11 unused Assets to reduce memory usage. Loaded Objects now: 942.
    Total: 0.551090 ms (FindLiveObjects: 0.059784 ms CreateObjectMapping: 0.065660 ms MarkObjects: 0.396008 ms DeleteObjects: 0.027592 ms)

    Platform assembly: D:\Unity Builds\Cyberia 3\rooms_Data\Managed\Mono.Security.dll (this message is harmless)
    PlayerConnection accepted from [192.168.7.145] handle:0xa6c
    DynamicHeapAllocator allocation probe 1 failed - Could not get memory for large allocation 393216.
    DynamicHeapAllocator allocation probe 2 failed - Could not get memory for large allocation 393216.
    DynamicHeapAllocator allocation probe 3 failed - Could not get memory for large allocation 393216.
    DynamicHeapAllocator allocation probe 4 failed - Could not get memory for large allocation 393216.
    DynamicHeapAllocator out of memory - Could not get memory for large allocation 393216!
    DynamicHeapAllocator allocation probe 1 failed - Could not get memory for large allocation 393216.
    Crash!!!
    ERROR: Error while initializing dbghelp.dll, GetLastError: 'The operation completed successfully.' (Address: 00000000)

    ========== OUTPUTING STACK TRACE ==================

    ERROR: Error while initializing dbghelp.dll, GetLastError: 'The operation completed successfully.' (Address: 00000000)

    ========== END OF STACKTRACE ===========

    **** Crash! ****
     
  35. itsDrew

    itsDrew

    Joined:
    Aug 16, 2017
    Posts:
    32
    Any chance you figured out a fix to this? I've done the same thing. Have a VPS on amazon, I can connect and run the game with a windows client on my computer, I uploaded a webGL build to my site and am getting the same message. Though after looking at the console-log, I think it may be a CORS thing. I've got my site hosted in an amazon S3 bucket, will try to change some settings around and see if it works.
     
  36. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    I had no trouble connecting with WebGL (as of a few months ago.) My game and master servers are hosted on linode and the actual WebGL build is hosted on a cheap web host. So...probably not CORS unless you're missing something I somehow accidentally accounted for.

    You do have to start the server in WebGL mode. Rooms uses HLAPI, so you cannot connect to the same server with udp (standalone) and websockets (WebGL).
     
  37. itsDrew

    itsDrew

    Joined:
    Aug 16, 2017
    Posts:
    32
    Thanks for the response... I'm in the discord chat right now... I didn't use the rooms demo, used the quick-setup demo. How do I start the server in webGL mode? Any docs/reading material you can point me to? I'm pretty new in the world of networking. (Took me a month to wrap my head around client prediction. I have a game, but now need to figure out how to get it online). I still haven't had a chance to go through your how-to's on the wiki.
     
  38. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    -msfWebGl

    Replied on discord also
     
  39. itsDrew

    itsDrew

    Joined:
    Aug 16, 2017
    Posts:
    32
    For anyone having trouble with connecting to amazon virtual server...

    I had a lot of trouble with this, so i'll post it here in case anyone gets in the exact (lol) situation I got into.
    I tested MSF demo on an amazon EC2 instance with the demo and had it working fine when my security group allowed access to all connection types, all ports, all ips. Cool, but def not good for production. I made my own game, went through the same process as the demo, changed my security groups to the proper ports (1500-1600 and 5000 by default i believe) for custom TCP rules (WRONG!). Spent a day trying to figure out why my game would connect to master, load everything but at the final step when the game loaded, the client wouldn't connect. Wasted a lot of time messing with the framework thinking that something was wrong with the scripts when not using a demo (though I found that I learned a lot about how everything works by trying to Debug bugs that didn't exist). Ended up being my security groups. I changed them to TCP with the correct ports AND UDP with correct ports, and it worked immediately. This might have been obvious for an expert, but I tend to spend time in waters over my head. So, if that's you too, hopefully this helps.
     
  40. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    Oops. If you were running a WebGL server, you'd need the TCP ports open anyway, though.
     
  41. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Hello there, I have a few questions. This looks like an amazing framework so I am hoping it can do what I am after and and work with the things I am needing it to work with. I can't get the worlds demo to work for some reason though. I just downloaded it today, but am getting "Zone not found" error every time.

    That being said, I took the quick build from the menu, changed a few things so that it created a linux 64 headless masterserver and gameserver, I uploaded that to my server and was able to connect and then from another build i connected another copy and we joined up in a lobby. I noticed the actual game scene has its own network manager, does this mean I can use this Master-Server framework on top of uMMO so that I can utilize its Server-Authority network play (only sending commands to the server, and the server sends back your transform and syncs what is needed for mmo security)? If this is the case (which I really hope it is, this would be the best thing I have come across so far and will definitely use it!) since my game is a small scale mmo rpg (only a hand full of people at a time), will people be able to, say instead of going to a lobby go to a character creation / selection screen and create a character, pick a character name, save it to the data base and then load into a game that is using ummo's network manager and all of its plugin to handle movement and what not but have their character and name they created within the master-server framework's character creation screen? If so, since this is an rpg of course, and the player is playing the game, collecting items, doing quests and such, how do I go about saving this back to the master-server database if the player is using ummos network manager to actually play the game?

    Here is what ummo looks like, and what the "meat" of the system consists of (pics at bottom of post.)

    You just put the uMMO plugin into the scene that you want to become a multiplayer game, by default as a client, when you load the scene with ummo in it, you either select dedicated server, or type it in (or save in the inspector) and then it will connect to the server. In master-server framework, instead of there being a lobby or a "create server" option, right now I would only want a "join game" button which would put any client players all into the same game server (for now, while testing and while the game is small), but would be good as an administration panel of sorts so I could go in and spawn additional game server if necessary, and instead of lobbys, the clients would see game servers instead and they can pick which one they want. One for now is fine and then logging in with their created character name (for testing they would all have the same character prefab for now, I just want to get to this point first where I can make a character name, and load it into the game and have that character have a name, a level, etc, basic stuff for an rpg first and then build from that)

    Up to this point, does this sound possible?

    I wish I could get the "worlds demo" working to see how that works and if it might be something helpful to me, but I can't seem to get past the error below. Anyways, I do really hope that this will be able to help me accomplish what I am after.

    I currently use World Streamer which dynamically loads and unloads the game for the client to increase performance, but on the server side I believe I might need different server for different large zone areas and idealy be able to move between them seamlessly on the client side, which is pretty much the whole point behind world streamer, but one step at a time.

    Code (CSharp):
    1. [Error] [Error | Logs] Failed to enter the world: Zone not found
    2. LogAppenders.UnityConsoleAppenderWithNames()
    3. BmLogger.Log()
    4. Logs.Log()
    5. Logs.Error()
    6.  
    7. WorldDemoMainScene.<OnEnterWorldClick>m__0()    Assets/Barebones/Demos/WorldsDemo/Scripts/WorldDemoMainScene.cs:31
    8.  
    9. BasePeer.TriggerAck()    Assets/Barebones/Networking/Scripts/BasePeer.cs:356
    10. BasePeer.HandleDataReceived()    Assets/Barebones/Networking/Scripts/BasePeer.cs:383
    11. ClientSocketWs.Update()    Assets/Barebones/Networking/Scripts/ClientSocketWs.cs:177
    12. BmUpdateRunner.Update()    Assets/Barebones/Networking/Scripts/BmUpdateRunner.cs:53
    13.  






     
  42. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    To summarize, yes, you should be able to use MSF with uMMO.
     
  43. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Thanks, I actually got it working last night for the most part. The player didnt spawn, but I loaded a lobby and loaded a map via ummo, so that was a good start at least. Hopefully someone might know what is up with the Worlds Demo still though.
     
  44. ANIMAPRO

    ANIMAPRO

    Joined:
    Nov 11, 2017
    Posts:
    5
    I have problem with start game when I updated the same project on VPS
    for example:

    I have game "archery" with scores, archery.x86_64 is in root/archery on VPS, use screen in putty and line:
    ./archery.x86_64 -msfStartMaster -msfStartSpawner -spawnZones
    and everything works, connect and I can play game in Windows and Android

    Then I done some changes in Unity project (just one line) in scripts in scene with game (no changes in first scene when game is connect and spawn,

    export updated "archery" project

    I removed old archery project from server and copy new there
    and this time there is error with spawn zones

    when I paste first archery project zone works

    I tried to create archery2.x86_64 and copy this to new folder root/archery2 and it work but in test in Windows this second project work as first project on VPS - archery not archery2 (when I play there is no changes with I done) and I don't know why
    (in Unity I changed path to archery2)

    I tested updated project on localhost and it works correctly

    Edit: I think problem was with path to server. I wrote this slash \ not this /
     
    Last edited: Mar 16, 2018
  45. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Hello,
    This is using the Worlds functionality? Would it be possible for you to share the project (minus your own game, of course) so I can see how you have it setup? I kept getting errors and issues with "zones".

    Thanks!

    Edit------------
    Got it working. :D
     
    Last edited: Mar 17, 2018
  46. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Hey there,
    I just tried out the worlds demo and it is great. I did have a question on the feasibility of having seamless transitions between "zones". My game uses World Streamer to allow for a fairly large map size of 10240x10240 by dynamically loading and unloading the map around the player. The server was going to be setup into zones, probably 4 large ones for now to start out and test. I was wondering if it is even possible or what it might take to try and make it so there is no loading between the zones. I know it would somehow require a threshold in which the player would be connected to both servers and there would be a handoff of some sort in order to transition the player from one server to the next. My map is of course already tiled and each tile is its own mini scene pieced together by world streamer, but on the server side it is just static colliders in the same world space.

    If anyone has any information on if and how I could go about this, I would greatly appreciate it!

    Thanks,
     
  47. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    My game is split between a client and a server, both use the same scene name "_Game" but the server side is stripped down. All the demos use the same scene for both client and server. Does anyone know what is the minimum requirements for each? On the server side copy of the game I have my Unet network manager as well as the MSF prefab, which contains the gameroom, terminator, serverstarter, connector, and connection to master. What do I need on the client side version of the scene? I currently have my Unet network manager and connection to master. Should I use the same MSF prefab or can I get away with just specific parts of it? I would not see needing the terminator or server starter on the client side.
     
  48. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Has anyone happened to have developed a more sophisticated/extended feature chat module or anything by chance?
     
  49. angusmf

    angusmf

    Joined:
    Jan 19, 2015
    Posts:
    261
    Unlikely. I'd suggest doing chat separately anyway so you aren't running all that traffic through your master server, or at least reworking that module so it can run on its own server.
     
  50. alextoti33

    alextoti33

    Joined:
    Oct 8, 2017
    Posts:
    66