lfnetwork.com mark read register faq members calendar

Thread: razorace
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 10-17-2005, 04:27 PM   #41
Slider744
Junior Member
 
Slider744's Avatar
 
Join Date: Dec 2003
Location: France
Posts: 260
yes or perhaps i can use the syscall file function of Jedi academt to write a file instead of using fwrite...

the problem is that i don't know where goes the file writen by those syscall function on MAC os X

if it does not go in ~/Libraty/appliction support/jedi academy/base

the pk3 will not be loaded


******************************
Slider
JA+ MOD Author for Jedi Academy
the lastest version on

http://www.japlus.net/


******************************
Slider744 is offline   you may: quote & reply,
Old 10-17-2005, 07:30 PM   #42
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
*shrug* seems like an interesting feature but I'm not sure it would be worth the time commitment. The only people that regular use OJP run it in server-only mode so spending the time to port/debug this sort of code seems like time that could be better spent on gameplay features.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 10-19-2005, 12:58 AM   #43
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
i found a code snippet that copies the file and it's only like 20 lines in the C code. i'll post it later
stubert is offline   you may: quote & reply,
Old 10-19-2005, 09:36 AM   #44
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
1 line :x
Code:
FS_CopyFile ( fromOSpath, toOSpath );


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 10-19-2005, 09:43 AM   #45
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
Code:
int FileCopy( const char *src, const char *dst )

{

   #define BUFSZ 16000



   char            *buf[BUFSZ];

   FILE            *fi;

   FILE            *fo;

   unsigned        amount;

   unsigned        written;

   int             result;



  // buf = new char;



   fi = fopen( src, "rb" );

   fo = fopen( dst, "wb" );



   result = COPY_OK;

   if  ((fi == NULL) || (fo == NULL) )

    {

      result = COPY_ERROR;

      if (fi != NULL) fclose(fi);

      if (fo != NULL) fclose(fo);

    }



   if (result == COPY_OK)

    {

      do

      {

         amount = fread( buf, sizeof(char), BUFSZ, fi );

         if (amount)

         {

            written = fwrite( buf, sizeof(char), amount, fo );

            if (written != amount)

            {

            result = COPY_ERROR; // out of disk space or some other disk err?

            }

         }

      } // when amount read is < BUFSZ, copy is done

     while ((result == COPY_OK) && (amount == BUFSZ));

         fclose(fi);



     fclose(fo);

   }

   //delete [] buf;

   return(result);

}

you have control over the path with this
stubert is offline   you may: quote & reply,
Old 10-19-2005, 10:09 AM   #46
Slider744
Junior Member
 
Slider744's Avatar
 
Join Date: Dec 2003
Location: France
Posts: 260
yes i know what fo = fopen( dst, "wb" ); does

i already use it for the win32 version

the pb is that on mac the dst path is ~/Library/........./base which points to /Users/USERNAME_onMAC_OS_X/Library/................/base

fopen( "/Users/USERNAME_onMAC_OS_X/Library/................/base/test.pk3"
, "wb" ); will WORK


fopen( "~/Library/................/base/test.pk3"
, "wb" ); will NOT WORK

so i need on mac os X to know the user starting the JediAcademy.app application which is absolutly not in the same folders like for the windows game...

OR as i said, perhaps using the trap syscall fs_write functions will give on mac os x a better result as the main client programm will make the work to write the files in the good folder...
I think it will give a try to this method for mac ox x....

on windows i used fwrite because i can like that write the pk3 in base folder...
I am pratically sure that the base engine syscall fs_write will write the file in the fs_game folder which is not what i want...


******************************
Slider
JA+ MOD Author for Jedi Academy
the lastest version on

http://www.japlus.net/


******************************

Last edited by Slider744; 10-19-2005 at 10:49 AM.
Slider744 is offline   you may: quote & reply,
Old 10-19-2005, 10:12 AM   #47
Slider744
Junior Member
 
Slider744's Avatar
 
Join Date: Dec 2003
Location: France
Posts: 260
woa stubert, you live philadelhpia?

i went to philadelphia a few month ago...
^^


******************************
Slider
JA+ MOD Author for Jedi Academy
the lastest version on

http://www.japlus.net/


******************************
Slider744 is offline   you may: quote & reply,
Old 10-19-2005, 11:58 AM   #48
redsaurus
Rookie
 
redsaurus's Avatar
 
Join Date: Nov 2003
Location: Using a Mac
Posts: 49
The path seems to be stored in fs_homepath on the OS X version. I don't think that "base" is included at the end of the path
redsaurus is offline   you may: quote & reply,
Old 10-19-2005, 01:13 PM   #49
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
thats cool slider, you were on vacation?
stubert is offline   you may: quote & reply,
Old 10-19-2005, 02:51 PM   #50
Slider744
Junior Member
 
Slider744's Avatar
 
Join Date: Dec 2003
Location: France
Posts: 260
Quote:
Originally Posted by stubert
thats cool slider, you were on vacation?
heu no it was for work

can u tell me redsaurus what is the value of fs_homepath?

is it /Users/Redsaurus/Library/Application SUpport/Jedi Academy/ ?

then inside there is base and all other mod folders like japlus ?


******************************
Slider
JA+ MOD Author for Jedi Academy
the lastest version on

http://www.japlus.net/


******************************
Slider744 is offline   you may: quote & reply,
Old 10-19-2005, 03:34 PM   #51
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
Wow, cooperation. Sweet.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 10-19-2005, 03:59 PM   #52
Jufa
Rookie
 
Join Date: Sep 2005
Posts: 72
cooperation is sweet indeed
*winks to redsaurus* have you checked your email??




p.s. sry for off-topic
Jufa is offline   you may: quote & reply,
Old 10-20-2005, 07:53 AM   #53
redsaurus
Rookie
 
redsaurus's Avatar
 
Join Date: Nov 2003
Location: Using a Mac
Posts: 49
Quote:
Originally Posted by Slider744
heu no it was for work

can u tell me redsaurus what is the value of fs_homepath?

is it /Users/Redsaurus/Library/Application SUpport/Jedi Academy/ ?

then inside there is base and all other mod folders like japlus ?
The value of fs_homepath is stored in old Mac OS 9 folder system paths, it seems:

Code:
Macintosh HD:Users:<username>:Library:Application Support:Jedi Academy MP
Jufa: yes I'll reply to it soon
redsaurus is offline   you may: quote & reply,
Old 10-20-2005, 10:07 AM   #54
Slider744
Junior Member
 
Slider744's Avatar
 
Join Date: Dec 2003
Location: France
Posts: 260
Quote:
Originally Posted by redsaurus
The value of fs_homepath is stored in old Mac OS 9 folder system paths, it seems:

Code:
Macintosh HD:Users:<username>:Library:Application Support:Jedi Academy MP
Jufa: yes I'll reply to it soon
Hum
but is it because you have an old MAC version?


******************************
Slider
JA+ MOD Author for Jedi Academy
the lastest version on

http://www.japlus.net/


******************************
Slider744 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > razorace

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:35 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.