diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2004-11-05 18:44:29 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2004-11-05 18:44:29 +0000 |
commit | 4da831702c442a00792df51d164846e19333302d (patch) | |
tree | e638bc3aab435d7089ee6df07f5302efc030cf2b | |
parent | 71babdf149f40b8e754d8a077d2df2900e1f81b6 (diff) | |
download | mana-4da831702c442a00792df51d164846e19333302d.tar.gz mana-4da831702c442a00792df51d164846e19333302d.tar.bz2 mana-4da831702c442a00792df51d164846e19333302d.tar.xz mana-4da831702c442a00792df51d164846e19333302d.zip |
*** empty log message ***
-rwxr-xr-x | GenDeb.sh | 143 | ||||
-rw-r--r-- | docs/INSTALL/linux.txt | 8 | ||||
-rw-r--r-- | docs/ReadMe.txt | 33 | ||||
-rw-r--r-- | src/game.cpp | 22 | ||||
-rw-r--r-- | src/main.cpp | 118 | ||||
-rw-r--r-- | src/main.h | 2 |
6 files changed, 307 insertions, 19 deletions
diff --git a/GenDeb.sh b/GenDeb.sh new file mode 100755 index 00000000..befcb1c2 --- /dev/null +++ b/GenDeb.sh @@ -0,0 +1,143 @@ +#!/bin/bash + +echo "Debian Package Creation..."; + +if [ $USER != "root" ]; # only root can create deb packages... +then + echo "Sorry ! this must be run as root because only root can make Debian Packages !"; + echo "Aborting..."; + exit; +fi + +make clean; +make; + +if [ ! -x ./tmw ]; # if tmw doesn't exist +then + echo "Compilation failed somwhere. Please try to correct errors given by gcc output..."; + echo "Aborting..."; + exit; +fi + +if [ ! -f ./tmw.ini ]; # if tmw.ini doesn't exist +then + echo "Can't find the tmw.ini file. Maybe this tmw version is uncomplete..."; + echo "Aborting..."; + exit; +fi + +if [ ! -d ./data ]; # if the data folder doesn't exist... +then + echo "Can't find the Mana World datas..." + echo "Aborting..."; + exit; +fi + +echo "The Mana World seems to have compiled successfully."; +echo "Now creating Debian Repository..."; + +rm -rf Debian; +mkdir Debian 0>/dev/null 1>/dev/null 2>/dev/null; + +if [ ! -d ./Debian ]; # if the Debian folder doesn't exist... +then + echo "Can't create a Debian folder here..."; + echo "Have you got enough rights to do that ?" + echo "Aborting..."; + exit; +fi + +TMW_VERSION=`grep "core_version" ./tmw.ini | cut -d'=' -f2 | cut -d' ' -f2`; +echo "Version :" $TMW_VERSION; +mkdir `echo 'Debian/manaworld_'$TMW_VERSION'_i386'`; +cd `echo 'Debian/manaworld_'$TMW_VERSION'_i386'`; +mkdir DEBIAN; +mkdir usr; +mkdir usr/share; +mkdir usr/share/manaworld; +#cp ../../tmw.ini ./usr/share/manaworld; +cp ../../tmw ./usr/share/manaworld; +cp ../../keyboard.dat ./usr/share/manaworld; +cp -a ../../data ./usr/share/manaworld; +cp -a ../../docs ./usr/share/manaworld; + +# Creating a good link to launch the game +touch ./usr/share/manaworld/manaworld; +echo "#!/bin/sh" >>./usr/share/manaworld/manaworld; +echo "cd /usr/share/manaworld;" >>./usr/share/manaworld/manaworld; +echo "./tmw;" >>./usr/share/manaworld/manaworld; +echo "cd -" >>./usr/share/manaworld/manaworld; + +chmod +x ./usr/share/manaworld/manaworld; +# End of the link + +echo "Creating Rules for the Debian package..." +#echo "Set the variables value at the begining of this script if you want to change something..."; + +touch DEBIAN/postinst; +echo "#!/bin/sh" >>DEBIAN/postinst; +echo 'if [ "$1" = "configure" ]; then' >>DEBIAN/postinst; +echo ' chmod -R 777 /usr/share/manaworld/docs;' >>DEBIAN/postinst; +echo ' if [ -d /usr/games ]; then' >>DEBIAN/postinst; +echo ' cp /usr/share/manaworld/manaworld /usr/games/manaworld;' >>DEBIAN/postinst; +echo ' chmod +x /usr/share/manaworld/manaworld;' >>DEBIAN/postinst; +echo ' fi' >>DEBIAN/postinst; +echo 'fi' >>DEBIAN/postinst; + +chmod 755 DEBIAN/postinst; +# End of postinst script... + +touch DEBIAN/prerm; +echo '#!/bin/sh' >>DEBIAN/prerm; +echo 'if [ \( "$1" = "upgrade" -o "$1" = "remove" \) ]; then' >>DEBIAN/prerm; +echo ' if [ -d /usr/games ]; then' >>DEBIAN/prerm; +echo ' rm -f /usr/games/manaworld;' >>DEBIAN/prerm; +echo ' fi' >>DEBIAN/prerm; +echo 'fi' >>DEBIAN/prerm; + +chmod 755 DEBIAN/prerm; +# End of prerm script... + +touch DEBIAN/control +echo 'Package: manaworld' >>DEBIAN/control; +echo 'Version: '$TMW_VERSION >>DEBIAN/control; +echo 'Section: bin' >>DEBIAN/control; +echo 'Priority: optional' >>DEBIAN/control; +echo 'Architecture: i386' >>DEBIAN/control; +echo 'Depends: liballegro4.1 (>= 4.1), libjgmod (>= 0.99), libalfont (>= 1.9.2)' >>DEBIAN/control; +echo 'Suggests: Nothing' >>DEBIAN/control; +echo 'Installed-Size: 1200' >>DEBIAN/control; +echo 'Maintainer: Ferreira Yohann <bertram25@hotmail.com>' >>DEBIAN/control; +echo 'Description: The Mana World is a Great Online Game based upon the Seiken Densetsu Serie.' >>DEBIAN/control; +echo ' It has its own universe, and and its own character management system, which will' >>DEBIAN/control; +echo ' give you the opportunity to play in a 2D heroic-fantasy world forever.' >>DEBIAN/control; +echo ' .' >>DEBIAN/control; +echo ' You will find the dependancy of this package on the website. Install them before trying to install this one.' >>DEBIAN/control; +echo ' You need : libalfont, and libjgmod. liballegro4.1 is given by any Debian mirrors...' >>DEBIAN/control; +echo ' Look at the website for further informations...' >>DEBIAN/control; +echo ' .' >>DEBIAN/control; +echo ' Authors:' >>DEBIAN/control; +echo ' Elven Programmer <elvenprogrammer@sourceforge.net>' >>DEBIAN/control; +echo ' Kth5 <kth5@gawab.com>' >>DEBIAN/control; +echo ' Ultramichy <celdron15@hotmail.com>' >>DEBIAN/control; +echo ' SimEdw <simon@crossnet.se>' >>DEBIAN/control; +echo ' Rotonen <j_orponen@hotmail.com>' >>DEBIAN/control; +echo ' Chetic <Chetic@gmail.com>' >>DEBIAN/control; +echo ' .' >>DEBIAN/control; +echo ' Web Site: http://themanaworld.sourceforge.net/' >>DEBIAN/control; +# End of control file... + +echo "Rules created..." +echo "Creating Debian Package..." +cd .. +chown -R root:root `echo 'manaworld_'$TMW_VERSION'_i386'`; +dpkg --build `echo 'manaworld_'$TMW_VERSION'_i386'`; +cp `echo 'manaworld_'$TMW_VERSION'_i386.deb'` ..; +cd .. +echo "Cleaning ..."; +rm -rf Debian; +echo "You Debian Package is normally ready :" +echo "His name is : manaworld_"$TMW_VERSION"_i386.deb"; + +echo "End of Debian Creation..."; + diff --git a/docs/INSTALL/linux.txt b/docs/INSTALL/linux.txt index edf47dfc..222f9d8b 100644 --- a/docs/INSTALL/linux.txt +++ b/docs/INSTALL/linux.txt @@ -70,6 +70,8 @@ manual: 3) Installing the Alfont library ================================ +NOTE: if you're using Debian check this package http://themanaworl.sourceforge.net/files/jgmod_0.99_i386.deb + This is most likely not included in any distribution out there. So download the source from here: http://nekros.freeshell.org/delirium/alfont.php @@ -99,8 +101,10 @@ the source from here: 4) Installing the JGmod library ================================ -This is not included in any distribution. Download source package from here: - http://www.geocities.com/jeffery_guan/jgmod/jgmod.zip +NOTE: if you're using Debian check this package http://themanaworl.sourceforge.net/files/libalfont_1.9.2_i386.deb + +This is not included in any distribution. Download source package from here: +http://www.geocities.com/jeffery_guan/jgmod/jgmod.zip 1) extract archive and 'cd' into the directory 2) run 'sh fixunix.sh' diff --git a/docs/ReadMe.txt b/docs/ReadMe.txt index 1a6dc043..c0754c9e 100644 --- a/docs/ReadMe.txt +++ b/docs/ReadMe.txt @@ -5,27 +5,29 @@ umperio@users.sourceforge.net Release info: - - Version: 0.0.8 pre release + - Version: 0.0.8a - Date: ?/?/2004 Development team: - Elven Programmer (Admin) - kth5 (Programmer) + - SimEdw (Programmer) - Ultramichy (Game server admin) - Rotonen (Background story and music) Special thanks: - Sull (Linux Developer) + - Neorice (Pixel Artist) - natsuki (Win32 Developer) - Genis (Win32 Developer) - RRC (Graphic Designer) - necromus (Pixel Artist) - LordNev (Artist) - jui-feng for helping in server development and php scripts. - - SimEdw for porting TMW to MacOS X + - Bertram for Debian installation script Powered by: - - Allegro, a game developing library + - Allegro - AllegroFont - JMod @@ -69,7 +71,30 @@ Remember: the server is only for development or demo purposes (Thanks again to U ------------------ 0.0.8 -- Add application icon for Win32 binaries +- added sound support for macosx +- added primitive inventory +- added action failed messages for all skills and known reasons + (0x0110 handled) +- added sit capability with the right level +- added "dead" message and restart packet +- added skill dialog +- added skill update (0x0141 handled) +- added colored text for damage +- added monster death animation +- added icon to win32 executable +- added 'enter' key support in login screen +- added RLE sprites for tiles +- added collision detection with beings +- fix for mapserver segfault-bug in chatsystem (broken pipe for all users on + screen) +- partially added TMW GUI to inventory +- added soundpool that can preload, play and remove items to/from ram +- added tmw_bar_proc +- added tmw_plus_proc && possibility to increase stats point, at each new level +- added increase skill level dialog +- added 2xSaI engine +- added patch client v0.1 to Win32 version + 0.0.7e diff --git a/src/game.cpp b/src/game.cpp index 2a81e8d5..510de2cd 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -97,17 +97,12 @@ void game() { while(state!=EXIT) { status("INPUT"); do_input(); - //if(refresh) { - status("GRAPHIC"); - do_graphic(); - //refresh = false; - //} + status("GRAPHIC"); + do_graphic(); status("PARSE"); do_parse(); status("FLUSH"); flush(); - /*if(fps>30) - rest(15);*/ } exit_graphic(); @@ -746,9 +741,12 @@ void do_parse() { break; // Add item to inventory after you bought it case 0x00a0: - inventory.add_item(RFIFOW(2), RFIFOW(6), RFIFOW(4)); + if(RFIFOB(22)>0) + chatlog.chat_log("Unable to pick up item", BY_SERVER, gui_font); + else + inventory.add_item(RFIFOW(2), RFIFOW(6), RFIFOW(4)); break; - // Remove item to inventory after you sold it + // Remove item to inventory after you sold it case 0x00af: printf("sell %i\n",-RFIFOW(4)); inventory.increase_quantity(RFIFOW(2), -RFIFOW(4)); @@ -788,6 +786,12 @@ void do_parse() { case 0x010c: chatlog.chat_log("MVP player", BY_SERVER, gui_font); break; + // Item drop + case 0x009e: + WFIFOW(0) = net_w_value(0x009f); + WFIFOL(2) = net_l_value(RFIFOL(2)); + WFIFOSET(6); + break; // Manage non implemented packets default: //printf("%x\n",id); diff --git a/src/main.cpp b/src/main.cpp index 5411866e..a64a4076 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,6 +18,10 @@ You should have received a copy of the GNU General Public License along with The Mana World; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + By ElvenProgrammer aka Eugenio Favalli (umperio@users.upagiro.net) + + Bertram */ @@ -28,6 +32,15 @@ #include <iostream> +// Part of the patch - bertram +#ifdef __USE_UNIX98 +#include <sys/stat.h> +#include <pwd.h> +#include <unistd.h> +#include <errno.h> +#endif +// End of a part of the patch - bertram + /* Account infos */ int account_ID, session_ID1, session_ID2; char sex, n_server, n_character; @@ -57,12 +70,109 @@ void request_exit() { /** Do all initialization stuff */ void init_engine() { - allegro_init(); + allegro_init(); init_log(); set_close_button_callback(request_exit); // we should not use set_window_close_hook() since it's deprecated and might be gone in the future /-kth5 - set_config_file("tmw.ini"); - if(strcmp(get_config_string("system", "core_version", NULL), CORE_VERSION)!=0) - error("Wrong INI file"); + + // A little sample of code that will add (or not) the home user directory to read the tmw.ini file in, if we are under Linux. - Bertram + + // This has the goal to have each user is own ini.file under linux. And I do this because i'm expecting to make packages of manaworld for linux, so the tmw.ini will be copied at the right place before the first execution of the application... + + char *dir = new char[400]; + strcpy(dir, ""); + + #ifndef __USE_UNIX98 + // WIN32 and else... + printf("Windows and else version\n"); + strcpy(dir, "tmw.ini"); + #endif + + #ifdef __USE_UNIX98 + printf("Linux Version\n"); + // Linux ! + char *userHome; + + char *name = getlogin(); + + passwd *pass; + + if (name != NULL) + pass = getpwnam(name); + else + pass = getpwuid(geteuid()); + + if (pass == NULL) + { + printf("Couldn't determine the user home directory. Exitting.\n"); + exit(1); + } + + userHome = pass->pw_dir; + + // Checking if homeuser/.manaworld folder exists. + sprintf(dir, "%s/.manaworld", userHome); + if ((mkdir(dir, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH) != 0) && (errno != EEXIST)) + { + printf("%s can't be made... And doesn't exist ! Exitting ...", dir); + exit(1); + } + sprintf(dir, "%s/.manaworld/tmw.ini", userHome); + //printf("file is : %s\n", dir); + + // You don't have to delete name and userHome, since they both point to datas that mustn't be destroyed while LINUX is running. + + #endif + + // Checking if the tmw.ini file exists... otherwise creates it with default options ! + FILE *tmwFile = 0; + tmwFile = fopen(dir, "r"); + + // If we can't read it, it doesn't exist ! + if ( tmwFile == NULL ) + { + // We reopen the file in write mode and we create it + printf("No file : %s\n, Creating Default Options...\n", dir); + tmwFile = fopen(dir, "wt"); + if ( tmwFile == NULL ) + { + printf("Can't create %s file. Using Defaults.\n", dir); + } + else + { + // tmw.ini creation + fprintf(tmwFile, "[system]\nsystem =\nkeyboard = en\nlanguage = \ncore_version = 0.0.8\n\n"); + + fprintf(tmwFile, "[server]\nhost = animesites.de\nport = 6901\n\n"); + fprintf(tmwFile, "[settings]\n; = Screen mode:\n; = 1 Fullscreen\n; = 2 Windowed\nscreen = 2\n"); + fprintf(tmwFile, "; = Sound:\n; = 1 enabled\n; = 0 disabled\nsound = 0\n"); + + + + char * chatlogFilename = new char [400]; + #ifdef __USE_UNIX98 + sprintf(chatlogFilename, "%s/.manaworld/chatlog.txt", userHome); + #else + strcpy(chatlogFilename, "chatlog.txt"); + #endif + fprintf(tmwFile, "; = Chat logfile location:\nchatlog = %s\n", chatlogFilename); + delete chatlogFilename; chatlogFilename = 0; + + fprintf(tmwFile, "; = Display strecth mode:\n; = 0 Disabled (Test only)\n; = 1 Normal\n; = 2 SuperEagle\n"); + fprintf(tmwFile, "stretch = 1\n\n"); + fprintf(tmwFile, "[login]\nremember = 1\nusername = Player\n"); + + fclose(tmwFile); + } + } + + set_config_file(dir); + delete dir; dir = 0; + + + + // End of portion of code revised... Bertram + + // set_config_file("tmw.ini"); #ifdef MACOSX set_color_depth(32); Init_2xSaI(32); @@ -20,6 +20,8 @@ You should have received a copy of the GNU General Public License along with The Mana World; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + By ElvenProgrammer aka Eugenio Favalli (umperio@users.upagiro.net) */ |