Search Unity

Use Wordpress as your game's database

Discussion in 'Assets and Asset Store' started by MrDude, Feb 17, 2014.

?

If I were to build the kits in order of preference, which kit would you like first?

  1. Friends system: Invite friends and see what they are playing. Include PM and chat services

    44.2%
  2. Online privacy: Protect your info select exactly who can see what

    16.3%
  3. Message boards system: Categories for author, clan leaders, groups personal

    18.6%
  4. Online market place: Trade with NPCs or real players. Includes gifting service

    36.0%
  5. Custom character system: Create a character in one game and take him into other games

    20.9%
  6. 2D narrative game template: Write a story, build a game in a day...

    12.8%
  7. Clan system: Access your friends arsenal during your own battles

    8.1%
  8. Wordpress Games portal: Display available games, sell them and show stats (ratings/reviews)

    25.6%
  9. Other: Please specify...

    5.8%
Multiple votes are allowed.
  1. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Hey guys. I am looking for some feedback from you guys... I said I wanted to make the kit that allows you to fetch and make posts be powerful enough for experts to use but also simple enough for anyone to use....

    The solution to this was really simple...
    Step 1: Please the pros - Create a class that experts can call to do absolutely anything they want ...
    Step 2: Please the rest - Create common functions using that class.

    Simple, right? :D But this is where the catch comes in... I hardly ever make use of this type of thing so I have no idea what "common functions" are... What do people such as yourself actually DO that you would like to do with this kit?

    The only thing I could think of was "Fetch the 10 newest posts". I assume "Get 50 nested comments up to 3 levels deep" might be a common next one. What else?

    Pros would do it like this:
    Code (csharp):
    1.  
    2. void Start()
    3. {
    4.     WUPostalQuery query = new WUPostalQuery();
    5.     query.SpecifyPostStatus(eWUPostalStatus.publish);
    6.  
    7.     cmlData qs = query.QueryString;
    8.     FetchPosts(qs, response);
    9. }
    10.  
    11. void response( CML data)
    12. {
    13. }
    14.  
    15.  
    The rest would do it like this:
    Code (csharp):
    1.  
    2. void Start()
    3. {
    4.     FetchLastPosts(response);
    5. }
    6.  
    7. void response( CML data)
    8. {
    9. }
    10.  
    ...so, what functions are common enough to warrant "average user" versions? Thoughts?
     
  2. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Edit... Head's up for the pros...
    You can just continue to refine your query to your heart's content and just go mental if you choose... Post type, status, author, tags.... Go nuts...

    Example:
    Code (csharp):
    1. public void FetchLastPosts(Action<CML> response, Action<cmlData> onfail = null)
    2. {
    3.     WUPostalQuery query = new WUPostalQuery();
    4.     query.SpecifyPostStatus(eWUPostalStatus.publish);
    5.  
    6.     query.AddTaxonomySearch(eWUPTaxNestedRelation.OR,"wuss_product",eWUPTaxField.term_id, new string[]("characters"), eWUPTaxOperator.IN);
    7.     query.AddNestedTaxonomySearch(eWUPTaxNestedRelation.AND,"elemental",eWUPTaxField.slug, new string[]{"fire,ice,metal"}, eWUPTaxOperator.NOT_IN);
    8.     query.AddNestedTaxonomySearch(eWUPTaxNestedRelation.None,"race",eWUPTaxField.slug, new string[]{"human","elf"}, eWUPTaxOperator.IN);
    9.  
    10.     cmlData qs = query.QueryString;
    11.     FetchPosts(qs, response, onfail);
    12. }
    13.  
     
  3. angie_c

    angie_c

    Joined:
    Apr 6, 2015
    Posts:
    6
    Hey Mr.Dude!

    I've purchased and installed the standalone version of WULogin and have installed and activated the plugin on my wp site. When running your example scene in Unity 4.6, after replacing the online_url with my site, I am getting the error "connection error: couldn't connect to host" even before attempting to log in.

    Not sure what to make of it, am I missing something?

    Thanks!
     
  4. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Just make sure the "Online" box is ticked. If not it will try to use the "Offline" url which is set to "http://localhost" by default.
     
  5. angie_c

    angie_c

    Joined:
    Apr 6, 2015
    Posts:
    6
    Wow...it's been a long day! I didn't even see that tick box.

    Thanks for understanding stupid questions, works fine!
     
  6. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    lol

    No problems mate :)

    Have fun
     
  7. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    Some kind of DLC kit would be nice :)
     
  8. angie_c

    angie_c

    Joined:
    Apr 6, 2015
    Posts:
    6
    Hey Mr Dude

    I'm having a problem with your WULogin plug-in. I have the login working, but I'm then trying to use unitys www class to download information from the wordpress site, and its downloading the log-in page as if I wasn't logged in.

    I'm trying to download the account information using the woocommerce short code on the account page of the site using unity's www class after I have logged in with your plug-in. Is this the correct way to use your plug-in?
     
  9. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Hia

    Afraid not. If you log in successfully with my kit it means you can now successfully use any of my other kits. It doesn't mean that you can now do anything that you can do in wordpress...like use shortcodes and whatnot. It doesn't work like that. You are signed in via MY kits, not via Unity or the WWW class.

    You will notice that alll my kits come with unity AND WP scripts. This is because I need to ask WP for what I want and then send it to Unity in a format that Unity can understand. Just logging in doesn't automatically turn Unity into a web browser that knows how to parse/interpret/use normal HTML/CSS etc.
    If you want custom functionality like fetching woocommerce data you are going to have to write the php scripts to do so, then format the data into a single line of text that You can parse in Unity and send THAT line of text to Unity. Once it gets here, you need to then turn that data into useful info in Unity's data formats (float, int, whatever). Using my WPserver class you can basically do anything you want as long as you have the know how to write the php code for wp to do what you want to do and THAT is the tricky part. I make it simple to send the data back to Unity.

    But just sending shirtcodes to wp via the www class, no, that is never going to work.

    What you need to figure out is where your data is being saved. If it is saved in the usermata table then the WUlogin kit can fetch it for you during login, no problem. If it's saved as a custom post then you are going to have to hang tight till I release the POST reading /writing kit. Or wlse you will need to create that functionality yourself.
     
  10. angie_c

    angie_c

    Joined:
    Apr 6, 2015
    Posts:
    6
    Thanks for getting back to me!

    I have the C# code in Unity written to turn the data into strings then parse the strings into readable data. I had assumed that since the user was logged in to the wp site, I could access the users relevant woocommerce user data.

    I am brand new to PHP but after doing some research, it looks pretty straight forward. I did some digging and it looks like the data I need to access is in the woocommerce_downloadable_product_permissions table. Is it possible to access this using your script? I know there will be more writing to do using php but I wanted to check make sure it's possible before studying up on php.

    Thanks so much for all of your helpful answers and I'm sorry for the stupid questions!
     
  11. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I think I'll reply to this via PM as the answer is not technically related to my kits... gimme a few minutes then check your pm :)
     
  12. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I was just informed a little while ago that one of my customers has a new title live on Google Play.

    Please check out their app here:
    https://play.google.com/store/apps/details?id=com.drllz.drllz

    Congratulations again :)
    I hope it does real well for you.

    Feel free to post some screenshots if you are reading this. You are more than welcome. :)
     
  13. drllz

    drllz

    Joined:
    Mar 31, 2015
    Posts:
    2
    Hey MrDude, thanks for the mention, and yeah drllz just launched on Google Play and we're still waiting for approval from Apple iTunes before we go live there too. Fingers crossed!
    Here's some screenshots ( plenty more on our website)

    You can also try it out in the web browser here (use the Trial mode if you don't want to sign up;)


    cheers and thanks
    James
    www.drllz.com
     
  14. corbaman

    corbaman

    Joined:
    Feb 1, 2014
    Posts:
    4
    Is the first post up-to-date with regard to the feature list?

    I'd really like a message board system. If it integrates with clans, that would be nice, but just any way for users to communicate with each other in a public way would be nice for generating some interest.

    Or is that automatically part of the Wordpress integration?
     
    Last edited: Jun 20, 2015
  15. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Hi Corbaman

    What you are after... that is gonna be in there in spades... PM, clan wide, per-friends lists, game wide, public boards.... check out www.patreon.com/mybad to see what my ultimate goal is for this kit. I think you, in particular, are gonna love it... ;)
     
    corbaman likes this.
  16. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I've been getting a lot of error reports lately from people who seem to think the kit is broken only to discover that they need to tik the "Online" checkbox and then all is well with the world again. It became apparent that I never actually explained to people what that tick box is for...

    My apologies for that. Allow me to quickly explain.

    Basically, I afford you the opportunity to develop your game offline using your localhost as your URL and also offer you the option of working with your live site also, if you so choose. You will notice there is an online_url field as well as an offline_url field in the WPServer prefab. If Online is ticked, all my kits will run off the URL you specified in the online_url field. If it is not selected then my kits use the offline_url. That simple.

    You don't NEED to work offline first but in case you want to, doing so is a single mouse click away. If you ever find that the kit doesn't work and throws you out messages like
    ...first check if you have that tick box enabled or not, as appropriate. 99% of the time that will solve your issue.

    In the event that the box is selected/not selected as it should be, that error means that the server sent back an actual error. Errors sent from WP itself is sent as HTML and not encoded as my kit expects and that is why that error happens. To see what the error is, double click on that error to get to the base64_decode function in Encoder.cs. Do a Debug.Log on the parameter the function receives and that will tell you what the error is, wether it is a 404 page not found error or a whatever. At least then you will know what went wrong and know where to start looking for the solution.

    Hope this has been helpful...
     
  17. corbaman

    corbaman

    Joined:
    Feb 1, 2014
    Posts:
    4
    That sounds exactly like what I want.

    Let me ask you one other thing. I notice you have a few different assets on the Store related to Wordpress. Could you do a more detail writeup about which ones are which - kind of a roadmap for which pieces should be pulled in for which functionality?

    I think for basic forums I need MBSCore, and WULogin for MBSCore. Then you have some other assets for a virtual currency, scoreboards, and data storage all based on Wordpress.

    What about a clan system? Is that TBD? Eg. It would be nice if each clan automatically had a Wordpress forum which only it's members could access. That's a good start for guild support on the web.
     
  18. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Most of what you asked is already answered in this very thread. Just require reading from start to end (and then you will start to find some of it repeated numerous times)... but I'm not that kind of ass who will tell you "Go read the forums and get back to me" so I will give you the abridged version and you can decide for yourself if you still need more detailed info afterwards...

    1. MBSCore: Highly recommended you get this because then you get other kits at a discount.

    2. WULogin Standalone: All you need to create an account and verify your identity during game logins. You need this to use any of my other kits.

    3. WULogin for MBSCore: Exactly the same as WULogin Standalone but missing some files. Those files are in MBSCore thus you need to install MBSCore before or after "WULogin for MBSCore". It also costs less than WULogin Standalone.

    4. Everything else: Optional plugins. Look at what they do, decide if you want it or not, get it if you do. As long as you have a working WULogin Standalone or WULogin for MBSCore in your project, all the rest will work no matter what kits you get or don't get. All of them only require WULogin.

    5. Future kits: You will notice at the bottom of the main graphic for each kit I have a section called "Requires" and a few empty slots. If any kit requires any other kit in order to work, I will CLEARLY state that in the product description AND I will add it to the graphic so you can know EXACTLY what you need.

    So far, everything only needs WULogin (which is kinda obvious since you can't do anything without first logging into your account) and thus have nothing in there. The exception being WULogin for MBSCore which obviously needs MBSCore, and WUMyCred which is a plugin that allows you to use the myCreds plugin in Unity so that obviously needs the myCred plugin.

    All of my kits at the moment, you can say: "if you can log in with my system, you have what you need to use the rest but all of THOSE work without requiring anything else.". Once that changes, I will be sure to let you know. As for forums, yes, that is still TBD. As you read on the link I posted, that is going to be a unique system. Nothing "basic" about it :p The plan is for each game to have it's own public board and for each player to have a public board (subject to my own custom and unique privacy system), for each clan to have a private board and each guild to have a guild wide board.

    the way I look at it is like this: Games will have a Thieves Guild and a Knights Guild and whatnot. When you belong to a guild (optional) you gain access to their resources. Friends can form a clan and raid together and share loot. Each person can then obviously have a life outside the game/clan also so there are special sections for individuals. Here, think "Facebook"... but inside your game.

    That's the plan but it is still faaaaaaar off. Many other things to do first.
     
  19. Reza-AUS

    Reza-AUS

    Joined:
    Aug 19, 2014
    Posts:
    6
    Hi MrDude,

    I purchased your wp login and data modules yesterday and it works perfectly but I'm looking for a functionality that I seam not to be able to find. I'm wondering if its supported or if you can guide me how to add it myself.

    I need to check the user role and enable functionality based on if the user is admin or editor etc. Is there a way to fetch the user role data?

    Also, I'm wondering if there is a way to fetch a list of all users within a role group? That is to enable a user to send messages or share files with a specific wp user group or a selected user within a specific group. I'm only after fetching the user list.

    Thanks for your awesome work!
     
  20. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Hi Reza

    Checking the user rooe is indeed supported, yes. Look in the wulogin prefab and you will find a host of fields you can fetch upon successful login. One of those is called fetch_roles. Just tick that box. Done. :) Now, after login succeeds, you can access the user's role from any script using WULogin.roles.

    As for fetching a list of users, no, that I don't support. This kit is meant to log one person in and then work on that user's data. The way I look at it, no user has any business knowing anything about about any other's stuff. In your case, though, it is possible to add that functionality, sure, but you will need to know a bit of sql and about WP to do so.

    First the easy bit, in WULogin, look for thenserver actions enum. At the end of the enum add a new value called 'FetchUsers'. Now you just need to call WPServer.contactServer using that enum as the first param. Look in WPLogin and copy paste any of my existing functions and rename it accordingly. This saves you from having to figure out what to pass for the other params but, yeah, calling custom code is that easy, add a value to the enum (actualy not strictly required but I'm a creature of habit so indulge me :p) and then contact the server using that value as the first param.

    Now, on the server you need only edit unity_functions.php. In Unity you called ContactServer() and two of the params was your enum value as a string and a prefix label called 'LOGIN'. In unity_functions.php just create a function called loginFetchUsers() and have it do a database search for users with the same role as the current user or do whatever you want here. Most important of all is this: the function name is made up of the lowercase version of the prefix you sent, followed by the exact spelling of your enum value. Do that and Unity can now communicate with the server.

    For the server to communicate back, if anything goes wrong, use PrintError($message) to tell Unity and then quit the function. If everything goes well, all data must be returned to Unity using two functions: SendNode($nodename) and SendField($fieldname, $fieldvalue). Think of SendNode as a section header and SendField as the section's data. In your case it would look something like this

    Code (csharp):
    1. SendNode('LOGIN', 'success=true');
    2. SendNode('admins');
    3. foreach( $admins as $admin) SendField($admin->ID, $admin->first_name);
    Oh, and make sure if everything went okay that your first SendNode returns LOGIN and success=true.

    And that is it. The server will now be able to communicate with unity. Follow these simple guidelines and you can add any functionality you want

    Good luck :)
     
  21. Reza-AUS

    Reza-AUS

    Joined:
    Aug 19, 2014
    Posts:
    6
    MrDude, I'm writing to thank you for your lightning quick response and for the clear instructions you provided above.

    For other readers, I would like to confirm that based on instructions above, it was really simple to modify the code and to add a few different functionalities that I needed.
     
  22. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    You are most welcome :)
     
  23. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I think @corbaman is going to be particularly pleased with this piece of news... :p

    I have wanted to create a few demo games and show how my system allows for cross game communication, how my kits can be used together and all the good stuff. As also mentioned before, my kit is to place a great focus on social aspects like friends lists and clans and notice boards by account, by game, by guild and per clan...

    Well, I have finally decided to get a new domain name for this exact purpose and not just showcase the odd feature or two but actually use my kits for what they were intended: Creating an entire social website focused around gaming. As I create new kits, they will be added to the site and games. As new games or demos become available it will be published on there directly and/or made available for download from there.

    As of yesterday I am the proud owner of http://www.guild.site but still have to wait till the 15th before the domain becomes available and before I can start building the website. I just wanted to share the news with you so you can be aware of it... coming soon :D
     
  24. Reza-AUS

    Reza-AUS

    Joined:
    Aug 19, 2014
    Posts:
    6
    Hi MrDude,

    I have found a small issue in MBS.CML.cs that took me a few hours to figure out. I have solved the problem in my code but I'm mentioning it here for your reference. This issue might not affect many others but affected me because I am doing the following:

    1. I'm using WUData to save various app settings on a MySQL server which works fine.
    2. The data (field content) that I'm posting to the server is binary JSON (BSON) formatted BASE64 string that I have made by using Convert.ToBase64String()
    3. BASE64 string occasionally contains "//" characters. That appears randomly in the string.

    Now the problem is that in "MBS.CML.cs", function "virtual public bool ParseFile(string data)", there are a few lines code that removes comments from a CML string, which is exactly the constellation "//", which appears randomly in the BSON string. That did shorten my BSON string that I was trying to download from the server time to time and it took me a while to figure out what was going on.

    Cheers!
     
  25. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Hey there

    Thanks for pointing that out, mate. You hit it right on the head there.

    I tried to emulate C's // comment system by allowing everything up to the // to exist but completely discarding everything starting from the //. The only exception is for URL's where I allow for a maximum of 1 url per line so the first instance of :// is allowed thereafter everything following the first subsequent // is ignored.

    This is the first time that this has ever been an issue so I wonder, should I update CML with a boolean value to treat comments or content inside named properties as values? I would still ignore lines starting with // but any line containing // in the content would allow it.

    This would be an easy update to do if this is something people would be interested in... So let me ask it straight and hear back from you who use it:
    Should I ignore // inside field values (and allow you to use it in your values) or should I treat it as a comment and discard it and everything following it?
     
  26. Reza-AUS

    Reza-AUS

    Joined:
    Aug 19, 2014
    Posts:
    6
    Hi,

    I think, as someone else might need to use Base64 converted strings for any reason, its probably safest to ignore the // field values and not use them for commenting. I'm not sure if comments in CML are actually needed but if you want to have that option, why don't you use something like html comments ie. <!-- > or similar?

    I just checked a few different very long Base64 strings that I have saved while troubleshooting and neither of them contained any < or ! characters. So probably they are not used in Base64 strings and are safe to use.
     
  27. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    // is common in programming so it would instantly be recognizable as comments.
    CML itself has a special meaning for < and > so <!--> I am not keen on
    Same with # like in .ini files. If I make # a comment it means people can no longer use that as values. Whatever I choose to use for comments I am taking away from people.

    I personally like the idea of sending base64 strings also but doing so is something you and I do, not everyone. Complicating the scripting format for everyone just because you and I could benefit from it... it's just not Cricket..

    It will be easiest to just add a boolean to the class to skip comments. I want to keep everything simple and overcomplicating comments is not on the cards. This is also why I don't include /* */ comments. // works on the current line only, is simply, quick and very widely recognized. It just made sense to use it and still does.

    I was thinking that you getting // in your base64 value might have been a once in a lifetime event but it seems you get it often if I go on your comments. Do you have any idea what it is that gets converted into the // sequence? Just out of curiosity...

    I'll update MBSCore with that change and let you know when it's up and running. Like I said, it should be a real quick fix... few minutes at most... Stay tuned...

    Edit:
    No, where have you gone that Unity is saying you are offline? :p The changes only took me like 2 minutes to make. I wanna email you a copy to see if you are happy with how it works before I update MBSCore...
    Code (csharp):
    1. //To allow the comment markers in named fields and the data list
    2. CML data = new CML();
    3. data.disable_comment_checks = true;
    4. data.Load(filename);
    5.  
    6. //or
    7. CML data = new CML(filename, true, true);
    8.  
    9. //To allow comments only in named fields but still use comments on their own lines
    10. CML data = new CML();
    11. data.disable_inline_comment_checks = true;
    12. data.Load(filename);
    13.  
    14. //or
    15. CML data = new CML(filename, true);
    16.  
     
    Last edited: Jul 7, 2015
  28. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    Hey Mr Dude! Been away for a bit - summer=away.from.computer.as.much.as.possible.... I won't even touch it till it starts getting cold out again (in Wisconsin that will come way too soon!)... I do however keep checking the forums on iPad (even when camping, so I guess I'm just addicted)...

    Just wanted to pop in and see how the inventory system was going? Have been looking forward to seeing your take on that using Wordpress as back end. I want to dive in again after kids are back in school and I can't sit outside in a tshirt anymore... :)

    Hope you've been well, and enjoying summer!
    --Dan
     
    theANMATOR2b likes this.
  29. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Sorry to disappoint, Dan... :(

    I've been busy with the day job 90% of the time, trying to get my Patreon site noticed over at www.patreon.com/mybad and building the accompanying website over at www.guild.site and in between updating some existing kits... I simply haven't had time to work on the Wordpress kits themselves.

    This new website of mine, though, is designed to be a fully functional implementation of all my kits, though, so I was forced to do some work on the portal side of things and I more than a little bit chuffed with the progress I made with that and how awesome that looks and works! :D It seems I am going to be able to do what I intended after all and release the base portal with WULogin and then, as you install the other kits it will just add to the portal settings so you can manage everything under one location. :D

    I've also started making / updating some demo games to start showcasing the true power of having these kits but... life keeps getting in the way... I offer free games and exclusive code and more in exchange for a $5 pledge and I can't even get people to just read my posts and click the like button, much less take an interest in any of that... So in between making the demos and doing the updates on my other kits (when I am not doing my day job) I am also making a game to try and get some form of an income coming in... and chronicling the process as I go along so people can learn from me directly how I make my games...

    I simply haven't gotten around to working on new Wordpress kits... Sorry to disappoint, Dan... As soon as I have updated the turn based battle system and released this game I am making I want to focus all my attention on the Wordpress stuff but for now.... too many plates... :(
     
  30. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    Mr Dude, not a disappointment at all! Life always tends to take precedence. That's why I started taking a "summer break" from my own projects - we need to be able to focus on the "real world" (guilt free!) once in awhile. Then that little spark of creativity flares up again and we're drawn back into creating cool "stuff" again. It's a cycle. It's what we are and what we do. I'm just happy we have this awesome Unity Engine as an outlet! :) I'm glad you are taking the time to focus on other things - the alternative is burning out... It's good that there's too many plates! Would rather that than not enough plates, right? ;)

    I'm actually kind of relieved you've been working on other stuff, because it helps me justify my own foray into the real world. Lol! Soon enough I'll be trying to keep up with all the "stuff" you're cooking up in the back of your mind when you put it all into code! ;) one thing I found is that I keep filling up notepads with ideas and concepts - thinking through how I can tie it all in to an efficient system. So when I do start sitting down and coding into the night and forget there's a world outside the magic box filled with code that non-programmers can't truly appreciate, I have a great framework to aim for.

    Anyway - good to hear you're keeping sane and keeping at least one foot on solid ground - the virtual ground will always be there when you step back into it. ;) I'll pester you again when I follow the sirens song back to my magic box... Lol! Take care and "talk" again soon! ;)
     
  31. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Actually, all I want for christmas is one of those cork pinup boards... I have all these amazing ideas that I write down so I don't forget them and thenI forget where I wrote it down... so I started writing them down in a physical book and "misplaced" all of them so far... but if I can just have a pinup board stuck to my wall where I can pin my notes to I will most likely blow you all away with the stuff that goes through my head...! :D

    Bookmark my Patreon page and follow along with that free insight into my game making process... it might just help inspire you more.

    But... yeah.. I keep having these awesome ideas that I either forget or misplace... But if I had a notice board in my office... sigh... and all I can find are whiteboards. Whiteboards are so limited... don't you think? you have to delete to add... :D
     
  32. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    So I've been working on redoing my games website and have finally gotten my WP multisite setup and working the correct way. I can login just fine with either login demo (OnGUI and UGUI).

    When I run the WUDataDemo, after a successful (auto-relogin), l "fetch info" and without any errors I am presented with the "Generate game data" because my data is indeed empty. After I click that I see errors on the blue panel at the bottom of the screen.
    Sometimes I see the error twice, kind of overwrites the line about setting guid 1.

    Do I have to do something different because I'm using a WP multisite?
     
    Last edited: Sep 2, 2015
  33. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    No... it should all just work out of the box. Just make sure you have the latest versions of both the login kit and Data kits installed on your website and in Unity) and all should work just fine, multisite or not. The error message does in deed print twice as I print it and then pass the error long to a sample error handling function which prints it again so don't worry about that too much...

    But what is this you say about a message saying something about setting guid to 1??? Do me a favor, please, contact me via support@mybadstudios.com and send me a screenshot of what you see.This has me curious...

    The way my kit works is that it interacts with WP and if WP takes offense to anything for any reason, it will spit out it's own warnings and I will show that to you. As such, my kit is very likely to show you many, many errors that I don't even know about... (Like Service Unavailable.... that is not one of mine so that is WP waving a finger at you and me passing along the message) but guid... is that one of mine or one if it's? You have me intrigued!

    One thing you can do, just to play it save, all WUData functions take the Game's ID value as an optional parameter but it is a required one so I attempt to fetch it myself if you don't provide it... Try fetching WULogin.GameID and adding it to the WUData functions and see if that makes a difference. But still, email me with those screenshots and let's see if I can help you solve this mystery :)
     
  34. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    Thanks, email sent and I did not convey what I was seeing on the screen. The text was "Setting up content for gid: 2".

    Again, sorry for the confusion and thanks for your continual EXCELLENT customer support.
    Note: my (5 stars) review is shown for WULogin and once I'm back working with WUData I'll be sure to add another review for that too.
     
  35. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I just published a new version of WULogin and WUData. Please note that both need to be updated if you have both as they feature a few implementation changes...

    So, where to begin? Let's start with the major news first...

    In the beginning, there was POST...
    Then came Firefox an IE and said "We don't work with Unity's POST data. We refuse"... so to ensure compatibility across all platforms I was forced to use GET. Then one of my valued customers who is a smarter man than I found a way to fix the problem on the server end... which means POST is back! :D

    Of course, some of you might still prefer GET over POST (for reasons I can't fathom). Don't worry, I have not forgotten about you. when I changed from version 1 to version 2 I was forced to move to GET. As of tonight, you can choose to use POST or GET by simply selecting your preference from a drop down list in the WPLogin prefab. Enjoy! :D

    Please note that I have not tested compatibility on platforms I do not have (i.e. Android) but on the ones I did test it, it worked great!

    Binary data
    A few people have asked me if they are able to store large files and binary data. Up till now the answer has been no on both accounts since the field the data was stored in had a hard limit of 150 characters. As of tonight the varchar(150) is no more and has been replaced by Text... meaning theoretically you now have unlimited space to store your data in. You still can't store binary data but if you just convert it to base64 before you submit it, well there you go... :D Say thank you to POST for removing the limit on how much data you can send :D

    Ready for execution
    I discovered that if I call auto login during Start() the global, static variables are not yet set by the time the onLoggedIn event triggers. This means that even if login was successful, the login data was hidden from you until just AFTER your code ran. Off course, I do provide the login data to your function as a parameter but the global functions are so much more fun to use and, to be honest, you simply don't expect them to not be set... I know this caused a lot of grief for at least one person out there.... My apologies again. Well that issue is now solved and everything works as expected.

    Font bug
    The one complaint I got most frequently was about the Unity UI font's being missing. Most of you thought it meant my kit was broken and contacted me to tell me about it. This is in fact some weird import bug in Unity and has been reported by multiple developers, multiple times for a few months now... They can't seem to get it fixed and you guys keep thinking the kit is broken...

    Well, tonight I decided to take matters into my own hands. They can't load their default font? Fine, I will include it also and make my kit use THAT one instead of the one included in Unity. So, touch wood and praying all goes well, that annoying thing where the unity UI prefabs load without any visible text will now be thing of the past also!

    Anticlimactic finish
    Well, I guess that is about it, really... The rest of the changes are not really note worthy... Filename/class name changes on the server, extra functions being called in scripts on the server, stuff like that... The major news is that POST is now back, the data length limit has been lifted and hopefully that annoying bug is gone. Oh, yeah, and one more thing.... now that you can use POST, you can finally start using spaces in your data again without it invalidating the URL and breaking the server call ! :)

    So all and all it is just a few minor tweaks here and there but the impact is huge! :D So get your WULogin and WUData kits updated and enjoy these new features! :D
     
    Last edited: Sep 5, 2015
    danreid70 likes this.
  36. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    If any of you guys here are any good with PlayMaker, please contact me...

    I have 0 knowledge of how to create Actions and less time to learn :(

    If it would be possible to make the login kit PlayMaker compatible I'd be willing to give some free assets to the person who does so for me... Send me an email at support@mybadstudios.com if you wanna take me up on the offer.

    Thanks
     
  37. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,079
    I'm considering buying Wordpress User Login Standalone + Wordpress User Data. I haven't read this thread yet so forgive me if it's been answered a thousand times already.

    Would I be able to view the information my game posts from a given user in my myPHPAdmin section at my game's website? I'm not a database or web guy so am not sure how all this works. Is it just reading/writing to a database that I can see in myPHPAdmin under the user's name?

    If I wanted to look at someone's high score or some other number this way, would that be possible? If yes, would it show up in the regular WordPress database as extra field(s) added by the game or would this be a separate database or something else? Not that it really matters which database it is, I just want my game to write something and then be able to view a specific user name's value in a database from my end through myPhpAdmin or something like that.

    Would I need only the Wordpress User Login Standalone or should I have the Wordpress User Data too? It's only $20 for the second thing so I might just buy it anyway even if I don't need it for this. I can see this all being useful in the future.
     
  38. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Hi Todd

    WUData does write to your WP database but to a custom table. As such you can in deed view the results via phpmyadmin but since I store data so many levels deep (install once, store data for multiple games) i.e. Per game, per user, per category...even though you can view it in phpmyadmin I also provide you with a dashboard plugin that simplifies it all. Select the game then see a list of people who have data saved for that game (not just all your site's users, only relevant ones). Once you select the user you can view, edit or delete data as you see fit (but not add new fields yet).

    Go to the WUData product on the asset store and look at the last screenshot. That shows you the WP dashboard interface for viewing all the data my kit stores in your DB.
     
  39. Todd-Wasson

    Todd-Wasson

    Joined:
    Aug 7, 2014
    Posts:
    1,079
    Thanks, MrDude. :) I bought both tonight and got exactly what I wanted working including being able to see what I wanted to see in the myphpadmin area. I basically stripped down your WUDataDemo to the bare minimum I wanted and was off and running.

    Your startup stuff is excellent. It actually took me longer to find the documentation than it did to get your first example working on my site! Hats off to you, sir. You did your homework on this. :)
     
  40. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    Hey MrDude! I'm back again! :) I just set up my "office" in basement for the winter and started digging into my game again (not snowing yet, but getting cold enough that I should abide by my "I'll start working on this over winter" plan)... :)

    Anyway. I re-downloaded and re-imported the latest WU assets (WU Login for MBS Core, WU Data, etc.), and the WULoginUGUI is showing completely blank. Is this related to that Unity font issue described above? I created a new project and imported only the WU assets, and same thing (in case something in my game project was causing it). Still all blank. Even the watermark isn't showing up. I'm using Unity 5.2.2.f1, if that might be causing it?

    Could you check with a new project that the latest WU's from asset store are working correctly for you? I just want to make sure I didn't miss something stupidly obvious... :)

    Hope you're keeping busy (fun-busy, that is!) - also, did you ever get a cork-board for your wall, or still using whiteboards and post-its? :) Or still hoping you're on Santa's "Nice List" this year? :)
    --Dan
     
  41. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    No, man. Still busy as heck. Working on a game for a client and the release date is drawing very near so hectic all the way :) Good news is I am enjoying the project like mad and learning a lot while doing it so yeah "fun-busy" as you call it :D
    I haven't gotten around to doing 95% of what I was busy doing before I was panning what I was gonna do after that... But all things in due time...

    Your message is most perplexing to be sure. So far I have not had any issues like what you described and the last update should have fixed the missing fonts issue also so there should be no issues of any kind now... Heck, I even updated the kit to work with WebGL now... but I never tried it past 5.1.3 because of all the bad experiences I have had with 5.2. i have not had a 5.2.x installed for more than 2 hours each as they all break the project I am working on for my client.

    Unity has fixed some of the bugs but the most important one of all (clicks not registering) they have not said anything about. One guy, the author of the Curved World kit (man I want that so bad :p) has said that 5.2 completely broke his kit and Unity has assured him that they will have it fixed by 5.3 but not during any of the 5.2.x releases. When I read that I wrote 5.2 off like a month old rotten potato. I am waiting for 5.3 before I download a new Unity version...

    Having said that, you should not have any issues at all so that which you describe is super bad... I will download a copy of U5.2 this weekend and have a look if I can recreate the issue. Not even the watermark? :O wow...

    Anyway, just a few days ago I created this http://www.guild.site/WebGLTest/index.html using 5.2.1 and if you use FireFox or Chrome and a lot of patience for it to download you will see the kits up and running just fine (safari for some reason makes my entire level gold. Go figure)... (Actually, check it out. Did an awesome mod to the look of the login kit for that demo :p) I can't say why you have blanks so I will definitely check over the weekend. just send me an email to remind me, just in case :p

    And as for my cork board... I almost gave in and bought a cloth one today... smaller than I wanted and not exactly what I wanted...but only $13... but I put it back saying "i will rather get what I want than the next best thing" so still looking.

    Edit:
    Dan, you still have my email, right? Email me a screenshot of the blank screen you are facing, please
     
  42. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    Hey MrDude, I just sent an email with screen shot. I'm thinking you're probably right about it being a Unity 5.2xxx bug. This weekend I have a bunch of free time that I'll try reverting back to 5.1 and see if that fixes it.

    You should check out some rummage/garage sales - I bet you could get a really big, cool cork board for just a few bucks! :) I'm furnishing my "The Haven" basement bar and office with almost exclusively rummage/garage sale stuff... :)
     
  43. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    I just had a very interesting customer support email....

    Someone asked me if my Simple Achievements kit https://www.assetstore.unity3d.com/en/#!/content/3042 was compatible with the Wordpress kits.

    Well, considering the fact that it was made about 3 years before the Wordpress kits one would expect the answer to be a simple "no" but as I told him, amazingly enough, yes it is... It is actually compatible... there is just a few more steps involved... So for less than $2 you can now add new functionality to your Wordpress kits! :D

    Let me explain...

    The Simple Achievements Kit requires that you manually upload some php files to your web server instead of simply installing a plugin like all the other kits. One of those files is a configuration file that requires your database login details. These you will find in the root of your wordpress installation in a file called wp-config.php.

    So these are the steps you need to follow:
    1. Download and open wp-config.php from your website or just view it online if your web host allows this somehow
    2. Copy the database login details from there into the settings file included in the Simple Achievements Kit
    3. Follow the instructions as per the readme in the kit. Basically, just upload the php files to your server. Anywhere you want.
    4. When you use the kit, use WPLogin.username as the user ID in the functions

    Done.... that's it. The kit is now linked to your Wordpress kits and will allow you to create awards for your game and award them to your players.

    I never realized the kit could be used with the rest of the Wordpress kits until I was asked tonight... but yeah, it can. There is only one restriction to be aware of: With all my Wordpress kits I make sure that you can't do anything without first being logged in so cheating is out of the question. The Simple Achievements Kit has none of that authentication code in place so it has the potential of being abused... That's it.

    Well, enjoy :)
     
  44. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Currently slowly moving my websites over to my new VPS and in the process broke 2 of the three websites... nice... including the main one so now this is the only place I have to showcase the progress. lol. :D

    Anyway, I've been super busy lately and thus everything took much longer than I expected. I only recently made the facepalm discovery that fetching posts is gonna be rather pointless unless you can write posts also so I started creating a write module also. Got the whole thing done and just needing to test it but the darn gui for the demo scenes take forever to make... To make a post takes like 3 to 4 lines of code (and then more, depending on how detailed you want to get) but the GUI takes me hours to setup so I haven't done the advanced posting one yet.... Thought I'd share what the basic posting demo scene looks like... the query part is still in the making and once that is done I will start sending it out to the beta testers... Dan, looking at you here, mate ;) :p

    Hopefully, soon...
    Screen Shot 2015-12-19 at 5.00.16 PM.png Screen Shot 2015-12-19 at 5.01.01 PM.png Screen Shot 2015-12-20 at 3.33.47 PM.jpg
     
    Last edited: Dec 20, 2015
    danreid70, zyzyx and BackwoodsGaming like this.
  45. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Just another quick update. Basically, the class is meant to be used from code and as such all you really need to do to make a post to your website is this:
    Code (csharp):
    1. WUPost new_post = new WUPost();
    2. new_post.post_title = "I am doing this from within Unity";
    3. new_post.post_content = "And loving it!";
    4. new_post.SendPost();
    Everything else is optional and will use default values. The entire prefab thing is serious overkill but makes it so much easier to demonstrate how to use the code. I don't see you ever using this prefab as is but it is there if you need it... yet, again, serious overkill when you look at the 4 lines of code above and realize that that is the bare minimum it takes. Anything else is gravy... Postal.jpg
     
    danreid70 and BackwoodsGaming like this.
  46. nike055

    nike055

    Joined:
    Nov 15, 2012
    Posts:
    3
    Hi MrDude,

    I tried to save data using the following simple code (UserWPData is my own class where properties have the appropriate types):
    cmlData regData = new cmlData();
    regData.Seti("Level", (int)UserWPData.Level);
    regData.Seti("Sport", (int)UserWPData.Sport);
    regData.Set("DateOfBirth", UserWPData.BirthDate.Date.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture));
    regData.Seti("IsTrainingPassed", UserWPData.IsTrainingPassed ? 1 : 0);
    regData.Set("TrialsData", UserWPData.TrialsData);
    WUData.UpdateCategory("RegistrationData", regData, 0, OnDataCreated, DisplayErrors);

    But in Wordpress, I got the data sorted in another order, "TrialsData" is before "DateOfBirth" and "IsTrainingPassed", please look at the attached image.

    Could you write please, why the order of fields is another, can it be corrected?

    Thank you!
     

    Attached Files:

  47. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    Hi nike.

    I can't see why this is a problem at all. You fetch the data by name so the order does not matter. Just like the returned data has fields that are used internally but doesn't come from your data, the fact that it's there doesn't break anything... As such, there is nothing for me to fix, sorry to say.

    You give me the data in an order you want, I add them in the order you give me (after adding extra fields) then I delete my extra fields and store yours in the order that I got them. Then I ask WP to give them back to me and I display them in the order that WP gives them to me. From what I can see it looks like the values are listed in ascending order (smallest first) but unlike numbers where 0 is smaller than 1, with strings a is smaller than b but z is smaller than cat because 1 character is considered smaller than 2 characters, no matter what the character is... so Level, Sports, DateOfBirth that is considered "correct" because the first two are both 5 characters long and L is smaller than S but DateOfBirth is 11 characters long so is larger than both even though it starts with a B. This is true for all programming languages as far as I know.

    So yeah, nothing there to fix, unfortunately. Only thing you can do if you want is make it display descending and thus show it the other way around. But in both cases I don't see why this is a problem... If regData.Int("Sport") gives you the value of Sport what does it matter if it is saved before or after DateOfBirth?
     
  48. nike055

    nike055

    Joined:
    Nov 15, 2012
    Posts:
    3
    Hi MrDude,

    Correct sorting of fields in WordPress is needed for me because an end user uses WordPress backend in order to adjust parameters of visualization.

    In regard to your last post, when WUData.UpdateCategory is used, the order of data is correct (DataToSend.png), but when the data are fetched back, the order becomes incorrect and there is no logic of sorting (FetchedData.png).

    And what is interesting, sometimes fields are stored in the right order (in WordPress), as they are sorted in the code: CorrectSorting.png
    But it is unclear when it is happening.

    Could you please share your ideas?
     

    Attached Files:

  49. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    No ideas at all. I fetch them and I send them back in the order that I get them. The order is 100% unimportant. I have no idea why this is an issue for you...

    I have no idea what "adjust parameters of visualization" means, I'm sorry to say

    Code (csharp):
    1. cmlData myData = results.Last;
    2. Debug.LogWarning( string.Format("Level:{0}\nSport:{1}\nDOB:{2}\nTrained:{3}\nData:{4}",
    3. myData.Int("Level"),
    4. myData.Int("Sport"),
    5. myData.String("DateOfBirth"),
    6. myData.Int("IsTrainingPassed"),
    7. myData.Int("TrialsData")
    8. ) );
    Why does it matter what order the fields are when you fetch the data by name? I simply can't see what the problem is you are having. The order of the fields are in now way important at all. Contact me on support@mybadstudios.com and explain to me what it is you are trying to do and maybe I can help you some way but as I said, I tell WP to return the data to me and then I pass it along to you as I get it. I promise you I don't have any code that says "If the field is "DateOfBirth" make sure to skip two loop cycles before sending it and if the field is "Level" then wait 5 loop cycles and if the code is...". :p
     
    BackwoodsGaming likes this.
  50. MrDude

    MrDude

    Joined:
    Sep 21, 2006
    Posts:
    2,569
    So I recently asked of my beta testers what they would do with the kit when they get it and what features they would like to see. One of them said he would be using it primarily to show the latest news from his website inside the game but he would like the option of showing the featured image if possible and the full text if someone clicks upon it.

    Well, every post gives you a title and an excerpt field in addition to your main post which means you can either tell your story in your post title or in the excerpt field which was made for that very purpose. In any event, I fetch all three fields so you already have all the data available to display however you see fit so I just added some code to also (optionally) fetch the URL's of the featured images (if set) and created a new demo scene...
    NewsFeed.jpg
     
    BackwoodsGaming likes this.