Jump to content
  • Advertisement

siliconsurfer

Member
  • Content count

    116
  • Joined

  • Last visited

Community Reputation

128 Neutral

About siliconsurfer

  • Rank
    Member
  1. Hi, I'm an avid player of world of warcraft. One thing I'd like to do is right a bot, to log on, and check the Auction House perodically. I know there are bots to do this, but my problem is that I actually play the game on linux using wine. Therefore many of the bots don't work. I was wondering if any of you had any ideas/thoughts/knowledge on how bots are developed for games like wow. Any resources/info you have would be great Cheers
  2. Hi, I know you shouldn't use the "==" operator to compare to strings (or char *)in C++, afterall thats what strcmp is for. But I was wondering is it valid to compare to char's using "=="? Cheers
  3. siliconsurfer

    How to compare an const unsigned char * with a char *

    For anyone who may be interested, I found out how to cast the const unsigned char * to a const char *, thus I could compare two char * variables using strcmp. //First I call my method which returns the unsigned char * const unsigned char *rspValue = rsp->getValue(); //Next I compare the two, using reinterpret_cast to recast the type if(strcmp(reinterpret_cast<const char *>(rspValue), "11") == 0){ //Do some stuff here }
  4. Hi, I call a method which returns a conts unsigned char *, now I want to compare that to a string. I know for a char * I can just do strcmp(char *, "string"); But this gives errors, I presume because it's unsigned. Does anyone know how I could compare the two?? Thanks
  5. Hi, last year I developed a game in C++ for the PC, now I want to move onto mobile games. I've been looking for articles, but found nothing great yet. Does anyone have any good pointers/tips on how to get started developing java games for mobiles? I'm looking for ideas on development environments, development kits, SDK's, tutorials etc. Any help would be much appreciated.
  6. Cheers, that's great... Pretty much exactly what I wanted.
  7. C++ I used scanf, because I was famliar with the function, but if you could point me to an example using streams, or a better way then please do.
  8. Second thoughts, is it possible to just declare an array of char pointers, and pass that in, will scanf create the data on the heap, and assign the address to each pointer in the array?
  9. Hi, in short I would like to pass a dynamic number of parameters to scanf, why? Because sometimes in some programs I want to read files with four fields, and other times I want read files with three fields, sometimes they are strings, sometimes they are ints. Now forgetting the problems assocaited with storing data in strings, or int's. Is it possible to embed a loop in scanf, so it cycles through pointers to store the data i.e say I have a file with the following data on each line:- --------- #firstName secondName address age dave jones belfast 22 --------- So i would create a formatString to pass to scanf. char formatString[] = "\%s \%s \%s \%d"; now after reading a line into a buffer how can I pass say four arguments to scanf, without implicitly coding four arguments in? could I write something like:- char fName[32]; char sName[32]; char address[32]; char *array[3]; array[0]=&fName; array[1]=&sName; array[2]=&address; scanf(buffer, formatString, for(int i=0;i<3;i++){array}, &age); Any thoughts, suggestions on how to achive this or something simliar?
  10. siliconsurfer

    char * to enum

    Hi, quick question. I have a enum type called stage. So I can have write:- stage theStage = first; stage theStage = second; etc etc I was wondering is there any way, if I read in the string "first" from a text file and store it in char *stageString, can I somehow convert the char * to the enum type. i.e stage theStage = stageString; Cheers
  11. siliconsurfer

    Maybe it's time to move to Linux

    I've been a linux advocate for a long time now. Infact I don't have a windoze box. I play Doom III, World of Warcraft, GTA, and many more games on nix. Infact for my final year project as a BEng Software Engineer, I developed a game which would run on both linux and windoze. It was suprisngly easy, as I had to give no consideration to platform independance, as the SDL library and ANSI C++ did that for me.
  12. siliconsurfer

    problems with unsigned char *

    I think it's ok to create a const pointer, Technically what should happen is the address which the pointer holds will be constant, but the data which is stored at that address can be changed - I think!.
  13. siliconsurfer

    problems with unsigned char *

    Ok well Thanks to everyone, especailly Engima and the_dannobot. You both pretty much hit the nail on the head with your last posts. Here is what I've got - and it's working. For those who are interested in the server side the following is done (hard coded, I've gota get it to take values passed in now - but that's the easy bit ;-) ) [source lang=cpp] const char *inName = "Url"; int size = 2; ptrObject->SetAttribute("Url", reinterpret_cast< unsigned char const * >("44"), 2); And on the client side I do this [source lang=cpp] const unsigned char *value = NULL; int valueLen=0; if(rspData->GetAttribute("Url", value, valueLen) == false){ printf("Error: the data not found\n"); }else{ printf("Client received a TCCRspMsg response\n"); printf("Server categorized %s as %s\n", reqUrl, value); } Cheers again, but just to clear up my understanding of a unsigned char, does that mean the char can only be made up of 8bit ASCII? If thats right, then how is a signed char stored?
  14. siliconsurfer

    problems with unsigned char *

    Ok, well let me explain a little more, orginally I thought the problem was on the client side when it got the response message, but it seems the the message is not getting created properly at the sever side. There is a responseMEssage which takes a dataObject. So I write dataObject *ptrObject = new dataObject(); The dataObject has a SetAttribute and GetAttribute methods. I don't know what goes on inside, as I only have the header, but the definitions are as follows:- void SetAttribute(const char *name, const unsigned char *value, int valueLen); bool GetAttribute(const char *name, const unsigned char *&value,int &valueLen); What I would like to do is pass in the name "Url" the value 44 and the length 2 Then be able to create variables and call GetAttribute and print them. I've tried the follwoing to Set the Attributes, it compiles and runs, but nothing seems to get set. const char *inName = "Url"; const unsigned char *inValue = (unsigned char*) "44"; int size = 2; ptrObject-&gt;SetAttribute(inName, inValue, size); I belive no data is being set, because I get nothing when I try const char *newData =NULL; const unsigned char *newData2 =NULL; pCustomData->GetAttribute(newData, newData2, size); printf("data %s\n", newData2); And yes, there is alot of legacy C code about, and I think that's why there isn't much use of the stdlib.
  15. siliconsurfer

    problems with unsigned char *

    GetValue returns a bool, fales if it can't find the data. I've discovered now that it's not getting the data, probably because it's not getting stored for some reason. so if as you say, I need to create enough space for the unsigned char, is there any way to store a string such as "the string" in a const unsigned char *? So say I write const unsigned char *value = new unsigned char[16]. How would I store data in it? Cheers
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!