Search Unity

[RELEASED] MultiOnline : multiplayer online kit - V3 now available

Discussion in 'Assets and Asset Store' started by VirtuElle, Aug 16, 2013.

  1. AlanPT

    AlanPT

    Joined:
    Jul 31, 2013
    Posts:
    32
    Thanks VirtuElle, that solved my problem (I thought some users would forget to change the number).

    For a simple mulituser online learning environment all that is needed is a username (which can be shown over the different users) and a chat. Having a lobby and multiple game choices and unique users are generally unneeded extras.

    I have a new problem now. I have somehow disabled the chat function. It is no longer showing up. I have reimported the gamechat prefab. Any quick ideas. Should it be pointing towards the camera's gui layer somewhere?
     
  2. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    You just have to put the prefab in your game scene, that's all. It doesn't work ?
     
  3. AlanPT

    AlanPT

    Joined:
    Jul 31, 2013
    Posts:
    32
    That is what I did, and it worked before yesterday. It is now only working for newly connected peers, not the player who hosted the initial game. The host can't even send or receive in the waitroom/lobby (though others can. Very odd, but not that important for me.
     
  4. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    That's very strange... What did you do exactly to "disabled the chat function" ? Did you remove some code ?
    Because in any way, the chat must work in the waitroom, so if it don't work correctly, you have probably do more than just remove the chat prefab.
     
  5. AlanPT

    AlanPT

    Joined:
    Jul 31, 2013
    Posts:
    32
    I'm not sure what happened, but re-adding a new chat prefab didn't solve it. I did get the message "Fixing invalid scene view ID Allocated ID: ..." at one stage but it has since left. I don't have any other errors or warnings.

    I am not after a solution, because this project is over. I thought it might be useful to note if it has happened to someone else.
    Thanks
     
  6. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Yes, that's the problem: I can't guess which lines you deleted, but I'm quite sure that you removed something in the waitroom or in a RPC function of MNetwork.
    That's why put back the chat prefab doesn't resolve the problem.
    So if you don't know which lines of code you deleted/changed, the only one solution is to re-install all the package.
     
  7. smokegun

    smokegun

    Joined:
    Dec 13, 2012
    Posts:
    170
    The login system doesn't work in the editor and also not in the webplayer. I get this error:
    "SecurityException: No valid crossdomain policy available to allow access"
    How to fix it?
     
  8. AlanPT

    AlanPT

    Joined:
    Jul 31, 2013
    Posts:
    32
    I have finished this project (finally). But I will definitely use this project in my next one. Thanks for your help.
     
  9. smokegun

    smokegun

    Joined:
    Dec 13, 2012
    Posts:
    170
    You can create a new project and inmport the package and replace the script in your broken projet??


    Help me please?
     
  10. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    When you build for webplayer, the WWW functions (used in MO) doesn't work if your webplayer is not on the same domain as the web pages called by these functions (for security reasons).
    That mean that a build for webplayer cannot work in editor (because the editor cannot be on your web hosting) -> if you want to test your game from the editor, you must build for "PC, Mac & Linux".
    So, about the webplayer, you just have to put your webplayer build in your web hosting (the same where you put the php pages of MO), and start the game from there, everything will work correctly.
     
  11. smokegun

    smokegun

    Joined:
    Dec 13, 2012
    Posts:
    170
  12. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Ok, first, did you check that your player is well register in your database (from phpMyAdmin, in users table) ?
    Put a Debug.Log() in MOServer line 116 like that:
    Code (CSharp):
    1.  
    2. if(www.isDone){  
    3.     string trimText = www.text.Trim();
    4.     Debug.Log(trimText);
    5.     string[] text = trimText.Split('|');
    And tell me if you have any message in console when you try to login.
     
  13. smokegun

    smokegun

    Joined:
    Dec 13, 2012
    Posts:
    170
    Thanks this worked.
    But i've got another thing.

    I wan't to use UFPS in multionline.
    You can walk en the others can see it.

    BUT: i've you pickup a weapon you see it but the others can't see you'r weapon and the weapons gots a network view how to fix it?
     
  14. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    You must also instantiate the weapon using Network.Instantiate
     
  15. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi there,

    MultiOnline V3.0 is coming soon, I hope you will enjoy it.
    I submitted it just now to the asset store team, so it will be available in few days.

    Main new features:
    - Friend list
    - Dedicated server option
    - Filters in game list
    - Player names display
    - Improvement of the settings configurable from inspector
    - Installation system for the MySQL table: that's now easier to install
    And all the code have been rewritten in order to make it more clear and easier to maintain.

    You can already try it from the online demo:
    - MultiOnline demo
    - MultiOnline dedicated server demo
    Note: you must open the game port on your router when you host game, else the players external to your network will not be able to join your game.
     
  16. dceevp

    dceevp

    Joined:
    Mar 4, 2013
    Posts:
    19
    when the version 3 will be ready?
     
  17. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    As say in my previous message, I submitted it to the asset store, so the new version is finished and it will be available soon as it is validated by the asset store team. It usually takes 2 to 3 working days.
     
  18. smokegun

    smokegun

    Joined:
    Dec 13, 2012
    Posts:
    170
    Where do i need to instatiate it? in the script on the weapon??? and on the start function or update?
     
  19. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    No, just in the place where the weapon is currently instantiated, instead the current instantiation function.
     
  20. nscyber

    nscyber

    Joined:
    Jul 14, 2014
    Posts:
    22
    hello,i can't join to my room

     
  21. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    - Have you well build the game with all the scenes ?
    - Have you well checked the box "Run in background" ?
    - Do you have any error message ?
     
    nscyber likes this.
  22. nscyber

    nscyber

    Joined:
    Jul 14, 2014
    Posts:
    22
    Ohhh, Thank you
     
  23. nscyber

    nscyber

    Joined:
    Jul 14, 2014
    Posts:
    22
    What is the difference between MultiOnline dedicated server and MultiOnline ?
     
  24. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    The dedicated server option is a new scene which will comes with MultiOnline in the new version (which will probably be available in few days). This scene will allow you to host a game without be a player, that was impossible with the current version of MultiOnline (except if you change the code).
    It will also always possible to let players host themselves the games, that's just a new option that you can use or not depending your needs..
     
    nscyber likes this.
  25. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
  26. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Look at the doc part 7.5:
    When you build for webplayer, the WWW functions (used in MultiOnline) doesn't work if your webplayer is not on the same domain as the web pages called by these functions (for security reasons).
    You just have to put your webplayer build in your web hosting (the same where you put the php pages of MultiOnline), and start the game from there, everything will work correctly.
     
  27. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
  28. kinghack

    kinghack

    Joined:
    Nov 30, 2013
    Posts:
    54
    I installed the new MultiOnline V3 and started up a dedicated server But it isn't showing up on the server list. however it it showing up in the database.
     
  29. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Ok, so the game is well register in database ?
    Even after the player has searched the list ?
    Check that it's not just a problem of filters (host type -> Server must be checked)
    Check also that you have well uploaded all the php files of the V3 instead once of the V2
     
  30. madskillzHD

    madskillzHD

    Joined:
    Jul 18, 2014
    Posts:
    4
    dude, when i did the video tutorial for V.2.0 and i started up the menu, it worked just fine, but i did the V.0.3 tutorial and when i went to the menu, no buttons, none, just the background, the dedicated server works fine but when i go to the menu it has all the menu scipts and stuff, but no buttons show up at all,,, help?
     
  31. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    That's very strange...
    Check first that you have the two menus checked in the inspector (MMenu and MOMenu) in the menu scene.
    If you have installed the new version in your current project, check that you have well deleted all the scripts and scenes of the V2, your problem may be a conflict some elements of the older version.
    You don't have any error message when you click on play ?
     
  32. madskillzHD

    madskillzHD

    Joined:
    Jul 18, 2014
    Posts:
    4
    OK yeah its fixed now, thank you for your help. BTW i love this asset, i would, and have, commend this to lots of people. thank you for this wonderful asset. you are very talented with scripting.
     
  33. kinghack

    kinghack

    Joined:
    Nov 30, 2013
    Posts:
    54
    The Use-Filters box is cheeked but no filter window pops up. But that's probably because there are no games showing up. I have had problems in the past with call interval on V2 but when ever I try to edit MOGame.class.php And replace

    if(mktime($value['lastUpdate_h'], $value['lastUpdate_m'], $value['lastUpdate_s'], $value['lastUpdate_mo'], $value['lastUpdate_d'], $value['lastUpdate_y']) >= time()-$callInterval){

    with

    } else {
    }

    It says login failed when I try login.
     
    Last edited: Jul 19, 2014
  34. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Hey how do i change the map on version 3, When i go into the waitroom script its not showing an option to change the map.
     
  35. madskillzHD

    madskillzHD

    Joined:
    Jul 18, 2014
    Posts:
    4
    go to MultiOnline folder, resources, MGamePerimiter and change the maps. hope this helps (=
     
  36. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Ok, if you just replace these lines by "else", it makes probably a php error (because that's not a right code), that's why the login doesn't work (if you have a php error somewhere in your code, the php codes don't work anymore)

    So, in MOGame.class.php, delete or put in comments:
    - The line 280:
    Code (CSharp):
    1. if(mktime($value['lastUpdate_h'], $value['lastUpdate_m'], $value['lastUpdate_s'], $value['lastUpdate_mo'], $value['lastUpdate_d'], $value['lastUpdate_y']) >= time()-$callInterval){
    - The lines 298 to 302:
    Code (CSharp):
    1.  
    2. } else {
    3.           // Else : delete the game
    4.             $array = array(':id' => $value['gameId']);
    5.            $this->prepare_exec('DELETE FROM games WHERE id=:id', $array);
    6.   }
    - AND, the line 339:
    Code (CSharp):
    1. if(mktime($value['lastUpdate_h'], $value['lastUpdate_m'], $value['lastUpdate_s'], $value['lastUpdate_mo'], $value['lastUpdate_d'], $value['lastUpdate_y']) >= time()-$callInterval){
    - And even the lines 357 to 361:
    Code (CSharp):
    1.  
    2. } else {
    3.           // Else : delete the game
    4.           $array = array(':id' => $value['gameId']);
    5.           $this->prepare_exec('DELETE FROM games WHERE id=:id', $array);
    6.   }
    ... There so now more code to put in comment, because the queries the search the games hosted by the players and by the servers are separated.
     
    Last edited: Jul 19, 2014
  37. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Yes, that's it.
    For more details look at the documentation part 4.2, it explains everything about this new gameobject MGameParameters.
     
  38. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Thank you, that's really nice !
    I'm glad you enjoy it.
     
  39. kinghack

    kinghack

    Joined:
    Nov 30, 2013
    Posts:
    54
    Yea that worked I can now see the games now Thanks.
     
  40. kinghack

    kinghack

    Joined:
    Nov 30, 2013
    Posts:
    54
    For some reason when another player joins the game the player isnt showing up on the hierarchy but still shows their name tags in game. And these are the errors that I am getting.

     
    Last edited: Jul 19, 2014
  41. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Is your host is a server ?
    If yes, you must build the .exe with all the other scenes, as show in doc part 3.5 - page 40.
     
    Last edited: Jul 19, 2014
  42. kinghack

    kinghack

    Joined:
    Nov 30, 2013
    Posts:
    54
    Thanks. My bad sorry for missing that part.
     
  43. kinghack

    kinghack

    Joined:
    Nov 30, 2013
    Posts:
    54
    I have a script where you press Space to Equip & Un-Equip the gun but it only shows on the player's screen who's doing it. How can I make it so all players can see when another player is Equipping and Un-Equipping?

    I tried doing Network.active

    public GameObject Gun;

    if(Input.GetKeyDown(KeyCode.Space)) {
    Gun.Network.active = !Gun.Network.active;
    }
     
  44. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    What it Network.active ? I don't know this attribut, I searched it in documentation, I found nothing about it.

    So your problem is that the other players don't see the animations played when a player equi his gun, is it right or it's something else ?
    If it's that, you must synchronize the animations accross the network, look at doc part 5.1 for that.
     
  45. kinghack

    kinghack

    Joined:
    Nov 30, 2013
    Posts:
    54
    I don't think Network.active is a real attribute but I was seeing if it would work.

    But the problem is the other players can't see when another players Gun game object is Enabled or Disabled.
    but i'm not sure what I add to make it update for all the other players.
     
  46. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Just use RPC function exactly as for synchronize the animations.
     
  47. kinghack

    kinghack

    Joined:
    Nov 30, 2013
    Posts:
    54
    So like have @RPC at the top of the function?
     
  48. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Yes, @RPC if you code in JS, or [RPC] if you code in C#.
    And you call it using NetworkView.RPC()
     
  49. fearlessneon

    fearlessneon

    Joined:
    Nov 8, 2013
    Posts:
    12
    I am considering on buying MultiOnline but i was wondering on the dedicated server can i have it so the dedicated servers are official servers and that's the only on that shows up on the server list and also can I make it were it will find a random official server session and join it.
     
  50. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    I'm sorry, but I didn't understand everything...
    With the dedicated server, you can have only one server if you want (you just have to create only one game using the dedicated server scene), in this case, only this one will appear on the list.
    And I didn't understand the second part of you question about find a random official server. You have the games list, and you can join a game/server, there is no random.
    You would like don't display the games list and just join a game randomly ?