[c/c++] Clientless (Work in Progress)

Posts 61–75 of 131 · Page 5 of 9
Quote Originally Posted by dudeguything21 View Post
Is there anyway to pick a specific character when logging in? I am trying to use Chars.find(some value) but I don't know enough about C/C++ to know what I am supposed to lookup.

I have tried using .find(ClassType::ROGUE) but that gives me an error "list iterator is not dereferencebale"
All character data is stored in the Client->Chars variable. Its filled from the char/list request as bluuman said. using .find() would search for a CharacterInfo struct or a character Id, not for a class type. To pick a specific character that you dont know the ID of you would need to iterate through the Chars map and look for one that has either the correct objectType or level or exp or fame or whatever you want to search by.



Quote Originally Posted by bluuman View Post
lots of random include file errors. currently it's "cannot open include file: 'corecrt.h', even though i included its path in additional lib and include files. i can see the file in the folder, so its there. this is mostly due to my lack of c++ knowledge.
You might run into errors like this occasionally in C/C++ depending on what other includes you have added to the project. But it doesnt mean to include the direct file its requesting (most of the time). Generally one of the other includes will have that specific file included in it. If you clone the master branch of the github repo and you set up curl and open-ssl correctly then it should compile with no errors. Just make sure you edit the file "BuildMacros.props-sample" with the correct values and resave it as "BuildMacros.props".
Quote Originally Posted by toddddd View Post
All character data is stored in the Client->Chars variable. Its filled from the char/list request as bluuman said. using .find() would search for a CharacterInfo struct or a character Id, not for a class type. To pick a specific character that you dont know the ID of you would need to iterate through the Chars map and look for one that has either the correct objectType or level or exp or fame or whatever you want to search by.





You might run into errors like this occasionally, just depends on how you set up your project. But it doesnt mean to include the direct file its requesting (most of the time). Generally one of the other includes will have that specific file included in it. If you clone the master branch of the github repo and you set up curl and open-ssl correctly then it should compile with no errors. Just make sure you edit the file "BuildMacros.props-sample" with the correct values and resave it as "BuildMacros.props".
yes, ive edited my BuildMacros.props to the correct file paths, i think this might be a problem with my visual studio install?? the header files it's missing are located in here "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt", but even once i add this to my include directories (i've googled this error, i think it should be there by default, but it's not). I have lots of errors which the compiler thinks are incorrect, like there is no x in the global scope, identifier x is undefined. I'm really doing, or not doing, something here.

edit: oh, and on line 168 of clientless.cpp
Code:
  std::string serverxml = curl_get("http://realmofthemadgodhrd.appspot.com/char/list");
, i think you should affix "?guid='random string here'" to the end of it, because you can get an error when sending this request (something like too many failed logins for this character(thanks to 059 for helping me on this one)).
Quote Originally Posted by bluuman View Post
i think this might be a problem with my visual studio install?
What visual studios did you install? I have 2015 community version and have no problems with it. You might need to download microsoft visual c++ redistributable as well (its an sdk that has most of the includes). Most computers already have this downloaded and installed, but you can always try to download it manually and install just to be safe. I think this is the latest one: https://www.microsoft.com/en-us/down....aspx?id=48145

Then when thats set up you shouldnt have to add any extra include paths other then the build macro ones.

Quote Originally Posted by bluuman View Post
i think you should affix "?guid='random string here'" to the end of it, because you can get an error when sending this request (something like too many failed logins for this character(thanks to 059 for helping me on this one)).
That request is getting just the server xml and only goes out once for the entire program. The request to get the characters for each client is later on. I havent run into it returning any problems and ive been running 60+ clients.
Quote Originally Posted by toddddd View Post
What visual studios did you install? I have 2015 community version and have no problems with it. You might need to download microsoft visual c++ redistributable as well (its an sdk that has most of the includes). Most computers already have this downloaded and installed, but you can always try to download it manually and install just to be safe. I think this is the latest one: https://www.microsoft.com/en-us/down....aspx?id=48145ⓘ

Then when thats set up you shouldnt have to add any extra include paths other then the build macro ones.
running 2015 visual studio community aswell. ive installed all c++ tools that come with the installer. i'll give the downloads a go, thanks. EDIT: no dice on that, i already have it installed anyways apparently. uninstalled and reinstalled, still 800 errors. ill go for a visual studio reinstall maybe. first im going to look if i need to add some include directories.
Quote Originally Posted by toddddd View Post
That request is getting just the server xml and only goes out once for the entire program. The request to get the characters for each client is later on. I havent run into it returning any problems and ive been running 60+ clients.
yeah, shouldnt run into any problems, unless you are debugging and running this over and over. i think it's fine how it is, but it could save a headache for some users if added (basically if you send the request without a password for the same account (i think its a blank for GUID) they will time you out).
Quote Originally Posted by bluuman View Post
yeah, shouldnt run into any problems, unless you are debugging and running this over and over. i think it's fine how it is, but it could save a headache for some users if added (basically if you send the request without a password for the same account (i think its a blank for GUID) they will time you out).
I have be running it over and over again with 60+ clients like i said. No issues whatsoever. So id be surprised if someone running 1 or 2 clients runs into an issue because of it. I personally have never had it return anything wrong by making a request to get just the servers and then later on a request to get the characters (which if you look at k-relay, it only sends a request to get servers). Plus if the request to get the servers fails, when it is getting the characters for the clients later it checks to see if it needs to parse the server data as well (since the servers are sent back with the characters for each request as well).
Quote Originally Posted by toddddd View Post
I have be running it over and over again with 60+ clients like i said. No issues whatsoever. So id be surprised if someone running 1 or 2 clients runs into an issue because of it. I personally have never had it return anything wrong by making a request to get just the servers and then later on a request to get the characters (which if you look at k-relay, it only sends a request to get servers). Plus if the request to get the servers fails, when it is getting the characters for the clients later it checks to see if it needs to parse the server data as well (since the servers are sent back with the characters for each request as well).
totally understand that under a typical use you would not experience any issues, yet if you simply go to your web browser now and open the char/list 10 times with guid blank, you will get this error: <Error>LoginError.tooManyFails</Error>. A user may experience this issue when debugging, or when he is opening the program and closing it to check some settings. Simply, to fix it just append any random string. it's a minor issue.
Quote Originally Posted by bluuman View Post
totally understand that under a typical use you would not experience any issues, yet if you simply go to your web browser now and open the char/list 10 times with guid blank, you will get this error: <Error>LoginError.tooManyFails</Error>. A user may experience this issue when debugging, or when he is opening the program and closing it to check some settings. Simply, to fix it just append any random string. it's a minor issue.

but theres no guid param on the request.... go open http://realmofthemadgodhrd.appspot.com/char/list 100000x times and you will never get that error. It sounds like attaching a guid param causes problems not prevents them.


edit: and it wont send out the "?guid=asdasd&password=asdasd" request to get the character data unless both a guid and password are set in the settings.


edit2: took me about 30 times of refeshing non-stop to get it to display an error for the original request (where theres no params). But again as ive mentioned, even if that one fails to get the servers it will still get the servers when its getting the character data for one of the clients. So i dont see any reason to attach a random param to the request still.
Quote Originally Posted by toddddd View Post
but theres no guid param on the request.... go open http://realmofthemadgodhrd.appspot.com/char/listⓘ 100000x times and you will never get that error. It sounds like attaching a guid param causes problems not prevents them.
I just tried it and after 10 refreshes i get the error. I'm curious to know if it only occurs from my end (please try it). Either way, the timeout is a minor 1 minute, not a big deal.
Quote Originally Posted by bluuman View Post
I just tried it and after 10 refreshes i get the error. I'm curious to know if it only occurs from my end (please try it). Either way, the timeout is a minor 1 minute, not a big deal.
yes i edited the post above and said after about 30 times of me just hitting f5 over and over and over again it did occur. But as i said, even if that happens it will still get the servers when it parses the character data for one of the clients. So im still not really convinced there needs to be a random guid param added to the request. Thanks for pointing this out though.

let me know if you get the project to compile for you too.
Quote Originally Posted by toddddd View Post
edit2: took me about 30 times of refeshing non-stop to get it to display an error for the original request (where theres no params). But again as ive mentioned, even if that one fails to get the servers it will still get the servers when its getting the character data for one of the clients. So i dont see any reason to attach a random param to the request still.
well, that settles it. I missed that part
now i just wish i could compile your project... i will try from my laptop and second PC tomorrow.
Quote Originally Posted by bluuman View Post
now i just wish i could compile your project... i will try from my laptop and second PC tomorrow.
what OS are you on? Windows 7? 8? 8.1? 10? What open-ssl did you download? Im using OpenSSL 1.0.2j. Then make sure the include for open-ssl is something like "OpenSSL-Win32\lib\VC" and not just "OpenSSL-Win32\lib".
Quote Originally Posted by toddddd View Post
what OS are you on? Windows 7? 8? 8.1? 10? What open-ssl did you download? Im using OpenSSL 1.0.2j. Then make sure the include for open-ssl is something like "OpenSSL-Win32\lib\VC" and not just "OpenSSL-Win32\lib".
I'm using windows 7
please check this (did i do it right??)

here are some errors ;(


i'll try my other pc later. need to sleep now. thanks for the help.
Uhh if you are using the build macros, you shouldnt have to do that.

Open the "BuildMacros.prop-sample" file and edit the lines:
Code:
 <CURL_INCLUDE>YOUR_CURL_INCLUDE</CURL_INCLUDE>
    <CURL_LIB>YOUR_CURL_LIB</CURL_LIB>
    <OPENSSL_INCLUDE>YOUR_OPEN_SSL_INCLUDE</OPENSSL_INCLUDE>
    <OPENSSL_LIB>YOUR_OPEN_SSL_LIB</OPENSSL_LIB>
Make sure you save this as "BuildMacros.prop"


then in your project config in visual studios:




The "Additional Dependencies" in the last image are:
Code:
Ws2_32.lib
libeay32MDd.lib
ssleay32MDd.lib
libcurl.lib

So do that. Use the build macros instead of putting them directly into the project config. If you added both the build macro's and the include paths to the project config then that might cause issues.
Quote Originally Posted by toddddd View Post
Uhh if you are using the build macros, you shouldnt have to do that.

Open the "BuildMacros.prop-sample" file and edit the lines:
Code:
 <CURL_INCLUDE>YOUR_CURL_INCLUDE</CURL_INCLUDE>
    <CURL_LIB>YOUR_CURL_LIB</CURL_LIB>
    <OPENSSL_INCLUDE>YOUR_OPEN_SSL_INCLUDE</OPENSSL_INCLUDE>
    <OPENSSL_LIB>YOUR_OPEN_SSL_LIB</OPENSSL_LIB>
Make sure you save this as "BuildMacros.prop"


then in your project config in visual studios:




The "Additional Dependencies" in the last image are:
Code:
Ws2_32.lib
libeay32MDd.lib
ssleay32MDd.lib
libcurl.lib

So do that. Use the build macros instead of putting them directly into the project config. If you added both the build macro's and the include paths to the project config then that might cause issues.
Thanks, i will try these last two things (currently i did include from buildmacros and in visual studio project options). Thanks greatly for you help.
Whenever I try and write the accept trade packet it declines instead. How do I setup the accept trade packet in the client so that it doesn't do this?
Posts 61–75 of 131 · Page 5 of 9

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?