| 
Ananas
 Moderator 
Joined: 22nd Apr 2009Posts: 2190
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoChange SAKE_SEEK to SEEK_END. That works for me. In your quest.cpp file.
 ---
"Pineapples and shit." |  
		| 
lewis999  
Joined: 27th Aug 2010Posts: 368
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoThanks but now I get this : C:\Users\LewisH\Downloads\eoserv-trunk-r189\eoserv-trunk-r189\trunk\src\world.hpp||In constructor 'Quest::Quest(short int, World*)':| C:\Users\LewisH\Downloads\eoserv-trunk-r189\eoserv-trunk-r189\trunk\src\world.hpp|270|error: '2' cannot be used as a function| C:\Users\LewisH\Downloads\eoserv-trunk-r189\eoserv-trunk-r189\trunk\src\world.hpp|272|error: '2' cannot be used as a function| C:\Users\LewisH\Downloads\eoserv-trunk-r189\eoserv-trunk-r189\trunk\src\world.hpp|275|warning: comparison between signed and unsigned integer expressions| ||=== Build finished: 2 errors, 23 warnings ===| 
 |  
		| 
Ananas
 Moderator 
Joined: 22nd Apr 2009Posts: 2190
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoCan you pastebin your quest.cpp and post it. I could get a clear view of what you're using and how to fix this.
 ---
"Pineapples and shit." |  
		| 
lewis999  
Joined: 27th Aug 2010Posts: 368
 
  Re: EOserv rev 189 Compiled
15 years, 11 weeks ago |  
		| 
Ananas
 Moderator 
Joined: 22nd Apr 2009Posts: 2190
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoTry and switch your Quest::Quest function with this one;
 Quest::Quest(short id, World *world)
 {
 char namebuf[4];
 
 if (id < 0)
 {
 return;
 }
 this->id = id;
 this->exists = true;
 
 std::string filename = "";
 filename = world->config["QuestDir"].GetString();
 std::sprintf(namebuf, "%05i", id);
 filename.append(namebuf);
 filename.append(".eqf");
 std::FILE *fh = std::fopen(filename.c_str(), "rt");
 std::string buf;
 
 if (!fh)
 {
 Console::Err("Could not load file: %s", filename.c_str());
 this->exists = false;
 return;
 }
 
 std::fseek(fh, 0, SEEK_END);
 long size = ftell(fh);
 std::rewind(fh);
 
 buf.resize(size);
 std::fread(&buf[0], 1, size, fh);
 std::fclose(fh);
 
 Load(buf);
 }
 
 ---
"Pineapples and shit." |  
		| 
lewis999  
Joined: 27th Aug 2010Posts: 368
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoThank you for all you help, its finaly working :D
 I'm just going to fix the spawn and home stuff now then ill upload v0.3 :) |  
		| 
Ananas
 Moderator 
Joined: 22nd Apr 2009Posts: 2190
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoNice! :] If you need help on errors and such you could always ask me in this topic.
 ---
"Pineapples and shit." |  
		| 
Blade  
Joined: 24th Nov 2009Posts: 87
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoI gave up on trying to get Addison's thing working because the problems it has are conveniently never explained in the thread about it and when I tried to ask about it I just got told to hold off until Apollo's bulk rev comes out. |  
		| 
		|  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agohey lewis i think you forgot to add quest.cpp again in v0.3 ---
Live and let live. Hurt but do not kill. Finish what you start. NEVER GIVE UP!!! |  
		| 
Addison  
Joined: 24th Mar 2009Posts: 1380
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoSAKE_SEEK is what Sausage uses to load map files safely. I decided to add into my source to be cool. Here's what you need to add at the top of quest.cpp: 
 static const char *safe_fail_filename;
 static void safe_fail(int line)
 {
 Console::Err("Invalid file / failed read/seek: %s -- %i", safe_fail_filename, line);
 std::exit(1);
 }
 
 #define SAFE_SEEK(fh, offset, from) if (std::fseek(fh, offset, from) != 0) { std::fclose(fh); safe_fail(__LINE__); }
 #define SAFE_READ(buf, size, count, fh) if (std::fread(buf, size, count, fh) != static_cast<int>(count)) {  std::fclose(fh); safe_fail(__LINE__);}
 
 ---
http://www.addipop.com |  
		| 
Ananas
 Moderator 
Joined: 22nd Apr 2009Posts: 2190
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoDon't you mean SAFE_SEEK Instead of SAKE_SEEK?
 ---
"Pineapples and shit." |  
		| 
Blade  
Joined: 24th Nov 2009Posts: 87
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoHe's right, the 4 Quest.cpp/hpp files aren't added into this project, I had to manually add them myself. There was also a weird issue with recompiling eoserv.  I readded the server-specific changes I have normally (std::abs map fix, disabling of #class, and pet items), but my project refused to acknowledge that there had been a change, so I had to rebuild instead of build. Shit was kinda weird. |  
		| 
Addison  
Joined: 24th Mar 2009Posts: 1380
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoAnanas, we all make mistakes. I've heard about that mistake a few times. Eventually, I'll get off my lazy ass and finish my quest system and upload all the fixes.
 ---
http://www.addipop.com |  
		| 
Ananas
 Moderator 
Joined: 22nd Apr 2009Posts: 2190
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks ago
Addison posted: (30th Aug 2010 12:13 pm)
 
 Ananas, we all make mistakes. I've heard about that mistake a few times. Eventually, I'll get off my lazy ass and finish my quest system and upload all the fixes.
 
Didn't ment to offend you =[, Just had to make sure if it had to be SAFE instead of SAKE cause I couldn't find it anywere ;p
 ---
"Pineapples and shit." |  
		| 
Blade  
Joined: 24th Nov 2009Posts: 87
 
  Re: EOserv rev 189 Compiled 
15 years, 11 weeks agoWith this new quest thing, I am unable to make the Wise Man thing happen more than once.  After I finish changing my class, he is unclickable again.  I don't know if this is a problem in Lewis' implementation or if it was always a problem in the original quest code
itself,butregardless it makes for a depressingly lackluster Wise Man, unless you actually want people to be able to change their class only once.
 edit: See next post, iFail@life |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |