Kurgan Posted October 13, 2005 Share Posted October 13, 2005 Ah ok. 'Cause I was gonna say, anything abusive I think we should simply drop out of OJP. Link to comment Share on other sites More sharing options...
razorace Posted October 14, 2005 Share Posted October 14, 2005 Hmmm, sounds like there's some concern with the source code I recieved. Enisform, how about you contact me the next time you see me on MSN and we can talk about it? Link to comment Share on other sites More sharing options...
stubert Posted October 14, 2005 Author Share Posted October 14, 2005 why bother? all ensi is pineing over is a few admin commands that nobody cares about, the rest are lines copies right from ojp, et, osp.. i was just hoping you'd take advantage of the things i spent the builk of my time on, weapon adjusters, scoreboard and rewards, moveable hud, unlagged (which ensi copied and i spent a week straight debugging), threads with the in-game file installations, **** like that. later on i'll show you how to make file transfers work smoothly and do up some nice howtos and yea, ensi is supposed to understand that we forked it and that he has no buisness telling me what to do with my fork than i do with his. and i hate admin mods, their ghey. Link to comment Share on other sites More sharing options...
razorace Posted October 14, 2005 Share Posted October 14, 2005 Well, I just want to make sure I'm on the straight with everyone that contributed since otherwise I could get in a big, huge mess later. Link to comment Share on other sites More sharing options...
ensiform Posted October 14, 2005 Share Posted October 14, 2005 why bother? all ensi is pineing over is a few admin commands that nobody cares about, the rest are lines copies right from ojp, et, osp.. i was just hoping you'd take advantage of the things i spent the builk of my time on, weapon adjusters, scoreboard and rewards, moveable hud, unlagged (which ensi copied and i spent a week straight debugging), threads with the in-game file installations, **** like that. later on i'll show you how to make file transfers work smoothly and do up some nice howtos and yea, ensi is supposed to understand that we forked it and that he has no buisness telling me what to do with my fork than i do with his. and i hate admin mods, their ghey. uhm no go ahead and think all i did was steal or barrow but your wrong there. also using pthread in windows is very lagged and is mem consuming according to slider. Kurgan: as for whats listed above has nothing to do with red slushie ;D i really dont care if u have the code,,, its still quite buggy anyway. Link to comment Share on other sites More sharing options...
razorace Posted October 14, 2005 Share Posted October 14, 2005 I wasn't even aware that pthread would work on a windows plat. I thought it was a *unix thingy only Link to comment Share on other sites More sharing options...
ensiform Posted October 15, 2005 Share Posted October 15, 2005 it does :x but slider told me its a mem hog. Link to comment Share on other sites More sharing options...
razorace Posted October 15, 2005 Share Posted October 15, 2005 Doesn't surprise me. pthread was originally only designed for unix. Link to comment Share on other sites More sharing options...
stubert Posted October 15, 2005 Author Share Posted October 15, 2005 theres really nothing wrong with it, plus your code will carry to pthreads for os X and pthreads for linux if you need some threads going server side. Link to comment Share on other sites More sharing options...
razorace Posted October 15, 2005 Share Posted October 15, 2005 Other than cheat detection, why use threads in the first place? Isn't most of the code linear in nature anyway? Link to comment Share on other sites More sharing options...
stubert Posted October 16, 2005 Author Share Posted October 16, 2005 i use threads for file transfers as well. i can have jka transfer a map and play at the same time only loosing about 5-10 fps Link to comment Share on other sites More sharing options...
slider Posted October 17, 2005 Share Posted October 17, 2005 it does :x but slider told me its a mem hog. yes on windows, it is probably better to use the native thread function.. Indeed phtread on windows is a port of phtread linux code in order to provide the same headers for each function than the linux api. But in background it uses the native windows api library.. In my URL redirect for autodownload in JA+2.4Beta1, i uses the windows native api for the windows version. But sure on linux and mac, i use pthread. But i prefer having 2 different codes for each plateform. It is probably more optimized. Moreover some feature in pthread available in linux and mac plateform are not available in the windows port of pthread.. Using the native thread api for windows, i have much more options and feature.... moreover the thread needed code for uRL redirect autodownload is very simple. So it is very easy to have a linux, mac version based on pthread or even directly just some fork(), and a windows version based on the native windows api.. Link to comment Share on other sites More sharing options...
stubert Posted October 17, 2005 Author Share Posted October 17, 2005 yea, curl + pthreads are portable to mac Link to comment Share on other sites More sharing options...
slider Posted October 17, 2005 Share Posted October 17, 2005 the only things i didn't port correctly yet on MAC OS X is the path of the base folder it is in ~/Library/Application data/Jedi Academy/ or something like that... and i didn't found yet how to point directly to this path when i write a file using fwrite and fopen... using this path doesn't work because it does not read the ~/ and does not understand it as /users/yourUserName... I would have probably a mean in C/C++ to know the name of the user which starting the jedi academy.app programm on MAC.... or perhaps on mac os x, the game is storing the path of base in a cvar? or perhaps there is a subroutine syscall on the mac port of the game to know the real path /Users/username/Library/........./base Link to comment Share on other sites More sharing options...
stubert Posted October 17, 2005 Author Share Posted October 17, 2005 you probably need to include system headers for that.. or maybe it's a GNU thing Link to comment Share on other sites More sharing options...
slider Posted October 17, 2005 Share Posted October 17, 2005 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 Link to comment Share on other sites More sharing options...
razorace Posted October 17, 2005 Share Posted October 17, 2005 *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. Link to comment Share on other sites More sharing options...
stubert Posted October 19, 2005 Author Share Posted October 19, 2005 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 Link to comment Share on other sites More sharing options...
ensiform Posted October 19, 2005 Share Posted October 19, 2005 1 line :x FS_CopyFile ( fromOSpath, toOSpath ); Link to comment Share on other sites More sharing options...
stubert Posted October 19, 2005 Author Share Posted October 19, 2005 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 Link to comment Share on other sites More sharing options...
slider Posted October 19, 2005 Share Posted October 19, 2005 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... Link to comment Share on other sites More sharing options...
slider Posted October 19, 2005 Share Posted October 19, 2005 woa stubert, you live philadelhpia? i went to philadelphia a few month ago... ^^ Link to comment Share on other sites More sharing options...
redsaurus Posted October 19, 2005 Share Posted October 19, 2005 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 Link to comment Share on other sites More sharing options...
stubert Posted October 19, 2005 Author Share Posted October 19, 2005 thats cool slider, you were on vacation? Link to comment Share on other sites More sharing options...
slider Posted October 19, 2005 Share Posted October 19, 2005 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 ? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.