Search Unity

uMMORPG Official Thread

Discussion in 'Assets and Asset Store' started by mischa2k, Dec 29, 2015.

  1. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    Thank you for the new Update Vis, all works like magic, very nice I play around the Database.sqlite file and I can banned or modify any character password in the easy way as possible. You are a genius. Keep the very nice work
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress: PBKDF2 password hashing is done. Only took 8 lines of code, so that's good.
    Working on the item mall system now.

    That looks very good! Great to see a german game come out of it :)
    Please keep sharing your progress, this is very motivating for all of us.

    You are welcome. Great to hear that people like SQLite.
     
    Last edited: Jan 27, 2017
    Zhenite and camta005 like this.
  3. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    I have question, I create account and make 2 characters and erase 1 and I see in the data base that register this delete character but how I can restore this character if the people erase by mistake?
     
  4. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Just put a '0' into the deleted value in the database. If you use the sqlite browser then you can just type into the field. Otherwise you can also run a SQL query like
    Code (CSharp):
    1. UPDATE characters SET deleted=0 WHERE name='someone'
     
  5. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    wow this is so nice database, Im glad that you make this happened choose the easy data base for the project, :)
     
    mischa2k likes this.
  6. bartuq

    bartuq

    Joined:
    Sep 26, 2016
    Posts:
    127
    Hey @vis2k, I added another command for GameMasters. Looks like is working but I would like to ask you it is ok in this way as teleport - player.transform.position or I need use something with agent?

    Ok, it need be with player.agent.Warp(_player.transform.position); to work correctly. Another problem it's not working from client site :/

    PlayerChat.cs
    /teleport player name

    public class PlayerChat : NetworkBehaviour
    Code (CSharp):
    1. [SerializeField] ChannelInfo chanTeleport = new ChannelInfo("/teleport", "", "", Color.cyan);
    public string OnSubmit(string s)
    Code (CSharp):
    1. else if (s.StartsWith(chanTeleport.command)) {
    2.                 // teleport
    3.                 var user = ParseGeneral(chanTeleport.command, s);
    4.                 if (!Utils.IsNullOrWhiteSpace(user))
    5.                 {
    6.                     if (user != name)
    7.                     {
    8.                         lastcommand = chanTeleport.command + " " + user;
    9.                         CmdMsgTeleport(user);
    10.                     }
    11.                     else print("cant teleport to self");
    12.                 }
    13.                 else print("invalid teleport format: " + user);
    Code (CSharp):
    1. [Command(channel = Channels.DefaultUnreliable)] // unimportant => unreliable
    2.     void CmdMsgTeleport(string playerName) {
    3.         // find the player with that name (note: linq version is too ugly)
    4.         foreach (var entry in NetworkServer.objects) {
    5.             var _player = entry.Value.GetComponent<Player>();
    6.             if (entry.Value.name == playerName && _player != null) {
    7.                 player.agent.Warp(_player.transform.position);
    8.                 Debug.Log(_player.transform.position);
    9.                 return;
    10.             }
    11.         }
    12.     }
     
    Last edited: Jan 27, 2017
  7. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    hello I try to build
    Headless Mode

    https://gyazo.com/da9d71d6061a44edd364d8e5cdbf6c32

    but I dont see the Option Im using Mac computer any tip? can i do this on mac? or should I need a Linux operating system?
    I all ready rent the VPS withDebian 7 (Wheezy) (64 bits) distribution (linux)
     
  8. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Could be many things. Break your code down into smaller functions and don't do too much at once. Then use Debug.Log to see at which point it fails. For example, add debug messages in the command to see if the server actually reaches. Add messages to see which player name passed, which position was used, etc.

    Yes headless mode only works for Linux. Windows has batch mode, but that's not as good.
     
  9. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    So i need have a Linux computer to build the Headless Mode?
     
  10. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    and install all the unity software and all stuff?
     
  11. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You can build it from Mac too. Just select 'Linux' as Target Platform, then select headless.
     
  12. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    https://gyazo.com/da9d71d6061a44edd364d8e5cdbf6c32 but how I do that? I dont get the option thats why I show the image, dont let me change the Mac operating system, do you think the problem is because went I install unity I dont install the linux Option?
    Sorry for too many questions, but I never build out of mac system, I install the optional systems, and I think for each distribution of the client from my project I need build one for each system right?
     
    Last edited: Jan 27, 2017
  13. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Yes, you have to select the additional linux platform option when installing.
     
  14. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    /Users/jl/Desktop/headless.x86_64.zip root@149.56.15.218:~/headless.x86_64.zip
    -bash: /Users/jl/Desktop/headless.x86_64.zip: Permission denied
     
    Last edited: Jan 27, 2017
  15. MHolmstrom

    MHolmstrom

    Joined:
    Aug 16, 2012
    Posts:
    115
    All randomly this happened, Just hit play and last time I had no problem, also reimported the Dlls
    Code (CSharp):
    1. DllNotFoundException: Assets/uMMORPG/Plugins/sqlite3_x86/sqlite3.dll
     
  16. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Check the uMMORPG documentation, the solution is explained there.

    Probably a wrong configuration. That should all work fine with V1.56.
     
  17. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @vis2k

    According to dotnetperl https://www.dotnetperls.com/for-foreach their benchmarks show that For loops are a tad faster than Foreach when an array is accessed once which the SavePlayers does, i tried the following changes using StartCoroutine() and found that it almost removes the tiny jerky feel for every save performed:

    Code (CSharp):
    1.     void SavePlayers() {
    2.         var players = (from entry in NetworkServer.objects
    3.                        where entry.Value.GetComponent<Player>() != null
    4.                        select entry.Value.GetComponent<Player>()).ToList();
    5.         StartCoroutine(CSMany(players));
    6.         if (players.Count > 0) Debug.Log("saved " + players.Count + " player(s)");
    7.     }
    8.     IEnumerator CSMany(List<Player> players) {
    9.         Database.ExecuteNonQuery("BEGIN"); // transaction for performance
    10.         for (int idx = 0; idx < players.Count; idx++) {
    11.             Database.CharacterSave(players[idx]);
    12.             yield return 0;
    13.         }
    14.         Database.ExecuteNonQuery("END");
    15.     }
    PS. This is from a full client/server build, i noted CPU spikes before the above change, after the above change CPU spikes subsided.

    Tested on Ubuntu 14.04 uMMORPG v1.55 Headless Server with a 5400rpm HDD 4Gig RAM DUO Core Intel CPU (I figured if it runs well on a low end server, there should be no issues on a modern day server!)

    -J
     
    camta005 likes this.
  18. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    There's no more spike because you use a coroutine. It saves one character per Update tick (which is not secure by the way).
     
    Natalynn likes this.
  19. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Yep your absolutely right, i noted it after more testing and noted if i have 100's+ entries and server "happens" to die the chances of coroutine not saving properly since as you said its per tick!.

    On a separate note, i use both Gaia and World Creator for my terrains and i noticed ever since the switch in Monster.cs EventMoveRandomly() without Utils.RandVec3XZ() my monsters will not move, after some testing turns out in terrains with different heightmaps
    Code (CSharp):
    1. var circle3D = new Vector3(circle2D.x, start.y, circle2D.y);
    the above start.y being added to the agents.destination to start+circle3D again caused the path to return invalid, after i changed start.y back to 0f to keep the original start
    Code (CSharp):
    1. var circle3D = new Vector3(circle2D.x, 0f, circle2D.y);
    My monsters now move correctly on any map i generate with either Gaia or World Creator.

    ** Not sure if its a bug, but certainly made a difference in my project.

    -J
     
    camta005 likes this.
  20. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    Please help I follow the step by step guide and I cant install the headless file i did this
    first I log in in my VPS then I try to install the file
    scp /Users/luis/Desktop/to/headless.x86_64.zip root@149.56.15.218:~/headless.x86_64.zip

    root@149.56.15.218's password: here I add the password and then show that comment

    /Users/luis/Desktop/to/headless.x86_64.zip: No such file or directory

    root@vps115079:~#

    I dont know what can I do help guys please.
    PS. Im 100% that the file is in that location because I drag the File to the terminal and show that Path. so :(
    http://pastebin.com/ukmJQWMU
     
    Last edited: Jan 27, 2017
  21. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    Sorry for ask again but, I try diferent commands and still can't install the zip file, the guide step by step is not working , so do I have to try filezilla, to accomplish the install the zip file or what you recommend? I try diferent distribution from Linux in the Vps server and all are the same.
     
  22. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Is the Item Mall an in-game item mall? If so that's awesome :). Also I hope there is a paid currency, such as you buy uMMORPG Points with real money on the website, then you can use this new currency on the item mall. This how most item malls at least.
     
  23. gigz09

    gigz09

    Joined:
    Jun 6, 2016
    Posts:
    14
    I think you are invoking the scp in your vps through ssh not in your local machine where your headless.x86_64.zip is.
    If you are using windows machine, try winscp (https://winscp.net/) or in linux, just open the terminal.
     
    mischa2k likes this.
  24. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Reworked the Banned Column in the Database. It's now been changed to Rank. This allows you use the same column for Administrator, Moderator, Banned and Player. This way it's all in one column and not a whole new one. Maybe in the future, @vis2k can have something like this by default.

    Code (csharp):
    1.  
    2. Rank List:
    3. - Admin: 3
    4. - Moderator: 2
    5. - Banned: 1
    6. - Normal: 0
    7.  
    Open up Database.cs and Replace IsValidAccount with the method below:
    Code (csharp):
    1.  
    2.     // account data ////////////////////////////////////////////////////////////
    3.     public static bool IsValidAccount(string account, string password) {
    4.         if (!Utils.IsNullOrWhiteSpace(account) && !Utils.IsNullOrWhiteSpace(password)) {
    5.             var table = ExecuteReader("SELECT password, rank FROM accounts WHERE name=@name", new SqliteParameter("@name", account));
    6.             if (table.Count == 1) {
    7.                 // account exists. check password and rank status.
    8.                 var row = table[0];
    9.                 return (string)row[0] == password && (long)row[1] != 1 || (long)row[1] == 2 || (long)row[1] == 3;
    10.             } else {
    11.                 // account doesn't exist. create it.
    12.                 ExecuteNonQuery("INSERT INTO accounts VALUES (@name, @password, 0)", new SqliteParameter("@name", account), new SqliteParameter("@password", password));
    13.                 return true;
    14.             }
    15.         }
    16.         return false;
    17.     }
    Under the Static Database() and go to the end of the method and change the Query to:
    Code (csharp):
    1.  
    2.             ExecuteNonQuery(@"CREATE TABLE 'accounts' (
    3.                                'name' TEXT NOT NULL PRIMARY KEY,
    4.                                'password' TEXT NOT NULL,
    5.                                'rank' INTEGER NOT NULL)");
    6.  
    Add the method below:
    Code (csharp):
    1.  
    2.     //Check the status of your account before proceeding.
    3.     public static bool AccountStatus(string account) {
    4.         var u= ExecuteReader("SELECT name, rank FROM accounts WHERE name=@name", new SqliteParameter("@name", account));
    5.         if (table.Count == 1) {
    6.             var row = table[0];
    7.             Debug.Log("Your rank:  " + (long)row[1]);
    8.             return (long)row[1] == 2 || (long)row[1] == 3;
    9.         } else {
    10.             Debug.Log("Cannot check Account Status.");
    11.             return true;
    12.         }
    13.     }
    Open up PlayerChat.cs and add the test command:
    Code (csharp):
    1.  
    2.             //This is just an basic command; This should check the rank so it works for all staff.
    3.             if (s.StartsWith("/test") && Database.AccountStatus("admin")) {
    4.                 AddMessage(new MessageInfo("[System]", chanLocal.identifierIn, "You are part of the Staff Team.", "", chanLocal.color));
    5.             } else {
    6.                 Debug.Log("You're not an staff.");
    7.             }
    8.  
    Enjoy :).
     
    Last edited: May 23, 2017
    camta005 and mischa2k like this.
  25. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Good morning.

    Thanks for letting me know, I will take a look.

    The short and unsatisfying answer is that you have to get comfortable with a terminal. There are a lot of great youtube tutorials that explain the basics like ls, cp, etc. Once you understand them, you will be able to navigate around a server via ssh very easily.

    Yes, a real item mall with item mall currency that you can buy on a website. And the whole CMS/payment provider/server integration to make it work. The difficult integration part is almost done too.

    Note that I am not yet sure about how I will make this feature available. The solution will be very simple, but only because more than a year of research went into it. People will be able to just follow the setup guide and make real money from day one. Giving it out for free seems kind disproportionate.
     
  26. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    I assume it's going to be an entirely new asset on the store? If so, how much will this stuff cost. Though It's not really needed for me at the moment, till all the unity networking issues are fixed on there side and have a solid test of what everything can handle and with the Unity Simulation Server.

    Though once all this stuff is done and have players in the game, that's probably when I'd go out and purchase this to have.
     
  27. GOLDY00

    GOLDY00

    Joined:
    Mar 16, 2013
    Posts:
    139
    I'm wondering for people that have gotten the whole thing working with a. Online part to play with friends can some 1 do a video please I tried tutorials on the document I don't get it I just a simple dumb down version port forward blah here build 2 builds one is this and that etc etc I have Anna try to do this I'm so excited for all these updates they are mint don't get me wrong but only thing is the part of this is to get it online so please help anyone by saying go lol here or find it on tutorials doesn't help I can figure most stuff out with this package and that's why I love it just not this part thx in advance
     
  28. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    I am not sure yet.

    I have a UNET server hosting tutorial on my website: https://noobtuts.com/unity/unet-server-hosting
     
  29. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    Hi Guys,
    i'm still confusing after updating my Unity to 5.5.1f1.

    after import a fresh uMMORPG 1.55 version, nothing happens after clicking the "Server & Play" Button.
    i try the workaround with the x64 & x86 modul setting.
    Because of the somewhat long thread in this forum I find no solution.

    Errors:
    SqliteException: SQLite error
    no such table: accounts
    Mono.Data.Sqlite.SQLite3.Prepare (Mono.Data.Sqlite.SqliteConnection cnn, System.String strSql, Mono.Data.Sqlite.SqliteStatement previous, UInt32 timeoutMS, System.String& strRemain)
    Mono.Data.Sqlite.SqliteCommand.BuildNextCommand ()

    Unable to open Assets/uMMORPG/Plugins/sqlite3_x64/sqlite3.dll: Check external application preferences.

    Should i wait for 1.56 or is there a simple & clear solution?
     
  30. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Yes sorry about that, I didn't test it in the Windows editor before releasing the build.
    Try this: delete the database.sqlite file in your project folder. Delete the x86 sqlite3.dll if you use a 64 bit system. Then try again.
     
  31. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    thank you, it works so far.
     
  32. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Good to hear. Make sure to upgrade to V1.56 when it's out though, because you definitely need the x86 DLL for some build platforms.
     
  33. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    Hello Finally install the file in the VPS. Is any other command for run the server? ./game.x86_64 ?
    In the screen shoot show all what I did any tip helps, also I check for the permission and all are good, I unzip the file and all looks good. I try install the headless.86_64 and alone each x86 and x64 and the last one was headless.x86_x64 universal.
    https://gyazo.com/3151dde2fbad38b74bf09196be6a3454
     
  34. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Did you try to make it executable via chmod?
    I am not sure why some people can't run the file by default, there seems to be a different configuration on the server or perhaps in the Unity build somewhere.
     
  35. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    ok, but updating uMMORPG is a little painful o_O
    I should organize my modifications better
     
  36. MHolmstrom

    MHolmstrom

    Joined:
    Aug 16, 2012
    Posts:
    115
    Vis2k if it's not to much to ask for, would you mind writing in the changelog what we need to replace or here on the forum, it's getting hard to keep track of all the custom code and there is really no time to dig deep for me like modify the whole combat system when I know there is a update around the corner and beeing in fear of compile errors :)
     
  37. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It's enough if you manually set the exact same settings for the DLLs.

    I am already trying to put the class name before each point in the changelog. Is that what you mean? Or do you need the function name too? Or what do you mean?

    I am also trying to do small, incremental updates each time, so it's never too big of a shock. But some features like a new database system have to be released as one big thing.
     
    MHolmstrom likes this.
  38. gigz09

    gigz09

    Joined:
    Jun 6, 2016
    Posts:
    14
    I would like to share on how I keep track the changes for both uMMORPG and for my working game project.
    -
    I am using git as my source control/version control and GitExtensions as its UI. Its simple and very easy to use especially if you already have experience in any version control. With this, I wouldn't have to worry about implementing changes and accidentally break anything, it also helps me to keep track which files and lines that have changed from one version to another.

    upload_2017-1-29_0-55-6.png

    GitExtension is available for windows, linux and mac. - https://gitextensions.github.io
     
    mischa2k and MHolmstrom like this.
  39. MHolmstrom

    MHolmstrom

    Joined:
    Aug 16, 2012
    Posts:
    115
    @gigz09 thanks that was just what I needed! :)
     
  40. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    I try using Windows 7 with putty and winscp and the final step is the same I can't start the server.
    let me know what I did bad im go describe step by step my situation:
    build the headless.zip ( 2 files come from this build headless_Data this is a folder and the last file headless.x86_64)I compress this 2 files
    I transfer the file headless.zip to the VPS
    unzip the file
    and last step is run the server with the command ./game.x86_64 and not run the server say no such a file or directory
    i check that the file headless.x86_64 are executable. and it is because show in green color also in windows using the winscp in the vps can see under headless.x86_64 properties that show the X that mean that the file is executable.
    what can i do? im sure many of us are going have the same problem, and the people that not have this problem maybe they are good in the terminal said. Im really stuck I hope some one help me with this Issue
     
  41. MHolmstrom

    MHolmstrom

    Joined:
    Aug 16, 2012
    Posts:
    115
    this fellow also got a HD update :)

    When the equipment don't use SkinnedMeshRender why not hand sculpture them o_O


     
    cioa00, Ronith and camta005 like this.
  42. gigz09

    gigz09

    Joined:
    Jun 6, 2016
    Posts:
    14
    you should run it using ./headless.x86_64 not ./game.x86_64 because that is the file name of your headless build
     
    mischa2k likes this.
  43. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    That is some great art. How long did it take you for the skeleton?
    This would be really cool for the showcase too, if you want me to add it.
     
    MHolmstrom likes this.
  44. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
  45. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You said you used a debian server right?
    I remember reading that Unity only supports Ubuntu and it may or may not on work other systems. Maybe try setting up a Ubuntu Virtual Machine to see if it works there. If it does, maybe rent an Ubuntu server. I recommended namecheap.com because I kind of expected all kinds of issues with different server configurations. This way I can at least recommend one hoster where it did work.
     
  46. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    no I all ready use Ubuntu server.
     
  47. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
  48. charris456

    charris456

    Joined:
    Nov 25, 2012
    Posts:
    29
    mischa2k and gigz09 like this.
  49. gigz09

    gigz09

    Joined:
    Jun 6, 2016
    Posts:
    14
    Last edited: Jan 29, 2017
    mischa2k likes this.
  50. MHolmstrom

    MHolmstrom

    Joined:
    Aug 16, 2012
    Posts:
    115
    Go for it! I put my cubum tale on pause remember the game with all cubic environment? And i've worked alot on my own modular things for a few month but I wrapped this one up in a marathon of 23h or so :)