Hi, I’ve download the JSONQuery_UE4.7.3.rar for UE4.7.3,
but it caused crashes when running on Android Devices.
The reason we’ve found is the function PostJsonRequest.
It’s almost like he updated before I could even ask… Thanks alot This is going to be so helpful, glad I messed with PHP when I was 15 haha!
ZenTech: I have to admit I haven’t tried it on mobile - thanks for the headsup, I’ll try to look into it!
MaxFights: At your service haha, good luck!
Thank you for this! I have little experience in C++ for UE4 despite knowing PHP, Javascript, C# and even the Source Engine code. My current project requires me to do EVERYTHING so, I was about to hire a programmer to do a simple login system for me since majority of the connection protocols are handled in C++. All I wanted to do was have someone log in and have the game check to see if you’re a premium member. lol So I’ve been hesitant about paying someone for something so small. I can’t believe this thread was here since last year. No idea how I missed it! Again, thank you so much!
No worries man, my pleasure! Glad you like it, and if you have something to show, please let me see it! Cheers!
Hello Stefander,
Firstly thank you for great plugin! It is extremely useful and essential for my project. I have a problem though. I’ve set up a little test blueprint and simple node.js server to see if I can make it work and it looks like I don’t receive my data on server side from my game. Response from the server works like a charm and I don’t think It’s server side problem.
Here is my blueprint:
And this is my node.js code:
As simple as it can be… Am I doing something wrong with request? Server shows that it didn’t receive any data. It prints “{}” in console.
I can confirm problems on android at that exact same node. Great plugin by the way, I’ve actually extended it a little if your interested? I wrote a little addition to get key names of arrays that weren’t labelled. Could post in anyone has encountered a similar problem. I’m looking into the android problem at the moment so i’ll post if I can find a solution, but if you could look into that it would be greatly appreciated.
Well I worked out your android problem. It throws a fit if you don’t include a content-type. A quick fix for me was to edit the JsonFieldData.cpp and add this around line 140 where the http request is being dealt with.
Just add this line to make it work on android.
HttpRequest->SetHeader(“Content-Type”,“raw”);
Or whatever content type you want.
After that plain sailing etc.
TArray<FString> UJsonFieldData::GetObjectArrayKeys(UObject* WorldContextObject, const FString& key) {
TArray<FString> stringArray;
for (auto currJsonValue = Data->Values.CreateConstIterator(); currJsonValue; ++currJsonValue)
{
// Get the key name
const FString Name = (*currJsonValue).Key;
stringArray.Add(Name);
// Get the value as a FJsonValue object
TSharedPtr< FJsonValue > Value = (*currJsonValue).Value;
}
// Return the array, will be empty if unsuccessful
return stringArray;
}
I also wrote this for when your value is an array, it lists the key names of each item so you can later target that key. I can post an example if anyone is interested.
Hi there. Is there a way to read a file on your local drive or does it have to be from a url?
Hi,
Could someone help me with the error? only happens with this Plugin.
Tks
Done !
I found the solution:
http://idkudk.blogspot.com.br/2015/02/how-to-get-plugins-to-package-correctly.html#more
Hey Stefander. Finally getting a chance to work with your plugin now that some heavy stuff is off my shoulders. Right now i’m setting up a login in the game that posts to the API plugin on Wordpress. This allows me to connect users from their to the game with additional variables.
Right now, the API User plugin gathers info by posting to the URL like this http://url.com/api/user/generate_auth_cookie/?username=john&password=PASSWORD-HERE
Is this out of the realm of how your plugin handles posting? I can successfully get data, but no matter what I do the status always ends up being “Error”.
Search Results for “-api-user” | WordPress.org
This is how my blueprint is set up. Its just as basic as your examples.
Hope to hear from you soon!
Thanks a bunch.
Please does someone knew how to get a HTTP header, i m trying to get the value of a cookies once i connect a player, all i’ve found is a method GetHeader(); i tried to use it with HttpRequest->GetHeader(“Cookies”) when i do a GetRequest(), but all i got is an empty returned value while my cookies contain information, has anyone already tried to do something similar or know a way to do it
Thanks
Sorry for my absence, currently in the process of finishing 2 projects simultaneously so it’s been reallly busy the last couple of weeks (and coming few weeks), please excuse me for the late reply!
@johnbo: Thanks a lot for your effort man, I’ll try to get a new release out as soon as possible!
@WizzarDad: I appreciate your input man!
@sbnewsom: That shouldn’t be a problem, do the examples that I supplied work? Posting data shouldn’t be a problem, and the output string should be in the Console log (for as far as I can remember), maybe you could check that?
@Zakkar: That’s a good question, I’ll have to look into that though…
@Stefander thanks but I already solved it, in fact when you post information to authentify the player, all the information are saved automatically into the JsonFile, even the cookies, but maybe you ll have to add this to make it work HttpRequest->SetHeader(“Content-Type”, “application/”); depending on how you would like to post information. To see all the information about your JsonFile just check the content variable on OnReady function
Hope that it help and thanks for this plugin i owe you a lot
Hey!
Pardon me if it’s a stupid question, I’m new to Jquery.
Does it have any support for parsing data into a local file without any server attached or is that out of the scope for this plugin?
I.e. can I write the logic for store/read data on the local computer using this plugin?
You shouldn’t login this way into WordPress as it can encode/decode the password by itself. I have a fail/save php script somewhere I used when I was working with UDK and a custom php login script. This script will also allow users to register them selves and lets WordPress store the password/user info encrypted as it should be (MD5 hash if I remember right)
I’m planning on re-writing it a bit for UE4 later today when I have my local XAMPP server installed and was thinking of writing a small/first tutorial for it. Ill update this post as soon as I have it working, the tutorial working (will be my first tutorial)
Hello everyone,
I am new to blueprint (and the unreal engine). I have downloaded the -query plugin for one of my projects, and I would like to do the following:
- I currently have data on a server (array)
- I want to use the -query plugin in UE4 to ask the server for the data so I can import it and use it in UE4
I have tried to follow similar blueprints described above, but I can’t seem to get things to work.
Any help would be very appreciated!!
Thanks!
Does anyone have any php we can use to test a post request? I have been trying for a few hours and always get a 406 (not acceptable) whem trying a post.Get works perfectly fine.
Update : I set up xampp (local server) and it works fine.Any host gator users out there with shared hosting might have issues with post requests.,Im pretty sure its an issue with their mod_security plugin.Just a heads up.