Welcome, Guest. Please Login or Register.
March 03, 2025, 05:17:11 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Beta] YaBBpak Creator 1.1 « previous next »
Pages: 1 2 [3] 4 5 6 Reply Ignore Print
Author Topic: [Beta] YaBBpak Creator 1.1  (Read 10943 times)
jack-uk
Full Member
***
Posts: 118


I'm a llamatron addict

Re:[Beta] YaBBpak Creator 1.1
« Reply #30 on: February 27, 2003, 08:44:30 PM »
Reply with quote

Quote from: [Unknown] on February 27, 2003, 08:11:39 PMSorry, I guess I shouldn't have succumb to the numerous warning messages that I was using outdated and bad header files.  (to get rid of that, I switched to the C++ Std Lib.... which may be an M$ thing, I don't know.)

Dunno .. I've never progammed the MS compiler. I have done a couple of ports of stuff of a similar complexity .. usually it's just that they've slightly changed the function declarations from a standard one & renamed it slightly -- it shouldn't be too hard to figure out ;)

QuoteCan I offer any assistance?  Feel free to message me about it. (pm, aim, whatever.)
Thanks for the offer .. you may regret it <g>

QuoteAs well, I would be happy to create one that bases itself around diff (and give a link to the windows version of diff, which I have, along with it.) if there is a lot of want for it.
If you want to give it a bash, who am I to stop you?
I'm in the mood to hack at the mo - hence me updating my mods and porting this - but two heads are allways better than one!
Logged

Jack.R.Abbit
Mod Team
YaBB God
*****
Posts: 553


RACE FOR SPENT!

Re:[Beta] YaBBpak Creator 1.1
« Reply #31 on: February 27, 2003, 10:32:13 PM »
Reply with quote

For some time now I have been thinking about an app that would make a mod for you.  I don't have the time to do it so I'll just say how I thought it would work.  It would involve keeping a clean set up files in one directory and the modded set of files in another directory.  Run the mod maker and it would use diff to determine what needed to change to go from the clean set to the modded set and produce a .mod file from it.  Make it a bit smarter to allow you to select which files to consider when making the mod.  Even smarter to allow you to make a mod from any two directories.

I was planning to attempt a desktop app and eventually some sort of add on to PackMan itself.

Just my thoughts.  I think it would be a killer app.

-Jack
Logged

<--------  Mods by Jack  -------->
Package Server: http://www.modsbydesign.com/mods.by.jack/yabbse/ (now serving)


|----------------------------------------------|
|                                              |
|          DON'T PM ME FOR SUPPORT!             |
|                                              |
|----------------------------------------------|
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Beta] YaBBpak Creator 1.1
« Reply #32 on: February 27, 2003, 10:36:14 PM »
Reply with quote

Those were my thoughts exactly.  I just have to have the time to do it.

However, this still makes packages.... which can be very useful for getting them to be more popular...

*hint, hint*

-[Unknown]
Logged
Big P
Mod Team
YaBB God
*****
Posts: 1462


"Back in '68, I don't like you, The End."

ICQ - 76064555pierceward@hotmail.com WWW
Re:[Beta] YaBBpak Creator 1.1
« Reply #33 on: February 27, 2003, 11:02:28 PM »
Reply with quote

Just wondering, does YaBBpak use the same <tags> as BoardMod? (My last YaBBPak was for 1.4.1, and it didn't, but the YaBBpak Creator uses the same tags).
Logged

PHPNews has been released!!! Download it now!!!
Jack.R.Abbit
Mod Team
YaBB God
*****
Posts: 553


RACE FOR SPENT!

Re:[Beta] YaBBpak Creator 1.1
« Reply #34 on: February 27, 2003, 11:22:23 PM »
Reply with quote

As of 1.5.0, PackMan understands both sets of tags.   Originally I just made the mod for 1.4.1 so that more BoardMod files could be used as yabbpaks making it easier to get more yabbpaks thus making them more popular.  Then that code got integrated into 1.5.0.  It will take either/or/both.  However, some BoardMod files do not use the "Sources/xxxxx.php" path for the file to modify so it is not bullit proof.  I had intended on making PackMan make that correction on the fly if needed but I'm currently not working on Yabb.

-Jack
« Last Edit: February 27, 2003, 11:33:41 PM by Jack.R.Abbit » Logged

<--------  Mods by Jack  -------->
Package Server: http://www.modsbydesign.com/mods.by.jack/yabbse/ (now serving)


|----------------------------------------------|
|                                              |
|          DON'T PM ME FOR SUPPORT!             |
|                                              |
|----------------------------------------------|
jack-uk
Full Member
***
Posts: 118


I'm a llamatron addict

Re:[Beta] YaBBpak Creator 1.1
« Reply #35 on: February 27, 2003, 11:45:01 PM »
Reply with quote

Quote from: Jack.R.Abbit on February 27, 2003, 10:32:13 PM
For some time now I have been thinking about an app that would make a mod for you.  

For some time now, I have been wondering whether you are my clone, or is it vice-versa?

I have lots of ideas for Packman, but have yet had the time to sit and think them through.
Logged

jack-uk
Full Member
***
Posts: 118


I'm a llamatron addict

Re:[Beta] YaBBpak Creator 1.1
« Reply #36 on: March 02, 2003, 03:12:37 PM »
Reply with quote

Yay .. I've done it !  ;D

You can get a precompiled version (Mandrake 9.0) - it works here, but YMMV at http://www.jack.org.uk/yabbse-stuff/ypmake/ypmake-linux-10.tar.gz

If you just want the source, then get it from http://www.jack.org.uk/yabbse-stuff/ypmake/ypmake-10.cpp

It works with what I presume to be identical functionality to the Wndows version.
Logged

jack-uk
Full Member
***
Posts: 118


I'm a llamatron addict

Re:[Beta] YaBBpak Creator 1.1
« Reply #37 on: March 02, 2003, 03:19:33 PM »
Reply with quote

For those who want to know what I changed...

Firstly, I added a check to ensure that an input file actually exists before trying to copy from it (I was sure I had a major problem on my hands - it was just seg-faulting on me .. until I noticed the typo in the filename I gave it .. d'oh!)

Also, I have changed the character being looked for when isolating the filename of an input file '\\' in 'doze becomes '/' under unix.

And I have added a little bit more feedback while processing - OK, so they were originally debugging messages (see above)

Finally, I have changed the names of the file handling functions (M$ seemed to like preceeding everything with an underscore for no reason that I can fathom).
Most of the changes were in the WritePak function :-
void writePak(vector<node> files, FILE *output)
{
   vector<node>::iterator file;
   string cur_directory = "~";
   int infile, bread;
   unsigned char buffer[4096];
   struct _stat sBuff;

   for (file = files.begin(); file < files.end(); file++)
   {
      // Since it's sorted, write a new line for each directory.
      if (cur_directory != file->path)
      {
         fprintf(output, "dir|^|%s\n", file->path.c_str());
         cur_directory = file->path;
      }

      infile = _open(file->data.c_str(), _O_RDONLY | _O_BINARY, _S_IREAD);

      // Write the informational line (name, size, time).
      _fstat(infile, &sBuff);
      string temp = file->path + "/" + file->filename;
      fprintf(output, "file|^|%s|^|%d|^|%d\n", temp.c_str(), _filelength(infile), sBuff.st_mtime);

      // Copy infile to output.
      while (!_eof(infile))
      {
         bread = _read(infile, buffer, 4095);
         fwrite(buffer, bread, 1, output);
      }

      _close(infile);
   }
}


becomes

void writePak(vector<node> files, FILE *output)
{
   vector<node>::iterator file;
   string cur_directory = "~";
   int infile, bread;
   unsigned char buffer[4096];
   struct stat sBuff;

   printf ("Writing...\n");

   for (file = files.begin(); file < files.end(); file++)
   {
     printf ("File to add .. %s\n", file->data.c_str());
     if (file_exists(file->data.c_str())) {
      // Since it's sorted, write a new line for each directory.
      if (cur_directory != file->path)
      {
         fprintf(output, "dir|^|%s\n", file->path.c_str());
         cur_directory = file->path;
      }
      
      infile = open(file->data.c_str(), O_RDONLY, S_IREAD);

      // Write the informational line (name, size, time).
      fstat(infile, &sBuff);
      string temp = file->path + "/" + file->filename;
      fprintf(output, "file|^|%s|^|%d|^|%d\n", temp.c_str(), sBuff.st_size, sBuff.st_mtime);

      // Copy infile to output.
      while (bread = read(infile, buffer, 4095))
      {
         fwrite(buffer, bread, 1, output);
      }

      close(infile);
     } else {
       printf("File not found %s .. skipping\n", file->filename.c_str());
     }
   }
}


Enjoy!
Logged

[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Beta] YaBBpak Creator 1.1
« Reply #38 on: March 02, 2003, 03:32:27 PM »
Reply with quote

Quote from: jack-uk on March 02, 2003, 03:19:33 PM
For those who want to know what I changed...

Firstly, I added a check to ensure that an input file actually exists before trying to copy from it (I was sure I had a major problem on my hands - it was just seg-faulting on me .. until I noticed the typo in the filename I gave it .. d'oh!)

Actually, it turns out I removed the check on modification.*.  It actually should be in addNode.... here's a new version. (I'll get it compiled soon.)


void addNode(vector<node> &files, string filename, string directory, string fakename)
{
   const static basic_string<char>::size_type npos = -1;
   node temp;

   if (!file_exists(filename.c_str()))
      printf("File not found\n");

   // Are we going to fake out the filename?
   if (fakename == "")
   {
      // Isolate the filename itself.
      basic_string<char>::size_type i = filename.rfind('/');
      if (filename.rfind('/') > i && filename.rfind('/') != npos)
         i = filename.rfind('/');

      temp.filename = filename.substr(i + 1);
   }
   else
      temp.filename = fakename;

   temp.path = directory;
   temp.data = filename;

   files.push_back(temp);
}


Then remove the additional check in writePak().

Quote
Also, I have changed the character being looked for when isolating the filename of an input file '\\' in 'doze becomes '/' under unix.

That's fine... mine checked for either, but on linux you can have the windows slash.

QuoteAnd I have added a little bit more feedback while processing - OK, so they were originally debugging messages (see above)

Finally, I have changed the names of the file handling functions (M$ seemed to like preceeding everything with an underscore for no reason that I can fathom).
Most of the changes were in the WritePak function :-
....

Yeah, I know.  They wanted to get rid of them, so they changed them to _.  Plus, I like the f* (fopen, fwrite, etc.) ones better, but they don't have stat... :/.

Quote
Enjoy!

Thanks again.

-[Unknown]
Logged
jack-uk
Full Member
***
Posts: 118


I'm a llamatron addict

Re:[Beta] YaBBpak Creator 1.1
« Reply #39 on: March 02, 2003, 03:41:43 PM »
Reply with quote

Quote from: [Unknown] on March 02, 2003, 03:32:27 PMActually, it turns out I removed the check on modification.*.  It actually should be in addNode.... here's a new version. (I'll get it compiled soon.)

Wouldn't that version add the incrorrect filename to the files vector anyway? .. How about..


void addNode(vector<node> &files, string filename, string directory, string fakename)
{
  const static basic_string<char>::size_type npos = -1;
  node temp;

  if (!file_exists(filename.c_str())) {
     printf("File not found\n");
     return;
  }

  // Are we going to fake out the filename?
  if (fakename == "")
  {
     // Isolate the filename itself.
     basic_string<char>::size_type i = filename.rfind('/');
     if (filename.rfind('/') > i && filename.rfind('/') != npos)
        i = filename.rfind('/');

     temp.filename = filename.substr(i + 1);
  }
  else
     temp.filename = fakename;

  temp.path = directory;
  temp.data = filename;

  files.push_back(temp);
}


Quote
Quote
Also, I have changed the character being looked for when isolating the filename of an input file '\\' in 'doze becomes '/' under unix.

That's fine... mine checked for either, but on linux you can have the windows slash.

Hmm .. it didn't seem to actually work with Unix style paths until I changed it, but as you said '\' is a valid character in a Unix filename (although anyone who used it should get a slapping ;) )

QuoteYeah, I know.  They wanted to get rid of them, so they changed them to _.  Plus, I like the f* (fopen, fwrite, etc.) ones better, but they don't have stat... :/.

lol .. That was causing my only headache .. I was convinced that I'd broken something where you're reading from a fd and writing to a *file when in fact I;d just put in a wrong filename ::)

QuoteThanks again.

No Prob, anytime. :)
Logged

[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Beta] YaBBpak Creator 1.1
« Reply #40 on: March 02, 2003, 03:52:25 PM »
Reply with quote

Quoteif (!file_exists(filename.c_str())) {
     printf("File not found\n");
     return;
 }

Darn it.  This is what I meant to do from the first time I typed it...

The windows version is now up to date. (with that fix..)

Thanks yet again....
-[Unknown]
Logged
jack-uk
Full Member
***
Posts: 118


I'm a llamatron addict

Re:[Beta] YaBBpak Creator 1.1
« Reply #41 on: March 02, 2003, 04:30:27 PM »
Reply with quote

Quote from: [Unknown] on March 02, 2003, 03:52:25 PMThe windows version is now up to date. (with that fix..)

I've changed the Unix one to do a check in AddNode so the behaviour matches. However, I've left the check in WritePak also, there's no harm in defensive paranoia ;)
Logged

Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:[Beta] YaBBpak Creator 1.1
« Reply #42 on: March 02, 2003, 09:48:51 PM »
Reply with quote

the first line of my modification.txt was deleted when i tried this
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Beta] YaBBpak Creator 1.1
« Reply #43 on: March 02, 2003, 09:58:10 PM »
Reply with quote

Quote from: Spaceman-Spiff on March 02, 2003, 09:48:51 PM
the first line of my modification.txt was deleted when i tried this

Linux, Windows (command line or gui?), or .NET?

I've tested all but the linux one, and I lost no lines.... (files in CRLF aka \r\n aka DOS format...)

-[Unknown]
Logged
jack-uk
Full Member
***
Posts: 118


I'm a llamatron addict

Re:[Beta] YaBBpak Creator 1.1
« Reply #44 on: March 02, 2003, 10:44:16 PM »
Reply with quote

I have tested the linux one & it certainly appears to have the correct result. The line endings etc are exactly what they are with one created by packman.

How are you transferring the created .mod.yp file?
If you are uploading with FTP, it may be monkeying around with the line endings .. try uploading in BINARY mode.
Logged

Pages: 1 2 [3] 4 5 6 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Beta] YaBBpak Creator 1.1 « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.095 seconds with 20 queries.