From 34262706ea26736a6bcc1c20f09bd5c8d5b890bf Mon Sep 17 00:00:00 2001 From: HarpyWar Date: Mon, 3 Feb 2014 11:02:09 +0400 Subject: [PATCH] reorganize files, only pvpgn source here now --- pvpgn/BUGS => BUGS | 0 pvpgn/CMakeLists.txt => CMakeLists.txt | 0 d2pack109/COPYING => COPYING | 0 pvpgn/CREDITS => CREDITS | 0 ...igureChecks.cmake => ConfigureChecks.cmake | 0 pvpgn/IGNOREME => IGNOREME | 0 pvpgn/NEWS => NEWS | 0 pvpgn/README.ALPHA => README.ALPHA | 0 pvpgn/README.DEV => README.DEV | 0 pvpgn/README.cmake => README.cmake | 0 README.md | 4 +- pvpgn/TODO => TODO | 0 pvpgn/UPDATE => UPDATE | 0 .../Modules/CheckIncludeFilesCXX.cmake | 0 .../Modules/CheckMkdirArgs.cmake | 0 .../Modules/CheckTypeSizeCXX.cmake | 0 .../Modules/CheckTypeSizeCXX.cxx.in | 0 .../Modules/DefineInstallationPaths.cmake | 0 .../cmake => cmake}/Modules/FindMySQL.cmake | 0 {pvpgn/cmake => cmake}/Modules/FindODBC.cmake | 0 .../Modules/FindPostgreSQL.cmake | 0 .../cmake => cmake}/Modules/FindSQLite3.cmake | 0 {pvpgn/cmake => cmake}/Modules/FindZLIB.cmake | 0 {pvpgn/conf => conf}/CMakeLists.txt | 0 {pvpgn/conf => conf}/Makefile.am | 0 {pvpgn/conf => conf}/ad.conf.in | 0 .../conf => conf}/address_translation.conf.in | 0 {pvpgn/conf => conf}/anongame_infos.conf.in | 0 {pvpgn/conf => conf}/autoupdate.conf.in | 1036 +++++------ {pvpgn/conf => conf}/bnalias.conf.in | 0 {pvpgn/conf => conf}/bnban.conf.in | 0 {pvpgn/conf => conf}/bnetd.conf.in | 0 {pvpgn/conf => conf}/bnetd.conf.win32 | 0 {pvpgn/conf => conf}/bnetd_default_user.cdb | Bin .../conf => conf}/bnetd_default_user.plain.in | 0 {pvpgn/conf => conf}/bnhelp.conf.in | 0 {pvpgn/conf => conf}/bnissue.txt.in | 0 {pvpgn/conf => conf}/bnmaps.conf.in | 0 {pvpgn/conf => conf}/bnmotd-bgBG.txt.in | 0 {pvpgn/conf => conf}/bnmotd-csCZ.txt.in | 0 {pvpgn/conf => conf}/bnmotd-deDE.txt.in | 0 {pvpgn/conf => conf}/bnmotd-enUS.txt.in | 0 {pvpgn/conf => conf}/bnmotd-esES.txt.in | 0 {pvpgn/conf => conf}/bnmotd-frFR.txt.in | 0 {pvpgn/conf => conf}/bnmotd-jpJA.txt.in | 0 {pvpgn/conf => conf}/bnmotd-koKR.txt.in | 0 {pvpgn/conf => conf}/bnmotd-nlNL.txt.in | 0 {pvpgn/conf => conf}/bnmotd-plPL.txt.in | 0 {pvpgn/conf => conf}/bnmotd-ptBR.txt.in | 0 {pvpgn/conf => conf}/bnmotd-ruRU.txt.in | 0 {pvpgn/conf => conf}/bnmotd-svSE.txt.in | 0 {pvpgn/conf => conf}/bnmotd-zhCN.txt.in | 0 {pvpgn/conf => conf}/bnmotd-zhTW.txt.in | 0 {pvpgn/conf => conf}/bnxpcalc.conf.in | 0 {pvpgn/conf => conf}/bnxplevel.conf.in | 0 {pvpgn/conf => conf}/channel.conf.in | 0 {pvpgn/conf => conf}/command_groups.conf.in | 0 {pvpgn/conf => conf}/d2cs.conf.in | 0 {pvpgn/conf => conf}/d2cs.conf.win32 | 0 {pvpgn/conf => conf}/d2dbs.conf.in | 0 {pvpgn/conf => conf}/d2dbs.conf.win32 | 0 {pvpgn/conf => conf}/d2server.ini | 0 {pvpgn/conf => conf}/news.txt.in | 0 {pvpgn/conf => conf}/realm.conf.in | 0 {pvpgn/conf => conf}/sql_DB_layout.conf.in | 0 {pvpgn/conf => conf}/sql_DB_layout2.conf.in | 0 {pvpgn/conf => conf}/supportfile.conf.in | 0 {pvpgn/conf => conf}/topics.conf.in | 0 {pvpgn/conf => conf}/tournament.conf.in | 0 {pvpgn/conf => conf}/versioncheck.conf.in | 0 pvpgn/config.h.cmake => config.h.cmake | 0 ...nversion-changelog => conversion-changelog | 0 d2pack109/CREDITS | 245 --- d2pack109/README | 44 - d2pack109/Win32-Projects/Makefile.mingw | 493 ------ d2pack109/Win32-Projects/make_mingw.bat | 24 - d2pack109/Win32-Projects/make_mingw.sh | 8 - d2pack109/conf/address_translation.conf | 94 - d2pack109/conf/d2cs.conf.in | 201 --- d2pack109/conf/d2cs.conf.win32 | 201 --- d2pack109/conf/d2dbs.conf.in | 104 -- d2pack109/conf/d2dbs.conf.win32 | 104 -- .../docs/Compile.Instructions.Win32.MinGW.txt | 25 - d2pack109/docs/INSTALL.unix | 48 - d2pack109/docs/Service.Win32.txt | 5 - d2pack109/src/Makefile.in | 348 ---- d2pack109/src/autoconf/ansi2knr.c | 637 ------- d2pack109/src/autoconf/ccstdc.m4 | 91 - d2pack109/src/autoconf/config.guess | 1410 --------------- d2pack109/src/autoconf/config.sub | 1508 ----------------- d2pack109/src/autoconf/termios.m4 | 14 - d2pack109/src/autoconf/winsz.m4 | 36 - d2pack109/src/autogen.sh | 4 - d2pack109/src/common/addr.c | 626 ------- d2pack109/src/common/addr.h | 100 -- d2pack109/src/common/bn_type.c | 665 -------- d2pack109/src/common/bn_type.h | 90 - d2pack109/src/common/d2game_protocol.h | 551 ------ d2pack109/src/common/elist.h | 91 - d2pack109/src/common/eventlog.c | 379 ----- d2pack109/src/common/eventlog.h | 75 - d2pack109/src/common/fdwatch.c | 211 --- d2pack109/src/common/fdwatch.h | 77 - d2pack109/src/common/fdwatch_epoll.c | 160 -- d2pack109/src/common/fdwatch_epoll.h | 28 - d2pack109/src/common/fdwatch_kqueue.c | 286 ---- d2pack109/src/common/fdwatch_kqueue.h | 28 - d2pack109/src/common/fdwatch_poll.c | 185 -- d2pack109/src/common/fdwatch_poll.h | 28 - d2pack109/src/common/fdwatch_select.c | 176 -- d2pack109/src/common/fdwatch_select.h | 28 - d2pack109/src/common/field_sizes.h | 63 - d2pack109/src/common/flags.h | 27 - d2pack109/src/common/hashtable.c | 593 ------- d2pack109/src/common/hashtable.h | 103 -- d2pack109/src/common/hexdump.c | 76 - d2pack109/src/common/hexdump.h | 32 - d2pack109/src/common/init_protocol.h | 64 - d2pack109/src/common/list.c | 345 ---- d2pack109/src/common/list.h | 90 - d2pack109/src/common/network.c | 233 --- d2pack109/src/common/network.h | 34 - d2pack109/src/common/packet.c | 787 --------- d2pack109/src/common/packet.h | 170 -- d2pack109/src/common/queue.c | 207 --- d2pack109/src/common/queue.h | 60 - d2pack109/src/common/rlimit.c | 79 - d2pack109/src/common/rlimit.h | 19 - d2pack109/src/common/setup_before.h | 374 ---- d2pack109/src/common/tag.c | 246 --- d2pack109/src/common/tag.h | 127 -- d2pack109/src/common/trans.c | 353 ---- d2pack109/src/common/trans.h | 55 - d2pack109/src/common/util.c | 634 ------- d2pack109/src/common/util.h | 45 - d2pack109/src/common/version.h | 21 - d2pack109/src/common/xalloc.c | 119 -- d2pack109/src/common/xalloc.h | 67 - d2pack109/src/compat/access.h | 30 - d2pack109/src/compat/char_bit.h | 35 - d2pack109/src/compat/difftime.c | 42 - d2pack109/src/compat/difftime.h | 38 - d2pack109/src/compat/exitstatus.h | 37 - d2pack109/src/compat/gethostname.h | 34 - d2pack109/src/compat/getopt.c | 1009 ----------- d2pack109/src/compat/getopt.h | 151 -- d2pack109/src/compat/gettimeofday.c | 72 - d2pack109/src/compat/gettimeofday.h | 49 - d2pack109/src/compat/inet_aton.c | 183 -- d2pack109/src/compat/inet_aton.h | 72 - d2pack109/src/compat/inet_ntoa.c | 64 - d2pack109/src/compat/inet_ntoa.h | 34 - d2pack109/src/compat/memcpy.c | 61 - d2pack109/src/compat/memcpy.h | 28 - d2pack109/src/compat/memmove.c | 49 - d2pack109/src/compat/memmove.h | 28 - d2pack109/src/compat/memset.c | 47 - d2pack109/src/compat/memset.h | 28 - d2pack109/src/compat/mkdir.h | 55 - d2pack109/src/compat/mmap.c | 84 - d2pack109/src/compat/mmap.h | 66 - d2pack109/src/compat/pdir.c | 241 --- d2pack109/src/compat/pdir.h | 94 - d2pack109/src/compat/psock.c | 87 - d2pack109/src/compat/psock.h | 275 --- d2pack109/src/compat/recv.h | 39 - d2pack109/src/compat/rename.h | 36 - d2pack109/src/compat/seek.h | 45 - d2pack109/src/compat/send.h | 39 - d2pack109/src/compat/signal.h | 26 - d2pack109/src/compat/socket.h | 40 - d2pack109/src/compat/stdfileno.h | 39 - d2pack109/src/compat/strcasecmp.c | 70 - d2pack109/src/compat/strcasecmp.h | 34 - d2pack109/src/compat/strchr.h | 31 - d2pack109/src/compat/strdup.c | 57 - d2pack109/src/compat/strdup.h | 27 - d2pack109/src/compat/strerror.c | 291 ---- d2pack109/src/compat/strerror.h | 27 - d2pack109/src/compat/strftime.c | 61 - d2pack109/src/compat/strftime.h | 27 - d2pack109/src/compat/strncasecmp.c | 71 - d2pack109/src/compat/strncasecmp.h | 34 - d2pack109/src/compat/strrchr.h | 31 - d2pack109/src/compat/strsep.c | 57 - d2pack109/src/compat/strsep.h | 27 - d2pack109/src/compat/strtoul.c | 105 -- d2pack109/src/compat/strtoul.h | 27 - d2pack109/src/compat/termios.h | 53 - d2pack109/src/compat/uint.h | 99 -- d2pack109/src/compat/uname.c | 60 - d2pack109/src/compat/uname.h | 49 - d2pack109/src/configure.in | 196 --- d2pack109/src/d2cs/bit.h | 30 - d2pack109/src/d2cs/bnetd.c | 99 -- d2pack109/src/d2cs/bnetd.h | 30 - d2pack109/src/d2cs/cmdline_parse.c | 154 -- d2pack109/src/d2cs/cmdline_parse.h | 48 - d2pack109/src/d2cs/conf.c | 319 ---- d2pack109/src/d2cs/conf.h | 43 - d2pack109/src/d2cs/connection.c | 839 --------- d2pack109/src/d2cs/connection.h | 139 -- d2pack109/src/d2cs/d2charfile.c | 763 --------- d2pack109/src/d2cs/d2charfile.h | 83 - d2pack109/src/d2cs/d2charlist.c | 104 -- d2pack109/src/d2cs/d2charlist.h | 29 - d2pack109/src/d2cs/d2cs_bnetd_protocol.h | 112 -- d2pack109/src/d2cs/d2cs_d2dbs_ladder.h | 56 - d2pack109/src/d2cs/d2cs_d2gs_character.h | 82 - d2pack109/src/d2cs/d2cs_d2gs_protocol.h | 182 -- d2pack109/src/d2cs/d2cs_protocol.h | 350 ---- d2pack109/src/d2cs/d2gs.c | 464 ----- d2pack109/src/d2cs/d2gs.h | 74 - d2pack109/src/d2cs/d2ladder.c | 280 --- d2pack109/src/d2cs/d2ladder.h | 41 - d2pack109/src/d2cs/game.c | 517 ------ d2pack109/src/d2cs/game.h | 110 -- d2pack109/src/d2cs/gamequeue.c | 196 --- d2pack109/src/d2cs/gamequeue.h | 44 - d2pack109/src/d2cs/handle_bnetd.c | 296 ---- d2pack109/src/d2cs/handle_bnetd.h | 27 - d2pack109/src/d2cs/handle_d2cs.c | 984 ----------- d2pack109/src/d2cs/handle_d2cs.h | 28 - d2pack109/src/d2cs/handle_d2gs.c | 435 ----- d2pack109/src/d2cs/handle_d2gs.h | 40 - d2pack109/src/d2cs/handle_init.c | 101 -- d2pack109/src/d2cs/handle_init.h | 26 - d2pack109/src/d2cs/handle_signal.c | 242 --- d2pack109/src/d2cs/handle_signal.h | 33 - d2pack109/src/d2cs/main.c | 261 --- d2pack109/src/d2cs/net.c | 287 ---- d2pack109/src/d2cs/net.h | 28 - d2pack109/src/d2cs/prefs.c | 345 ---- d2pack109/src/d2cs/prefs.h | 121 -- d2pack109/src/d2cs/s2s.c | 184 -- d2pack109/src/d2cs/s2s.h | 28 - d2pack109/src/d2cs/server.c | 355 ---- d2pack109/src/d2cs/server.h | 27 - d2pack109/src/d2cs/serverqueue.c | 172 -- d2pack109/src/d2cs/serverqueue.h | 51 - d2pack109/src/d2cs/setup.h | 140 -- d2pack109/src/d2cs/version.h | 25 - d2pack109/src/d2cs/xstring.c | 269 --- d2pack109/src/d2cs/xstring.h | 29 - d2pack109/src/d2dbs/charlock.c | 267 --- d2pack109/src/d2dbs/charlock.h | 45 - d2pack109/src/d2dbs/cmdline_parse.c | 153 -- d2pack109/src/d2dbs/cmdline_parse.h | 49 - d2pack109/src/d2dbs/d2ladder.c | 965 ----------- d2pack109/src/d2dbs/d2ladder.h | 61 - d2pack109/src/d2dbs/dbsdupecheck.c | 120 -- d2pack109/src/d2dbs/dbsdupecheck.h | 22 - d2pack109/src/d2dbs/dbserver.c | 565 ------ d2pack109/src/d2dbs/dbserver.h | 51 - d2pack109/src/d2dbs/dbspacket.c | 865 ---------- d2pack109/src/d2dbs/dbspacket.h | 120 -- d2pack109/src/d2dbs/handle_signal.c | 213 --- d2pack109/src/d2dbs/handle_signal.h | 32 - d2pack109/src/d2dbs/main.c | 241 --- d2pack109/src/d2dbs/prefs.c | 190 --- d2pack109/src/d2dbs/prefs.h | 71 - d2pack109/src/d2dbs/setup.h | 68 - d2pack109/src/d2dbs/version.h | 24 - d2pack109/src/win32/configwin.h | 394 ----- d2pack109/src/win32/d2cs_winmain.c | 374 ---- d2pack109/src/win32/d2dbs_winmain.c | 370 ---- d2pack109/src/win32/service.c | 236 --- d2pack109/src/win32/service.h | 19 - d2pack109/src/win32/u2d.c | 61 - d2pack109/src/win32/winmain.h | 30 - .../Compile.Instructions.Win32.Dev-C++.txt | 62 +- .../Compile.Instructions.Win32.VS.Net2005.txt | 112 +- {pvpgn/docs => docs}/INDEX | 0 {pvpgn/docs => docs}/INSTALL.unix | 0 {pvpgn/docs => docs}/Makefile.am | 0 {pvpgn/docs => docs}/PORTS | 0 {pvpgn/docs => docs}/README.fdwatch | 0 {pvpgn/docs => docs}/README.storage | 0 {pvpgn/docs => docs}/bnmotd.txt | 0 {pvpgn/files => files}/CMakeLists.txt | 0 {pvpgn/files => files}/IX86ver1.mpq | Bin {pvpgn/files => files}/Makefile.am | 0 {pvpgn/files => files}/PMACver1.mpq | Bin {pvpgn/files => files}/XMACver1.mpq | Bin {pvpgn/files => files}/ad000001.mng | Bin {pvpgn/files => files}/ad000001.smk | Bin {pvpgn/files => files}/ad000002.mng | Bin {pvpgn/files => files}/ad000003.mng | Bin {pvpgn/files => files}/ad000004.mng | Bin {pvpgn/files => files}/ad000075.mng | Bin {pvpgn/files => files}/bnserver-D2DV.ini | 0 {pvpgn/files => files}/bnserver-D2XP.ini | 0 {pvpgn/files => files}/bnserver-WAR3.ini | 0 {pvpgn/files => files}/bnserver.ini | 0 .../files => files}/chathelp-war3-default.txt | 0 {pvpgn/files => files}/chathelp-war3-enUS.txt | 0 {pvpgn/files => files}/chathelp-war3-frFR.txt | 0 {pvpgn/files => files}/chathelp-war3-ruRU.txt | 0 {pvpgn/files => files}/chathelp-war3-zhCN.txt | 30 +- {pvpgn/files => files}/icons-WAR3.bni | Bin {pvpgn/files => files}/icons.bni | Bin {pvpgn/files => files}/icons_STAR.bni | Bin {pvpgn/files => files}/newaccount-default.txt | 0 {pvpgn/files => files}/newaccount-enUS.txt | 0 {d2pack109/files => files}/newbie.save | Bin .../termsofservice-default.txt | 0 .../files => files}/termsofservice-enUS.txt | 0 .../files => files}/tos-unicode_default.txt | 42 +- {pvpgn/files => files}/tos.txt | 42 +- {pvpgn/files => files}/tos_default.txt | 42 +- {pvpgn/files => files}/ver-ix86-1.mpq | Bin {pvpgn/man => man}/CMakeLists.txt | 0 {pvpgn/man => man}/Makefile.am | 0 {pvpgn/man => man}/bnbot.1 | 0 {pvpgn/man => man}/bnchat.1 | 0 {pvpgn/man => man}/bnetd.1 | 0 {pvpgn/man => man}/bnetd.conf.5 | 0 {pvpgn/man => man}/bnftp.1 | 0 {pvpgn/man => man}/bni2tga.1 | 0 {pvpgn/man => man}/bnibuild.1 | 0 {pvpgn/man => man}/bniextract.1 | 0 {pvpgn/man => man}/bnilist.1 | 0 {pvpgn/man => man}/bnpass.1 | 0 {pvpgn/man => man}/bnpcap.1 | 0 {pvpgn/man => man}/bnproxy.1 | 0 {pvpgn/man => man}/bnstat.1 | 0 {pvpgn/man => man}/bntext.5 | 0 {pvpgn/man => man}/bntrackd.1 | 0 {pvpgn/man => man}/tgainfo.1 | 0 pvpgn/COPYING | 340 ---- pvpgn/README | 12 - pvpgn/files/newbie.save | Bin 130 -> 0 bytes pvpgn/src/autoconf/install-sh | 250 --- pvpgn/src/autoconf/mkdir-p | 101 -- pvpgn/src/autoconf/mkdir.m4 | 35 - pvpgn/src/common/introtate.h | 60 - pvpgn/src/common/setup_after.h | 24 - pvpgn/src/compat/netinet_in.h | 29 - pvpgn/src/compat/read.h | 26 - pvpgn/src/compat/statmacros.h | 161 -- pvpgn/src/win32/console_resource.h | 2 - pvpgn/src/win32/console_resource.rc | 10 - pvpgn/src/win32/d2cs_resource.h | 17 - pvpgn/src/win32/d2cs_resource.rc | 44 - pvpgn/src/win32/d2dbs_resource.h | 16 - pvpgn/src/win32/d2dbs_resource.rc | 43 - pvpgn/src/win32/logo01.ico | Bin 14758 -> 0 bytes {pvpgn/scripts => scripts}/S98bnetd | 0 {pvpgn/scripts => scripts}/announce.sh | 0 {pvpgn/scripts => scripts}/bnetd.init | 0 {pvpgn/scripts => scripts}/bnetd.logrotate | 0 {pvpgn/scripts => scripts}/bnetmasq.sh | 0 {pvpgn/scripts => scripts}/convert_w3.pl | 0 {pvpgn/scripts => scripts}/cvs2cl.pl | 0 {pvpgn/scripts => scripts}/flat2cdb.pl | 0 {pvpgn/scripts => scripts}/fsgs2bnetd.pl | 0 {pvpgn/scripts => scripts}/ladder.py | 0 {pvpgn/scripts => scripts}/lastlogin.pl | 0 {pvpgn/scripts => scripts}/login_testusers.sh | 0 {pvpgn/scripts => scripts}/make_testusers.sh | 0 {pvpgn/scripts => scripts}/process.pl | 0 {pvpgn/scripts => scripts}/pvpgn_hash.inc.php | 250 +-- .../pvpgn_wol_hash.inc.php | 114 +- {pvpgn/scripts => scripts}/rc.bnetd | 0 {pvpgn/scripts => scripts}/reform.awk | 0 .../scripts => scripts}/sql/repairlevels.pl | 0 {pvpgn/scripts => scripts}/storage/cdb2sql.pl | 0 .../scripts => scripts}/storage/plain2sql.pl | 0 {pvpgn/scripts => scripts}/tos.bat | 70 +- {pvpgn/scripts => scripts}/tos.sh | 0 {pvpgn/src => src}/CMakeLists.txt | 0 {pvpgn/src => src}/Makefile.am | 0 {pvpgn/src => src}/autoconf/Makefile.am | 0 {pvpgn/src => src}/autoconf/ansi2knr.c | 0 {pvpgn/src => src}/autoconf/ccstdc.m4 | 0 {pvpgn/src => src}/autoconf/config.guess | 0 {pvpgn/src => src}/autoconf/config.sub | 0 {d2pack109/src => src}/autoconf/install-sh | 0 {d2pack109/src => src}/autoconf/mkdir-p | 0 {d2pack109/src => src}/autoconf/mkdir.m4 | 0 {pvpgn/src => src}/autoconf/termios.m4 | 0 {pvpgn/src => src}/autoconf/winsz.m4 | 0 {pvpgn/src => src}/bnetd/CMakeLists.txt | 0 {pvpgn/src => src}/bnetd/Makefile.am | 0 {pvpgn/src => src}/bnetd/account.cpp | 0 {pvpgn/src => src}/bnetd/account.h | 0 {pvpgn/src => src}/bnetd/account_wrap.cpp | 0 {pvpgn/src => src}/bnetd/account_wrap.h | 0 {pvpgn/src => src}/bnetd/adbanner.cpp | 0 {pvpgn/src => src}/bnetd/adbanner.h | 0 {pvpgn/src => src}/bnetd/alias_command.cpp | 0 {pvpgn/src => src}/bnetd/alias_command.h | 0 {pvpgn/src => src}/bnetd/anongame.cpp | 0 {pvpgn/src => src}/bnetd/anongame.h | 0 .../src => src}/bnetd/anongame_gameresult.cpp | 0 .../src => src}/bnetd/anongame_gameresult.h | 0 {pvpgn/src => src}/bnetd/anongame_infos.cpp | 0 {pvpgn/src => src}/bnetd/anongame_infos.h | 0 .../src => src}/bnetd/anongame_maplists.cpp | 0 {pvpgn/src => src}/bnetd/anongame_maplists.h | 0 {pvpgn/src => src}/bnetd/anongame_wol.cpp | 1248 +++++++------- {pvpgn/src => src}/bnetd/anongame_wol.h | 194 +-- {pvpgn/src => src}/bnetd/attr.h | 0 {pvpgn/src => src}/bnetd/attrgroup.cpp | 0 {pvpgn/src => src}/bnetd/attrgroup.h | 0 {pvpgn/src => src}/bnetd/attrlayer.cpp | 0 {pvpgn/src => src}/bnetd/attrlayer.h | 0 {pvpgn/src => src}/bnetd/autoupdate.cpp | 0 {pvpgn/src => src}/bnetd/autoupdate.h | 0 {pvpgn/src => src}/bnetd/channel.cpp | 0 {pvpgn/src => src}/bnetd/channel.h | 0 {pvpgn/src => src}/bnetd/channel_conv.cpp | 0 {pvpgn/src => src}/bnetd/channel_conv.h | 0 {pvpgn/src => src}/bnetd/character.cpp | 0 {pvpgn/src => src}/bnetd/character.h | 0 {pvpgn/src => src}/bnetd/clan.cpp | 0 {pvpgn/src => src}/bnetd/clan.h | 0 {pvpgn/src => src}/bnetd/cmdline.cpp | 0 {pvpgn/src => src}/bnetd/cmdline.h | 0 {pvpgn/src => src}/bnetd/command.cpp | 0 {pvpgn/src => src}/bnetd/command.h | 0 {pvpgn/src => src}/bnetd/command_groups.cpp | 0 {pvpgn/src => src}/bnetd/command_groups.h | 0 {pvpgn/src => src}/bnetd/connection.cpp | 0 {pvpgn/src => src}/bnetd/connection.h | 0 {pvpgn/src => src}/bnetd/file.cpp | 0 {pvpgn/src => src}/bnetd/file.h | 0 {pvpgn/src => src}/bnetd/file_cdb.cpp | 0 {pvpgn/src => src}/bnetd/file_cdb.h | 0 {pvpgn/src => src}/bnetd/file_plain.cpp | 0 {pvpgn/src => src}/bnetd/file_plain.h | 0 {pvpgn/src => src}/bnetd/friends.cpp | 0 {pvpgn/src => src}/bnetd/friends.h | 0 {pvpgn/src => src}/bnetd/game.cpp | 0 {pvpgn/src => src}/bnetd/game.h | 0 {pvpgn/src => src}/bnetd/game_conv.cpp | 0 {pvpgn/src => src}/bnetd/game_conv.h | 0 {pvpgn/src => src}/bnetd/handle_anongame.cpp | 0 {pvpgn/src => src}/bnetd/handle_anongame.h | 0 {pvpgn/src => src}/bnetd/handle_apireg.cpp | 0 {pvpgn/src => src}/bnetd/handle_apireg.h | 0 {pvpgn/src => src}/bnetd/handle_bnet.cpp | 0 {pvpgn/src => src}/bnetd/handle_bnet.h | 0 {pvpgn/src => src}/bnetd/handle_bot.cpp | 0 {pvpgn/src => src}/bnetd/handle_bot.h | 0 {pvpgn/src => src}/bnetd/handle_d2cs.cpp | 0 {pvpgn/src => src}/bnetd/handle_d2cs.h | 0 {pvpgn/src => src}/bnetd/handle_file.cpp | 0 {pvpgn/src => src}/bnetd/handle_file.h | 0 {pvpgn/src => src}/bnetd/handle_init.cpp | 0 {pvpgn/src => src}/bnetd/handle_init.h | 0 {pvpgn/src => src}/bnetd/handle_irc.cpp | 0 {pvpgn/src => src}/bnetd/handle_irc.h | 0 .../src => src}/bnetd/handle_irc_common.cpp | 0 {pvpgn/src => src}/bnetd/handle_irc_common.h | 0 {pvpgn/src => src}/bnetd/handle_telnet.cpp | 0 {pvpgn/src => src}/bnetd/handle_telnet.h | 0 {pvpgn/src => src}/bnetd/handle_udp.cpp | 0 {pvpgn/src => src}/bnetd/handle_udp.h | 0 {pvpgn/src => src}/bnetd/handle_wol.cpp | 0 {pvpgn/src => src}/bnetd/handle_wol.h | 0 .../src => src}/bnetd/handle_wol_gameres.cpp | 0 {pvpgn/src => src}/bnetd/handle_wol_gameres.h | 0 {pvpgn/src => src}/bnetd/handle_wserv.cpp | 0 {pvpgn/src => src}/bnetd/handle_wserv.h | 0 {pvpgn/src => src}/bnetd/handlers.h | 0 {pvpgn/src => src}/bnetd/helpfile.cpp | 0 {pvpgn/src => src}/bnetd/helpfile.h | 0 {pvpgn/src => src}/bnetd/ipban.cpp | 0 {pvpgn/src => src}/bnetd/ipban.h | 0 {pvpgn/src => src}/bnetd/irc.cpp | 0 {pvpgn/src => src}/bnetd/irc.h | 0 {pvpgn/src => src}/bnetd/ladder.cpp | 0 {pvpgn/src => src}/bnetd/ladder.h | 0 {pvpgn/src => src}/bnetd/ladder_calc.cpp | 0 {pvpgn/src => src}/bnetd/ladder_calc.h | 0 {pvpgn/src => src}/bnetd/mail.cpp | 0 {pvpgn/src => src}/bnetd/mail.h | 0 {pvpgn/src => src}/bnetd/main.cpp | 0 {pvpgn/src => src}/bnetd/message.cpp | 0 {pvpgn/src => src}/bnetd/message.h | 0 {pvpgn/src => src}/bnetd/news.cpp | 0 {pvpgn/src => src}/bnetd/news.h | 0 {pvpgn/src => src}/bnetd/output.cpp | 0 {pvpgn/src => src}/bnetd/output.h | 0 {pvpgn/src => src}/bnetd/prefs.cpp | 0 {pvpgn/src => src}/bnetd/prefs.h | 0 {pvpgn/src => src}/bnetd/quota.h | 0 {pvpgn/src => src}/bnetd/realm.cpp | 0 {pvpgn/src => src}/bnetd/realm.h | 0 {pvpgn/src => src}/bnetd/runprog.cpp | 0 {pvpgn/src => src}/bnetd/runprog.h | 0 {pvpgn/src => src}/bnetd/server.cpp | 0 {pvpgn/src => src}/bnetd/server.h | 0 {pvpgn/src => src}/bnetd/sql_common.cpp | 0 {pvpgn/src => src}/bnetd/sql_common.h | 0 {pvpgn/src => src}/bnetd/sql_dbcreator.cpp | 0 {pvpgn/src => src}/bnetd/sql_dbcreator.h | 0 {pvpgn/src => src}/bnetd/sql_mysql.cpp | 2 +- {pvpgn/src => src}/bnetd/sql_mysql.h | 0 {pvpgn/src => src}/bnetd/sql_odbc.cpp | 0 {pvpgn/src => src}/bnetd/sql_odbc.h | 0 {pvpgn/src => src}/bnetd/sql_pgsql.cpp | 0 {pvpgn/src => src}/bnetd/sql_pgsql.h | 0 {pvpgn/src => src}/bnetd/sql_sqlite3.cpp | 0 {pvpgn/src => src}/bnetd/sql_sqlite3.h | 0 {pvpgn/src => src}/bnetd/storage.cpp | 0 {pvpgn/src => src}/bnetd/storage.h | 0 {pvpgn/src => src}/bnetd/storage_file.cpp | 0 {pvpgn/src => src}/bnetd/storage_file.h | 0 {pvpgn/src => src}/bnetd/storage_sql.cpp | 0 {pvpgn/src => src}/bnetd/storage_sql.h | 0 {pvpgn/src => src}/bnetd/storage_sql2.cpp | 0 {pvpgn/src => src}/bnetd/storage_sql2.h | 0 {pvpgn/src => src}/bnetd/support.cpp | 0 {pvpgn/src => src}/bnetd/support.h | 0 {pvpgn/src => src}/bnetd/team.cpp | 0 {pvpgn/src => src}/bnetd/team.h | 0 {pvpgn/src => src}/bnetd/tick.cpp | 0 {pvpgn/src => src}/bnetd/tick.h | 0 {pvpgn/src => src}/bnetd/timer.cpp | 0 {pvpgn/src => src}/bnetd/timer.h | 0 {pvpgn/src => src}/bnetd/topic.cpp | 0 {pvpgn/src => src}/bnetd/topic.h | 0 {pvpgn/src => src}/bnetd/tournament.cpp | 0 {pvpgn/src => src}/bnetd/tournament.h | 0 {pvpgn/src => src}/bnetd/tracker.cpp | 0 {pvpgn/src => src}/bnetd/tracker.h | 0 {pvpgn/src => src}/bnetd/udptest_send.cpp | 0 {pvpgn/src => src}/bnetd/udptest_send.h | 0 {pvpgn/src => src}/bnetd/versioncheck.cpp | 0 {pvpgn/src => src}/bnetd/versioncheck.h | 0 {pvpgn/src => src}/bnetd/watch.cpp | 0 {pvpgn/src => src}/bnetd/watch.h | 0 {pvpgn/src => src}/bniutils/CMakeLists.txt | 0 {pvpgn/src => src}/bniutils/Makefile.am | 0 {pvpgn/src => src}/bniutils/bni.cpp | 0 {pvpgn/src => src}/bniutils/bni.h | 0 {pvpgn/src => src}/bniutils/bni2tga.cpp | 0 {pvpgn/src => src}/bniutils/bnibuild.cpp | 0 {pvpgn/src => src}/bniutils/bniextract.cpp | 0 {pvpgn/src => src}/bniutils/bnilist.cpp | 0 {pvpgn/src => src}/bniutils/fileio.cpp | 0 {pvpgn/src => src}/bniutils/fileio.h | 0 {pvpgn/src => src}/bniutils/tga.cpp | 0 {pvpgn/src => src}/bniutils/tga.h | 0 {pvpgn/src => src}/bniutils/tgainfo.cpp | 0 {pvpgn/src => src}/bnpass/CMakeLists.txt | 0 {pvpgn/src => src}/bnpass/Makefile.am | 0 {pvpgn/src => src}/bnpass/bnpass.cpp | 0 {pvpgn/src => src}/bnpass/sha1hash.cpp | 0 {pvpgn/src => src}/bnpcap/CMakeLists.txt | 0 {pvpgn/src => src}/bnpcap/Makefile.am | 0 {pvpgn/src => src}/bnpcap/bnpcap.cpp | 0 {pvpgn/src => src}/bnproxy/bnproxy.c | 0 {pvpgn/src => src}/bnproxy/virtconn.c | 0 {pvpgn/src => src}/bnproxy/virtconn.h | 0 {pvpgn/src => src}/bntrackd/CMakeLists.txt | 0 {pvpgn/src => src}/bntrackd/Makefile.am | 0 {pvpgn/src => src}/bntrackd/bntrackd.cpp | 0 {pvpgn/src => src}/bntrackd/servers.xsl | 0 {pvpgn/src => src}/client/CMakeLists.txt | 0 {pvpgn/src => src}/client/Makefile.am | 0 {pvpgn/src => src}/client/ansi_term.h | 0 {pvpgn/src => src}/client/bnbot.cpp | 0 {pvpgn/src => src}/client/bnchat.cpp | 0 {pvpgn/src => src}/client/bnftp.cpp | 0 {pvpgn/src => src}/client/bnstat.cpp | 0 {pvpgn/src => src}/client/client.cpp | 0 {pvpgn/src => src}/client/client.h | 0 {pvpgn/src => src}/client/client_connect.cpp | 0 {pvpgn/src => src}/client/client_connect.h | 0 {pvpgn/src => src}/client/udptest.cpp | 0 {pvpgn/src => src}/client/udptest.h | 0 {pvpgn/src => src}/common/CMakeLists.txt | 0 {pvpgn/src => src}/common/Makefile.am | 0 {pvpgn/src => src}/common/addr.cpp | 0 {pvpgn/src => src}/common/addr.h | 0 {pvpgn/src => src}/common/anongame_protocol.h | 0 {pvpgn/src => src}/common/asnprintf.cpp | 0 {pvpgn/src => src}/common/asnprintf.h | 0 {pvpgn/src => src}/common/bigint.cpp | 0 {pvpgn/src => src}/common/bigint.h | 0 {pvpgn/src => src}/common/bn_type.cpp | 0 {pvpgn/src => src}/common/bn_type.h | 0 {pvpgn/src => src}/common/bnet_protocol.h | 0 {pvpgn/src => src}/common/bnethash.cpp | 0 {pvpgn/src => src}/common/bnethash.h | 0 {pvpgn/src => src}/common/bnethashconv.cpp | 0 {pvpgn/src => src}/common/bnethashconv.h | 0 {pvpgn/src => src}/common/bnetsrp3.cpp | 0 {pvpgn/src => src}/common/bnetsrp3.h | 0 {pvpgn/src => src}/common/bnettime.cpp | 0 {pvpgn/src => src}/common/bnettime.h | 0 {pvpgn/src => src}/common/bot_protocol.h | 0 {pvpgn/src => src}/common/cdbhash.h | 0 {pvpgn/src => src}/common/conf.cpp | 0 {pvpgn/src => src}/common/conf.h | 0 {pvpgn/src => src}/common/d2char_checksum.cpp | 0 {pvpgn/src => src}/common/d2char_checksum.h | 0 {pvpgn/src => src}/common/d2char_file.h | 0 .../src => src}/common/d2cs_bnetd_protocol.h | 0 {pvpgn/src => src}/common/d2cs_d2dbs_ladder.h | 0 .../src => src}/common/d2cs_d2gs_character.h | 0 .../src => src}/common/d2cs_d2gs_protocol.h | 0 {pvpgn/src => src}/common/d2cs_protocol.h | 0 {pvpgn/src => src}/common/d2game_protocol.h | 0 {pvpgn/src => src}/common/elist.h | 0 {pvpgn/src => src}/common/eventlog.cpp | 0 {pvpgn/src => src}/common/eventlog.h | 0 {pvpgn/src => src}/common/fdwatch.cpp | 0 {pvpgn/src => src}/common/fdwatch.h | 0 {pvpgn/src => src}/common/fdwatch_epoll.cpp | 0 {pvpgn/src => src}/common/fdwatch_epoll.h | 0 {pvpgn/src => src}/common/fdwatch_kqueue.cpp | 0 {pvpgn/src => src}/common/fdwatch_kqueue.h | 0 {pvpgn/src => src}/common/fdwatch_poll.cpp | 0 {pvpgn/src => src}/common/fdwatch_poll.h | 0 {pvpgn/src => src}/common/fdwatch_select.cpp | 0 {pvpgn/src => src}/common/fdwatch_select.h | 0 {pvpgn/src => src}/common/fdwbackend.cpp | 0 {pvpgn/src => src}/common/fdwbackend.h | 0 {pvpgn/src => src}/common/field_sizes.h | 0 {pvpgn/src => src}/common/file_protocol.h | 0 {pvpgn/src => src}/common/flags.h | 0 .../common/give_up_root_privileges.cpp | 0 .../common/give_up_root_privileges.h | 0 {pvpgn/src => src}/common/gui_printf.cpp | 0 {pvpgn/src => src}/common/gui_printf.h | 0 {pvpgn/src => src}/common/hashtable.cpp | 0 {pvpgn/src => src}/common/hashtable.h | 0 {pvpgn/src => src}/common/hexdump.cpp | 0 {pvpgn/src => src}/common/hexdump.h | 0 {pvpgn/src => src}/common/init_protocol.h | 0 {d2pack109/src => src}/common/introtate.h | 0 {pvpgn/src => src}/common/irc_protocol.h | 0 {pvpgn/src => src}/common/list.cpp | 0 {pvpgn/src => src}/common/list.h | 0 {pvpgn/src => src}/common/lstr.h | 0 {pvpgn/src => src}/common/network.cpp | 0 {pvpgn/src => src}/common/network.h | 0 {pvpgn/src => src}/common/packet.cpp | 0 {pvpgn/src => src}/common/packet.h | 0 {pvpgn/src => src}/common/peerchat.cpp | 0 {pvpgn/src => src}/common/peerchat.h | 0 {pvpgn/src => src}/common/proginfo.cpp | 0 {pvpgn/src => src}/common/proginfo.h | 0 {pvpgn/src => src}/common/queue.cpp | 0 {pvpgn/src => src}/common/queue.h | 0 {pvpgn/src => src}/common/rcm.cpp | 0 {pvpgn/src => src}/common/rcm.h | 0 {pvpgn/src => src}/common/rlimit.cpp | 0 {pvpgn/src => src}/common/rlimit.h | 0 {pvpgn/src => src}/common/scoped_array.h | 0 {pvpgn/src => src}/common/scoped_ptr.h | 0 {d2pack109/src => src}/common/setup_after.h | 0 {pvpgn/src => src}/common/setup_before.h | 0 {pvpgn/src => src}/common/systemerror.cpp | 0 {pvpgn/src => src}/common/systemerror.h | 0 {pvpgn/src => src}/common/tag.cpp | 0 {pvpgn/src => src}/common/tag.h | 0 {pvpgn/src => src}/common/token.cpp | 0 {pvpgn/src => src}/common/token.h | 0 {pvpgn/src => src}/common/tracker.h | 0 {pvpgn/src => src}/common/trans.cpp | 0 {pvpgn/src => src}/common/trans.h | 0 {pvpgn/src => src}/common/udp_protocol.h | 0 {pvpgn/src => src}/common/util.cpp | 0 {pvpgn/src => src}/common/util.h | 0 {pvpgn/src => src}/common/version.h | 0 .../src => src}/common/wol_gameres_protocol.h | 0 {pvpgn/src => src}/common/wolhash.cpp | 0 {pvpgn/src => src}/common/wolhash.h | 0 {pvpgn/src => src}/common/xalloc.cpp | 0 {pvpgn/src => src}/common/xalloc.h | 0 {pvpgn/src => src}/common/xstr.cpp | 0 {pvpgn/src => src}/common/xstr.h | 0 {pvpgn/src => src}/common/xstring.cpp | 0 {pvpgn/src => src}/common/xstring.h | 0 {pvpgn/src => src}/compat/CMakeLists.txt | 0 {pvpgn/src => src}/compat/Makefile.am | 0 {pvpgn/src => src}/compat/access.h | 0 {pvpgn/src => src}/compat/gethostname.h | 0 {pvpgn/src => src}/compat/gettimeofday.cpp | 0 {pvpgn/src => src}/compat/gettimeofday.h | 0 {pvpgn/src => src}/compat/inet_aton.cpp | 0 {pvpgn/src => src}/compat/inet_aton.h | 0 {pvpgn/src => src}/compat/inet_ntoa.cpp | 0 {pvpgn/src => src}/compat/inet_ntoa.h | 0 {pvpgn/src => src}/compat/mkdir.h | 0 {pvpgn/src => src}/compat/mmap.cpp | 0 {pvpgn/src => src}/compat/mmap.h | 0 {d2pack109/src => src}/compat/netinet_in.h | 0 {pvpgn/src => src}/compat/pdir.cpp | 0 {pvpgn/src => src}/compat/pdir.h | 0 {pvpgn/src => src}/compat/pgetopt.cpp | 0 {pvpgn/src => src}/compat/pgetopt.h | 0 {pvpgn/src => src}/compat/pgetpid.h | 0 {pvpgn/src => src}/compat/psock.cpp | 0 {pvpgn/src => src}/compat/psock.h | 0 {d2pack109/src => src}/compat/read.h | 0 {pvpgn/src => src}/compat/recv.h | 0 {pvpgn/src => src}/compat/rename.h | 0 {pvpgn/src => src}/compat/runtime_libs.h | 0 {pvpgn/src => src}/compat/send.h | 0 {pvpgn/src => src}/compat/snprintf.cpp | 0 {pvpgn/src => src}/compat/snprintf.h | 0 {pvpgn/src => src}/compat/socket.h | 0 {d2pack109/src => src}/compat/statmacros.h | 0 {pvpgn/src => src}/compat/stdfileno.h | 0 {pvpgn/src => src}/compat/strcasecmp.cpp | 0 {pvpgn/src => src}/compat/strcasecmp.h | 0 {pvpgn/src => src}/compat/strdup.cpp | 0 {pvpgn/src => src}/compat/strdup.h | 0 {pvpgn/src => src}/compat/strerror.cpp | 0 {pvpgn/src => src}/compat/strerror.h | 0 {pvpgn/src => src}/compat/strncasecmp.cpp | 0 {pvpgn/src => src}/compat/strncasecmp.h | 0 {pvpgn/src => src}/compat/strsep.cpp | 0 {pvpgn/src => src}/compat/strsep.h | 0 {pvpgn/src => src}/compat/strtoul.cpp | 0 {pvpgn/src => src}/compat/strtoul.h | 0 {pvpgn/src => src}/compat/termios.h | 0 {pvpgn/src => src}/compat/uint.h | 0 {pvpgn/src => src}/compat/uname.cpp | 0 {pvpgn/src => src}/compat/uname.h | 0 {pvpgn/src => src}/compat/vsnprintf.cpp | 0 {pvpgn/src => src}/compat/vsnprintf.h | 0 {pvpgn/src => src}/d2cs/CMakeLists.txt | 0 {pvpgn/src => src}/d2cs/Makefile.am | 0 {pvpgn/src => src}/d2cs/bit.h | 0 {pvpgn/src => src}/d2cs/bnetd.cpp | 0 {pvpgn/src => src}/d2cs/bnetd.h | 0 {pvpgn/src => src}/d2cs/cmdline.cpp | 0 {pvpgn/src => src}/d2cs/cmdline.h | 0 {pvpgn/src => src}/d2cs/connection.cpp | 0 {pvpgn/src => src}/d2cs/connection.h | 0 {pvpgn/src => src}/d2cs/d2charfile.cpp | 0 {pvpgn/src => src}/d2cs/d2charfile.h | 0 {pvpgn/src => src}/d2cs/d2charlist.cpp | 0 {pvpgn/src => src}/d2cs/d2charlist.h | 0 {pvpgn/src => src}/d2cs/d2gs.cpp | 0 {pvpgn/src => src}/d2cs/d2gs.h | 0 {pvpgn/src => src}/d2cs/d2ladder.cpp | 0 {pvpgn/src => src}/d2cs/d2ladder.h | 0 {pvpgn/src => src}/d2cs/game.cpp | 0 {pvpgn/src => src}/d2cs/game.h | 0 {pvpgn/src => src}/d2cs/gamequeue.cpp | 0 {pvpgn/src => src}/d2cs/gamequeue.h | 0 {pvpgn/src => src}/d2cs/handle_bnetd.cpp | 0 {pvpgn/src => src}/d2cs/handle_bnetd.h | 0 {pvpgn/src => src}/d2cs/handle_d2cs.cpp | 0 {pvpgn/src => src}/d2cs/handle_d2cs.h | 0 {pvpgn/src => src}/d2cs/handle_d2gs.cpp | 0 {pvpgn/src => src}/d2cs/handle_d2gs.h | 0 {pvpgn/src => src}/d2cs/handle_init.cpp | 0 {pvpgn/src => src}/d2cs/handle_init.h | 0 {pvpgn/src => src}/d2cs/handle_signal.cpp | 0 {pvpgn/src => src}/d2cs/handle_signal.h | 0 {pvpgn/src => src}/d2cs/main.cpp | 0 {pvpgn/src => src}/d2cs/net.cpp | 0 {pvpgn/src => src}/d2cs/net.h | 0 {pvpgn/src => src}/d2cs/prefs.cpp | 0 {pvpgn/src => src}/d2cs/prefs.h | 0 {pvpgn/src => src}/d2cs/s2s.cpp | 0 {pvpgn/src => src}/d2cs/s2s.h | 0 {pvpgn/src => src}/d2cs/server.cpp | 0 {pvpgn/src => src}/d2cs/server.h | 0 {pvpgn/src => src}/d2cs/serverqueue.cpp | 0 {pvpgn/src => src}/d2cs/serverqueue.h | 0 {pvpgn/src => src}/d2cs/setup.h | 0 {pvpgn/src => src}/d2cs/version.h | 0 {pvpgn/src => src}/d2dbs/CMakeLists.txt | 0 {pvpgn/src => src}/d2dbs/Makefile.am | 0 {pvpgn/src => src}/d2dbs/charlock.cpp | 0 {pvpgn/src => src}/d2dbs/charlock.h | 0 {pvpgn/src => src}/d2dbs/cmdline.cpp | 0 {pvpgn/src => src}/d2dbs/cmdline.h | 0 {pvpgn/src => src}/d2dbs/d2ladder.cpp | 0 {pvpgn/src => src}/d2dbs/d2ladder.h | 0 {pvpgn/src => src}/d2dbs/dbsdupecheck.cpp | 0 {pvpgn/src => src}/d2dbs/dbsdupecheck.h | 0 {pvpgn/src => src}/d2dbs/dbserver.cpp | 0 {pvpgn/src => src}/d2dbs/dbserver.h | 0 {pvpgn/src => src}/d2dbs/dbspacket.cpp | 0 {pvpgn/src => src}/d2dbs/dbspacket.h | 0 {pvpgn/src => src}/d2dbs/handle_signal.cpp | 0 {pvpgn/src => src}/d2dbs/handle_signal.h | 0 {pvpgn/src => src}/d2dbs/main.cpp | 0 {pvpgn/src => src}/d2dbs/prefs.cpp | 0 {pvpgn/src => src}/d2dbs/prefs.h | 0 {pvpgn/src => src}/d2dbs/setup.h | 0 {pvpgn/src => src}/d2dbs/version.h | 0 {pvpgn/src => src}/test/CMakeLists.txt | 0 {pvpgn/src => src}/test/bigint.cpp | 0 {pvpgn/src => src}/test/bnetsrp3_test.cpp | 0 {pvpgn/src => src}/tinycdb/CMakeLists.txt | 0 {pvpgn/src => src}/tinycdb/ChangeLog | 0 {pvpgn/src => src}/tinycdb/Makefile.am | 0 {pvpgn/src => src}/tinycdb/cdb.cpp | 0 {pvpgn/src => src}/tinycdb/cdb.h | 0 {pvpgn/src => src}/tinycdb/cdb_find.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_findnext.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_hash.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_init.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_int.h | 0 {pvpgn/src => src}/tinycdb/cdb_make.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_make_add.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_make_find.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_make_put.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_seek.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_seq.cpp | 0 {pvpgn/src => src}/tinycdb/cdb_unpack.cpp | 0 {pvpgn/src => src}/win32/CMakeLists.txt | 0 {pvpgn/src => src}/win32/Makefile.am | 0 {pvpgn/src => src}/win32/configwin.h | 0 {pvpgn/src => src}/win32/console_output.cpp | 0 {pvpgn/src => src}/win32/console_output.h | 0 .../src => src}/win32/console_resource.h | 0 .../src => src}/win32/console_resource.rc | 0 {d2pack109/src => src}/win32/d2cs_resource.h | 0 {d2pack109/src => src}/win32/d2cs_resource.rc | 0 {pvpgn/src => src}/win32/d2cs_winmain.cpp | 0 {d2pack109/src => src}/win32/d2dbs_resource.h | 0 .../src => src}/win32/d2dbs_resource.rc | 0 {pvpgn/src => src}/win32/d2dbs_winmain.cpp | 0 {d2pack109/src => src}/win32/logo01.ico | Bin {pvpgn/src => src}/win32/resource.h | 0 {pvpgn/src => src}/win32/resource.rc | 0 {pvpgn/src => src}/win32/service.cpp | 0 {pvpgn/src => src}/win32/service.h | 0 {pvpgn/src => src}/win32/winmain.cpp | 0 {pvpgn/src => src}/win32/winmain.h | 0 ...version-history.txt => version-history.txt | 0 web/site/admin/downloads.php | 127 -- web/site/admin/index.php | 212 --- web/site/admin/links.php | 128 -- web/site/files.php | 44 - web/site/images/botbar-bg.gif | Bin 8430 -> 0 bytes web/site/images/left01.jpg | Bin 46030 -> 0 bytes web/site/images/left02.jpg | Bin 30274 -> 0 bytes web/site/images/left03.jpg | Bin 45459 -> 0 bytes web/site/images/left04.jpg | Bin 30913 -> 0 bytes web/site/images/topbar-bg.gif | Bin 8379 -> 0 bytes web/site/includes/about.htm | 23 - web/site/includes/help.htm | 22 - web/site/includes/sqlerror.htm | 85 - web/site/includes/viewnews.php | 80 - web/site/index.php | 293 ---- web/site/pvpgn.css | 86 - 850 files changed, 1624 insertions(+), 38364 deletions(-) rename pvpgn/BUGS => BUGS (100%) rename pvpgn/CMakeLists.txt => CMakeLists.txt (100%) rename d2pack109/COPYING => COPYING (100%) rename pvpgn/CREDITS => CREDITS (100%) rename pvpgn/ConfigureChecks.cmake => ConfigureChecks.cmake (100%) rename pvpgn/IGNOREME => IGNOREME (100%) rename pvpgn/NEWS => NEWS (100%) rename pvpgn/README.ALPHA => README.ALPHA (100%) rename pvpgn/README.DEV => README.DEV (100%) rename pvpgn/README.cmake => README.cmake (100%) rename pvpgn/TODO => TODO (100%) rename pvpgn/UPDATE => UPDATE (100%) rename {pvpgn/cmake => cmake}/Modules/CheckIncludeFilesCXX.cmake (100%) rename {pvpgn/cmake => cmake}/Modules/CheckMkdirArgs.cmake (100%) rename {pvpgn/cmake => cmake}/Modules/CheckTypeSizeCXX.cmake (100%) rename {pvpgn/cmake => cmake}/Modules/CheckTypeSizeCXX.cxx.in (100%) rename {pvpgn/cmake => cmake}/Modules/DefineInstallationPaths.cmake (100%) rename {pvpgn/cmake => cmake}/Modules/FindMySQL.cmake (100%) rename {pvpgn/cmake => cmake}/Modules/FindODBC.cmake (100%) rename {pvpgn/cmake => cmake}/Modules/FindPostgreSQL.cmake (100%) rename {pvpgn/cmake => cmake}/Modules/FindSQLite3.cmake (100%) rename {pvpgn/cmake => cmake}/Modules/FindZLIB.cmake (100%) rename {pvpgn/conf => conf}/CMakeLists.txt (100%) rename {pvpgn/conf => conf}/Makefile.am (100%) rename {pvpgn/conf => conf}/ad.conf.in (100%) rename {pvpgn/conf => conf}/address_translation.conf.in (100%) rename {pvpgn/conf => conf}/anongame_infos.conf.in (100%) rename {pvpgn/conf => conf}/autoupdate.conf.in (98%) rename {pvpgn/conf => conf}/bnalias.conf.in (100%) rename {pvpgn/conf => conf}/bnban.conf.in (100%) rename {pvpgn/conf => conf}/bnetd.conf.in (100%) rename {pvpgn/conf => conf}/bnetd.conf.win32 (100%) rename {pvpgn/conf => conf}/bnetd_default_user.cdb (100%) rename {pvpgn/conf => conf}/bnetd_default_user.plain.in (100%) rename {pvpgn/conf => conf}/bnhelp.conf.in (100%) rename {pvpgn/conf => conf}/bnissue.txt.in (100%) rename {pvpgn/conf => conf}/bnmaps.conf.in (100%) rename {pvpgn/conf => conf}/bnmotd-bgBG.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-csCZ.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-deDE.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-enUS.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-esES.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-frFR.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-jpJA.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-koKR.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-nlNL.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-plPL.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-ptBR.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-ruRU.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-svSE.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-zhCN.txt.in (100%) rename {pvpgn/conf => conf}/bnmotd-zhTW.txt.in (100%) rename {pvpgn/conf => conf}/bnxpcalc.conf.in (100%) rename {pvpgn/conf => conf}/bnxplevel.conf.in (100%) rename {pvpgn/conf => conf}/channel.conf.in (100%) rename {pvpgn/conf => conf}/command_groups.conf.in (100%) rename {pvpgn/conf => conf}/d2cs.conf.in (100%) rename {pvpgn/conf => conf}/d2cs.conf.win32 (100%) rename {pvpgn/conf => conf}/d2dbs.conf.in (100%) rename {pvpgn/conf => conf}/d2dbs.conf.win32 (100%) rename {pvpgn/conf => conf}/d2server.ini (100%) rename {pvpgn/conf => conf}/news.txt.in (100%) rename {pvpgn/conf => conf}/realm.conf.in (100%) rename {pvpgn/conf => conf}/sql_DB_layout.conf.in (100%) rename {pvpgn/conf => conf}/sql_DB_layout2.conf.in (100%) rename {pvpgn/conf => conf}/supportfile.conf.in (100%) rename {pvpgn/conf => conf}/topics.conf.in (100%) rename {pvpgn/conf => conf}/tournament.conf.in (100%) rename {pvpgn/conf => conf}/versioncheck.conf.in (100%) rename pvpgn/config.h.cmake => config.h.cmake (100%) rename pvpgn/conversion-changelog => conversion-changelog (100%) delete mode 100644 d2pack109/CREDITS delete mode 100644 d2pack109/README delete mode 100644 d2pack109/Win32-Projects/Makefile.mingw delete mode 100644 d2pack109/Win32-Projects/make_mingw.bat delete mode 100755 d2pack109/Win32-Projects/make_mingw.sh delete mode 100644 d2pack109/conf/address_translation.conf delete mode 100644 d2pack109/conf/d2cs.conf.in delete mode 100644 d2pack109/conf/d2cs.conf.win32 delete mode 100644 d2pack109/conf/d2dbs.conf.in delete mode 100644 d2pack109/conf/d2dbs.conf.win32 delete mode 100644 d2pack109/docs/Compile.Instructions.Win32.MinGW.txt delete mode 100644 d2pack109/docs/INSTALL.unix delete mode 100644 d2pack109/docs/Service.Win32.txt delete mode 100644 d2pack109/src/Makefile.in delete mode 100644 d2pack109/src/autoconf/ansi2knr.c delete mode 100644 d2pack109/src/autoconf/ccstdc.m4 delete mode 100644 d2pack109/src/autoconf/config.guess delete mode 100644 d2pack109/src/autoconf/config.sub delete mode 100644 d2pack109/src/autoconf/termios.m4 delete mode 100644 d2pack109/src/autoconf/winsz.m4 delete mode 100755 d2pack109/src/autogen.sh delete mode 100644 d2pack109/src/common/addr.c delete mode 100644 d2pack109/src/common/addr.h delete mode 100644 d2pack109/src/common/bn_type.c delete mode 100644 d2pack109/src/common/bn_type.h delete mode 100644 d2pack109/src/common/d2game_protocol.h delete mode 100644 d2pack109/src/common/elist.h delete mode 100644 d2pack109/src/common/eventlog.c delete mode 100644 d2pack109/src/common/eventlog.h delete mode 100644 d2pack109/src/common/fdwatch.c delete mode 100644 d2pack109/src/common/fdwatch.h delete mode 100644 d2pack109/src/common/fdwatch_epoll.c delete mode 100644 d2pack109/src/common/fdwatch_epoll.h delete mode 100644 d2pack109/src/common/fdwatch_kqueue.c delete mode 100644 d2pack109/src/common/fdwatch_kqueue.h delete mode 100644 d2pack109/src/common/fdwatch_poll.c delete mode 100644 d2pack109/src/common/fdwatch_poll.h delete mode 100644 d2pack109/src/common/fdwatch_select.c delete mode 100644 d2pack109/src/common/fdwatch_select.h delete mode 100644 d2pack109/src/common/field_sizes.h delete mode 100644 d2pack109/src/common/flags.h delete mode 100644 d2pack109/src/common/hashtable.c delete mode 100644 d2pack109/src/common/hashtable.h delete mode 100644 d2pack109/src/common/hexdump.c delete mode 100644 d2pack109/src/common/hexdump.h delete mode 100644 d2pack109/src/common/init_protocol.h delete mode 100644 d2pack109/src/common/list.c delete mode 100644 d2pack109/src/common/list.h delete mode 100644 d2pack109/src/common/network.c delete mode 100644 d2pack109/src/common/network.h delete mode 100644 d2pack109/src/common/packet.c delete mode 100644 d2pack109/src/common/packet.h delete mode 100644 d2pack109/src/common/queue.c delete mode 100644 d2pack109/src/common/queue.h delete mode 100644 d2pack109/src/common/rlimit.c delete mode 100644 d2pack109/src/common/rlimit.h delete mode 100644 d2pack109/src/common/setup_before.h delete mode 100644 d2pack109/src/common/tag.c delete mode 100644 d2pack109/src/common/tag.h delete mode 100644 d2pack109/src/common/trans.c delete mode 100644 d2pack109/src/common/trans.h delete mode 100644 d2pack109/src/common/util.c delete mode 100644 d2pack109/src/common/util.h delete mode 100644 d2pack109/src/common/version.h delete mode 100644 d2pack109/src/common/xalloc.c delete mode 100644 d2pack109/src/common/xalloc.h delete mode 100644 d2pack109/src/compat/access.h delete mode 100644 d2pack109/src/compat/char_bit.h delete mode 100644 d2pack109/src/compat/difftime.c delete mode 100644 d2pack109/src/compat/difftime.h delete mode 100644 d2pack109/src/compat/exitstatus.h delete mode 100644 d2pack109/src/compat/gethostname.h delete mode 100644 d2pack109/src/compat/getopt.c delete mode 100644 d2pack109/src/compat/getopt.h delete mode 100644 d2pack109/src/compat/gettimeofday.c delete mode 100644 d2pack109/src/compat/gettimeofday.h delete mode 100644 d2pack109/src/compat/inet_aton.c delete mode 100644 d2pack109/src/compat/inet_aton.h delete mode 100644 d2pack109/src/compat/inet_ntoa.c delete mode 100644 d2pack109/src/compat/inet_ntoa.h delete mode 100644 d2pack109/src/compat/memcpy.c delete mode 100644 d2pack109/src/compat/memcpy.h delete mode 100644 d2pack109/src/compat/memmove.c delete mode 100644 d2pack109/src/compat/memmove.h delete mode 100644 d2pack109/src/compat/memset.c delete mode 100644 d2pack109/src/compat/memset.h delete mode 100644 d2pack109/src/compat/mkdir.h delete mode 100644 d2pack109/src/compat/mmap.c delete mode 100644 d2pack109/src/compat/mmap.h delete mode 100644 d2pack109/src/compat/pdir.c delete mode 100644 d2pack109/src/compat/pdir.h delete mode 100644 d2pack109/src/compat/psock.c delete mode 100644 d2pack109/src/compat/psock.h delete mode 100644 d2pack109/src/compat/recv.h delete mode 100644 d2pack109/src/compat/rename.h delete mode 100644 d2pack109/src/compat/seek.h delete mode 100644 d2pack109/src/compat/send.h delete mode 100644 d2pack109/src/compat/signal.h delete mode 100644 d2pack109/src/compat/socket.h delete mode 100644 d2pack109/src/compat/stdfileno.h delete mode 100644 d2pack109/src/compat/strcasecmp.c delete mode 100644 d2pack109/src/compat/strcasecmp.h delete mode 100644 d2pack109/src/compat/strchr.h delete mode 100644 d2pack109/src/compat/strdup.c delete mode 100644 d2pack109/src/compat/strdup.h delete mode 100644 d2pack109/src/compat/strerror.c delete mode 100644 d2pack109/src/compat/strerror.h delete mode 100644 d2pack109/src/compat/strftime.c delete mode 100644 d2pack109/src/compat/strftime.h delete mode 100644 d2pack109/src/compat/strncasecmp.c delete mode 100644 d2pack109/src/compat/strncasecmp.h delete mode 100644 d2pack109/src/compat/strrchr.h delete mode 100644 d2pack109/src/compat/strsep.c delete mode 100644 d2pack109/src/compat/strsep.h delete mode 100644 d2pack109/src/compat/strtoul.c delete mode 100644 d2pack109/src/compat/strtoul.h delete mode 100644 d2pack109/src/compat/termios.h delete mode 100644 d2pack109/src/compat/uint.h delete mode 100644 d2pack109/src/compat/uname.c delete mode 100644 d2pack109/src/compat/uname.h delete mode 100644 d2pack109/src/configure.in delete mode 100644 d2pack109/src/d2cs/bit.h delete mode 100644 d2pack109/src/d2cs/bnetd.c delete mode 100644 d2pack109/src/d2cs/bnetd.h delete mode 100644 d2pack109/src/d2cs/cmdline_parse.c delete mode 100644 d2pack109/src/d2cs/cmdline_parse.h delete mode 100644 d2pack109/src/d2cs/conf.c delete mode 100644 d2pack109/src/d2cs/conf.h delete mode 100644 d2pack109/src/d2cs/connection.c delete mode 100644 d2pack109/src/d2cs/connection.h delete mode 100644 d2pack109/src/d2cs/d2charfile.c delete mode 100644 d2pack109/src/d2cs/d2charfile.h delete mode 100644 d2pack109/src/d2cs/d2charlist.c delete mode 100644 d2pack109/src/d2cs/d2charlist.h delete mode 100644 d2pack109/src/d2cs/d2cs_bnetd_protocol.h delete mode 100644 d2pack109/src/d2cs/d2cs_d2dbs_ladder.h delete mode 100644 d2pack109/src/d2cs/d2cs_d2gs_character.h delete mode 100644 d2pack109/src/d2cs/d2cs_d2gs_protocol.h delete mode 100644 d2pack109/src/d2cs/d2cs_protocol.h delete mode 100644 d2pack109/src/d2cs/d2gs.c delete mode 100644 d2pack109/src/d2cs/d2gs.h delete mode 100644 d2pack109/src/d2cs/d2ladder.c delete mode 100644 d2pack109/src/d2cs/d2ladder.h delete mode 100644 d2pack109/src/d2cs/game.c delete mode 100644 d2pack109/src/d2cs/game.h delete mode 100644 d2pack109/src/d2cs/gamequeue.c delete mode 100644 d2pack109/src/d2cs/gamequeue.h delete mode 100644 d2pack109/src/d2cs/handle_bnetd.c delete mode 100644 d2pack109/src/d2cs/handle_bnetd.h delete mode 100644 d2pack109/src/d2cs/handle_d2cs.c delete mode 100644 d2pack109/src/d2cs/handle_d2cs.h delete mode 100644 d2pack109/src/d2cs/handle_d2gs.c delete mode 100644 d2pack109/src/d2cs/handle_d2gs.h delete mode 100644 d2pack109/src/d2cs/handle_init.c delete mode 100644 d2pack109/src/d2cs/handle_init.h delete mode 100644 d2pack109/src/d2cs/handle_signal.c delete mode 100644 d2pack109/src/d2cs/handle_signal.h delete mode 100644 d2pack109/src/d2cs/main.c delete mode 100644 d2pack109/src/d2cs/net.c delete mode 100644 d2pack109/src/d2cs/net.h delete mode 100644 d2pack109/src/d2cs/prefs.c delete mode 100644 d2pack109/src/d2cs/prefs.h delete mode 100644 d2pack109/src/d2cs/s2s.c delete mode 100644 d2pack109/src/d2cs/s2s.h delete mode 100644 d2pack109/src/d2cs/server.c delete mode 100644 d2pack109/src/d2cs/server.h delete mode 100644 d2pack109/src/d2cs/serverqueue.c delete mode 100644 d2pack109/src/d2cs/serverqueue.h delete mode 100644 d2pack109/src/d2cs/setup.h delete mode 100644 d2pack109/src/d2cs/version.h delete mode 100644 d2pack109/src/d2cs/xstring.c delete mode 100644 d2pack109/src/d2cs/xstring.h delete mode 100644 d2pack109/src/d2dbs/charlock.c delete mode 100644 d2pack109/src/d2dbs/charlock.h delete mode 100644 d2pack109/src/d2dbs/cmdline_parse.c delete mode 100644 d2pack109/src/d2dbs/cmdline_parse.h delete mode 100644 d2pack109/src/d2dbs/d2ladder.c delete mode 100644 d2pack109/src/d2dbs/d2ladder.h delete mode 100644 d2pack109/src/d2dbs/dbsdupecheck.c delete mode 100644 d2pack109/src/d2dbs/dbsdupecheck.h delete mode 100644 d2pack109/src/d2dbs/dbserver.c delete mode 100644 d2pack109/src/d2dbs/dbserver.h delete mode 100644 d2pack109/src/d2dbs/dbspacket.c delete mode 100644 d2pack109/src/d2dbs/dbspacket.h delete mode 100644 d2pack109/src/d2dbs/handle_signal.c delete mode 100644 d2pack109/src/d2dbs/handle_signal.h delete mode 100644 d2pack109/src/d2dbs/main.c delete mode 100644 d2pack109/src/d2dbs/prefs.c delete mode 100644 d2pack109/src/d2dbs/prefs.h delete mode 100644 d2pack109/src/d2dbs/setup.h delete mode 100644 d2pack109/src/d2dbs/version.h delete mode 100644 d2pack109/src/win32/configwin.h delete mode 100644 d2pack109/src/win32/d2cs_winmain.c delete mode 100644 d2pack109/src/win32/d2dbs_winmain.c delete mode 100644 d2pack109/src/win32/service.c delete mode 100644 d2pack109/src/win32/service.h delete mode 100644 d2pack109/src/win32/u2d.c delete mode 100644 d2pack109/src/win32/winmain.h rename {pvpgn/docs => docs}/Compile.Instructions.Win32.Dev-C++.txt (98%) rename {pvpgn/docs => docs}/Compile.Instructions.Win32.VS.Net2005.txt (98%) rename {pvpgn/docs => docs}/INDEX (100%) rename {pvpgn/docs => docs}/INSTALL.unix (100%) rename {pvpgn/docs => docs}/Makefile.am (100%) rename {pvpgn/docs => docs}/PORTS (100%) rename {pvpgn/docs => docs}/README.fdwatch (100%) rename {pvpgn/docs => docs}/README.storage (100%) rename {pvpgn/docs => docs}/bnmotd.txt (100%) rename {pvpgn/files => files}/CMakeLists.txt (100%) rename {pvpgn/files => files}/IX86ver1.mpq (100%) rename {pvpgn/files => files}/Makefile.am (100%) rename {pvpgn/files => files}/PMACver1.mpq (100%) rename {pvpgn/files => files}/XMACver1.mpq (100%) rename {pvpgn/files => files}/ad000001.mng (100%) rename {pvpgn/files => files}/ad000001.smk (100%) rename {pvpgn/files => files}/ad000002.mng (100%) rename {pvpgn/files => files}/ad000003.mng (100%) rename {pvpgn/files => files}/ad000004.mng (100%) rename {pvpgn/files => files}/ad000075.mng (100%) rename {pvpgn/files => files}/bnserver-D2DV.ini (100%) rename {pvpgn/files => files}/bnserver-D2XP.ini (100%) rename {pvpgn/files => files}/bnserver-WAR3.ini (100%) rename {pvpgn/files => files}/bnserver.ini (100%) rename {pvpgn/files => files}/chathelp-war3-default.txt (100%) rename {pvpgn/files => files}/chathelp-war3-enUS.txt (100%) rename {pvpgn/files => files}/chathelp-war3-frFR.txt (100%) rename {pvpgn/files => files}/chathelp-war3-ruRU.txt (100%) rename {pvpgn/files => files}/chathelp-war3-zhCN.txt (96%) rename {pvpgn/files => files}/icons-WAR3.bni (100%) rename {pvpgn/files => files}/icons.bni (100%) rename {pvpgn/files => files}/icons_STAR.bni (100%) rename {pvpgn/files => files}/newaccount-default.txt (100%) rename {pvpgn/files => files}/newaccount-enUS.txt (100%) rename {d2pack109/files => files}/newbie.save (100%) rename {pvpgn/files => files}/termsofservice-default.txt (100%) rename {pvpgn/files => files}/termsofservice-enUS.txt (100%) rename {pvpgn/files => files}/tos-unicode_default.txt (98%) rename {pvpgn/files => files}/tos.txt (98%) rename {pvpgn/files => files}/tos_default.txt (98%) rename {pvpgn/files => files}/ver-ix86-1.mpq (100%) rename {pvpgn/man => man}/CMakeLists.txt (100%) rename {pvpgn/man => man}/Makefile.am (100%) rename {pvpgn/man => man}/bnbot.1 (100%) rename {pvpgn/man => man}/bnchat.1 (100%) rename {pvpgn/man => man}/bnetd.1 (100%) rename {pvpgn/man => man}/bnetd.conf.5 (100%) rename {pvpgn/man => man}/bnftp.1 (100%) rename {pvpgn/man => man}/bni2tga.1 (100%) rename {pvpgn/man => man}/bnibuild.1 (100%) rename {pvpgn/man => man}/bniextract.1 (100%) rename {pvpgn/man => man}/bnilist.1 (100%) rename {pvpgn/man => man}/bnpass.1 (100%) rename {pvpgn/man => man}/bnpcap.1 (100%) rename {pvpgn/man => man}/bnproxy.1 (100%) rename {pvpgn/man => man}/bnstat.1 (100%) rename {pvpgn/man => man}/bntext.5 (100%) rename {pvpgn/man => man}/bntrackd.1 (100%) rename {pvpgn/man => man}/tgainfo.1 (100%) delete mode 100644 pvpgn/COPYING delete mode 100644 pvpgn/README delete mode 100644 pvpgn/files/newbie.save delete mode 100644 pvpgn/src/autoconf/install-sh delete mode 100644 pvpgn/src/autoconf/mkdir-p delete mode 100644 pvpgn/src/autoconf/mkdir.m4 delete mode 100644 pvpgn/src/common/introtate.h delete mode 100644 pvpgn/src/common/setup_after.h delete mode 100644 pvpgn/src/compat/netinet_in.h delete mode 100644 pvpgn/src/compat/read.h delete mode 100644 pvpgn/src/compat/statmacros.h delete mode 100644 pvpgn/src/win32/console_resource.h delete mode 100644 pvpgn/src/win32/console_resource.rc delete mode 100644 pvpgn/src/win32/d2cs_resource.h delete mode 100644 pvpgn/src/win32/d2cs_resource.rc delete mode 100644 pvpgn/src/win32/d2dbs_resource.h delete mode 100644 pvpgn/src/win32/d2dbs_resource.rc delete mode 100644 pvpgn/src/win32/logo01.ico rename {pvpgn/scripts => scripts}/S98bnetd (100%) rename {pvpgn/scripts => scripts}/announce.sh (100%) rename {pvpgn/scripts => scripts}/bnetd.init (100%) rename {pvpgn/scripts => scripts}/bnetd.logrotate (100%) rename {pvpgn/scripts => scripts}/bnetmasq.sh (100%) rename {pvpgn/scripts => scripts}/convert_w3.pl (100%) rename {pvpgn/scripts => scripts}/cvs2cl.pl (100%) rename {pvpgn/scripts => scripts}/flat2cdb.pl (100%) rename {pvpgn/scripts => scripts}/fsgs2bnetd.pl (100%) rename {pvpgn/scripts => scripts}/ladder.py (100%) rename {pvpgn/scripts => scripts}/lastlogin.pl (100%) rename {pvpgn/scripts => scripts}/login_testusers.sh (100%) rename {pvpgn/scripts => scripts}/make_testusers.sh (100%) rename {pvpgn/scripts => scripts}/process.pl (100%) rename {pvpgn/scripts => scripts}/pvpgn_hash.inc.php (96%) rename {pvpgn/scripts => scripts}/pvpgn_wol_hash.inc.php (95%) rename {pvpgn/scripts => scripts}/rc.bnetd (100%) rename {pvpgn/scripts => scripts}/reform.awk (100%) rename {pvpgn/scripts => scripts}/sql/repairlevels.pl (100%) rename {pvpgn/scripts => scripts}/storage/cdb2sql.pl (100%) rename {pvpgn/scripts => scripts}/storage/plain2sql.pl (100%) rename {pvpgn/scripts => scripts}/tos.bat (96%) rename {pvpgn/scripts => scripts}/tos.sh (100%) rename {pvpgn/src => src}/CMakeLists.txt (100%) rename {pvpgn/src => src}/Makefile.am (100%) rename {pvpgn/src => src}/autoconf/Makefile.am (100%) rename {pvpgn/src => src}/autoconf/ansi2knr.c (100%) rename {pvpgn/src => src}/autoconf/ccstdc.m4 (100%) rename {pvpgn/src => src}/autoconf/config.guess (100%) rename {pvpgn/src => src}/autoconf/config.sub (100%) rename {d2pack109/src => src}/autoconf/install-sh (100%) rename {d2pack109/src => src}/autoconf/mkdir-p (100%) rename {d2pack109/src => src}/autoconf/mkdir.m4 (100%) rename {pvpgn/src => src}/autoconf/termios.m4 (100%) rename {pvpgn/src => src}/autoconf/winsz.m4 (100%) rename {pvpgn/src => src}/bnetd/CMakeLists.txt (100%) rename {pvpgn/src => src}/bnetd/Makefile.am (100%) rename {pvpgn/src => src}/bnetd/account.cpp (100%) rename {pvpgn/src => src}/bnetd/account.h (100%) rename {pvpgn/src => src}/bnetd/account_wrap.cpp (100%) rename {pvpgn/src => src}/bnetd/account_wrap.h (100%) rename {pvpgn/src => src}/bnetd/adbanner.cpp (100%) rename {pvpgn/src => src}/bnetd/adbanner.h (100%) rename {pvpgn/src => src}/bnetd/alias_command.cpp (100%) rename {pvpgn/src => src}/bnetd/alias_command.h (100%) rename {pvpgn/src => src}/bnetd/anongame.cpp (100%) rename {pvpgn/src => src}/bnetd/anongame.h (100%) rename {pvpgn/src => src}/bnetd/anongame_gameresult.cpp (100%) rename {pvpgn/src => src}/bnetd/anongame_gameresult.h (100%) rename {pvpgn/src => src}/bnetd/anongame_infos.cpp (100%) rename {pvpgn/src => src}/bnetd/anongame_infos.h (100%) rename {pvpgn/src => src}/bnetd/anongame_maplists.cpp (100%) rename {pvpgn/src => src}/bnetd/anongame_maplists.h (100%) rename {pvpgn/src => src}/bnetd/anongame_wol.cpp (96%) rename {pvpgn/src => src}/bnetd/anongame_wol.h (95%) rename {pvpgn/src => src}/bnetd/attr.h (100%) rename {pvpgn/src => src}/bnetd/attrgroup.cpp (100%) rename {pvpgn/src => src}/bnetd/attrgroup.h (100%) rename {pvpgn/src => src}/bnetd/attrlayer.cpp (100%) rename {pvpgn/src => src}/bnetd/attrlayer.h (100%) rename {pvpgn/src => src}/bnetd/autoupdate.cpp (100%) rename {pvpgn/src => src}/bnetd/autoupdate.h (100%) rename {pvpgn/src => src}/bnetd/channel.cpp (100%) rename {pvpgn/src => src}/bnetd/channel.h (100%) rename {pvpgn/src => src}/bnetd/channel_conv.cpp (100%) rename {pvpgn/src => src}/bnetd/channel_conv.h (100%) rename {pvpgn/src => src}/bnetd/character.cpp (100%) rename {pvpgn/src => src}/bnetd/character.h (100%) rename {pvpgn/src => src}/bnetd/clan.cpp (100%) rename {pvpgn/src => src}/bnetd/clan.h (100%) rename {pvpgn/src => src}/bnetd/cmdline.cpp (100%) rename {pvpgn/src => src}/bnetd/cmdline.h (100%) rename {pvpgn/src => src}/bnetd/command.cpp (100%) rename {pvpgn/src => src}/bnetd/command.h (100%) rename {pvpgn/src => src}/bnetd/command_groups.cpp (100%) rename {pvpgn/src => src}/bnetd/command_groups.h (100%) rename {pvpgn/src => src}/bnetd/connection.cpp (100%) rename {pvpgn/src => src}/bnetd/connection.h (100%) rename {pvpgn/src => src}/bnetd/file.cpp (100%) rename {pvpgn/src => src}/bnetd/file.h (100%) rename {pvpgn/src => src}/bnetd/file_cdb.cpp (100%) rename {pvpgn/src => src}/bnetd/file_cdb.h (100%) rename {pvpgn/src => src}/bnetd/file_plain.cpp (100%) rename {pvpgn/src => src}/bnetd/file_plain.h (100%) rename {pvpgn/src => src}/bnetd/friends.cpp (100%) rename {pvpgn/src => src}/bnetd/friends.h (100%) rename {pvpgn/src => src}/bnetd/game.cpp (100%) rename {pvpgn/src => src}/bnetd/game.h (100%) rename {pvpgn/src => src}/bnetd/game_conv.cpp (100%) rename {pvpgn/src => src}/bnetd/game_conv.h (100%) rename {pvpgn/src => src}/bnetd/handle_anongame.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_anongame.h (100%) rename {pvpgn/src => src}/bnetd/handle_apireg.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_apireg.h (100%) rename {pvpgn/src => src}/bnetd/handle_bnet.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_bnet.h (100%) rename {pvpgn/src => src}/bnetd/handle_bot.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_bot.h (100%) rename {pvpgn/src => src}/bnetd/handle_d2cs.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_d2cs.h (100%) rename {pvpgn/src => src}/bnetd/handle_file.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_file.h (100%) rename {pvpgn/src => src}/bnetd/handle_init.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_init.h (100%) rename {pvpgn/src => src}/bnetd/handle_irc.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_irc.h (100%) rename {pvpgn/src => src}/bnetd/handle_irc_common.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_irc_common.h (100%) rename {pvpgn/src => src}/bnetd/handle_telnet.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_telnet.h (100%) rename {pvpgn/src => src}/bnetd/handle_udp.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_udp.h (100%) rename {pvpgn/src => src}/bnetd/handle_wol.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_wol.h (100%) rename {pvpgn/src => src}/bnetd/handle_wol_gameres.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_wol_gameres.h (100%) rename {pvpgn/src => src}/bnetd/handle_wserv.cpp (100%) rename {pvpgn/src => src}/bnetd/handle_wserv.h (100%) rename {pvpgn/src => src}/bnetd/handlers.h (100%) rename {pvpgn/src => src}/bnetd/helpfile.cpp (100%) rename {pvpgn/src => src}/bnetd/helpfile.h (100%) rename {pvpgn/src => src}/bnetd/ipban.cpp (100%) rename {pvpgn/src => src}/bnetd/ipban.h (100%) rename {pvpgn/src => src}/bnetd/irc.cpp (100%) rename {pvpgn/src => src}/bnetd/irc.h (100%) rename {pvpgn/src => src}/bnetd/ladder.cpp (100%) rename {pvpgn/src => src}/bnetd/ladder.h (100%) rename {pvpgn/src => src}/bnetd/ladder_calc.cpp (100%) rename {pvpgn/src => src}/bnetd/ladder_calc.h (100%) rename {pvpgn/src => src}/bnetd/mail.cpp (100%) rename {pvpgn/src => src}/bnetd/mail.h (100%) rename {pvpgn/src => src}/bnetd/main.cpp (100%) rename {pvpgn/src => src}/bnetd/message.cpp (100%) rename {pvpgn/src => src}/bnetd/message.h (100%) rename {pvpgn/src => src}/bnetd/news.cpp (100%) rename {pvpgn/src => src}/bnetd/news.h (100%) rename {pvpgn/src => src}/bnetd/output.cpp (100%) rename {pvpgn/src => src}/bnetd/output.h (100%) rename {pvpgn/src => src}/bnetd/prefs.cpp (100%) rename {pvpgn/src => src}/bnetd/prefs.h (100%) rename {pvpgn/src => src}/bnetd/quota.h (100%) rename {pvpgn/src => src}/bnetd/realm.cpp (100%) rename {pvpgn/src => src}/bnetd/realm.h (100%) rename {pvpgn/src => src}/bnetd/runprog.cpp (100%) rename {pvpgn/src => src}/bnetd/runprog.h (100%) rename {pvpgn/src => src}/bnetd/server.cpp (100%) rename {pvpgn/src => src}/bnetd/server.h (100%) rename {pvpgn/src => src}/bnetd/sql_common.cpp (100%) rename {pvpgn/src => src}/bnetd/sql_common.h (100%) rename {pvpgn/src => src}/bnetd/sql_dbcreator.cpp (100%) rename {pvpgn/src => src}/bnetd/sql_dbcreator.h (100%) rename {pvpgn/src => src}/bnetd/sql_mysql.cpp (99%) rename {pvpgn/src => src}/bnetd/sql_mysql.h (100%) rename {pvpgn/src => src}/bnetd/sql_odbc.cpp (100%) rename {pvpgn/src => src}/bnetd/sql_odbc.h (100%) rename {pvpgn/src => src}/bnetd/sql_pgsql.cpp (100%) rename {pvpgn/src => src}/bnetd/sql_pgsql.h (100%) rename {pvpgn/src => src}/bnetd/sql_sqlite3.cpp (100%) rename {pvpgn/src => src}/bnetd/sql_sqlite3.h (100%) rename {pvpgn/src => src}/bnetd/storage.cpp (100%) rename {pvpgn/src => src}/bnetd/storage.h (100%) rename {pvpgn/src => src}/bnetd/storage_file.cpp (100%) rename {pvpgn/src => src}/bnetd/storage_file.h (100%) rename {pvpgn/src => src}/bnetd/storage_sql.cpp (100%) rename {pvpgn/src => src}/bnetd/storage_sql.h (100%) rename {pvpgn/src => src}/bnetd/storage_sql2.cpp (100%) rename {pvpgn/src => src}/bnetd/storage_sql2.h (100%) rename {pvpgn/src => src}/bnetd/support.cpp (100%) rename {pvpgn/src => src}/bnetd/support.h (100%) rename {pvpgn/src => src}/bnetd/team.cpp (100%) rename {pvpgn/src => src}/bnetd/team.h (100%) rename {pvpgn/src => src}/bnetd/tick.cpp (100%) rename {pvpgn/src => src}/bnetd/tick.h (100%) rename {pvpgn/src => src}/bnetd/timer.cpp (100%) rename {pvpgn/src => src}/bnetd/timer.h (100%) rename {pvpgn/src => src}/bnetd/topic.cpp (100%) rename {pvpgn/src => src}/bnetd/topic.h (100%) rename {pvpgn/src => src}/bnetd/tournament.cpp (100%) rename {pvpgn/src => src}/bnetd/tournament.h (100%) rename {pvpgn/src => src}/bnetd/tracker.cpp (100%) rename {pvpgn/src => src}/bnetd/tracker.h (100%) rename {pvpgn/src => src}/bnetd/udptest_send.cpp (100%) rename {pvpgn/src => src}/bnetd/udptest_send.h (100%) rename {pvpgn/src => src}/bnetd/versioncheck.cpp (100%) rename {pvpgn/src => src}/bnetd/versioncheck.h (100%) rename {pvpgn/src => src}/bnetd/watch.cpp (100%) rename {pvpgn/src => src}/bnetd/watch.h (100%) rename {pvpgn/src => src}/bniutils/CMakeLists.txt (100%) rename {pvpgn/src => src}/bniutils/Makefile.am (100%) rename {pvpgn/src => src}/bniutils/bni.cpp (100%) rename {pvpgn/src => src}/bniutils/bni.h (100%) rename {pvpgn/src => src}/bniutils/bni2tga.cpp (100%) rename {pvpgn/src => src}/bniutils/bnibuild.cpp (100%) rename {pvpgn/src => src}/bniutils/bniextract.cpp (100%) rename {pvpgn/src => src}/bniutils/bnilist.cpp (100%) rename {pvpgn/src => src}/bniutils/fileio.cpp (100%) rename {pvpgn/src => src}/bniutils/fileio.h (100%) rename {pvpgn/src => src}/bniutils/tga.cpp (100%) rename {pvpgn/src => src}/bniutils/tga.h (100%) rename {pvpgn/src => src}/bniutils/tgainfo.cpp (100%) rename {pvpgn/src => src}/bnpass/CMakeLists.txt (100%) rename {pvpgn/src => src}/bnpass/Makefile.am (100%) rename {pvpgn/src => src}/bnpass/bnpass.cpp (100%) rename {pvpgn/src => src}/bnpass/sha1hash.cpp (100%) rename {pvpgn/src => src}/bnpcap/CMakeLists.txt (100%) rename {pvpgn/src => src}/bnpcap/Makefile.am (100%) rename {pvpgn/src => src}/bnpcap/bnpcap.cpp (100%) rename {pvpgn/src => src}/bnproxy/bnproxy.c (100%) rename {pvpgn/src => src}/bnproxy/virtconn.c (100%) rename {pvpgn/src => src}/bnproxy/virtconn.h (100%) rename {pvpgn/src => src}/bntrackd/CMakeLists.txt (100%) rename {pvpgn/src => src}/bntrackd/Makefile.am (100%) rename {pvpgn/src => src}/bntrackd/bntrackd.cpp (100%) rename {pvpgn/src => src}/bntrackd/servers.xsl (100%) rename {pvpgn/src => src}/client/CMakeLists.txt (100%) rename {pvpgn/src => src}/client/Makefile.am (100%) rename {pvpgn/src => src}/client/ansi_term.h (100%) rename {pvpgn/src => src}/client/bnbot.cpp (100%) rename {pvpgn/src => src}/client/bnchat.cpp (100%) rename {pvpgn/src => src}/client/bnftp.cpp (100%) rename {pvpgn/src => src}/client/bnstat.cpp (100%) rename {pvpgn/src => src}/client/client.cpp (100%) rename {pvpgn/src => src}/client/client.h (100%) rename {pvpgn/src => src}/client/client_connect.cpp (100%) rename {pvpgn/src => src}/client/client_connect.h (100%) rename {pvpgn/src => src}/client/udptest.cpp (100%) rename {pvpgn/src => src}/client/udptest.h (100%) rename {pvpgn/src => src}/common/CMakeLists.txt (100%) rename {pvpgn/src => src}/common/Makefile.am (100%) rename {pvpgn/src => src}/common/addr.cpp (100%) rename {pvpgn/src => src}/common/addr.h (100%) rename {pvpgn/src => src}/common/anongame_protocol.h (100%) rename {pvpgn/src => src}/common/asnprintf.cpp (100%) rename {pvpgn/src => src}/common/asnprintf.h (100%) rename {pvpgn/src => src}/common/bigint.cpp (100%) rename {pvpgn/src => src}/common/bigint.h (100%) rename {pvpgn/src => src}/common/bn_type.cpp (100%) rename {pvpgn/src => src}/common/bn_type.h (100%) rename {pvpgn/src => src}/common/bnet_protocol.h (100%) rename {pvpgn/src => src}/common/bnethash.cpp (100%) rename {pvpgn/src => src}/common/bnethash.h (100%) rename {pvpgn/src => src}/common/bnethashconv.cpp (100%) rename {pvpgn/src => src}/common/bnethashconv.h (100%) rename {pvpgn/src => src}/common/bnetsrp3.cpp (100%) rename {pvpgn/src => src}/common/bnetsrp3.h (100%) rename {pvpgn/src => src}/common/bnettime.cpp (100%) rename {pvpgn/src => src}/common/bnettime.h (100%) rename {pvpgn/src => src}/common/bot_protocol.h (100%) rename {pvpgn/src => src}/common/cdbhash.h (100%) rename {pvpgn/src => src}/common/conf.cpp (100%) rename {pvpgn/src => src}/common/conf.h (100%) rename {pvpgn/src => src}/common/d2char_checksum.cpp (100%) rename {pvpgn/src => src}/common/d2char_checksum.h (100%) rename {pvpgn/src => src}/common/d2char_file.h (100%) rename {pvpgn/src => src}/common/d2cs_bnetd_protocol.h (100%) rename {pvpgn/src => src}/common/d2cs_d2dbs_ladder.h (100%) rename {pvpgn/src => src}/common/d2cs_d2gs_character.h (100%) rename {pvpgn/src => src}/common/d2cs_d2gs_protocol.h (100%) rename {pvpgn/src => src}/common/d2cs_protocol.h (100%) rename {pvpgn/src => src}/common/d2game_protocol.h (100%) rename {pvpgn/src => src}/common/elist.h (100%) rename {pvpgn/src => src}/common/eventlog.cpp (100%) rename {pvpgn/src => src}/common/eventlog.h (100%) rename {pvpgn/src => src}/common/fdwatch.cpp (100%) rename {pvpgn/src => src}/common/fdwatch.h (100%) rename {pvpgn/src => src}/common/fdwatch_epoll.cpp (100%) rename {pvpgn/src => src}/common/fdwatch_epoll.h (100%) rename {pvpgn/src => src}/common/fdwatch_kqueue.cpp (100%) rename {pvpgn/src => src}/common/fdwatch_kqueue.h (100%) rename {pvpgn/src => src}/common/fdwatch_poll.cpp (100%) rename {pvpgn/src => src}/common/fdwatch_poll.h (100%) rename {pvpgn/src => src}/common/fdwatch_select.cpp (100%) rename {pvpgn/src => src}/common/fdwatch_select.h (100%) rename {pvpgn/src => src}/common/fdwbackend.cpp (100%) rename {pvpgn/src => src}/common/fdwbackend.h (100%) rename {pvpgn/src => src}/common/field_sizes.h (100%) rename {pvpgn/src => src}/common/file_protocol.h (100%) rename {pvpgn/src => src}/common/flags.h (100%) rename {pvpgn/src => src}/common/give_up_root_privileges.cpp (100%) rename {pvpgn/src => src}/common/give_up_root_privileges.h (100%) rename {pvpgn/src => src}/common/gui_printf.cpp (100%) rename {pvpgn/src => src}/common/gui_printf.h (100%) rename {pvpgn/src => src}/common/hashtable.cpp (100%) rename {pvpgn/src => src}/common/hashtable.h (100%) rename {pvpgn/src => src}/common/hexdump.cpp (100%) rename {pvpgn/src => src}/common/hexdump.h (100%) rename {pvpgn/src => src}/common/init_protocol.h (100%) rename {d2pack109/src => src}/common/introtate.h (100%) rename {pvpgn/src => src}/common/irc_protocol.h (100%) rename {pvpgn/src => src}/common/list.cpp (100%) rename {pvpgn/src => src}/common/list.h (100%) rename {pvpgn/src => src}/common/lstr.h (100%) rename {pvpgn/src => src}/common/network.cpp (100%) rename {pvpgn/src => src}/common/network.h (100%) rename {pvpgn/src => src}/common/packet.cpp (100%) rename {pvpgn/src => src}/common/packet.h (100%) rename {pvpgn/src => src}/common/peerchat.cpp (100%) rename {pvpgn/src => src}/common/peerchat.h (100%) rename {pvpgn/src => src}/common/proginfo.cpp (100%) rename {pvpgn/src => src}/common/proginfo.h (100%) rename {pvpgn/src => src}/common/queue.cpp (100%) rename {pvpgn/src => src}/common/queue.h (100%) rename {pvpgn/src => src}/common/rcm.cpp (100%) rename {pvpgn/src => src}/common/rcm.h (100%) rename {pvpgn/src => src}/common/rlimit.cpp (100%) rename {pvpgn/src => src}/common/rlimit.h (100%) rename {pvpgn/src => src}/common/scoped_array.h (100%) rename {pvpgn/src => src}/common/scoped_ptr.h (100%) rename {d2pack109/src => src}/common/setup_after.h (100%) rename {pvpgn/src => src}/common/setup_before.h (100%) rename {pvpgn/src => src}/common/systemerror.cpp (100%) rename {pvpgn/src => src}/common/systemerror.h (100%) rename {pvpgn/src => src}/common/tag.cpp (100%) rename {pvpgn/src => src}/common/tag.h (100%) rename {pvpgn/src => src}/common/token.cpp (100%) rename {pvpgn/src => src}/common/token.h (100%) rename {pvpgn/src => src}/common/tracker.h (100%) rename {pvpgn/src => src}/common/trans.cpp (100%) rename {pvpgn/src => src}/common/trans.h (100%) rename {pvpgn/src => src}/common/udp_protocol.h (100%) rename {pvpgn/src => src}/common/util.cpp (100%) rename {pvpgn/src => src}/common/util.h (100%) rename {pvpgn/src => src}/common/version.h (100%) rename {pvpgn/src => src}/common/wol_gameres_protocol.h (100%) rename {pvpgn/src => src}/common/wolhash.cpp (100%) rename {pvpgn/src => src}/common/wolhash.h (100%) rename {pvpgn/src => src}/common/xalloc.cpp (100%) rename {pvpgn/src => src}/common/xalloc.h (100%) rename {pvpgn/src => src}/common/xstr.cpp (100%) rename {pvpgn/src => src}/common/xstr.h (100%) rename {pvpgn/src => src}/common/xstring.cpp (100%) rename {pvpgn/src => src}/common/xstring.h (100%) rename {pvpgn/src => src}/compat/CMakeLists.txt (100%) rename {pvpgn/src => src}/compat/Makefile.am (100%) rename {pvpgn/src => src}/compat/access.h (100%) rename {pvpgn/src => src}/compat/gethostname.h (100%) rename {pvpgn/src => src}/compat/gettimeofday.cpp (100%) rename {pvpgn/src => src}/compat/gettimeofday.h (100%) rename {pvpgn/src => src}/compat/inet_aton.cpp (100%) rename {pvpgn/src => src}/compat/inet_aton.h (100%) rename {pvpgn/src => src}/compat/inet_ntoa.cpp (100%) rename {pvpgn/src => src}/compat/inet_ntoa.h (100%) rename {pvpgn/src => src}/compat/mkdir.h (100%) rename {pvpgn/src => src}/compat/mmap.cpp (100%) rename {pvpgn/src => src}/compat/mmap.h (100%) rename {d2pack109/src => src}/compat/netinet_in.h (100%) rename {pvpgn/src => src}/compat/pdir.cpp (100%) rename {pvpgn/src => src}/compat/pdir.h (100%) rename {pvpgn/src => src}/compat/pgetopt.cpp (100%) rename {pvpgn/src => src}/compat/pgetopt.h (100%) rename {pvpgn/src => src}/compat/pgetpid.h (100%) rename {pvpgn/src => src}/compat/psock.cpp (100%) rename {pvpgn/src => src}/compat/psock.h (100%) rename {d2pack109/src => src}/compat/read.h (100%) rename {pvpgn/src => src}/compat/recv.h (100%) rename {pvpgn/src => src}/compat/rename.h (100%) rename {pvpgn/src => src}/compat/runtime_libs.h (100%) rename {pvpgn/src => src}/compat/send.h (100%) rename {pvpgn/src => src}/compat/snprintf.cpp (100%) rename {pvpgn/src => src}/compat/snprintf.h (100%) rename {pvpgn/src => src}/compat/socket.h (100%) rename {d2pack109/src => src}/compat/statmacros.h (100%) rename {pvpgn/src => src}/compat/stdfileno.h (100%) rename {pvpgn/src => src}/compat/strcasecmp.cpp (100%) rename {pvpgn/src => src}/compat/strcasecmp.h (100%) rename {pvpgn/src => src}/compat/strdup.cpp (100%) rename {pvpgn/src => src}/compat/strdup.h (100%) rename {pvpgn/src => src}/compat/strerror.cpp (100%) rename {pvpgn/src => src}/compat/strerror.h (100%) rename {pvpgn/src => src}/compat/strncasecmp.cpp (100%) rename {pvpgn/src => src}/compat/strncasecmp.h (100%) rename {pvpgn/src => src}/compat/strsep.cpp (100%) rename {pvpgn/src => src}/compat/strsep.h (100%) rename {pvpgn/src => src}/compat/strtoul.cpp (100%) rename {pvpgn/src => src}/compat/strtoul.h (100%) rename {pvpgn/src => src}/compat/termios.h (100%) rename {pvpgn/src => src}/compat/uint.h (100%) rename {pvpgn/src => src}/compat/uname.cpp (100%) rename {pvpgn/src => src}/compat/uname.h (100%) rename {pvpgn/src => src}/compat/vsnprintf.cpp (100%) rename {pvpgn/src => src}/compat/vsnprintf.h (100%) rename {pvpgn/src => src}/d2cs/CMakeLists.txt (100%) rename {pvpgn/src => src}/d2cs/Makefile.am (100%) rename {pvpgn/src => src}/d2cs/bit.h (100%) rename {pvpgn/src => src}/d2cs/bnetd.cpp (100%) rename {pvpgn/src => src}/d2cs/bnetd.h (100%) rename {pvpgn/src => src}/d2cs/cmdline.cpp (100%) rename {pvpgn/src => src}/d2cs/cmdline.h (100%) rename {pvpgn/src => src}/d2cs/connection.cpp (100%) rename {pvpgn/src => src}/d2cs/connection.h (100%) rename {pvpgn/src => src}/d2cs/d2charfile.cpp (100%) rename {pvpgn/src => src}/d2cs/d2charfile.h (100%) rename {pvpgn/src => src}/d2cs/d2charlist.cpp (100%) rename {pvpgn/src => src}/d2cs/d2charlist.h (100%) rename {pvpgn/src => src}/d2cs/d2gs.cpp (100%) rename {pvpgn/src => src}/d2cs/d2gs.h (100%) rename {pvpgn/src => src}/d2cs/d2ladder.cpp (100%) rename {pvpgn/src => src}/d2cs/d2ladder.h (100%) rename {pvpgn/src => src}/d2cs/game.cpp (100%) rename {pvpgn/src => src}/d2cs/game.h (100%) rename {pvpgn/src => src}/d2cs/gamequeue.cpp (100%) rename {pvpgn/src => src}/d2cs/gamequeue.h (100%) rename {pvpgn/src => src}/d2cs/handle_bnetd.cpp (100%) rename {pvpgn/src => src}/d2cs/handle_bnetd.h (100%) rename {pvpgn/src => src}/d2cs/handle_d2cs.cpp (100%) rename {pvpgn/src => src}/d2cs/handle_d2cs.h (100%) rename {pvpgn/src => src}/d2cs/handle_d2gs.cpp (100%) rename {pvpgn/src => src}/d2cs/handle_d2gs.h (100%) rename {pvpgn/src => src}/d2cs/handle_init.cpp (100%) rename {pvpgn/src => src}/d2cs/handle_init.h (100%) rename {pvpgn/src => src}/d2cs/handle_signal.cpp (100%) rename {pvpgn/src => src}/d2cs/handle_signal.h (100%) rename {pvpgn/src => src}/d2cs/main.cpp (100%) rename {pvpgn/src => src}/d2cs/net.cpp (100%) rename {pvpgn/src => src}/d2cs/net.h (100%) rename {pvpgn/src => src}/d2cs/prefs.cpp (100%) rename {pvpgn/src => src}/d2cs/prefs.h (100%) rename {pvpgn/src => src}/d2cs/s2s.cpp (100%) rename {pvpgn/src => src}/d2cs/s2s.h (100%) rename {pvpgn/src => src}/d2cs/server.cpp (100%) rename {pvpgn/src => src}/d2cs/server.h (100%) rename {pvpgn/src => src}/d2cs/serverqueue.cpp (100%) rename {pvpgn/src => src}/d2cs/serverqueue.h (100%) rename {pvpgn/src => src}/d2cs/setup.h (100%) rename {pvpgn/src => src}/d2cs/version.h (100%) rename {pvpgn/src => src}/d2dbs/CMakeLists.txt (100%) rename {pvpgn/src => src}/d2dbs/Makefile.am (100%) rename {pvpgn/src => src}/d2dbs/charlock.cpp (100%) rename {pvpgn/src => src}/d2dbs/charlock.h (100%) rename {pvpgn/src => src}/d2dbs/cmdline.cpp (100%) rename {pvpgn/src => src}/d2dbs/cmdline.h (100%) rename {pvpgn/src => src}/d2dbs/d2ladder.cpp (100%) rename {pvpgn/src => src}/d2dbs/d2ladder.h (100%) rename {pvpgn/src => src}/d2dbs/dbsdupecheck.cpp (100%) rename {pvpgn/src => src}/d2dbs/dbsdupecheck.h (100%) rename {pvpgn/src => src}/d2dbs/dbserver.cpp (100%) rename {pvpgn/src => src}/d2dbs/dbserver.h (100%) rename {pvpgn/src => src}/d2dbs/dbspacket.cpp (100%) rename {pvpgn/src => src}/d2dbs/dbspacket.h (100%) rename {pvpgn/src => src}/d2dbs/handle_signal.cpp (100%) rename {pvpgn/src => src}/d2dbs/handle_signal.h (100%) rename {pvpgn/src => src}/d2dbs/main.cpp (100%) rename {pvpgn/src => src}/d2dbs/prefs.cpp (100%) rename {pvpgn/src => src}/d2dbs/prefs.h (100%) rename {pvpgn/src => src}/d2dbs/setup.h (100%) rename {pvpgn/src => src}/d2dbs/version.h (100%) rename {pvpgn/src => src}/test/CMakeLists.txt (100%) rename {pvpgn/src => src}/test/bigint.cpp (100%) rename {pvpgn/src => src}/test/bnetsrp3_test.cpp (100%) rename {pvpgn/src => src}/tinycdb/CMakeLists.txt (100%) rename {pvpgn/src => src}/tinycdb/ChangeLog (100%) rename {pvpgn/src => src}/tinycdb/Makefile.am (100%) rename {pvpgn/src => src}/tinycdb/cdb.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb.h (100%) rename {pvpgn/src => src}/tinycdb/cdb_find.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_findnext.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_hash.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_init.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_int.h (100%) rename {pvpgn/src => src}/tinycdb/cdb_make.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_make_add.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_make_find.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_make_put.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_seek.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_seq.cpp (100%) rename {pvpgn/src => src}/tinycdb/cdb_unpack.cpp (100%) rename {pvpgn/src => src}/win32/CMakeLists.txt (100%) rename {pvpgn/src => src}/win32/Makefile.am (100%) rename {pvpgn/src => src}/win32/configwin.h (100%) rename {pvpgn/src => src}/win32/console_output.cpp (100%) rename {pvpgn/src => src}/win32/console_output.h (100%) rename {d2pack109/src => src}/win32/console_resource.h (100%) rename {d2pack109/src => src}/win32/console_resource.rc (100%) rename {d2pack109/src => src}/win32/d2cs_resource.h (100%) rename {d2pack109/src => src}/win32/d2cs_resource.rc (100%) rename {pvpgn/src => src}/win32/d2cs_winmain.cpp (100%) rename {d2pack109/src => src}/win32/d2dbs_resource.h (100%) rename {d2pack109/src => src}/win32/d2dbs_resource.rc (100%) rename {pvpgn/src => src}/win32/d2dbs_winmain.cpp (100%) rename {d2pack109/src => src}/win32/logo01.ico (100%) rename {pvpgn/src => src}/win32/resource.h (100%) rename {pvpgn/src => src}/win32/resource.rc (100%) rename {pvpgn/src => src}/win32/service.cpp (100%) rename {pvpgn/src => src}/win32/service.h (100%) rename {pvpgn/src => src}/win32/winmain.cpp (100%) rename {pvpgn/src => src}/win32/winmain.h (100%) rename pvpgn/version-history.txt => version-history.txt (100%) delete mode 100644 web/site/admin/downloads.php delete mode 100644 web/site/admin/index.php delete mode 100644 web/site/admin/links.php delete mode 100644 web/site/files.php delete mode 100644 web/site/images/botbar-bg.gif delete mode 100644 web/site/images/left01.jpg delete mode 100644 web/site/images/left02.jpg delete mode 100644 web/site/images/left03.jpg delete mode 100644 web/site/images/left04.jpg delete mode 100644 web/site/images/topbar-bg.gif delete mode 100644 web/site/includes/about.htm delete mode 100644 web/site/includes/help.htm delete mode 100644 web/site/includes/sqlerror.htm delete mode 100644 web/site/includes/viewnews.php delete mode 100644 web/site/index.php delete mode 100644 web/site/pvpgn.css diff --git a/pvpgn/BUGS b/BUGS similarity index 100% rename from pvpgn/BUGS rename to BUGS diff --git a/pvpgn/CMakeLists.txt b/CMakeLists.txt similarity index 100% rename from pvpgn/CMakeLists.txt rename to CMakeLists.txt diff --git a/d2pack109/COPYING b/COPYING similarity index 100% rename from d2pack109/COPYING rename to COPYING diff --git a/pvpgn/CREDITS b/CREDITS similarity index 100% rename from pvpgn/CREDITS rename to CREDITS diff --git a/pvpgn/ConfigureChecks.cmake b/ConfigureChecks.cmake similarity index 100% rename from pvpgn/ConfigureChecks.cmake rename to ConfigureChecks.cmake diff --git a/pvpgn/IGNOREME b/IGNOREME similarity index 100% rename from pvpgn/IGNOREME rename to IGNOREME diff --git a/pvpgn/NEWS b/NEWS similarity index 100% rename from pvpgn/NEWS rename to NEWS diff --git a/pvpgn/README.ALPHA b/README.ALPHA similarity index 100% rename from pvpgn/README.ALPHA rename to README.ALPHA diff --git a/pvpgn/README.DEV b/README.DEV similarity index 100% rename from pvpgn/README.DEV rename to README.DEV diff --git a/pvpgn/README.cmake b/README.cmake similarity index 100% rename from pvpgn/README.cmake rename to README.cmake diff --git a/README.md b/README.md index 1bb012e..e84fd4b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ New commands * `/save` immediately save changes of accounts and clans from the cache to a storage (useful for testing) [commit](https://github.com/HarpyWar/pvpgn/commit/be8d65d16f910b2090b0db9e7eb2c043b816dae7) - Minor changes -- * add original MOTD files with UTF-8 encoding @@ -26,7 +25,8 @@ Minor changes * add ODBC support for CMake * add latest versioncheck.conf * skip_versioncheck, allow_bad_version are enabled by default in bnetd.conf - for easy start - +* source code is formatted for better reading +* unused files are removed, only pvpgn source here Build source code -- diff --git a/pvpgn/TODO b/TODO similarity index 100% rename from pvpgn/TODO rename to TODO diff --git a/pvpgn/UPDATE b/UPDATE similarity index 100% rename from pvpgn/UPDATE rename to UPDATE diff --git a/pvpgn/cmake/Modules/CheckIncludeFilesCXX.cmake b/cmake/Modules/CheckIncludeFilesCXX.cmake similarity index 100% rename from pvpgn/cmake/Modules/CheckIncludeFilesCXX.cmake rename to cmake/Modules/CheckIncludeFilesCXX.cmake diff --git a/pvpgn/cmake/Modules/CheckMkdirArgs.cmake b/cmake/Modules/CheckMkdirArgs.cmake similarity index 100% rename from pvpgn/cmake/Modules/CheckMkdirArgs.cmake rename to cmake/Modules/CheckMkdirArgs.cmake diff --git a/pvpgn/cmake/Modules/CheckTypeSizeCXX.cmake b/cmake/Modules/CheckTypeSizeCXX.cmake similarity index 100% rename from pvpgn/cmake/Modules/CheckTypeSizeCXX.cmake rename to cmake/Modules/CheckTypeSizeCXX.cmake diff --git a/pvpgn/cmake/Modules/CheckTypeSizeCXX.cxx.in b/cmake/Modules/CheckTypeSizeCXX.cxx.in similarity index 100% rename from pvpgn/cmake/Modules/CheckTypeSizeCXX.cxx.in rename to cmake/Modules/CheckTypeSizeCXX.cxx.in diff --git a/pvpgn/cmake/Modules/DefineInstallationPaths.cmake b/cmake/Modules/DefineInstallationPaths.cmake similarity index 100% rename from pvpgn/cmake/Modules/DefineInstallationPaths.cmake rename to cmake/Modules/DefineInstallationPaths.cmake diff --git a/pvpgn/cmake/Modules/FindMySQL.cmake b/cmake/Modules/FindMySQL.cmake similarity index 100% rename from pvpgn/cmake/Modules/FindMySQL.cmake rename to cmake/Modules/FindMySQL.cmake diff --git a/pvpgn/cmake/Modules/FindODBC.cmake b/cmake/Modules/FindODBC.cmake similarity index 100% rename from pvpgn/cmake/Modules/FindODBC.cmake rename to cmake/Modules/FindODBC.cmake diff --git a/pvpgn/cmake/Modules/FindPostgreSQL.cmake b/cmake/Modules/FindPostgreSQL.cmake similarity index 100% rename from pvpgn/cmake/Modules/FindPostgreSQL.cmake rename to cmake/Modules/FindPostgreSQL.cmake diff --git a/pvpgn/cmake/Modules/FindSQLite3.cmake b/cmake/Modules/FindSQLite3.cmake similarity index 100% rename from pvpgn/cmake/Modules/FindSQLite3.cmake rename to cmake/Modules/FindSQLite3.cmake diff --git a/pvpgn/cmake/Modules/FindZLIB.cmake b/cmake/Modules/FindZLIB.cmake similarity index 100% rename from pvpgn/cmake/Modules/FindZLIB.cmake rename to cmake/Modules/FindZLIB.cmake diff --git a/pvpgn/conf/CMakeLists.txt b/conf/CMakeLists.txt similarity index 100% rename from pvpgn/conf/CMakeLists.txt rename to conf/CMakeLists.txt diff --git a/pvpgn/conf/Makefile.am b/conf/Makefile.am similarity index 100% rename from pvpgn/conf/Makefile.am rename to conf/Makefile.am diff --git a/pvpgn/conf/ad.conf.in b/conf/ad.conf.in similarity index 100% rename from pvpgn/conf/ad.conf.in rename to conf/ad.conf.in diff --git a/pvpgn/conf/address_translation.conf.in b/conf/address_translation.conf.in similarity index 100% rename from pvpgn/conf/address_translation.conf.in rename to conf/address_translation.conf.in diff --git a/pvpgn/conf/anongame_infos.conf.in b/conf/anongame_infos.conf.in similarity index 100% rename from pvpgn/conf/anongame_infos.conf.in rename to conf/anongame_infos.conf.in diff --git a/pvpgn/conf/autoupdate.conf.in b/conf/autoupdate.conf.in similarity index 98% rename from pvpgn/conf/autoupdate.conf.in rename to conf/autoupdate.conf.in index 26953ac..a4fb468 100644 --- a/pvpgn/conf/autoupdate.conf.in +++ b/conf/autoupdate.conf.in @@ -1,518 +1,518 @@ -############################################################################## -# autoupdate.conf - Auto Update Configuration # -#----------------------------------------------------------------------------# -# # -# This is a list of client tags and their equivalent autoupdate files and # -# version information. # -# # -# This file will be ignored for certain clients if skip_versioncheck is # -# enabled in the bnetd.conf file. # -# # -# Only the first matching line is used. If no lines match then no upgrade # -# will be attempted and the client will remain at its current version. # -# # -# Note: if you want to use the autoupdate wildcard entries, you'll also need # -# to uncomment the corresponding wildcard entries in versioncheck.conf. # -# # -# Do not include "/" in any of the filenames. # -# # -# The versiontag is used to identify a particular version as specified in # -# the versioncheck configuration file. # -# # -# It works like this: versioncheck identifies a version by reported version # -# number, checksum, clienttag, etc. The autoupdate then uses the arch tag, # -# client tag and version tag to find the needed update file. # -# # -############################################################################## -# Battle.net related informations # -#----------------------------------------------------------------------------# -# War3 and War3x clients have different mpq files for the different game # -# languages. This is accounted for by the server, and the client will get # -# the correct file. Only one entry is needed per arch, client, and version # -# tag. # -# # -# Example: With the following line: # -# # -# IX86 W3XP W3XP_107A W3XP_IX86_1xx_111A.mpq # -# # -# war3x english clients will receive the file "W3XP_IX86_1xx_111A_enUS.mpq" # -# where russian clients will receive the file "W3XP_IX86_1xx_111A_ruRU.mpq" # -# and german clients will receive the file "W3XP_IX86_1xx_111A_deDE.mpq" # -# Make sure all the required mpq files are in the files directory or # -# autoupdate will not work. # -# # -# The avaliable language files are: # -# # -# enUS csCZ deDE esES frFR itIT jaJA koKR plPL ruRU zhCN zhTW # -# # -# The format of this file is as follows: # -# # -# archtag clienttag versiontag -----update file----- # -# # -############################################################################## -# Westwood Online related informations # -#----------------------------------------------------------------------------# -# For WOL autoupdate is used standart FTP protocol which is not included in # -# PvPGN. The default WOL autoupdate entryes are writed according to # -# westwood's autoupdate FTP server settings (username, password, filepath). # -# # -# WOLv2 using diferent rtp files for the diferent SKUs. This is accounted # -# for by the server, and the client will get the correct file. Only one # -# entry is needed per arch, client, and version tag. # -# # -# Example: With the following line: # -# IX86 TSUN 65536 131075_65536.rtp tibsun # -# # -# TibSun clients with SKU 4608 will receive the file "131075_65536_4608.rtp" # -# TibSun clients with SKU 4610 will receive the file "131075_65536_4610.rtp" # -# # -# The avaliable clients, theirs tags and SKUs are: # -# # -# Client name CTag SKUs # -# --------------------------------------------------- # -# Renegade RNGD 3072 3074 3075 3078 3081 3082 # -# Dune 2000 DN2K 3584 3586 3587 3589 3591 # -# Nox NOXX 4096 4098 4099 4101 4102 4105 # -# Tiberian Sun TSUN 4608 4610 4611 4615 # -# Red Alert 1v3 RALT 5376 5378 5379 # -# Lands of Lore 3 LOR3 6400 6401 6402 6403 6405 # -# Tiberian Sun XP TSXP 7168 7170 7171 7175 7424 7426 7427 7431 # -# Emperor: BFD EBFD 7936 7938 7939 7945 7946 # -# Red Alert 2 RAL2 8448 8450 8451 8457 8458 8960 8962 8963 8969 8970 # -# Nox Quest NOXQ 9472 9474 9475 9477 9478 9481 # -# Yuri's Revenge YURI 10496 10498 10499 10505 10506 # -# Renegade Server RFDS 12288 # -# WOL API WWOL 32512 # -# # -# Note: WOL update entry must including file path according to FTP server. # -# All WOL entries using archtag IX86. # -# # -# The format of this file is as follows: # -# # -# archtag clienttag versiontag -----update file----- file path # -# # -############################################################################## - -##### Intel (IX86) ########################################################### - -# =============== WarCraft III - FT (Expansion) =============== -#IX86 W3XP W3XP_107A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_110A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_111A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_112A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_113A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_113B W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_114A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_114B W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_115A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_116A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_117A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_118A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_119A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_119B W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_120A W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_120B W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_120C W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_120D W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_120E W3XP_IX86_1xx_122a_2.mpq -#IX86 W3XP W3XP_121A W3XP_IX86_1xx_122a_2.mpq - -# Incremental update from version 1.21b -#IX86 W3XP W3XP_121B W3XP_IX86_121B_122a_2.mpq - -# The next one is a WarCraft III - FT wildcard entry. -#IX86 W3XP W3XP_1xx W3XP_IX86_1xx_122a_2.mpq - -# ==================== WarCraft III - RoC ===================== -#IX86 WAR3 WAR3_107A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_110A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_111A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_112A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_113A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_113B WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_114A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_114B WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_115A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_116A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_117A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_118A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_119A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_119B WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_120A WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_120B WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_120C WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_120D WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_120E WAR3_IX86_1xx_122a_2.mpq -#IX86 WAR3 WAR3_121A WAR3_IX86_1xx_122a_2.mpq - -# Incremental update from version 1.21b -#IX86 WAR3 WAR3_121B WAR3_IX86_121B_122a_2.mpq - -# The next one is a WarCraft III - RoC wildcard entry. -#IX86 WAR3 WAR3_1xx WAR3_IX86_1xx_122a_2.mpq - -# ===================== Diablo II Expansion (LoD) =========================== -# Note: the following assumes that you want to upgrade all Diablo II clients -# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you -# will need to modify these entries accordingly. - -#IX86 D2XP D2XP_107 D2XP_IX86_1xx_112A.mpq -#IX86 D2XP D2XP_108 D2XP_IX86_1xx_112A.mpq -#IX86 D2XP D2XP_109 D2XP_IX86_1xx_112A.mpq -#IX86 D2XP D2XP_109B D2XP_IX86_1xx_112A.mpq -#IX86 D2XP D2XP_109C D2XP_IX86_1xx_112A.mpq -#IX86 D2XP D2XP_109D D2XP_IX86_1xx_112A.mpq -#IX86 D2XP D2XP_110 D2XP_IX86_1xx_112A.mpq -#IX86 D2XP D2XP_111 D2XP_IX86_1xx_112A.mpq - -# Incremental update from version 1.11a --> 1.11b -#IX86 D2XP D2XP_111B D2XP_IX86_111B_112A.mpq - -# The next one is a Diablo II LoD wildcard entry. -#IX86 D2XP D2XP_1xx D2XP_IX86_1xx_112A.mpq - -# ========================== Diablo II (DV) ================================= -# Note: the following assumes that you want to upgrade all Diablo II clients -# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you -# will need to modify these entries accordingly. - -#IX86 D2DV D2DV_100 D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_101 D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_103 D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_104B D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_104C D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_105 D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_105B D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_106 D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_106B D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_108 D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_109 D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_109B D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_109C D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_109D D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_110 D2DV_IX86_1xx_112A.mpq -#IX86 D2DV D2DV_111 D2DV_IX86_1xx_112A.mpq - -# Incremental update from version 1.11a --> 1.11b -#IX86 D2DV D2DV_111B D2DV_IX86_111B_112A.mpq - -# The next one is a Diablo II wildcard entry. -#IX86 D2DV D2DV_1xx D2DV_IX86_1xx_112A.mpq - -# ================ StarCraft Expansion (Brood War) ========================== -#IX86 SEXP SEXP_104 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_104_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_105 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_105_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_106 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_106_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_107 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_107_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_108 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_108_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_108B SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_108B_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_109 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_109_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_110 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_110_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_111 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_111_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_111B SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_111B_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_112 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_112_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_112B SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_112B_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_113 SEXP_IX86_1xx_1161.mpq -# unfortunately we don't have a SEXP_113_STAR in versioncheck.conf -#IX86 SEXP SEXP_113B SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_113B_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_113C SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_113C_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_113D SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_113D_STAR SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_113E SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_113E SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_114 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_114 SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_115 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_115 SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_1151 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_1151 SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_1152 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_1152 SEXP_IX86_1xx_1161.mpq -#IX86 SEXP SEXP_1153 SEXP_IX86_1xx_1161.mpq -#IX86 STAR SEXP_1153 SEXP_IX86_1xx_1161.mpq - -# Incremental update from version 1.15.3 -#IX86 SEXP SEXP_116 SEXP_IX86_116_1161.mpq -#IX86 STAR SEXP_116 SEXP_IX86_116_1161.mpq - -# The next one is a Brood War wildcard entry. -#IX86 SEXP SEXP_1xx SEXP_IX86_1xx_1161.mpq - -# ========================= StarCraft (original) ============================ -#IX86 STAR STAR_100 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_101 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_102 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_103 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_104 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_105 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_106 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_107 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_108 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_108B STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_109 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_109B STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_110 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_111 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_111B STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_112 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_112B STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_113 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_113B STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_113C STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_113D STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_113E STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_114 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_115 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_1151 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_1152 STAR_IX86_1xx_1161.mpq -#IX86 STAR STAR_1153 SEXP_IX86_1xx_1161.mpq - -# Incremental update from version 1.15.3 -#IX86 STAR STAR_116 SEXP_IX86_116_1161.mpq - -# The next one is a Starcraft wildcard entry. -#IX86 STAR STAR_1xx STAR_IX86_1xx_1161.mpq - -# ========================= Diablo (original) ============================== -# note: Blizzard doesn't update client from 109 to 109b. -#IX86 DRTL DRTL_108 DRTL_IX86_108_109.mpq - -# The next one is a Diablo wildcard entry. -#IX86 DRTL DRTL_1xx DRTL_IX86_100_109.mpq - -# ========================= Warcraft II BNE =============================== -#IX86 W2BN W2BN_200 W2BN_IX86_200_202.mpq -#IX86 W2BN W2BN_201 W2BN_IX86_201_202.mpq - -##### Mac OS X (XMAC) ######################################################## - -# ===================== Diablo II Expansion (LoD) =========================== -# Note: the following assumes that you want to upgrade all Diablo II clients -# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you -# will need to modify these entries accordingly. - -#XMAC D2XP D2XP_109D D2XP_XMAC_1xx_111B.mpq -#XMAC D2XP D2XP_110 D2XP_XMAC_1xx_111B.mpq - -# Incremental update from version 1.11a --> 1.11b -#XMAC D2XP D2XP_111 D2XP_XMAC_111A_111B.mpq - -# The next one is a Diablo II LoD wildcard entry. -#XMAC D2XP D2XP_1xx D2XP_XMAC_1xx_111B.mpq - -# ========================== Diablo II (DV) ================================= -# Note: the following assumes that you want to upgrade all Diablo II clients -# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you -# will need to modify these entries accordingly. - -#XMAC D2DV D2DV_109D D2DV_XMAC_1xx_111B.mpq -#XMAC D2DV D2DV_110 D2DV_XMAC_1xx_111B.mpq - -# Incremental update from version 1.11a --> 1.11b -#XMAC D2DV D2DV_111 D2DV_XMAC_111A_111B.mpq - -# The next one is a Diablo II LoD wildcard entry. -#XMAC D2DV D2DV_1xx D2DV_XMAC_1xx_111B.mpq - -# ================ StarCraft Expansion (Brood War) ========================== - -#XMAC SEXP SEXP_109B SEXP_XMAC_1xx_113E.mpq -#XMAC SEXP SEXP_110 SEXP_XMAC_1xx_113E.mpq -#XMAC STAR SEXP_110_STAR SEXP_XMAC_1xx_113E.mpq -#XMAC SEXP SEXP_111 SEXP_XMAC_1xx_113E.mpq -#XMAC STAR SEXP_111_STAR SEXP_XMAC_1xx_113E.mpq -#XMAC SEXP SEXP_111B SEXP_XMAC_1xx_113E.mpq -#XMAC STAR SEXP_111B_STAR SEXP_XMAC_1xx_113E.mpq -#XMAC SEXP SEXP_112 SEXP_XMAC_1xx_113E.mpq -#XMAC STAR SEXP_112_STAR SEXP_XMAC_1xx_113E.mpq -#XMAC SEXP SEXP_113 SEXP_XMAC_1xx_113E.mpq -#XMAC STAR SEXP_113_STAR SEXP_XMAC_1xx_113E.mpq -#XMAC SEXP SEXP_113C SEXP_XMAC_1xx_113E.mpq -#XMAC STAR SEXP_113C_STAR SEXP_XMAC_1xx_113E.mpq -# Unfortunately versioncheck.conf does not contain entries for 1.13{a|b|d} - -# The next one is a Brood War wildcard entry. -#XMAC SEXP SEXP_1xx SEXP_XMAC_1xx_113E.mpq - -# ========================= StarCraft (original) ============================ - -#XMAC STAR STAR_109B STAR_XMAC_1xx_113E.mpq -#XMAC STAR STAR_110 STAR_XMAC_1xx_113E.mpq -#XMAC STAR STAR_111 STAR_XMAC_1xx_113E.mpq -#XMAC STAR STAR_111B STAR_XMAC_1xx_113E.mpq -#XMAC STAR STAR_112 STAR_XMAC_1xx_113E.mpq -# Unfortunately versioncheck.conf does not contain entries for 1.13{a-d} - -# The next one is a Starcraft wildcard entry. -#XMAC STAR STAR_1xx STAR_XMAC_1xx_113E.mpq - -##### Mac OS Classic (PMAC) ################################################## - -# ===================== Diablo II Expansion (LoD) =========================== -# Note: the following assumes that you want to upgrade all Diablo II clients -# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you -# will need to modify these entries accordingly. - -#PMAC D2XP D2XP_1xx D2XP_PMAC_1xx_111B.mpq - -# ========================== Diablo II (DV) ================================= -# Note: the following assumes that you want to upgrade all Diablo II clients -# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you -# will need to modify these entries accordingly. - -#PMAC D2DV D2DV_109D D2DV_PMAC_1xx_111B.mpq -#PMAC D2DV D2DV_1xx D2DV_PMAC_1xx_111B.mpq - -# ================ StarCraft Expansion (Brood War) ========================== - -#PMAC SEXP SEXP_109B SEXP_PMAC_1xx_113E.mpq -#PMAC SEXP SEXP_110 SEXP_PMAC_1xx_113E.mpq -#PMAC STAR SEXP_110_STAR SEXP_PMAC_1xx_113E.mpq -#PMAC SEXP SEXP_111 SEXP_PMAC_1xx_113E.mpq -#PMAC STAR SEXP_111_STAR SEXP_PMAC_1xx_113E.mpq -#PMAC SEXP SEXP_111B SEXP_PMAC_1xx_113E.mpq -#PMAC STAR SEXP_111B_STAR SEXP_PMAC_1xx_113E.mpq -#PMAC SEXP SEXP_112 SEXP_PMAC_1xx_113E.mpq -#PMAC STAR SEXP_112_STAR SEXP_PMAC_1xx_113E.mpq - -# The next one is a Brood War wildcard entry. -#PMAC SEXP SEXP_1xx SEXP_PMAC_1xx_113E.mpq - -# ========================= StarCraft (original) ============================ - -#PMAC STAR STAR_109B STAR_PMAC_1xx_113E.mpq -#PMAC STAR STAR_110 STAR_PMAC_1xx_113E.mpq -#PMAC STAR STAR_111 STAR_PMAC_1xx_113E.mpq -#PMAC STAR STAR_111B STAR_PMAC_1xx_113E.mpq -#PMAC STAR STAR_112 STAR_PMAC_1xx_113E.mpq - -# The next one is a Brood War wildcard entry. -#PMAC STAR STAR_1xx STAR_PMAC_1xx_113E.mpq - -##### Westwood Online update entries ######################################### - -# ========================== Westwood Online API ============================ - -#IX86 WWOL 65536 65551_65536.rtp wolapi -#IX86 WWOL 65537 65551_65537.rtp wolapi -#IX86 WWOL 65538 65551_65538.rtp wolapi -#IX86 WWOL 65539 65551_65539.rtp wolapi -#IX86 WWOL 65540 65551_65540.rtp wolapi -#IX86 WWOL 65541 65551_65541.rtp wolapi -#IX86 WWOL 65542 65551_65542.rtp wolapi -#IX86 WWOL 65543 65551_65543.rtp wolapi -#IX86 WWOL 65544 65551_65544.rtp wolapi -#IX86 WWOL 65545 65551_65545.rtp wolapi -#IX86 WWOL 65546 65551_65546.rtp wolapi -#IX86 WWOL 65547 65551_65547.rtp wolapi -#IX86 WWOL 65548 65551_65548.rtp wolapi -#IX86 WWOL 65549 65551_65549.rtp wolapi -#IX86 WWOL 65550 65551_65550.rtp wolapi -#IX86 WWOL 65555 65556_65555.rtp wolapi - -# =============================== Renegade ================================== - -#IX86 RNGD 65538 65573_65538.rtp renegade -#IX86 RNGD 65550 65573_65538.rtp renegade -#IX86 RNGD 65551 65573_65538.rtp renegade -#IX86 RNGD 65566 65573_65538.rtp renegade -#IX86 RNGD 65567 65573_65538.rtp renegade -#IX86 RNGD 65568 65573_65538.rtp renegade -#IX86 RNGD 65570 65573_65570.rtp renegade -#IX86 RNGD 65571 65573_65571.rtp renegade -#IX86 RNGD 65572 65573_65572.rtp renegade - -# ==================== Renegade Free Dedicated Server ======================= - -#IX86 RFDS 65538 65572_65538.rtp renegade -#IX86 RFDS 65550 65572_65550.rtp renegade -#IX86 RFDS 65551 65572_65551.rtp renegade -#IX86 RFDS 65553 65572_65553.rtp renegade -#IX86 RFDS 65554 65572_65554.rtp renegade -#IX86 RFDS 65566 65572_65566.rtp renegade -#IX86 RFDS 65568 65572_65568.rtp renegade -#IX86 RFDS 65570 65572_65570.rtp renegade -#IX86 RFDS 65571 65572_65571.rtp renegade -#IX86 RFDS 65572 65573_65572.rtp renegade - -# ============================= Tiberian Sun ================================ - -#IX86 TSUN 65536 131075_65536.rtp tibsun -#IX86 TSUN 65541 131075_65536.rtp tibsun -#IX86 TSUN 65542 131075_65536.rtp tibsun -#IX86 TSUN 65543 131075_65536.rtp tibsun -#IX86 TSUN 65544 131075_65536.rtp tibsun -#IX86 TSUN 65545 131075_65536.rtp tibsun -#IX86 TSUN 65546 131075_65536.rtp tibsun -#IX86 TSUN 65547 131075_65536.rtp tibsun -#IX86 TSUN 65548 131075_65548.rtp tibsun -#IX86 TSUN 131072 131075_65548.rtp tibsun -#IX86 TSUN 131074 131075_131074.rtp tibsun - -# ======================= Tiberian Sun: FireStorm =========================== - -#IX86 TSXP 131072 131074_131072.rtp tibsun -#IX86 TSXP 131074 131075_131074.rtp tibsun - -# =============================== Dune 2000 ================================= - -#IX86 DN2K 65536 65542.rtp dune2k/1.006/1.000 -#IX86 DN2K 65537 65542_65537.rtp dune2k/1.006/1.001 - -# ================================== NOX ==================================== - -#IX86 NOXX 65536 65538_65536.rtp nox -#IX86 NOXX 65537 65538_65537.rtp nox - -# =============================== NOX: Quest ================================ - -#IX86 NOXQ 65536 65538_65536.rtp nox -#IX86 NOXQ 65537 65538_65537.rtp nox -#IX86 NOXQ 65538 65540_65538.rtp nox -#IX86 NOXQ 65539 65540_65539.rtp nox - -# ======================= Emperor: Battle for Dune ========================== - -#IX86 EBFD 1 65545_1.rtp emperor -#IX86 EBFD 65536 65545_65536.rtp emperor -#IX86 EBFD 65537 65545_65537.rtp emperor -#IX86 EBFD 65538 65545_65538.rtp emperor -#IX86 EBFD 65539 65545_65539.rtp emperor -#IX86 EBFD 65540 65545_65540.rtp emperor -#IX86 EBFD 65541 65545_65541.rtp emperor -#IX86 EBFD 65542 65545_65542.rtp emperor -#IX86 EBFD 65543 65545_65543.rtp emperor -#IX86 EBFD 65544 65545_65544.rtp emperor - -# ============================= Red Alert 2 ================================= - -#IX86 RAL2 65536 65542_65536.rtp ra2 -#IX86 RAL2 65537 65542_65537.rtp ra2 -#IX86 RAL2 65538 65542_65538.rtp ra2 -#IX86 RAL2 65539 65542_65539.rtp ra2 -#IX86 RAL2 65540 65542_65540.rtp ra2 -#IX86 RAL2 65541 65542_65541.rtp ra2 - -# ============================= Yuri's Revenge ============================== - -#IX86 YURI 65536 65537_65536.rtp yuri - -# ============================= Lands of Lore 3 ============================= - -#IX86 LOR3 65536 65539_65536.rtp lore3/1.003 -#IX86 LOR3 65537 65539_65537.rtp lore3/1.003 -#IX86 LOR3 65538 65539_65538.rtp lore3/1.003 +############################################################################## +# autoupdate.conf - Auto Update Configuration # +#----------------------------------------------------------------------------# +# # +# This is a list of client tags and their equivalent autoupdate files and # +# version information. # +# # +# This file will be ignored for certain clients if skip_versioncheck is # +# enabled in the bnetd.conf file. # +# # +# Only the first matching line is used. If no lines match then no upgrade # +# will be attempted and the client will remain at its current version. # +# # +# Note: if you want to use the autoupdate wildcard entries, you'll also need # +# to uncomment the corresponding wildcard entries in versioncheck.conf. # +# # +# Do not include "/" in any of the filenames. # +# # +# The versiontag is used to identify a particular version as specified in # +# the versioncheck configuration file. # +# # +# It works like this: versioncheck identifies a version by reported version # +# number, checksum, clienttag, etc. The autoupdate then uses the arch tag, # +# client tag and version tag to find the needed update file. # +# # +############################################################################## +# Battle.net related informations # +#----------------------------------------------------------------------------# +# War3 and War3x clients have different mpq files for the different game # +# languages. This is accounted for by the server, and the client will get # +# the correct file. Only one entry is needed per arch, client, and version # +# tag. # +# # +# Example: With the following line: # +# # +# IX86 W3XP W3XP_107A W3XP_IX86_1xx_111A.mpq # +# # +# war3x english clients will receive the file "W3XP_IX86_1xx_111A_enUS.mpq" # +# where russian clients will receive the file "W3XP_IX86_1xx_111A_ruRU.mpq" # +# and german clients will receive the file "W3XP_IX86_1xx_111A_deDE.mpq" # +# Make sure all the required mpq files are in the files directory or # +# autoupdate will not work. # +# # +# The avaliable language files are: # +# # +# enUS csCZ deDE esES frFR itIT jaJA koKR plPL ruRU zhCN zhTW # +# # +# The format of this file is as follows: # +# # +# archtag clienttag versiontag -----update file----- # +# # +############################################################################## +# Westwood Online related informations # +#----------------------------------------------------------------------------# +# For WOL autoupdate is used standart FTP protocol which is not included in # +# PvPGN. The default WOL autoupdate entryes are writed according to # +# westwood's autoupdate FTP server settings (username, password, filepath). # +# # +# WOLv2 using diferent rtp files for the diferent SKUs. This is accounted # +# for by the server, and the client will get the correct file. Only one # +# entry is needed per arch, client, and version tag. # +# # +# Example: With the following line: # +# IX86 TSUN 65536 131075_65536.rtp tibsun # +# # +# TibSun clients with SKU 4608 will receive the file "131075_65536_4608.rtp" # +# TibSun clients with SKU 4610 will receive the file "131075_65536_4610.rtp" # +# # +# The avaliable clients, theirs tags and SKUs are: # +# # +# Client name CTag SKUs # +# --------------------------------------------------- # +# Renegade RNGD 3072 3074 3075 3078 3081 3082 # +# Dune 2000 DN2K 3584 3586 3587 3589 3591 # +# Nox NOXX 4096 4098 4099 4101 4102 4105 # +# Tiberian Sun TSUN 4608 4610 4611 4615 # +# Red Alert 1v3 RALT 5376 5378 5379 # +# Lands of Lore 3 LOR3 6400 6401 6402 6403 6405 # +# Tiberian Sun XP TSXP 7168 7170 7171 7175 7424 7426 7427 7431 # +# Emperor: BFD EBFD 7936 7938 7939 7945 7946 # +# Red Alert 2 RAL2 8448 8450 8451 8457 8458 8960 8962 8963 8969 8970 # +# Nox Quest NOXQ 9472 9474 9475 9477 9478 9481 # +# Yuri's Revenge YURI 10496 10498 10499 10505 10506 # +# Renegade Server RFDS 12288 # +# WOL API WWOL 32512 # +# # +# Note: WOL update entry must including file path according to FTP server. # +# All WOL entries using archtag IX86. # +# # +# The format of this file is as follows: # +# # +# archtag clienttag versiontag -----update file----- file path # +# # +############################################################################## + +##### Intel (IX86) ########################################################### + +# =============== WarCraft III - FT (Expansion) =============== +#IX86 W3XP W3XP_107A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_110A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_111A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_112A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_113A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_113B W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_114A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_114B W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_115A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_116A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_117A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_118A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_119A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_119B W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_120A W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_120B W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_120C W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_120D W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_120E W3XP_IX86_1xx_122a_2.mpq +#IX86 W3XP W3XP_121A W3XP_IX86_1xx_122a_2.mpq + +# Incremental update from version 1.21b +#IX86 W3XP W3XP_121B W3XP_IX86_121B_122a_2.mpq + +# The next one is a WarCraft III - FT wildcard entry. +#IX86 W3XP W3XP_1xx W3XP_IX86_1xx_122a_2.mpq + +# ==================== WarCraft III - RoC ===================== +#IX86 WAR3 WAR3_107A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_110A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_111A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_112A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_113A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_113B WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_114A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_114B WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_115A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_116A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_117A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_118A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_119A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_119B WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_120A WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_120B WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_120C WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_120D WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_120E WAR3_IX86_1xx_122a_2.mpq +#IX86 WAR3 WAR3_121A WAR3_IX86_1xx_122a_2.mpq + +# Incremental update from version 1.21b +#IX86 WAR3 WAR3_121B WAR3_IX86_121B_122a_2.mpq + +# The next one is a WarCraft III - RoC wildcard entry. +#IX86 WAR3 WAR3_1xx WAR3_IX86_1xx_122a_2.mpq + +# ===================== Diablo II Expansion (LoD) =========================== +# Note: the following assumes that you want to upgrade all Diablo II clients +# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you +# will need to modify these entries accordingly. + +#IX86 D2XP D2XP_107 D2XP_IX86_1xx_112A.mpq +#IX86 D2XP D2XP_108 D2XP_IX86_1xx_112A.mpq +#IX86 D2XP D2XP_109 D2XP_IX86_1xx_112A.mpq +#IX86 D2XP D2XP_109B D2XP_IX86_1xx_112A.mpq +#IX86 D2XP D2XP_109C D2XP_IX86_1xx_112A.mpq +#IX86 D2XP D2XP_109D D2XP_IX86_1xx_112A.mpq +#IX86 D2XP D2XP_110 D2XP_IX86_1xx_112A.mpq +#IX86 D2XP D2XP_111 D2XP_IX86_1xx_112A.mpq + +# Incremental update from version 1.11a --> 1.11b +#IX86 D2XP D2XP_111B D2XP_IX86_111B_112A.mpq + +# The next one is a Diablo II LoD wildcard entry. +#IX86 D2XP D2XP_1xx D2XP_IX86_1xx_112A.mpq + +# ========================== Diablo II (DV) ================================= +# Note: the following assumes that you want to upgrade all Diablo II clients +# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you +# will need to modify these entries accordingly. + +#IX86 D2DV D2DV_100 D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_101 D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_103 D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_104B D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_104C D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_105 D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_105B D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_106 D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_106B D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_108 D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_109 D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_109B D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_109C D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_109D D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_110 D2DV_IX86_1xx_112A.mpq +#IX86 D2DV D2DV_111 D2DV_IX86_1xx_112A.mpq + +# Incremental update from version 1.11a --> 1.11b +#IX86 D2DV D2DV_111B D2DV_IX86_111B_112A.mpq + +# The next one is a Diablo II wildcard entry. +#IX86 D2DV D2DV_1xx D2DV_IX86_1xx_112A.mpq + +# ================ StarCraft Expansion (Brood War) ========================== +#IX86 SEXP SEXP_104 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_104_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_105 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_105_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_106 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_106_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_107 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_107_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_108 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_108_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_108B SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_108B_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_109 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_109_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_110 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_110_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_111 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_111_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_111B SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_111B_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_112 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_112_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_112B SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_112B_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_113 SEXP_IX86_1xx_1161.mpq +# unfortunately we don't have a SEXP_113_STAR in versioncheck.conf +#IX86 SEXP SEXP_113B SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_113B_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_113C SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_113C_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_113D SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_113D_STAR SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_113E SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_113E SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_114 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_114 SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_115 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_115 SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_1151 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_1151 SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_1152 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_1152 SEXP_IX86_1xx_1161.mpq +#IX86 SEXP SEXP_1153 SEXP_IX86_1xx_1161.mpq +#IX86 STAR SEXP_1153 SEXP_IX86_1xx_1161.mpq + +# Incremental update from version 1.15.3 +#IX86 SEXP SEXP_116 SEXP_IX86_116_1161.mpq +#IX86 STAR SEXP_116 SEXP_IX86_116_1161.mpq + +# The next one is a Brood War wildcard entry. +#IX86 SEXP SEXP_1xx SEXP_IX86_1xx_1161.mpq + +# ========================= StarCraft (original) ============================ +#IX86 STAR STAR_100 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_101 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_102 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_103 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_104 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_105 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_106 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_107 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_108 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_108B STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_109 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_109B STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_110 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_111 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_111B STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_112 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_112B STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_113 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_113B STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_113C STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_113D STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_113E STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_114 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_115 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_1151 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_1152 STAR_IX86_1xx_1161.mpq +#IX86 STAR STAR_1153 SEXP_IX86_1xx_1161.mpq + +# Incremental update from version 1.15.3 +#IX86 STAR STAR_116 SEXP_IX86_116_1161.mpq + +# The next one is a Starcraft wildcard entry. +#IX86 STAR STAR_1xx STAR_IX86_1xx_1161.mpq + +# ========================= Diablo (original) ============================== +# note: Blizzard doesn't update client from 109 to 109b. +#IX86 DRTL DRTL_108 DRTL_IX86_108_109.mpq + +# The next one is a Diablo wildcard entry. +#IX86 DRTL DRTL_1xx DRTL_IX86_100_109.mpq + +# ========================= Warcraft II BNE =============================== +#IX86 W2BN W2BN_200 W2BN_IX86_200_202.mpq +#IX86 W2BN W2BN_201 W2BN_IX86_201_202.mpq + +##### Mac OS X (XMAC) ######################################################## + +# ===================== Diablo II Expansion (LoD) =========================== +# Note: the following assumes that you want to upgrade all Diablo II clients +# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you +# will need to modify these entries accordingly. + +#XMAC D2XP D2XP_109D D2XP_XMAC_1xx_111B.mpq +#XMAC D2XP D2XP_110 D2XP_XMAC_1xx_111B.mpq + +# Incremental update from version 1.11a --> 1.11b +#XMAC D2XP D2XP_111 D2XP_XMAC_111A_111B.mpq + +# The next one is a Diablo II LoD wildcard entry. +#XMAC D2XP D2XP_1xx D2XP_XMAC_1xx_111B.mpq + +# ========================== Diablo II (DV) ================================= +# Note: the following assumes that you want to upgrade all Diablo II clients +# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you +# will need to modify these entries accordingly. + +#XMAC D2DV D2DV_109D D2DV_XMAC_1xx_111B.mpq +#XMAC D2DV D2DV_110 D2DV_XMAC_1xx_111B.mpq + +# Incremental update from version 1.11a --> 1.11b +#XMAC D2DV D2DV_111 D2DV_XMAC_111A_111B.mpq + +# The next one is a Diablo II LoD wildcard entry. +#XMAC D2DV D2DV_1xx D2DV_XMAC_1xx_111B.mpq + +# ================ StarCraft Expansion (Brood War) ========================== + +#XMAC SEXP SEXP_109B SEXP_XMAC_1xx_113E.mpq +#XMAC SEXP SEXP_110 SEXP_XMAC_1xx_113E.mpq +#XMAC STAR SEXP_110_STAR SEXP_XMAC_1xx_113E.mpq +#XMAC SEXP SEXP_111 SEXP_XMAC_1xx_113E.mpq +#XMAC STAR SEXP_111_STAR SEXP_XMAC_1xx_113E.mpq +#XMAC SEXP SEXP_111B SEXP_XMAC_1xx_113E.mpq +#XMAC STAR SEXP_111B_STAR SEXP_XMAC_1xx_113E.mpq +#XMAC SEXP SEXP_112 SEXP_XMAC_1xx_113E.mpq +#XMAC STAR SEXP_112_STAR SEXP_XMAC_1xx_113E.mpq +#XMAC SEXP SEXP_113 SEXP_XMAC_1xx_113E.mpq +#XMAC STAR SEXP_113_STAR SEXP_XMAC_1xx_113E.mpq +#XMAC SEXP SEXP_113C SEXP_XMAC_1xx_113E.mpq +#XMAC STAR SEXP_113C_STAR SEXP_XMAC_1xx_113E.mpq +# Unfortunately versioncheck.conf does not contain entries for 1.13{a|b|d} + +# The next one is a Brood War wildcard entry. +#XMAC SEXP SEXP_1xx SEXP_XMAC_1xx_113E.mpq + +# ========================= StarCraft (original) ============================ + +#XMAC STAR STAR_109B STAR_XMAC_1xx_113E.mpq +#XMAC STAR STAR_110 STAR_XMAC_1xx_113E.mpq +#XMAC STAR STAR_111 STAR_XMAC_1xx_113E.mpq +#XMAC STAR STAR_111B STAR_XMAC_1xx_113E.mpq +#XMAC STAR STAR_112 STAR_XMAC_1xx_113E.mpq +# Unfortunately versioncheck.conf does not contain entries for 1.13{a-d} + +# The next one is a Starcraft wildcard entry. +#XMAC STAR STAR_1xx STAR_XMAC_1xx_113E.mpq + +##### Mac OS Classic (PMAC) ################################################## + +# ===================== Diablo II Expansion (LoD) =========================== +# Note: the following assumes that you want to upgrade all Diablo II clients +# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you +# will need to modify these entries accordingly. + +#PMAC D2XP D2XP_1xx D2XP_PMAC_1xx_111B.mpq + +# ========================== Diablo II (DV) ================================= +# Note: the following assumes that you want to upgrade all Diablo II clients +# to version 1.11b. If you are still running a 1.10 or 1.09d realm, you +# will need to modify these entries accordingly. + +#PMAC D2DV D2DV_109D D2DV_PMAC_1xx_111B.mpq +#PMAC D2DV D2DV_1xx D2DV_PMAC_1xx_111B.mpq + +# ================ StarCraft Expansion (Brood War) ========================== + +#PMAC SEXP SEXP_109B SEXP_PMAC_1xx_113E.mpq +#PMAC SEXP SEXP_110 SEXP_PMAC_1xx_113E.mpq +#PMAC STAR SEXP_110_STAR SEXP_PMAC_1xx_113E.mpq +#PMAC SEXP SEXP_111 SEXP_PMAC_1xx_113E.mpq +#PMAC STAR SEXP_111_STAR SEXP_PMAC_1xx_113E.mpq +#PMAC SEXP SEXP_111B SEXP_PMAC_1xx_113E.mpq +#PMAC STAR SEXP_111B_STAR SEXP_PMAC_1xx_113E.mpq +#PMAC SEXP SEXP_112 SEXP_PMAC_1xx_113E.mpq +#PMAC STAR SEXP_112_STAR SEXP_PMAC_1xx_113E.mpq + +# The next one is a Brood War wildcard entry. +#PMAC SEXP SEXP_1xx SEXP_PMAC_1xx_113E.mpq + +# ========================= StarCraft (original) ============================ + +#PMAC STAR STAR_109B STAR_PMAC_1xx_113E.mpq +#PMAC STAR STAR_110 STAR_PMAC_1xx_113E.mpq +#PMAC STAR STAR_111 STAR_PMAC_1xx_113E.mpq +#PMAC STAR STAR_111B STAR_PMAC_1xx_113E.mpq +#PMAC STAR STAR_112 STAR_PMAC_1xx_113E.mpq + +# The next one is a Brood War wildcard entry. +#PMAC STAR STAR_1xx STAR_PMAC_1xx_113E.mpq + +##### Westwood Online update entries ######################################### + +# ========================== Westwood Online API ============================ + +#IX86 WWOL 65536 65551_65536.rtp wolapi +#IX86 WWOL 65537 65551_65537.rtp wolapi +#IX86 WWOL 65538 65551_65538.rtp wolapi +#IX86 WWOL 65539 65551_65539.rtp wolapi +#IX86 WWOL 65540 65551_65540.rtp wolapi +#IX86 WWOL 65541 65551_65541.rtp wolapi +#IX86 WWOL 65542 65551_65542.rtp wolapi +#IX86 WWOL 65543 65551_65543.rtp wolapi +#IX86 WWOL 65544 65551_65544.rtp wolapi +#IX86 WWOL 65545 65551_65545.rtp wolapi +#IX86 WWOL 65546 65551_65546.rtp wolapi +#IX86 WWOL 65547 65551_65547.rtp wolapi +#IX86 WWOL 65548 65551_65548.rtp wolapi +#IX86 WWOL 65549 65551_65549.rtp wolapi +#IX86 WWOL 65550 65551_65550.rtp wolapi +#IX86 WWOL 65555 65556_65555.rtp wolapi + +# =============================== Renegade ================================== + +#IX86 RNGD 65538 65573_65538.rtp renegade +#IX86 RNGD 65550 65573_65538.rtp renegade +#IX86 RNGD 65551 65573_65538.rtp renegade +#IX86 RNGD 65566 65573_65538.rtp renegade +#IX86 RNGD 65567 65573_65538.rtp renegade +#IX86 RNGD 65568 65573_65538.rtp renegade +#IX86 RNGD 65570 65573_65570.rtp renegade +#IX86 RNGD 65571 65573_65571.rtp renegade +#IX86 RNGD 65572 65573_65572.rtp renegade + +# ==================== Renegade Free Dedicated Server ======================= + +#IX86 RFDS 65538 65572_65538.rtp renegade +#IX86 RFDS 65550 65572_65550.rtp renegade +#IX86 RFDS 65551 65572_65551.rtp renegade +#IX86 RFDS 65553 65572_65553.rtp renegade +#IX86 RFDS 65554 65572_65554.rtp renegade +#IX86 RFDS 65566 65572_65566.rtp renegade +#IX86 RFDS 65568 65572_65568.rtp renegade +#IX86 RFDS 65570 65572_65570.rtp renegade +#IX86 RFDS 65571 65572_65571.rtp renegade +#IX86 RFDS 65572 65573_65572.rtp renegade + +# ============================= Tiberian Sun ================================ + +#IX86 TSUN 65536 131075_65536.rtp tibsun +#IX86 TSUN 65541 131075_65536.rtp tibsun +#IX86 TSUN 65542 131075_65536.rtp tibsun +#IX86 TSUN 65543 131075_65536.rtp tibsun +#IX86 TSUN 65544 131075_65536.rtp tibsun +#IX86 TSUN 65545 131075_65536.rtp tibsun +#IX86 TSUN 65546 131075_65536.rtp tibsun +#IX86 TSUN 65547 131075_65536.rtp tibsun +#IX86 TSUN 65548 131075_65548.rtp tibsun +#IX86 TSUN 131072 131075_65548.rtp tibsun +#IX86 TSUN 131074 131075_131074.rtp tibsun + +# ======================= Tiberian Sun: FireStorm =========================== + +#IX86 TSXP 131072 131074_131072.rtp tibsun +#IX86 TSXP 131074 131075_131074.rtp tibsun + +# =============================== Dune 2000 ================================= + +#IX86 DN2K 65536 65542.rtp dune2k/1.006/1.000 +#IX86 DN2K 65537 65542_65537.rtp dune2k/1.006/1.001 + +# ================================== NOX ==================================== + +#IX86 NOXX 65536 65538_65536.rtp nox +#IX86 NOXX 65537 65538_65537.rtp nox + +# =============================== NOX: Quest ================================ + +#IX86 NOXQ 65536 65538_65536.rtp nox +#IX86 NOXQ 65537 65538_65537.rtp nox +#IX86 NOXQ 65538 65540_65538.rtp nox +#IX86 NOXQ 65539 65540_65539.rtp nox + +# ======================= Emperor: Battle for Dune ========================== + +#IX86 EBFD 1 65545_1.rtp emperor +#IX86 EBFD 65536 65545_65536.rtp emperor +#IX86 EBFD 65537 65545_65537.rtp emperor +#IX86 EBFD 65538 65545_65538.rtp emperor +#IX86 EBFD 65539 65545_65539.rtp emperor +#IX86 EBFD 65540 65545_65540.rtp emperor +#IX86 EBFD 65541 65545_65541.rtp emperor +#IX86 EBFD 65542 65545_65542.rtp emperor +#IX86 EBFD 65543 65545_65543.rtp emperor +#IX86 EBFD 65544 65545_65544.rtp emperor + +# ============================= Red Alert 2 ================================= + +#IX86 RAL2 65536 65542_65536.rtp ra2 +#IX86 RAL2 65537 65542_65537.rtp ra2 +#IX86 RAL2 65538 65542_65538.rtp ra2 +#IX86 RAL2 65539 65542_65539.rtp ra2 +#IX86 RAL2 65540 65542_65540.rtp ra2 +#IX86 RAL2 65541 65542_65541.rtp ra2 + +# ============================= Yuri's Revenge ============================== + +#IX86 YURI 65536 65537_65536.rtp yuri + +# ============================= Lands of Lore 3 ============================= + +#IX86 LOR3 65536 65539_65536.rtp lore3/1.003 +#IX86 LOR3 65537 65539_65537.rtp lore3/1.003 +#IX86 LOR3 65538 65539_65538.rtp lore3/1.003 diff --git a/pvpgn/conf/bnalias.conf.in b/conf/bnalias.conf.in similarity index 100% rename from pvpgn/conf/bnalias.conf.in rename to conf/bnalias.conf.in diff --git a/pvpgn/conf/bnban.conf.in b/conf/bnban.conf.in similarity index 100% rename from pvpgn/conf/bnban.conf.in rename to conf/bnban.conf.in diff --git a/pvpgn/conf/bnetd.conf.in b/conf/bnetd.conf.in similarity index 100% rename from pvpgn/conf/bnetd.conf.in rename to conf/bnetd.conf.in diff --git a/pvpgn/conf/bnetd.conf.win32 b/conf/bnetd.conf.win32 similarity index 100% rename from pvpgn/conf/bnetd.conf.win32 rename to conf/bnetd.conf.win32 diff --git a/pvpgn/conf/bnetd_default_user.cdb b/conf/bnetd_default_user.cdb similarity index 100% rename from pvpgn/conf/bnetd_default_user.cdb rename to conf/bnetd_default_user.cdb diff --git a/pvpgn/conf/bnetd_default_user.plain.in b/conf/bnetd_default_user.plain.in similarity index 100% rename from pvpgn/conf/bnetd_default_user.plain.in rename to conf/bnetd_default_user.plain.in diff --git a/pvpgn/conf/bnhelp.conf.in b/conf/bnhelp.conf.in similarity index 100% rename from pvpgn/conf/bnhelp.conf.in rename to conf/bnhelp.conf.in diff --git a/pvpgn/conf/bnissue.txt.in b/conf/bnissue.txt.in similarity index 100% rename from pvpgn/conf/bnissue.txt.in rename to conf/bnissue.txt.in diff --git a/pvpgn/conf/bnmaps.conf.in b/conf/bnmaps.conf.in similarity index 100% rename from pvpgn/conf/bnmaps.conf.in rename to conf/bnmaps.conf.in diff --git a/pvpgn/conf/bnmotd-bgBG.txt.in b/conf/bnmotd-bgBG.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-bgBG.txt.in rename to conf/bnmotd-bgBG.txt.in diff --git a/pvpgn/conf/bnmotd-csCZ.txt.in b/conf/bnmotd-csCZ.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-csCZ.txt.in rename to conf/bnmotd-csCZ.txt.in diff --git a/pvpgn/conf/bnmotd-deDE.txt.in b/conf/bnmotd-deDE.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-deDE.txt.in rename to conf/bnmotd-deDE.txt.in diff --git a/pvpgn/conf/bnmotd-enUS.txt.in b/conf/bnmotd-enUS.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-enUS.txt.in rename to conf/bnmotd-enUS.txt.in diff --git a/pvpgn/conf/bnmotd-esES.txt.in b/conf/bnmotd-esES.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-esES.txt.in rename to conf/bnmotd-esES.txt.in diff --git a/pvpgn/conf/bnmotd-frFR.txt.in b/conf/bnmotd-frFR.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-frFR.txt.in rename to conf/bnmotd-frFR.txt.in diff --git a/pvpgn/conf/bnmotd-jpJA.txt.in b/conf/bnmotd-jpJA.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-jpJA.txt.in rename to conf/bnmotd-jpJA.txt.in diff --git a/pvpgn/conf/bnmotd-koKR.txt.in b/conf/bnmotd-koKR.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-koKR.txt.in rename to conf/bnmotd-koKR.txt.in diff --git a/pvpgn/conf/bnmotd-nlNL.txt.in b/conf/bnmotd-nlNL.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-nlNL.txt.in rename to conf/bnmotd-nlNL.txt.in diff --git a/pvpgn/conf/bnmotd-plPL.txt.in b/conf/bnmotd-plPL.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-plPL.txt.in rename to conf/bnmotd-plPL.txt.in diff --git a/pvpgn/conf/bnmotd-ptBR.txt.in b/conf/bnmotd-ptBR.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-ptBR.txt.in rename to conf/bnmotd-ptBR.txt.in diff --git a/pvpgn/conf/bnmotd-ruRU.txt.in b/conf/bnmotd-ruRU.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-ruRU.txt.in rename to conf/bnmotd-ruRU.txt.in diff --git a/pvpgn/conf/bnmotd-svSE.txt.in b/conf/bnmotd-svSE.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-svSE.txt.in rename to conf/bnmotd-svSE.txt.in diff --git a/pvpgn/conf/bnmotd-zhCN.txt.in b/conf/bnmotd-zhCN.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-zhCN.txt.in rename to conf/bnmotd-zhCN.txt.in diff --git a/pvpgn/conf/bnmotd-zhTW.txt.in b/conf/bnmotd-zhTW.txt.in similarity index 100% rename from pvpgn/conf/bnmotd-zhTW.txt.in rename to conf/bnmotd-zhTW.txt.in diff --git a/pvpgn/conf/bnxpcalc.conf.in b/conf/bnxpcalc.conf.in similarity index 100% rename from pvpgn/conf/bnxpcalc.conf.in rename to conf/bnxpcalc.conf.in diff --git a/pvpgn/conf/bnxplevel.conf.in b/conf/bnxplevel.conf.in similarity index 100% rename from pvpgn/conf/bnxplevel.conf.in rename to conf/bnxplevel.conf.in diff --git a/pvpgn/conf/channel.conf.in b/conf/channel.conf.in similarity index 100% rename from pvpgn/conf/channel.conf.in rename to conf/channel.conf.in diff --git a/pvpgn/conf/command_groups.conf.in b/conf/command_groups.conf.in similarity index 100% rename from pvpgn/conf/command_groups.conf.in rename to conf/command_groups.conf.in diff --git a/pvpgn/conf/d2cs.conf.in b/conf/d2cs.conf.in similarity index 100% rename from pvpgn/conf/d2cs.conf.in rename to conf/d2cs.conf.in diff --git a/pvpgn/conf/d2cs.conf.win32 b/conf/d2cs.conf.win32 similarity index 100% rename from pvpgn/conf/d2cs.conf.win32 rename to conf/d2cs.conf.win32 diff --git a/pvpgn/conf/d2dbs.conf.in b/conf/d2dbs.conf.in similarity index 100% rename from pvpgn/conf/d2dbs.conf.in rename to conf/d2dbs.conf.in diff --git a/pvpgn/conf/d2dbs.conf.win32 b/conf/d2dbs.conf.win32 similarity index 100% rename from pvpgn/conf/d2dbs.conf.win32 rename to conf/d2dbs.conf.win32 diff --git a/pvpgn/conf/d2server.ini b/conf/d2server.ini similarity index 100% rename from pvpgn/conf/d2server.ini rename to conf/d2server.ini diff --git a/pvpgn/conf/news.txt.in b/conf/news.txt.in similarity index 100% rename from pvpgn/conf/news.txt.in rename to conf/news.txt.in diff --git a/pvpgn/conf/realm.conf.in b/conf/realm.conf.in similarity index 100% rename from pvpgn/conf/realm.conf.in rename to conf/realm.conf.in diff --git a/pvpgn/conf/sql_DB_layout.conf.in b/conf/sql_DB_layout.conf.in similarity index 100% rename from pvpgn/conf/sql_DB_layout.conf.in rename to conf/sql_DB_layout.conf.in diff --git a/pvpgn/conf/sql_DB_layout2.conf.in b/conf/sql_DB_layout2.conf.in similarity index 100% rename from pvpgn/conf/sql_DB_layout2.conf.in rename to conf/sql_DB_layout2.conf.in diff --git a/pvpgn/conf/supportfile.conf.in b/conf/supportfile.conf.in similarity index 100% rename from pvpgn/conf/supportfile.conf.in rename to conf/supportfile.conf.in diff --git a/pvpgn/conf/topics.conf.in b/conf/topics.conf.in similarity index 100% rename from pvpgn/conf/topics.conf.in rename to conf/topics.conf.in diff --git a/pvpgn/conf/tournament.conf.in b/conf/tournament.conf.in similarity index 100% rename from pvpgn/conf/tournament.conf.in rename to conf/tournament.conf.in diff --git a/pvpgn/conf/versioncheck.conf.in b/conf/versioncheck.conf.in similarity index 100% rename from pvpgn/conf/versioncheck.conf.in rename to conf/versioncheck.conf.in diff --git a/pvpgn/config.h.cmake b/config.h.cmake similarity index 100% rename from pvpgn/config.h.cmake rename to config.h.cmake diff --git a/pvpgn/conversion-changelog b/conversion-changelog similarity index 100% rename from pvpgn/conversion-changelog rename to conversion-changelog diff --git a/d2pack109/CREDITS b/d2pack109/CREDITS deleted file mode 100644 index bbbaeb9..0000000 --- a/d2pack109/CREDITS +++ /dev/null @@ -1,245 +0,0 @@ -PvPGN CREDITS (also please see the original BNETD credits bellow): --------------------------------------------------------------------- - -CREDITS - This file contains the names of people who have contributed to the - development of the PvPGN BNETD mod in some way. This file is not - complete and we would like to thank everyone who helped us in any way. - -PROGRAMMING CONTRIBUTORS - Zzzoom (servers@3dgames.com.ar) - For persistent SQL connections patch, password brute force attacks - protection and various bug reports. - - Lots of other people who do not whish to be mentioned here. - -BINARY PACKAGES: -- Birzan George Cristian (Debian packages) -- Dorin Lazar (RPMs) -- Mihai Maties (RPMs & src.rpm snapshot script) -- Radu Radoveneanu (Slackware packages) - -ORIGINAL BNETD CREDITS: -------------------------------- - -CREDITS - - This file contains the names of people who have contributed to the - development of the BNETD server in some way. This project has made an - enormous amount of progress since the development has become public, - and this is one place where members of the community can be thanked. - - -PROGRAMMING CONTRIBUTORS - - The following people have contributed code, code ideas, bug fixes, and - debugging work: - - Mark Baysinger (mbaysing@ucsd.edu) - For the original idea, original implementation, documentation of the - protocol, starhack.ml.org, the tracking server, etc. - - Ross Combs (rocombs@cs.nmsu.edu) - Various cleanups, release coordination, / commands, config files, etc. - - Rob Crittenden (rcrit@greyoak.com) - For many bug fixes, protocol work, file downloads, man pages, user - icons, better channel handling, autoconf, ladder, etc. as well as - working on the FAQ and user support. - - Descolada (dyn1-tnt9-237.chicago.il.ameritech.net) - For the hashing algorithm complete with a sample C implementation. - - Gediminas (gediminas_lt@mailexcite.com) - For work on the client command "readline" code, the initial help - system, and a better /conn command. - - Oleg Drokin (green@ccssu.crimea.ua) - For patches to fix bnchat and bnstat. - - Damien Clermonte (clermond@esiee.fr) - For portability (to cygnus B20.1 on win32) work, testing, and helpful - observations, and the TCP keepalive patch. - - Denis Moreaux (vapula@endor.be) - For working out the correct ladder equations. - - Philippe Dubois (pdubois@matrox.com) - For working on the Win32 port, UDP stuff, auto-update, and the - bnettime code. - - Typhoon [Marco Ziech] (mmz@gmx.net) - For lots of good work on the BNI utilities, BITS (server inter- - connectivity) support, and his bnetmasq.sh script. He also - answers a lot of user questions and put together most of the - web site. - - Dizzy (dizzy@roedu.net) - For help with NAT issues, a much improved help system, channel - flooding prevention, new /-commands, a mail system, and more. - - Razvan Jianu (roger@hell.gameover.ro) - For many useful coredumps :) Also for the /addacct command. - - Qlex (qlex@eoliss.com) - For kick starting the Diablo II stuff, testing thousands quick - changes, moral support, and digging up all the information. - - Kenshin (kenshin_@hotmail.com) - For helping Qlex with the character stuff, fixing some major - bugs in the Diablo II code, and starting work on saving - characters. - - Hakan Tandogan (hakan@gurkensalat.com) - For always making RPMs for bnetd and the tracker and some patches to - correct startup/shutdown issues. Also for continuing Diablo II work. - - Jung-woo Sohn (logout@aeroguy.snu.ac.kr) - For /watch feedback, dobae flooding disconnect, better disconnect - game result handling, and generally for lots of good ideas. And - also for spotting the failed account creation crashing bug. - - YobGuls (yobguls@yobguls.2ndmail.com) - Actually contributed to the DSBot code, but see next entry. - - Eurijk! (wc2@zefga.net) - For pointing out how the new cdkey hashing works and also how - version checking is performed. This was some really ugly but - important stuff! He figured this out working on DSBot but - kindly explained it to us and showed us example code. He's - also working on the Prolix bot project and has provided lots - of useful bug reports and other commentary. - - Fred Wittekind (rom@twister.dyndns.org) - For autoupdate version range support. For pointing out all the - update MPQ files we didn't know about. Also for the message - force-command patch. - - Mathieu Legare (Mathieu_Legare@uqtr.uquebec.ca) - For picking up bnetdStats and making it report all kinds of - statistics. - - Onlyer (onlyer@users.sourceforge.net) - For new commands, Diablo II protocol work, Diablo II closed server - work, FSGS account conversion, etc. - - faster (lqx@cic.tsinghua.edu.cn) - For Diablo II closed communication (S2S) and for finding that - check_alloc bug. - - sousou (liupeng.cs@263.net) - For Diablo II closed database server and ladder. - - esper (esperpale@263.net) - Diablo II closed server gui and ladder. - - sherpya (sherpya@netfarm.it) - For lots of help with adbanners, the d2close merge, reporting - bugs (like the 100% poll() CPU usage bug), and lots of good - suggestions. Also for work on channel list reloads. - - Yoss (bartek@milc.com.pl) - For helpful suggestions for the mail code and for patching - the emote flooding hole. Also for the /admin command and for - the patch to fix the "operator can ban admins" bug. A big - thanks for much improved kill and ban commands and the new - dynamic ipban with better address matching and timeouts. - - Roland Stahn (blue@cs.tu-berlin.de) - For all the work tracking down the versioncheck information - for revision of the STAR and SEXP clients. For information about - Blizzard's numbering scheme. For helpful packet information. - Also for the bug reports and simple patches which probably should - have been fixed a long time ago but he was the only person with - enough patience to figure out what was happening. Specifically, - the "all countries in one channel" feature, the empty game pass - bug, the multiple game with same name bug, and the memory - corruption after autoupdates. For updated version information. - For diagnosing the autoupdate crash (bug in server.c handling - closed sockets). - - KWS (vizi@csucs.net) - For the nice bug reports on gameinfo parsing on game join, win32 - socket and file portability problems. Also for patches to update - versioncheck info, implement IP storage, the patch for better - eventlogs, and Makefile improvements. - - Jack (jack@takeovertheworld.org) - For Diablo II open game difficulty patch. - - forester (laterk@inbox.lv) - Working on the Win32 port, bnetd GUI for Win32, small patches. - -TESTING AND DEBUGGING CONTRIBUTORS - - The following people have sent in ideas, bug reports, and minor - patches. - - 187 (187@infoceptor.com) - For bug reports and the idea for the /news command. - - Shin DongJun (djshin@oslab.snu.ac.kr) - For some bug reports and patches. - - Jeffery Jones (jeffery_jones@mtlusa.com) - For the game address translation idea. - - Maxim Tereshenkov (max@ostin.ru) - For the stack trace which found the 8-bit account.c bug. - - Yanoch (yanoch@loginnovation.com) - For suggesting the /kill improvement. - - stacker (stacker@mail.ee.ntou.edu.tw) - For lots of bug reports and also the sbnetd front end. - - Mike Hindman (mhindman@bnetd.nmsu.edu) - David Fitzpatrick (dfitzpat@bnetd.nmsu.edu) - For lots of ideas and all the help with Diablo. - - Homer (homer@ogn.de) - For the helpful info on game info strings and ladder maps. - - Alvin Sim (elflord@faerie.cx) - For lots of testing and figuring out that Diablo II open gameplay was - actually not too hard to implement. - - AsmodeusB - For finding annoying the gameinfo bug in connection.c :) - - forester (http://forester.yo.lv) - For pointing out what gameresult 5 means. - - jerome (imeepmeep@mac.com) - For the MacOS X package. - - acbcdde (acbcdde@hotmail.com) - For Win32 Makefile and config.h fixes. - - mojohead ( Andrey Ilyin ) - For d2dbs/d2ladder.c fixes. - - -OTHER CONTRIBUTORS - - The following people have contributed their time, talent, and other - resources to the project: - - Josh (josh@bnetd.org) - For a wonderful web site, quick mirroring of new releases, testing, - organization, documentation, and user support. - - Tim Jung (tjung@igateway.net) - For kindly hosting our mailing lists, domain, web pages, etc. as well - as regular feedback and testing. - - Allan Clark (allanc@sco.com) - For putting together some nice RPMs. - - -NOTE - - This list is not complete. I have lost track of the names of some - people who have contributed, and likely forgotten about others. If you - think you should be listed here but aren't, please contact the - bnetd-dev mailing list and we will take care of it right away. diff --git a/d2pack109/README b/d2pack109/README deleted file mode 100644 index 8b77ba5..0000000 --- a/d2pack109/README +++ /dev/null @@ -1,44 +0,0 @@ - Readme for Player vs. Player Gaming Network - --------------------------------------------- - D2Pack 1.09 - ------------- - - PvPGN is a BNETD mod which aims to provide support for all Blizzard -clients (thus it supports all BNETD supported clients plus the most recent -ones). - This release only includes d2cs/d2dbs as needed to host a Diablo II 1.09 -closed realm. It only supports d2gs 1.09d. This package NEEDS a "bnetd" server -configured to work (for example use a "bnetd" from a PvPGN release). - -The list of supported clients and their minimum verion required is: -- Diablo 2 v1.09 -- Diablo 2 LOD v1.09 ------------- - - The documentation is located in the docs directory. Please read docs/INDEX -for a list of files and what they contain. - If you are updating from a previous PvPGN version check the file UPDATE -first. - - ------ - -We're always looking for good coders (C coders) or -anyone who can contribute to our project in any way. - -Project homepages/distribution sites: -- project home and main distribution site: http://pvpgn.berlios.de -- alternate project home: http://www.pvpgn.org -- alternate distribution site: http://www.pvpgn.de - -Support channels: - -1. BugTracker (preffered support method): -http://developer.berlios.de/bugs/?group_id=2291 - -2. Mailing List: pvpgn-users@lists.berlios.de ( to subscribe go here -https://lists.berlios.de/mailman/listinfo/pvpgn-users ) - -3. Forums: http://forums.pvpgn.org - -4. IRC live support: #pvpgn on irc.pvpgn.org diff --git a/d2pack109/Win32-Projects/Makefile.mingw b/d2pack109/Win32-Projects/Makefile.mingw deleted file mode 100644 index a626bc8..0000000 --- a/d2pack109/Win32-Projects/Makefile.mingw +++ /dev/null @@ -1,493 +0,0 @@ -# Project: d2pack109 Package -# Makefile: MinGW (http://www.mingw.org) -# -# Copyright (C) 2005 CreepLord (creeplord@pvpgn.org) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -##################################################################### - -ifndef DEST -DEST = ./win32-builds -endif - -VERSION = 0.7 -RELEASE = CVS -PACKAGE = $(DEST)/D2Pack109-$(VERSION)-$(RELEASE)-Win32$(TYPE).zip - -ifndef prefix - prefix = ./d2pack109 - installdir = $(prefix)-$(VERSION) -else - installdir = $(prefix) -endif - -confdir = $(installdir)/conf -docsdir = $(installdir)/docs -filesdir = $(installdir)/files -sharedir = $(installdir)/var -bakdir = $(sharedir)/bak -bakcharsavedir = $(sharedir)/bak/charsave -bakcharinfodir = $(sharedir)/bak/charinfo -charsavedir = $(sharedir)/charinfo -charinfodir = $(sharedir)/charsave -laddersdir = $(sharedir)/ladders -reportsdir = $(sharedir)/reports - -##################################################################### - -TOP_DIR = ./.. - -SRC_CONFDIR = $(TOP_DIR)/conf -SRC_DOCSDIR = $(TOP_DIR)/docs -SRC_FILESDIR = $(TOP_DIR)/files -SRC_SBINDIR = $(TOP_DIR)/sbin -SRC_SRCDIR = $(TOP_DIR)/src -SRC_COMMONDIR = $(SRC_SRCDIR)/common -SRC_COMPATDIR = $(SRC_SRCDIR)/compat -SRC_D2CSDIR = $(SRC_SRCDIR)/d2cs -SRC_D2DBSDIR = $(SRC_SRCDIR)/d2dbs -SRC_WIN32DIR = $(SRC_SRCDIR)/win32 - -##################################################################### - -CC = gcc -INSTALL = install -INSTALL_DIR = install -d -RMF = rm -f -STRIP = strip -WINDRES = windres -ZIP = zip -rm9q -ECHO = echo - -ifdef CROSS_BUILD -PCC = /usr/bin/gcc -ENV = -WFLAGS = -W -Wall -Wno-unused -#WFLAGS = -UNIX2DOS = ./u2d -else -PCC = $(CC) -ENV = -e -WFLAGS = -UNIX2DOS = u2d.exe -endif - -##################################################################### - -CFLAGS = $(WFLAGS) -I$(SRC_SRCDIR) -I$(SRC_SRCDIR)/include -LDFLAGS = -lws2_32 -L$(SRC_SRCDIR)/lib - -ifdef WITH_MYSQL -CFLAGS += -DWITH_SQL_MYSQL -LDFLAGS += -lmysql -endif - -ifdef WITH_PGSQL -CFLAGS += -DWITH_SQL_PGSQL -LDFLAGS += -lpq -endif - -ifdef WITH_SQLITE3 -CFLAGS += -DWITH_SQL_SQLITE3 -DHAVE_SQLITE3_H -LDFLAGS += -lsqlite3 -endif - -ifdef WITH_ODBC -CFLAGS += -DWITH_SQL_ODBC -LDFLAGS += -lodbc32 -endif - -ifdef WITH_GUI -CFLAGS += -DWIN32_GUI -LDFLAGS += -mwindows -endif - -##################################################################### -# EXECUTABLES -##################################################################### - -ifdef WITH_GUI - d2cs_SBIN = $(SRC_SBINDIR)/d2cs109.exe - d2dbs_SBIN = $(SRC_SBINDIR)/d2dbs109.exe -else - d2cs_SBIN = $(SRC_SBINDIR)/d2cs109Console.exe - d2dbs_SBIN = $(SRC_SBINDIR)/d2dbs109Console.exe -endif - -##################################################################### -# RESOURCES -##################################################################### - -ifdef WITH_GUI -d2cs_RES = $(SRC_WIN32DIR)/d2cs_resource.res -d2dbs_RES = $(SRC_WIN32DIR)/d2dbs_resource.res -else -d2cs_RES = $(SRC_WIN32DIR)/console_resource.res -d2dbs_RES = $(SRC_WIN32DIR)/console_resource.res -endif - -##################################################################### -# SOURCE -##################################################################### - -d2cs_SOURCE = \ - $(SRC_D2CSDIR)/main.c \ - $(SRC_D2CSDIR)/d2gs.c \ - $(SRC_D2CSDIR)/handle_d2gs.c \ - $(SRC_D2CSDIR)/serverqueue.c \ - $(SRC_D2CSDIR)/connection.c \ - $(SRC_D2CSDIR)/game.c \ - $(SRC_D2CSDIR)/server.c \ - $(SRC_D2CSDIR)/handle_init.c \ - $(SRC_D2CSDIR)/handle_d2cs.c \ - $(SRC_D2CSDIR)/d2charfile.c \ - $(SRC_D2CSDIR)/d2charlist.c \ - $(SRC_D2CSDIR)/xstring.c \ - $(SRC_D2CSDIR)/gamequeue.c \ - $(SRC_D2CSDIR)/prefs.c \ - $(SRC_D2CSDIR)/conf.c \ - $(SRC_D2CSDIR)/cmdline_parse.c \ - $(SRC_D2CSDIR)/bnetd.c \ - $(SRC_D2CSDIR)/handle_bnetd.c \ - $(SRC_D2CSDIR)/s2s.c \ - $(SRC_D2CSDIR)/net.c \ - $(SRC_D2CSDIR)/d2ladder.c \ - $(SRC_D2CSDIR)/handle_signal.c \ - $(SRC_COMMONDIR)/eventlog.c \ - $(SRC_COMMONDIR)/hashtable.c \ - $(SRC_COMMONDIR)/hexdump.c \ - $(SRC_COMMONDIR)/list.c \ - $(SRC_COMMONDIR)/packet.c \ - $(SRC_COMMONDIR)/bn_type.c \ - $(SRC_COMMONDIR)/addr.c \ - $(SRC_COMMONDIR)/util.c \ - $(SRC_COMMONDIR)/queue.c \ - $(SRC_COMMONDIR)/network.c \ - $(SRC_COMMONDIR)/fdwatch.c\ - $(SRC_COMMONDIR)/fdwatch_select.c\ - $(SRC_COMMONDIR)/fdwatch_poll.c\ - $(SRC_COMMONDIR)/fdwatch_kqueue.c\ - $(SRC_COMMONDIR)/fdwatch_epoll.c\ - $(SRC_COMMONDIR)/trans.c \ - $(SRC_COMMONDIR)/xalloc.c \ - $(SRC_COMMONDIR)/rlimit.c \ - $(SRC_COMMONDIR)/tag.c \ - $(SRC_COMPATDIR)/inet_aton.c \ - $(SRC_COMPATDIR)/inet_ntoa.c \ - $(SRC_COMPATDIR)/strdup.c \ - $(SRC_COMPATDIR)/strerror.c \ - $(SRC_COMPATDIR)/strtoul.c \ - $(SRC_COMPATDIR)/strftime.c \ - $(SRC_COMPATDIR)/strcasecmp.c \ - $(SRC_COMPATDIR)/strncasecmp.c \ - $(SRC_COMPATDIR)/strsep.c \ - $(SRC_COMPATDIR)/psock.c \ - $(SRC_COMPATDIR)/uname.c \ - $(SRC_COMPATDIR)/gettimeofday.c \ - $(SRC_COMPATDIR)/difftime.c \ - $(SRC_COMPATDIR)/pdir.c \ - $(SRC_COMPATDIR)/memset.c \ - $(SRC_COMPATDIR)/memcpy.c \ - $(SRC_COMPATDIR)/memmove.c \ - $(SRC_WIN32DIR)/service.c \ - $(SRC_WIN32DIR)/d2cs_winmain.c - -d2dbs_SOURCE = \ - $(SRC_D2DBSDIR)/main.c \ - $(SRC_D2DBSDIR)/charlock.c \ - $(SRC_D2DBSDIR)/d2ladder.c \ - $(SRC_D2DBSDIR)/dbserver.c \ - $(SRC_D2DBSDIR)/dbspacket.c \ - $(SRC_D2DBSDIR)/prefs.c \ - $(SRC_D2DBSDIR)/handle_signal.c \ - $(SRC_D2DBSDIR)/dbsdupecheck.c \ - $(SRC_D2DBSDIR)/cmdline_parse.c \ - $(SRC_D2CSDIR)/conf.c \ - $(SRC_D2CSDIR)/xstring.c \ - $(SRC_COMMONDIR)/eventlog.c \ - $(SRC_COMMONDIR)/list.c \ - $(SRC_COMMONDIR)/bn_type.c \ - $(SRC_COMMONDIR)/util.c \ - $(SRC_COMMONDIR)/addr.c \ - $(SRC_COMMONDIR)/xalloc.c \ - $(SRC_COMMONDIR)/fdwatch.c \ - $(SRC_COMMONDIR)/fdwatch_select.c \ - $(SRC_COMMONDIR)/fdwatch_poll.c \ - $(SRC_COMMONDIR)/fdwatch_epoll.c \ - $(SRC_COMMONDIR)/fdwatch_kqueue.c \ - $(SRC_COMMONDIR)/tag.c \ - $(SRC_COMMONDIR)/rlimit.c \ - $(SRC_COMPATDIR)/inet_aton.c \ - $(SRC_COMPATDIR)/psock.c \ - $(SRC_COMPATDIR)/strerror.c \ - $(SRC_COMPATDIR)/strsep.c \ - $(SRC_WIN32DIR)/service.c \ - $(SRC_WIN32DIR)/d2dbs_winmain.c - -##################################################################### -# OBJECTS -##################################################################### - -d2cs_OBJECTS = $(d2cs_SOURCE:.c=.o) -d2dbs_OBJECTS = $(d2dbs_SOURCE:.c=.o) - -d2server_OBJECTS = $(d2cs_OBJECTS) $(d2dbs_OBJECTS) - -##################################################################### -# Targets -##################################################################### - -.PHONY: all -all: - @$(ECHO) =============================================================================== - @$(ECHO) = = - @$(ECHO) = Targets: = - @$(ECHO) = = - @$(ECHO) = make_mingw gui Build GUI Programs = -# @$(ECHO) = make_mingw gui-mysql Build GUI Programs with mySQL Support = -# @$(ECHO) = make_mingw gui-pgsql Build GUI Programs with pgSQL Support = -# @$(ECHO) = make_mingw gui-sqlite3 Build GUI Programs with SQLite3 Support = -# @$(ECHO) = make_mingw gui-odbc Build GUI Programs with ODBC Support = -# @$(ECHO) = = - @$(ECHO) = make_mingw console Build Console Programs = -# @$(ECHO) = make_mingw console-mysql Build Console Programs with mySQL Support = -# @$(ECHO) = make_mingw console-pgsql Build Console Programs with pgSQL Support = -# @$(ECHO) = make_mingw console-sqlite3 Build Console Programs with SQLite3 Support = -# @$(ECHO) = make_mingw console-odbc Build Console Programs with ODBC Support = - @$(ECHO) = = - @$(ECHO) = make_mingw clean Remove All Objects, Resources, Executables = - @$(ECHO) = = - @$(ECHO) = make_mingw install [InstallPath] Installs the D2Pack109 Package = - @$(ECHO) = = - @$(ECHO) =============================================================================== - @pause - -##################################################################### -# COMPILING TARGETS -##################################################################### - -.PHONY: gui -gui: clean - @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1 - -.PHONY: gui-mysql -gui-mysql: clean - @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1 $(ENV) WITH_MYSQL=1 - -.PHONY: gui-pgsql -gui-pgsql: clean - @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1 $(ENV) WITH_PGSQL=1 - -.PHONY: gui-sqlite3 -gui-sqlite3: clean - @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1 $(ENV) WITH_SQLITE3=1 - -.PHONY: gui-odbc -gui-odbc: clean - @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_GUI=1 $(ENV) WITH_ODBC=1 - -.PHONY: console -console: clean servers - -.PHONY: console-mysql -console-mysql: clean - @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_MYSQL=1 - -.PHONY: console-pgsql -console-pgsql: clean - @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_PGSQL=1 - -.PHONY: console-sqlite3 -console-sqlite3: clean - @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_SQLITE3=1 - -.PHONY: console-odbc -console-odbc: clean - @$(MAKE) -s -fMakefile.mingw servers $(ENV) WITH_ODBC=1 - -##################################################################### - -.PHONY: servers -servers: $(d2cs_SBIN) $(d2dbs_SBIN) - -##################################################################### -# CLEANING -##################################################################### - -.PHONY: clean -clean: clean-obj clean-res clean-exe - -.PHONY: clean-obj -clean-obj: - @$(ECHO) Removing Objects - @-$(RMF) $(SRC_COMMONDIR)/*.o - @-$(RMF) $(SRC_COMPATDIR)/*.o - @-$(RMF) $(SRC_D2CSDIR)/*.o - @-$(RMF) $(SRC_D2DBSDIR)/*.o - @-$(RMF) $(SRC_WIN32DIR)/*.o - -.PHONY: clean-res -clean-res: - @$(ECHO) Removing Resourses - @-$(RMF) $(SRC_WIN32DIR)/*.res - -.PHONY: clean-exe -clean-exe: - @$(ECHO) Removing Executables - @-$(RMF) $(SRC_SBINDIR)/*.exe - -##################################################################### -# PACKAGING -##################################################################### - -.PHONY: gui-package -gui-package: - @$(MAKE) -s -fMakefile.mingw gui - @$(MAKE) -s -fMakefile.mingw package $(ENV) TYPE=-GUI $(ENV) - -.PHONY: console-package -console-package: - @$(MAKE) -s -fMakefile.mingw console - @$(MAKE) -s -fMakefile.mingw package $(ENV) TYPE=-Console $(ENV) NAME_TYPE=Console - -.PHONY: releases -releases: console-package gui-package - -.PHONY: package -package: $(DEST) install - @$(ECHO) Making PvPGN$(TYPE) Package - @$(ECHO) @echo off > $(installdir)/install.bat - @$(ECHO) d2cs109$(NAME_TYPE).exe -s install >> $(installdir)/install.bat - @$(ECHO) d2dbs109$(NAME_TYPE).exe -s install >> $(installdir)/install.bat - @$(ECHO) @echo off > $(installdir)/uninstall.bat - @$(ECHO) d2cs109$(NAME_TYPE).exe -s uninstall >> $(installdir)/uninstall.bat - @$(ECHO) d2dbs109$(NAME_TYPE).exe -s uninstall >> $(installdir)/uninstall.bat - @-$(RMF) $(PACKAGE) - @$(ZIP) $(PACKAGE) $(installdir) - -##################################################################### -# INSTALLING -##################################################################### - -.PHONY: install -install: install-dirs install-confs install-docs install-files install-exes install-misc install-u2d - -.PHONY: install-dirs -install-dirs: - @$(ECHO) Creating Directorys - @-$(INSTALL_DIR) $(installdir) - @-$(INSTALL_DIR) $(confdir) - @-$(INSTALL_DIR) $(docsdir) - @-$(INSTALL_DIR) $(filesdir) - @-$(INSTALL_DIR) $(sharedir) - @-$(INSTALL_DIR) $(bakdir) - @-$(INSTALL_DIR) $(bakcharsavedir) - @-$(INSTALL_DIR) $(bakcharinfodir) - @-$(INSTALL_DIR) $(charsavedir) - @-$(INSTALL_DIR) $(charinfodir) - @-$(INSTALL_DIR) $(laddersdir) - -.PHONY: install-confs -install-confs: - @$(ECHO) Installing Configuration Files - @-$(INSTALL) $(SRC_CONFDIR)/d2cs.conf.win32 $(confdir)/d2cs.conf - @-$(INSTALL) $(SRC_CONFDIR)/d2dbs.conf.win32 $(confdir)/d2dbs.conf - @-$(INSTALL) $(SRC_CONFDIR)/address_translation.conf $(confdir) - -.PHONY: install-docs -install-docs: - @$(ECHO) Installing Docs - @-$(INSTALL) $(SRC_DOCSDIR)/Service.Win32.txt $(docsdir) - @-$(INSTALL) $(SRC_DOCSDIR)/INSTALL.unix $(docsdir)/INSTALL.unix.txt - -.PHONY: install-files -install-files: - @$(ECHO) Installing Server Files - @-$(INSTALL) $(SRC_FILESDIR)/newbie.save $(filesdir) - -.PHONY: install-exes -install-exes: - @$(ECHO) Installing Executables - @-$(INSTALL) $(SRC_SBINDIR)/*.exe $(installdir) -# @-$(INSTALL) $(SRC_SBINDIR)/*.dll $(installdir) - -.PHONY: install-misc -install-misc: - @$(ECHO) Installing Misc Files - @-$(INSTALL) $(TOP_DIR)/COPYING $(installdir)/COPYING.txt - @-$(INSTALL) $(TOP_DIR)/CREDITS $(installdir)/CREDITS.txt - @-$(INSTALL) $(TOP_DIR)/README $(installdir)/README.txt - -.PHONY: install-u2d -install-u2d: - @$(ECHO) Converting Unix Style Text Files to Dos Format - @$(PCC) $(SRC_WIN32DIR)/u2d.c -o $(UNIX2DOS) - @-$(UNIX2DOS) $(confdir)/*.conf - @-$(UNIX2DOS) $(docsdir)/*.txt - @-$(UNIX2DOS) $(installdir)/*.txt - @-$(RMF) $(UNIX2DOS) - -##################################################################### -# DIRECTORYS -##################################################################### - -$(SRC_SBINDIR): - $(INSTALL_DIR) $(SRC_SBINDIR) - -$(DEST): - $(INSTALL_DIR) $(DEST) - -##################################################################### -# HEADER -##################################################################### - -.PHONY: SHOWHEADER -SHOWHEADER: - @$(ECHO) ============================================================ - @$(ECHO) CFLAGS..= $(CFLAGS) - @$(ECHO) LDFLAGS.= $(LDFLAGS) - @$(ECHO) ============================================================ - -##################################################################### -# SERVER BINS -##################################################################### - -$(d2cs_SBIN): SHOWHEADER $(d2cs_OBJECTS) $(d2cs_RES) $(SRC_SBINDIR) - @$(ECHO) Linking $@ - @$(CC) $(d2cs_OBJECTS) $(d2cs_RES) $(LDFLAGS) -o $@ - @$(STRIP) $@ - -$(d2dbs_SBIN): SHOWHEADER $(d2dbs_OBJECTS) $(d2dbs_RES) $(SRC_SBINDIR) - @$(ECHO) Linking $@ - @$(CC) $(d2dbs_OBJECTS) $(d2dbs_RES) $(LDFLAGS) -o $@ - @$(STRIP) $@ - -##################################################################### -# Object Files -##################################################################### - -%.o: %.c - @$(ECHO) Compiling $*.c - @$(CC) $(CFLAGS) -c $< -o $@ - -##################################################################### -# Resource Files -##################################################################### - -%.res: %.rc - @$(ECHO) Compiling $*.rc - @$(WINDRES) -i $< -o $@ -O coff --include-dir $(SRC_SRCDIR) diff --git a/d2pack109/Win32-Projects/make_mingw.bat b/d2pack109/Win32-Projects/make_mingw.bat deleted file mode 100644 index 9d2b171..0000000 --- a/d2pack109/Win32-Projects/make_mingw.bat +++ /dev/null @@ -1,24 +0,0 @@ -@echo off -path = C:\MinGW\bin - -if %1X == installX goto install - -mingw32-make -fMakefile.mingw %1 -goto end - -:install -if %2X == X goto error - -mingw32-make -fMakefile.mingw %1 -e prefix=%2 -goto end - -:error -echo: -echo You didn't supply the Install Path! -echo: -echo example: make_mingw install C:\d2pack109 -echo: -pause -goto end - -:end diff --git a/d2pack109/Win32-Projects/make_mingw.sh b/d2pack109/Win32-Projects/make_mingw.sh deleted file mode 100755 index b08b309..0000000 --- a/d2pack109/Win32-Projects/make_mingw.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -PREFIX=/usr/local/cross-tools -TARGET=i386-mingw32msvc -export PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH" -export CROSS_BUILD=1 -export DEST="./win32-builds" -exec make -fMakefile.mingw $* diff --git a/d2pack109/conf/address_translation.conf b/d2pack109/conf/address_translation.conf deleted file mode 100644 index 50cbfea..0000000 --- a/d2pack109/conf/address_translation.conf +++ /dev/null @@ -1,94 +0,0 @@ -######################################################################################################## -#------------------------------------------------------------------------------------------------------# -# Address Translation table # -#------------------------------------------------------------------------------------------------------# -# # -# This is a list of ip:port addresses that get translated # -# # -# The entries are broken into four parts: # -# # -# * the IP address w/port to be translated # -# * the output IP address w/port # -# * comma delimited list of networks to be excluded from translation # -# * comma delimited list of networks to be included in translation # -# # -# Each line must contain all four parts or the entire entry will be rejected # -# There are no default ports, make sure input and output includes the port number # -# # -# The entries are searched in the order listed in this file # -# Exclude networks are searched before include networks # -# Only the first matching line is used # -# Lines begining with '#' are ignored # -# # -# If no match is found, the input ip will be returned. # -# # -# NONE = There are no neworks to exclude/include (just a place holder, no entries will be added) # -# ANY = All networks will be excluded/included (same as 0.0.0.0/0) # -# # -######################################################################################################## - -######################################################################################################## -# w3route server ip (removed from w3trans.conf) (Port 6200) # -# # -# Set input address the same as the w3routeaddr setting in the bnetd.conf # -# Set output address to the address to be sent to war3 clients # -# Set exclude to the range of clients you want to recieve the input address # -# instead of the output address # -# Set include to the range of clients you want to recieve the output address # -# # -# input (ip:port) output (ip:port) exclude (ip/netmask) include (ip/netmask) # -#--------------------- ---------------------- ---------------------------- -------------------------# - -#0.0.0.0:6200 192.168.1.100:6200 NONE 192.168.1.0/24 -#0.0.0.0:6200 internetip:6200 NONE ANY - - - -######################################################################################################## -# Game Translations for clients (removed from gametrans.conf) (client data ports) # -# # -# Set input address to the client to be translated # -# Set output address to the address to be sent to the other clients # -# Set exclude to the range of clients you want to recieve the input address # -# instead of the output address # -# Set include to the range of clients you want to recieve the output address # -# # -# input (ip:port) output (ip:port) exclude (ip/netmask) include (ip/netmask) # -#--------------------- ---------------------- ---------------------------- -------------------------# - -#192.168.1.1:6119 internetip:6119 192.168.1.0/24,10.0.0.0/8 ANY -#192.168.1.2:6118 internetip:6118 192.168.1.0/24 ANY - - - -######################################################################################################## -# Diablo II Charactar Server (d2cs) - (removed from realm.conf) (Port 6113) # -# # -# Set input address to the ip of d2cs (same as the ip in the realm.conf) # -# Set output address to the address to be sent to the clients # -# Set exclude to the range of clients you want to recieve the input address # -# instead of the output address # -# Set include to the range of client you want to recieve the output address # -# # -# input (ip:port) output (ip:port) exclude (ip/netmask) include (ip/netmask) # -#--------------------- ---------------------- ---------------------------- -------------------------# - -#192.168.1.100:6113 internetip:6113 192.168.1.0/24 ANY - - - -######################################################################################################## -# Diablo II Game Server (d2gs) - (removed from d2gstrans.conf) (Port 4000) # -# # -# Set input address to the ip of d2gs (same as the gameservlist in d2cs.conf) # -# Set output address to the address to be sent to the clients # -# Set exclude to the range of clients you want to recieve the input address # -# instead of the output address # -# Set include to the range of client you want to recieve the output address # -# # -# input (ip:port) output (ip:port) exclude (ip/netmask) include (ip/netmask) # -#--------------------- ---------------------- ---------------------------- -------------------------# - -#192.168.1.100:4000 internetip:4000 192.168.1.0/24 ANY - - diff --git a/d2pack109/conf/d2cs.conf.in b/d2pack109/conf/d2cs.conf.in deleted file mode 100644 index 844c563..0000000 --- a/d2pack109/conf/d2cs.conf.in +++ /dev/null @@ -1,201 +0,0 @@ -################################################################################# -# d2cs.conf - Configuration file for the diablo2 game control server # -#-------------------------------------------------------------------------------# -# # -# This file is an example configuration and may require modification to # -# suit your needs or your site. Blank lines and lines starting with a "#" # -# are ignored. Use quotes around values that contain spaces. # -# # -################################################################################# - - -################################################################################# -# Server Major Settings # -#-------------------------------------------------------------------------------# -# # -# Your realm server name # -realmname = D2CS - -# This is a comma delimited list of hostnames that the server should -# listen on. It might be useful to make an internal-only server on a -# gateway machine for example. If the list is not set or if it has a -# entry with no host component, the server will bind to that port on all -# interfaces. -# d2cs default listening port is 6113 -servaddrs = 0.0.0.0:6113 - -# This is a comma delimited list of game servers -#gameservlist = your.gameserver,another.gameserver - -# This is bnetd server address with port -# bnetd default listening port is 6112 -#bnetdaddr = xxx.xxx.xxx.xxx:6112 - -# Set this to the maximum number of concurrent connections allowed on -# this server. -max_connections = 1000 - -# This sets the realm to Classic or LOD or Both -# Classic = 0 -# LOD = 1 -# Both = 2 (default) -lod_realm = 2 - -# This sets whether you can convert a clasic char to -# an expansion char. -# Allow Convert = 1 -# Don't allow Convert = 0 -allow_convert = 0 - -# here u can enter the symbols allowed in accountnames (additional to -# alphanumerical symbals which are always accepted). please note that -# it is absolutly mandatory that u set up the same symbols here as in -# bnetd.conf or else u wont be able to play D2 with some characters -# (those whose symbols are allowed in bnetd.conf but not here) -# same warnings as in bnetd.conf apply here - be warned - and just -# change something if you know what you are doing -#default setting is "-_[]" -account_allowed_symbols = "-_[]" - -# # -################################################################################# - -################################################################################# -# Message logs # -#-------------------------------------------------------------------------------# -# Multiple log levels can be defined by connecting them with a comma (,) -# Available loglevels are: -# none -# trace -# debug -# info -# warn -# error -# fatal -#loglevels = fatal,error,warn,info -loglevels = fatal,error,warn,info,debug,trace - -# # -################################################################################# - -################################################################################# -# File and Path section # -# Use absolute paths in these lines to avoid problems! # -#-------------------------------------------------------------------------------# -# # -logfile = /usr/local/var/d2cs.log -charsavedir = /usr/local/var/charsave -charinfodir = /usr/local/var/charinfo -bak_charsavedir = /usr/local/var/bak/charsave -bak_charinfodir = /usr/local/var/bak/charinfo -ladderdir = /usr/local/var/ladders -newbiefile = /usr/local/var/files/newbie.save -transfile = /usr/local/etc/address_translation.conf -# # -################################################################################# - -################################################################################# -# Misc # -#-------------------------------------------------------------------------------# -# # -# Message Of The Day, support hexcode -motd = "Tips: How to use color in your profile(Right click on your portrait to open pr ofile editing). Use \\\\xffc as Prefix (\\\\xff means ascii code 0xff,but you should use copy/paste trick to in put it, c means character 'c'. Color also works in game chat,but have input limit). Then append the Color chara cter list below: \\xffc0White '0' \\xffc1Red '1' \\xffc2Green '2' \\xffc3Blue '3' \\xffc4Gold '4' \\xffc5Gray '5' Black '6' \\xffc7DarkYellow '7' \\xffc8Orange '8' \\xffc9Yellow '9' \\xffc:DarkGreen ':' \\xffc;Purple ';' \\xffc/src) and run configure. You will need to provide configure with -your custom options, ex. - -./configure --prefix= - -It will configure the source distribution to compile and install in the -location. - -Check using ./configure --help for all available options. - -3. Compile and install PvPGN using - -$ make -$ make install - -WARNING !! make install it will also overwrite the configuration files. Make a -backup of them before doing "make install" (read more about this in the UPDATE -file). - -Now you just need to edit the config files and adjust them acording to your -system. Have fun! - -4. (only for binary PvPGN distributions) -Depending on the type of package you have obtained (ex RPM, deb, tgz) you will -have to install the package using the right package tool. - -Examples: - -$ rpm -ivh pvpgn-.rpm - -or - -$ installpkg pvpgn-.tgz - -or - -$ dpkg -i pvpgn-.deb - -After you install the binary package you will need to adjust PvPGN configuration -files (usually installed in /etc/pvpgn dir). Have fun! diff --git a/d2pack109/docs/Service.Win32.txt b/d2pack109/docs/Service.Win32.txt deleted file mode 100644 index cbb0a14..0000000 --- a/d2pack109/docs/Service.Win32.txt +++ /dev/null @@ -1,5 +0,0 @@ -To Install: -run the install.bat in the main dir - -To Uninstall: -run the uninstall.bat in the main dir \ No newline at end of file diff --git a/d2pack109/src/Makefile.in b/d2pack109/src/Makefile.in deleted file mode 100644 index d83fddb..0000000 --- a/d2pack109/src/Makefile.in +++ /dev/null @@ -1,348 +0,0 @@ -# -# Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com) -# Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -mandir = @mandir@ -confdir = @sysconfdir@ -sharedir = @localstatedir@ -filesdir = @localstatedir@/files -charinfodir = @localstatedir@/charinfo -charsavedir = @localstatedir@/charsave -ladderdir = @localstatedir@/ladders -statusdir = @localstatedir@/status -bak_charsavedir = @localstatedir@/bak/charsave -bak_charinfodir = @localstatedir@/bak/charinfo - -SRC_SRCDIR = @srcdir@ -SRC_SBINDIR = @srcdir@/../sbin -SRC_MANDIR = @srcdir@/../man -SRC_CONFDIR = @srcdir@/../conf -SRC_SHAREDIR = @srcdir@/../files -SRC_SCRIPTDIR = @srcdir@/../scripts - -SRC_ACDIR = ${SRC_SRCDIR}/autoconf -SRC_D2CSDIR = ${SRC_SRCDIR}/d2cs -SRC_D2DBSDIR = ${SRC_SRCDIR}/d2dbs -SRC_COMMONDIR = ${SRC_SRCDIR}/common -SRC_COMPATDIR = ${SRC_SRCDIR}/compat - -RMF = rm -f - -RMDIR = rmdir - -ECHO = echo - -SED = sed - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_DIRS = @INSTALL@ -d -m 755 - -# CC set by configure -# CFLAGS set by configure -CPPFLAGS = @DEFS@ @DEFINES@ -DD2CS_DEFAULT_CONF_FILE=\"${confdir}/d2cs.conf\" -DD2DBS_DEFAULT_CONF_FILE=\"${confdir}/d2dbs.conf\" -I"${SRC_SRCDIR}" @CPPFLAGS@ -COMPILE = @CC@ @CFLAGS@ ${CPPFLAGS} -fno-strict-aliasing -c -#PREPROCESS = @CPP@ ${CPPFLAGS} -LINK = @CC@ @CFLAGS@ @LDFLAGS@ -LINK_LIBS = @LIBS@ - -PARTS = common compat d2cs d2dbs - -d2cs_SBIN = ${SRC_SBINDIR}/d2cs -d2cs_CONFS = d2cs.conf address_translation.conf -d2cs_OBJECTS = ${SRC_D2CSDIR}/main.o \ -${SRC_D2CSDIR}/d2gs.o \ -${SRC_D2CSDIR}/handle_d2gs.o \ -${SRC_D2CSDIR}/serverqueue.o \ -${SRC_D2CSDIR}/connection.o \ -${SRC_D2CSDIR}/game.o \ -${SRC_D2CSDIR}/server.o \ -${SRC_D2CSDIR}/handle_init.o \ -${SRC_D2CSDIR}/handle_d2cs.o \ -${SRC_D2CSDIR}/d2charfile.o \ -${SRC_D2CSDIR}/d2charlist.o \ -${SRC_D2CSDIR}/xstring.o \ -${SRC_D2CSDIR}/gamequeue.o \ -${SRC_D2CSDIR}/conf.o \ -${SRC_D2CSDIR}/prefs.o \ -${SRC_D2CSDIR}/cmdline_parse.o \ -${SRC_D2CSDIR}/bnetd.o \ -${SRC_D2CSDIR}/handle_bnetd.o \ -${SRC_D2CSDIR}/s2s.o \ -${SRC_D2CSDIR}/net.o \ -${SRC_D2CSDIR}/d2ladder.o \ -${SRC_D2CSDIR}/handle_signal.o \ -${SRC_COMMONDIR}/hashtable.o \ -${SRC_COMMONDIR}/hexdump.o \ -${SRC_COMMONDIR}/eventlog.o \ -${SRC_COMMONDIR}/list.o \ -${SRC_COMMONDIR}/packet.o \ -${SRC_COMMONDIR}/bn_type.o \ -${SRC_COMMONDIR}/addr.o \ -${SRC_COMMONDIR}/util.o \ -${SRC_COMMONDIR}/queue.o \ -${SRC_COMMONDIR}/network.o \ -${SRC_COMMONDIR}/fdwatch.o \ -${SRC_COMMONDIR}/fdwatch_select.o \ -${SRC_COMMONDIR}/fdwatch_poll.o \ -${SRC_COMMONDIR}/fdwatch_epoll.o \ -${SRC_COMMONDIR}/fdwatch_kqueue.o \ -${SRC_COMMONDIR}/rlimit.o \ -${SRC_COMMONDIR}/trans.o \ -${SRC_COMMONDIR}/tag.o \ -${SRC_COMMONDIR}/xalloc.o \ -${SRC_COMPATDIR}/inet_aton.o \ -${SRC_COMPATDIR}/inet_ntoa.o \ -${SRC_COMPATDIR}/strdup.o \ -${SRC_COMPATDIR}/strerror.o \ -${SRC_COMPATDIR}/strtoul.o \ -${SRC_COMPATDIR}/strftime.o \ -${SRC_COMPATDIR}/strcasecmp.o \ -${SRC_COMPATDIR}/strncasecmp.o \ -${SRC_COMPATDIR}/strsep.o \ -${SRC_COMPATDIR}/psock.o \ -${SRC_COMPATDIR}/uname.o \ -${SRC_COMPATDIR}/gettimeofday.o \ -${SRC_COMPATDIR}/difftime.o \ -${SRC_COMPATDIR}/pdir.o \ -${SRC_COMPATDIR}/memset.o \ -${SRC_COMPATDIR}/memcpy.o \ -${SRC_COMPATDIR}/memmove.o - -d2dbs_SBIN = ${SRC_SBINDIR}/d2dbs -d2dbs_CONFS = d2dbs.conf -d2dbs_OBJECTS = ${SRC_D2DBSDIR}/main.o \ -${SRC_D2DBSDIR}/charlock.o \ -${SRC_D2DBSDIR}/d2ladder.o \ -${SRC_D2DBSDIR}/dbserver.o \ -${SRC_D2DBSDIR}/dbspacket.o \ -${SRC_D2DBSDIR}/cmdline_parse.o \ -${SRC_D2DBSDIR}/prefs.o \ -${SRC_D2DBSDIR}/handle_signal.o \ -${SRC_D2DBSDIR}/dbsdupecheck.o \ -${SRC_D2CSDIR}/conf.o \ -${SRC_D2CSDIR}/xstring.o \ -${SRC_COMMONDIR}/list.o \ -${SRC_COMMONDIR}/eventlog.o \ -${SRC_COMMONDIR}/bn_type.o \ -${SRC_COMMONDIR}/util.o \ -${SRC_COMMONDIR}/addr.o \ -${SRC_COMMONDIR}/fdwatch.o \ -${SRC_COMMONDIR}/fdwatch_select.o \ -${SRC_COMMONDIR}/fdwatch_poll.o \ -${SRC_COMMONDIR}/fdwatch_epoll.o \ -${SRC_COMMONDIR}/fdwatch_kqueue.o \ -${SRC_COMMONDIR}/rlimit.o \ -${SRC_COMMONDIR}/tag.o \ -${SRC_COMMONDIR}/xalloc.o \ -${SRC_COMPATDIR}/psock.o \ -${SRC_COMPATDIR}/strerror.o \ -${SRC_COMPATDIR}/strsep.o - -OBJECTS = ${d2cs_OBJECTS} ${d2dbs_OBJECTS} -SBINS = ${d2cs_SBIN} ${d2dbs_SBIN} - -CONFS = ${d2cs_CONFS} ${d2dbs_CONFS} - -SHARES = newbie.save - -OTHERRM = ${SRC_ACDIR}/ansi2knr ${SRC_ACDIR}/ansi2knr.o @ANSI2KNR_TMP@ -DIRS = ${SRC_SBINDIR} - -.PHONY: all -all: .dep @ANSI2KNR_DEP@ config ${SBINS} ${SRC_CONFDIR}/d2cs.conf ${SRC_CONFDIR}/d2dbs.conf - -.PHONY: clean -clean: - -${RMF} core - -${RMF} ${OBJECTS} - -${RMF} ${SBINS} - -${RMF} ${OTHERRM} - -.PHONY: distclean -distclean: clean - -${RMF} ${SRC_CONFDIR}/d2cs.conf - -${RMF} ${SRC_CONFDIR}/d2dbs.conf - -${RMF} ${SRC_SRCDIR}/config.cache ${SRC_SRCDIR}/config.log - -${RMF} ${SRC_SRCDIR}/config.status - -${RMF} ${SRC_SRCDIR}/Makefile ${SRC_SRCDIR}/config.h - -${RMDIR} ${DIRS} - -.PHONY: cvsclean -cvsclean: distclean - -${RMF} ${SRC_SRCDIR}/configure ${SRC_SRCDIR}/config.h.in - -.PHONY: clean-compile -clean-compile: clean all - -.PHONY: config -config: .dep ${SRC_SRCDIR}/Makefile ${SRC_SRCDIR}/config.h - -${SRC_SRCDIR}/configure: ${SRC_SRCDIR}/configure.in - @${ECHO} "The configure script is out of date; rebuilding..." - cd ${SRC_SRCDIR} && autoconf - @${ECHO} >> ${SRC_SRCDIR}/config.h.in - @${ECHO} >> $@ - -${SRC_SRCDIR}/config.h.in: ${SRC_SRCDIR}/configure.in - @${ECHO} "The config.h.in header is out of date; rebuilding..." - cd ${SRC_SRCDIR} && autoheader - @${ECHO} >> $@ - @${ECHO} >> ${SRC_SRCDIR}/configure - -${SRC_SRCDIR}/config.status: ${SRC_SRCDIR}/configure - @${ECHO} "The config.status script is out of date; rechecking..." - ${SRC_SRCDIR}/config.status --recheck - @${ECHO} >> $@ - -${SRC_SRCDIR}/config.h: ${SRC_SRCDIR}/config.h.in ${SRC_SRCDIR}/config.status - @${ECHO} "The config.h header is out of date; rewriting..." - ${SRC_SRCDIR}/config.status - @${ECHO} >> ${SRC_SRCDIR}/Makefile - @${ECHO} >> $@ - -${SRC_SRCDIR}/Makefile: ${SRC_SRCDIR}/Makefile.in ${SRC_SRCDIR}/config.status - @${ECHO} "The Makefile is out of date; rewriting..." - ${SRC_SRCDIR}/config.status - @${ECHO} >> ${SRC_SRCDIR}/config.h - @${ECHO} >> $@ - -${SRC_SBINDIR}: - ${INSTALL_DIRS} $@ - -.PHONY: install -install: .dep install-sbin install-conf install-share - -.PHONY: install-sbin -install-sbin: ${SBINS} - ${INSTALL_DIRS} ${DESTDIR}/${sbindir} - @list='${SBINS}'; for p in $$list; do \ - if test -f $$p; then \ - ${ECHO} " ${INSTALL_PROGRAM} $$p ${DESTDIR}/${sbindir}"; \ - ${INSTALL_PROGRAM} $$p ${DESTDIR}/${sbindir}; \ - else :; fi; \ - done - -.PHONY: install-conf -install-conf: ${SRC_CONFDIR}/d2cs.conf ${SRC_CONFDIR}/d2dbs.conf - ${INSTALL_DIRS} ${DESTDIR}/${confdir} - @list='${CONFS}'; for p in $$list; do \ - if test -f ${SRC_CONFDIR}/$$p; then \ - ${ECHO} " ${INSTALL_DATA} ${SRC_CONFDIR}/$$p ${DESTDIR}/${confdir}"; \ - ${INSTALL_DATA} ${SRC_CONFDIR}/$$p ${DESTDIR}/${confdir}; \ - else :; fi; \ - done - -.PHONY: install-share -install-share: - ${INSTALL_DIRS} ${DESTDIR}/${sharedir} ${DESTDIR}/${filesdir} \ - ${DESTDIR}/${charinfodir} ${DESTDIR}/${charsavedir} ${DESTDIR}/${bak_charsavedir} \ - ${DESTDIR}/${bak_charinfodir} ${DESTDIR}/${ladderdir} ${DESTDIR}/${statusdir} - @list='${SHARES}'; for p in $$list; do \ - if test -f ${SRC_SHAREDIR}/$$p; then \ - ${ECHO} " ${INSTALL_DATA} ${SRC_SHAREDIR}/$$p ${DESTDIR}/${filesdir}"; \ - ${INSTALL_DATA} ${SRC_SHAREDIR}/$$p ${DESTDIR}/${filesdir}; \ - else :; fi; \ - done - -.PHONY: uninstall -uninstall: uninstall-sbin uninstall-conf uninstall-share - -.PHONY: uninstall-sbin -uninstall-sbin: - @list='${SBINS}'; for p in $$list; do \ - ${ECHO} " ${RMF} ${sbindir}/$$p"; \ - ${RMF} ${sbindir}/$$p; \ - done - -.PHONY: uninstall-conf -uninstall-conf: - @list='${CONFS}'; for p in $$list; do \ - ${ECHO} " ${RMF} ${confdir}/$$p"; \ - ${RMF} ${confdir}/$$p; \ - done - -.PHONY: uninstall-share -uninstall-share: - @list='${SHARES}'; for p in $$list; do \ - ${ECHO} " ${RMF} ${sharedir}/$$p"; \ - ${RMF} ${sharedir}/$$p; \ - done - -${SRC_CONFDIR}/d2cs.conf: ${SRC_CONFDIR}/d2cs.conf.in ${SRC_SRCDIR}/config.status - @${RMF} $@ - ${SED} -e "s@/usr/local/var/@${sharedir}/@g" -e "s@/usr/local/etc/@${confdir}/@g" ${SRC_CONFDIR}/d2cs.conf.in > $@ - -${SRC_CONFDIR}/d2dbs.conf: ${SRC_CONFDIR}/d2dbs.conf.in ${SRC_SRCDIR}/config.status - @${RMF} $@ - ${SED} -e "s@/usr/local/var/@${sharedir}/@g" -e "s@/usr/local/etc/@${confdir}/@g" ${SRC_CONFDIR}/d2dbs.conf.in > $@ - -${SRC_ACDIR}/ansi2knr: ${SRC_ACDIR}/ansi2knr.o - @${RMF} $@ - ${LINK} ${SRC_ACDIR}/ansi2knr.o ${LINK_LIBS} -o $@ - -${SRC_ACDIR}/ansi2knr.o: ${SRC_ACDIR}/ansi2knr.c - @${RMF} $@ - ${COMPILE} ${SRC_ACDIR}/ansi2knr.c -o $@ - -SHOWHEADER: - @echo - @echo "Using compile command: ${COMPILE}" - @echo - -.c.o: SHOWHEADER - @${RMF} $@ - @echo "Compiling $*.c" - @@COMPILEANSI1@ - @@COMPILEANSI2@ - @@COMPILEANSI3@ - -.dep: - ${MAKE} dep - -dep: - @${RMF} .dep - @for a in ${PARTS}; do \ - echo Dependency check: $$a; \ - ${COMPILE} -MM `ls $$a/*.c` | sed -e "s@\(.*\)\.o:\(.*\)@$$a\/\1\.o:\2@g" 1>>.dep; \ - done - -${d2cs_SBIN}: SHOWHEADER ${d2cs_OBJECTS} - @${INSTALL_DIRS} ${SRC_SBINDIR} - @${RMF} $@ - ${LINK} ${d2cs_OBJECTS} ${LINK_LIBS} -o $@ - -${d2dbs_SBIN}: SHOWHEADER ${d2dbs_OBJECTS} - @${INSTALL_DIRS} ${SRC_SBINDIR} - @${RMF} $@ - ${LINK} ${d2dbs_OBJECTS} ${LINK_LIBS} -o $@ - -ifneq ($(wildcard .dep),) -include .dep -endif - -# Tell versions (3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/d2pack109/src/autoconf/ansi2knr.c b/d2pack109/src/autoconf/ansi2knr.c deleted file mode 100644 index 1ef66bf..0000000 --- a/d2pack109/src/autoconf/ansi2knr.c +++ /dev/null @@ -1,637 +0,0 @@ -/* Copyright (C) 1989, 1997, 1998 Aladdin Enterprises. All rights reserved. */ - -/*$Id: ansi2knr.c,v 1.1.1.1 2004/03/11 18:57:30 dizzy Exp $*/ -/* Convert ANSI C function definitions to K&R ("traditional C") syntax */ - -/* -ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY. No author or distributor accepts responsibility to anyone for the -consequences of using it or for whether it serves any particular purpose or -works at all, unless he says so in writing. Refer to the GNU General Public -License (the "GPL") for full details. - -Everyone is granted permission to copy, modify and redistribute ansi2knr, -but only under the conditions described in the GPL. A copy of this license -is supposed to have been given to you along with ansi2knr so you can know -your rights and responsibilities. It should be in a file named COPYLEFT, -or, if there is no file named COPYLEFT, a file named COPYING. Among other -things, the copyright notice and this notice must be preserved on all -copies. - -We explicitly state here what we believe is already implied by the GPL: if -the ansi2knr program is distributed as a separate set of sources and a -separate executable file which are aggregated on a storage medium together -with another program, this in itself does not bring the other program under -the GPL, nor does the mere fact that such a program or the procedures for -constructing it invoke the ansi2knr executable bring any other part of the -program under the GPL. -*/ - -/* - * Usage: - ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]] - * --filename provides the file name for the #line directive in the output, - * overriding input_file (if present). - * If no input_file is supplied, input is read from stdin. - * If no output_file is supplied, output goes to stdout. - * There are no error messages. - * - * ansi2knr recognizes function definitions by seeing one or more - * identifiers at the left margin, possibly including function pointer - * types, eventually followed by a left parenthesis with a right - * parenthesis after that and with a left brace as the first token on - * the next line. ansi2knr will recognize a multi-line header provided - * that no intervening line ends with a left or right brace or a - * semicolon. These algorithms ignore whitespace and comments. - * The following constructs will confuse it: - * - Any other construct that starts at the left margin and - * follows the above syntax (such as a macro or function call). - * - Some macros that tinker with the syntax of the function header. - */ - -/* - * The original and principal author of ansi2knr is L. Peter Deutsch - * . Other authors are noted in the change history - * that follows (in reverse chronological order): - rac 2000-08-02 modified to not force the return values to be - on the preceding line, to transform prototypes, to - remove the "void" single parameter restriction, and to - handle function pointers with ANSI style parameters. - lpd 1998-11-09 added further hack to recognize identifier(void) - as being a procedure - lpd 1998-10-23 added hack to recognize lines consisting of - identifier1(identifier2) as *not* being procedures - lpd 1997-12-08 made input_file optional; only closes input and/or - output file if not stdin or stdout respectively; prints - usage message on stderr rather than stdout; adds - --filename switch (changes suggested by - ) - lpd 1996-01-21 added code to cope with not HAVE_CONFIG_H and with - compilers that don't understand void, as suggested by - Tom Lane - lpd 1996-01-15 changed to require that the first non-comment token - on the line following a function header be a left brace, - to reduce sensitivity to macros, as suggested by Tom Lane - - lpd 1995-06-22 removed #ifndefs whose sole purpose was to define - undefined preprocessor symbols as 0; changed all #ifdefs - for configuration symbols to #ifs - lpd 1995-04-05 changed copyright notice to make it clear that - including ansi2knr in a program does not bring the entire - program under the GPL - lpd 1994-12-18 added conditionals for systems where ctype macros - don't handle 8-bit characters properly, suggested by - Francois Pinard ; - removed --varargs switch (this is now the default) - lpd 1994-10-10 removed CONFIG_BROKETS conditional - lpd 1994-07-16 added some conditionals to help GNU `configure', - suggested by Francois Pinard ; - properly erase prototype args in function parameters, - contributed by Jim Avera ; - correct error in writeblanks (it shouldn't erase EOLs) - lpd 1989-xx-xx original version - */ - -/* Most of the conditionals here are to make ansi2knr work with */ -/* or without the GNU configure machinery. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include - -#if HAVE_CONFIG_H - -/* - For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h). - This will define HAVE_CONFIG_H and so, activate the following lines. - */ - -# if STDC_HEADERS || HAVE_STRING_H -# include -# else -# include -# endif - -#else /* not HAVE_CONFIG_H */ - -/* Otherwise do it the hard way */ - -# ifdef BSD -# include -# else -# ifdef VMS - extern int strlen(), strncmp(); -# else -# include -# endif -# endif - -#endif /* not HAVE_CONFIG_H */ - -#if STDC_HEADERS -# include -#else -/* - malloc and free should be declared in stdlib.h, - but if you've got a K&R compiler, they probably aren't. - */ -# ifdef MSDOS -# include -# else -# ifdef VMS - extern char *malloc(); - extern void free(); -# else - extern char *malloc(); - extern int free(); -# endif -# endif - -#endif - -/* - * The ctype macros don't always handle 8-bit characters correctly. - * Compensate for this here. - */ -#ifdef isascii -# undef HAVE_ISASCII /* just in case */ -# define HAVE_ISASCII 1 -#else -#endif -#if STDC_HEADERS || !HAVE_ISASCII -# define is_ascii(c) 1 -#else -# define is_ascii(c) isascii(c) -#endif - -#define is_space(c) (is_ascii(c) && isspace(c)) -#define is_alpha(c) (is_ascii(c) && isalpha(c)) -#define is_alnum(c) (is_ascii(c) && isalnum(c)) - -/* Scanning macros */ -#define isidchar(ch) (is_alnum(ch) || (ch) == '_') -#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_') - -/* Forward references */ -static char *skipspace(); -static int writeblanks(); -static int test1(); -static int convert1(); - -static char *startfn; -static char *endfn; - -/* The main program */ -int -main(argc, argv) - int argc; - char *argv[]; -{ FILE *in = stdin; - FILE *out = stdout; - char *filename = 0; -#define bufsize 5000 /* arbitrary size */ - char *buf; - char *line; - char *more; - char *usage = - "Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n"; - /* - * In previous versions, ansi2knr recognized a --varargs switch. - * If this switch was supplied, ansi2knr would attempt to convert - * a ... argument to va_alist and va_dcl; if this switch was not - * supplied, ansi2knr would simply drop any such arguments. - * Now, ansi2knr always does this conversion, and we only - * check for this switch for backward compatibility. - */ - int convert_varargs = 1; - - while ( argc > 1 && argv[1][0] == '-' ) { - if ( !strcmp(argv[1], "--varargs") ) { - convert_varargs = 1; - argc--; - argv++; - continue; - } - if ( !strcmp(argv[1], "--filename") && argc > 2 ) { - filename = argv[2]; - argc -= 2; - argv += 2; - continue; - } - fprintf(stderr, "Unrecognized switch: %s\n", argv[1]); - fprintf(stderr, usage); - exit(1); - } - switch ( argc ) - { - default: - fprintf(stderr, usage); - exit(0); - case 3: - out = fopen(argv[2], "w"); - if ( out == NULL ) { - fprintf(stderr, "Cannot open output file %s\n", argv[2]); - exit(1); - } - /* falls through */ - case 2: - in = fopen(argv[1], "r"); - if ( in == NULL ) { - fprintf(stderr, "Cannot open input file %s\n", argv[1]); - exit(1); - } - if ( filename == 0 ) - filename = argv[1]; - /* falls through */ - case 1: - break; - } - if ( filename ) - fprintf(out, "#line 1 \"%s\"\n", filename); - buf = malloc(bufsize); - line = buf; - while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL ) - { -test: line += strlen(line); - switch ( test1(buf) ) - { - case 3: /* a function pointer */ - case 2: /* a function prototype */ - convert1(buf, out, 1, convert_varargs); - break; - case 1: /* a function */ - /* Check for a { at the start of the next line. */ - more = ++line; -f: if ( line >= buf + (bufsize - 1) ) /* overflow check */ - goto wl; - if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL ) - goto wl; - switch ( *skipspace(more, 1) ) - { - case '{': - /* Definitely a function */ - convert1(buf, out, 0, convert_varargs); - fputs(more, out); - break; - case 0: - /* The next line was blank or a comment: */ - /* keep scanning for a non-comment. */ - line += strlen(line); - goto f; - default: - /* buf isn't a function header, but */ - /* more might be. */ - fputs(buf, out); - strcpy(buf, more); - line = buf; - goto test; - } - break; - case -1: /* maybe the start of a function */ - if ( line != buf + (bufsize - 1) ) /* overflow check */ - continue; - /* falls through */ - default: /* not a function */ -wl: fputs(buf, out); - break; - } - line = buf; - } - if ( line != buf ) - fputs(buf, out); - free(buf); - if ( out != stdout ) - fclose(out); - if ( in != stdin ) - fclose(in); - return 0; -} - - -/* Skip over space and comments, in either direction. */ -static char * -skipspace(p, dir) - char *p; - int dir; /* 1 for forward, -1 for backward */ -{ if (*p=='\0') return p; - for ( ; ; ) - { while ( is_space(*p) ) - p += dir; - if ( !(*p == '/' && p[dir] == '*') ) - break; - p += dir; p += dir; - while ( !(*p == '*' && p[dir] == '/') ) - { if ( *p == 0 ) - return p; /* multi-line comment?? */ - p += dir; - } - p += dir; p += dir; - } - return p; -} - -/* - * Write blanks over part of a string. - * Don't overwrite end-of-line characters. - */ -static int -writeblanks(start, end) - char *start; - char *end; -{ char *p; - for ( p = start; p < end; p++ ) - if ( *p != '\r' && *p != '\n' ) - *p = ' '; - return 0; -} - -/* - * Test whether the string in buf is a function definition. - * The string may contain and/or end with a newline. - * Return as follows: - * 0 - definitely not a function definition; - * 1 - definitely a function definition; - * 2 - definitely a function prototype; - * 3 - definitely a function pointer; - * -1 - may be the beginning of a function definition, - * append another line and look again. - */ -static int -test1(buf) - char *buf; -{ char *p; - char *bend; - int contin; - - if ( !isalpha(*buf) ) - return 0; /* no name at left margin */ - bend = skipspace(buf + strlen(buf) - 1, -1); - switch ( *bend ) - { - case ';': contin = 2; break; - case ')': contin = 1; break; - case '{': - case '}': - return 0; /* not a function */ - default: contin = -1; - } - - /* find start and end of function name */ - startfn=buf; - while (*startfn!='\0' && *startfn!='(') - { - startfn++; - startfn = skipspace(startfn, 1); - } - if (*startfn=='\0') - return 0; /* not a function */ - startfn--; - p = startfn; - startfn = skipspace(startfn,-1); - endfn = startfn+1; - while (isidchar(*startfn)) startfn--; - startfn++; - if (startfn>=endfn) - return 0; - - p = skipspace(endfn, 1); -#if 0 -/* v v */ -/* typedef __ssize_t __io_read_ */ -fprintf(stderr,"found %s\n",buf); -fprintf(stderr,"func="); -{ int i; for (i=0; i 0) { - int level = 0; - - for (p = endfn; *p; p = skipspace(p + 1, 1)) - level += (*p == '(' ? 1 : *p == ')' ? -1 : 0); - if (level > 0) - contin = -1; - } - return contin; -} - -/* Convert a recognized function definition or header to K&R syntax. */ -static int -convert1(buf, out, header, convert_varargs) - char *buf; - FILE *out; - int header; /* Boolean */ - int convert_varargs; /* Boolean */ -{ - char *p; - /* - * The breaks table contains pointers to the beginning and end - * of each argument. - */ - char **breaks; - unsigned num_breaks = 2; /* for testing */ - char **btop; - char **bp; - char **ap; - char *vararg = 0; - - for (p=buf; p= btop ) - { /* Filled up break table. */ - /* Allocate a bigger one and start over. */ - free((char *)breaks); - num_breaks <<= 1; - goto top; - } - *bp++ = p; - /* Find the end of the argument */ - for ( ; end == NULL; p++ ) - { switch(*p) - { - case ',': - if ( !level ) end = p; - break; - case '(': - if ( !level ) lp = p; - level++; - break; - case ')': - if ( --level < 0 ) end = p; - else rp = p; - break; - case '/': - p = skipspace(p, 1) - 1; - break; - default: - ; - } - } - /* Erase any embedded function pointer parameters. */ - if ( lp ) - writeblanks(lp + 1, rp); - p--; /* back up over terminator */ - /* Find the name being declared. */ - /* This is complicated because of procedure and */ - /* array modifiers. */ - for ( ; ; ) - { p = skipspace(p - 1, -1); - switch ( *p ) - { - case ']': /* skip array dimension(s) */ - case ')': /* skip procedure args OR name */ - { int level = 1; - while ( level ) - switch ( *--p ) - { - case ']': case ')': level++; break; - case '[': case '(': level--; break; - case '/': p = skipspace(p, -1) + 1; break; - default: ; - } - } - if ( *p == '(' && *skipspace(p + 1, 1) == '*' ) - { /* We found the name of the function pointer */ - while ( !isidfirstchar(*p) ) - p = skipspace(p, 1) + 1; - goto found; - } - break; - default: - goto found; - } - } -found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' ) - { if ( convert_varargs ) - { *bp++ = "va_alist"; - vararg = p-2; - } - else - { p++; - if ( bp == breaks + 1 ) /* sole argument */ - writeblanks(breaks[0], p); - else - writeblanks(bp[-1] - 1, p); - bp--; - } - } - else - { while ( isidchar(*p) ) p--; - *bp++ = p+1; - } - p = end; - } - while ( *p++ == ',' ); - *bp = p; - /* Make a special check for 'void' arglist */ - if ( bp == breaks+2 ) - { p = skipspace(breaks[0], 1); - if ( !strncmp(p, "void", 4) ) - { p = skipspace(p+4, 1); - if ( p == breaks[2] - 1 ) - { bp = breaks; /* yup, pretend arglist is empty */ - writeblanks(breaks[0], p + 1); - } - } - } - /* Put out the function name and left parenthesis. */ - for (p=startfn; p != endfn; p++) putc(*p, out); - /* Put out the declaration. */ - if ( header ) - { fputs(");", out); - for ( p = breaks[0]; *p; p++ ) - if ( *p == '\r' || *p == '\n' ) - putc(*p, out); - } - else - { for ( ap = breaks+1; ap < bp; ap += 2 ) - { p = *ap; - while ( isidchar(*p) ) - putc(*p, out), p++; - if ( ap < bp - 1 ) - fputs(", ", out); - } - fputs(") ", out); - /* Put out the argument declarations */ - for ( ap = breaks+2; ap <= bp; ap += 2 ) - (*ap)[-1] = ';'; - if ( vararg != 0 ) - { *vararg = 0; - fputs(breaks[0], out); /* any prior args */ - fputs("va_dcl", out); /* the final arg */ - fputs(bp[0], out); - } - else - fputs(breaks[0], out); - } - free((char *)breaks); - return 0; -} diff --git a/d2pack109/src/autoconf/ccstdc.m4 b/d2pack109/src/autoconf/ccstdc.m4 deleted file mode 100644 index dfe01fb..0000000 --- a/d2pack109/src/autoconf/ccstdc.m4 +++ /dev/null @@ -1,91 +0,0 @@ -## ----------------------------------------- ## -## ANSIfy the C compiler whenever possible. ## -## From Franc,ois Pinard ## -## ----------------------------------------- ## - -# serial 1 - -# @defmac AC_PROG_CC_STDC -# @maindex PROG_CC_STDC -# @ovindex CC -# If the C compiler in not in ANSI C mode by default, try to add an option -# to output variable @code{CC} to make it so. This macro tries various -# options that select ANSI C on some system or another. It considers the -# compiler to be in ANSI C mode if it handles function prototypes correctly. -# -# If you use this macro, you should check after calling it whether the C -# compiler has been set to accept ANSI C; if not, the shell variable -# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source -# code in ANSI C, you can make an un-ANSIfied copy of it by using the -# program @code{ansi2knr}, which comes with Ghostscript. -# @end defmac - -AC_DEFUN(AM_PROG_CC_STDC, -[AC_REQUIRE([AC_PROG_CC]) -AC_BEFORE([$0], [AC_C_INLINE]) -AC_BEFORE([$0], [AC_C_CONST]) -dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require -dnl a magic option to avoid problems with ANSI preprocessor commands -dnl like #elif. -dnl FIXME: can't do this because then AC_AIX won't work due to a -dnl circular dependency. -dnl AC_BEFORE([$0], [AC_PROG_CPP]) -AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) -AC_CACHE_VAL(am_cv_prog_cc_stdc, -[am_cv_prog_cc_stdc=no -ac_save_CC="$CC" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - AC_TRY_COMPILE( -[#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -], [ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; -], -[am_cv_prog_cc_stdc="$ac_arg"; break]) -done -CC="$ac_save_CC" -]) -if test -z "$am_cv_prog_cc_stdc"; then - AC_MSG_RESULT([none needed]) -else - AC_MSG_RESULT($am_cv_prog_cc_stdc) -fi -case "x$am_cv_prog_cc_stdc" in - x|xno) ;; - *) CC="$CC $am_cv_prog_cc_stdc" ;; -esac -]) diff --git a/d2pack109/src/autoconf/config.guess b/d2pack109/src/autoconf/config.guess deleted file mode 100644 index d56c46d..0000000 --- a/d2pack109/src/autoconf/config.guess +++ /dev/null @@ -1,1410 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-08-18' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - arc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - pmax:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mipseb-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - wgrisc:OpenBSD:*:*) - echo mipsel-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - if test $UNAME_RELEASE = "V4.0"; then - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - fi - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha*:OpenVMS:*:*) - echo alpha-hp-vms - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - *:UNICOS/mp:*:*) - echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) - # Determine whether the default compiler uses glibc. - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #if __GLIBC__ >= 2 - LIBC=gnu - #else - LIBC= - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - # GNU/FreeBSD systems have a "k" prefix to indicate we are using - # FreeBSD's kernel, but not the complete OS. - case ${LIBC} in gnu) kernel_only='k' ;; esac - echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit 0 ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[567]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - case `uname -p` in - *86) UNAME_PROCESSOR=i686 ;; - powerpc) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/d2pack109/src/autoconf/config.sub b/d2pack109/src/autoconf/config.sub deleted file mode 100644 index 6890099..0000000 --- a/d2pack109/src/autoconf/config.sub +++ /dev/null @@ -1,1508 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. - -timestamp='2003-08-18' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m68000 | m68k | m88k | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | msp430-* \ - | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - mmix*) - basic_machine=mmix-knuth - os=-mmixware - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nv1) - basic_machine=nv1-cray - os=-unicosmp - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/d2pack109/src/autoconf/termios.m4 b/d2pack109/src/autoconf/termios.m4 deleted file mode 100644 index 1eb31d1..0000000 --- a/d2pack109/src/autoconf/termios.m4 +++ /dev/null @@ -1,14 +0,0 @@ -dnl From Jim Meyering. - -# serial 1 - -AC_DEFUN(AM_SYS_POSIX_TERMIOS, -[AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios, - [AC_TRY_LINK([#include -#include -#include ], - [/* SunOS 4.0.3 has termios.h but not the library calls. */ - tcgetattr(0, 0);], - am_cv_sys_posix_termios=yes, - am_cv_sys_posix_termios=no)]) -]) diff --git a/d2pack109/src/autoconf/winsz.m4 b/d2pack109/src/autoconf/winsz.m4 deleted file mode 100644 index fa81c9d..0000000 --- a/d2pack109/src/autoconf/winsz.m4 +++ /dev/null @@ -1,36 +0,0 @@ -dnl From Jim Meyering. - -# serial 1 - -AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL, -[AC_REQUIRE([AM_SYS_POSIX_TERMIOS]) - AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h], - am_cv_sys_tiocgwinsz_needs_sys_ioctl_h, - [am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no - - gwinsz_in_termios_h=no - if test $am_cv_sys_posix_termios = yes; then - AC_EGREP_CPP([yes], - [#include -# include -# ifdef TIOCGWINSZ - yes -# endif - ], gwinsz_in_termios_h=yes) - fi - - if test $gwinsz_in_termios_h = no; then - AC_EGREP_CPP([yes], - [#include -# include -# ifdef TIOCGWINSZ - yes -# endif - ], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes) - fi - ]) - if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then - AC_DEFINE(GWINSZ_IN_SYS_IOCTL,1, - [Define if TIOCGWINSZ requires sys/ioctl.h]) - fi -]) diff --git a/d2pack109/src/autogen.sh b/d2pack109/src/autogen.sh deleted file mode 100755 index 7fe1d2d..0000000 --- a/d2pack109/src/autogen.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -autoconf -autoheader diff --git a/d2pack109/src/common/addr.c b/d2pack109/src/common/addr.c deleted file mode 100644 index b906f3a..0000000 --- a/d2pack109/src/common/addr.c +++ /dev/null @@ -1,626 +0,0 @@ -/* - * Copyright (C) 1999,2000,2001 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#define ADDR_INTERNAL_ACCESS -#include "common/setup_before.h" -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#ifdef HAVE_MEMORY_H -# include -#endif -#include "compat/memset.h" -#include "compat/memcpy.h" -#include "compat/strrchr.h" -#include "compat/strdup.h" -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/socket.h" -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#ifdef HAVE_ARPA_INET_H -# include -#endif -#include "compat/inet_aton.h" -#include "compat/inet_ntoa.h" -#ifdef HAVE_NETDB_H -# include -#endif -#ifdef HAVE_ASSERT_H -# include -#endif -#include "compat/psock.h" -#include "common/eventlog.h" -#include "common/list.h" -#include "common/util.h" -#include "common/xalloc.h" -#include "common/addr.h" -#include "common/setup_after.h" - - -static char const * netaddr_num_to_addr_str(unsigned int netipaddr, unsigned int netmask); - - -#define HACK_SIZE 4 - -/* both arguments are in host byte order */ -extern char const * addr_num_to_addr_str(unsigned int ipaddr, unsigned short port) -{ - static unsigned int curr=0; - static char temp[HACK_SIZE][64]; - struct sockaddr_in tsa; - - curr = (curr+1)%HACK_SIZE; - - memset(&tsa,0,sizeof(tsa)); - tsa.sin_family = PSOCK_AF_INET; - tsa.sin_port = htons((unsigned short)0); - tsa.sin_addr.s_addr = htonl(ipaddr); - sprintf(temp[curr],"%.32s:%hu",inet_ntoa(tsa.sin_addr),port); - - return temp[curr]; -} - - -/* ipaddr is in host byte order */ -extern char const * addr_num_to_ip_str(unsigned int ipaddr) -{ - static unsigned int curr=0; - static char temp[HACK_SIZE][64]; - struct sockaddr_in tsa; - - curr = (curr+1)%HACK_SIZE; - - memset(&tsa,0,sizeof(tsa)); - tsa.sin_family = PSOCK_AF_INET; - tsa.sin_port = htons((unsigned short)0); - tsa.sin_addr.s_addr = htonl(ipaddr); - sprintf(temp[curr],"%.32s",inet_ntoa(tsa.sin_addr)); - - return temp[curr]; -} - - -static char const * netaddr_num_to_addr_str(unsigned int netipaddr, unsigned int netmask) -{ - static unsigned int curr=0; - static char temp[HACK_SIZE][64]; - struct sockaddr_in tsa; - - curr = (curr+1)%HACK_SIZE; - - memset(&tsa,0,sizeof(tsa)); - tsa.sin_family = PSOCK_AF_INET; - tsa.sin_port = htons((unsigned short)0); - tsa.sin_addr.s_addr = htonl(netipaddr); - sprintf(temp[curr],"%.32s/0x%08x",inet_ntoa(tsa.sin_addr),netmask); - - return temp[curr]; -} - - - -extern char const * host_lookup(char const * hoststr, unsigned int * ipaddr) -{ - struct sockaddr_in tsa; -#ifdef HAVE_GETHOSTBYNAME - struct hostent * hp; -#endif - - if (!hoststr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hoststr"); - return NULL; - } - if (!ipaddr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL ipaddr"); - return NULL; - } - - memset(&tsa,0,sizeof(tsa)); - tsa.sin_family = PSOCK_AF_INET; - tsa.sin_port = htons(0); - -#ifdef HAVE_GETHOSTBYNAME -#ifdef WIN32 - psock_init(); -#endif - hp = gethostbyname(hoststr); - if (!hp || !hp->h_addr_list) -#endif - { - if (inet_aton(hoststr,&tsa.sin_addr)) - { - *ipaddr = ntohl(tsa.sin_addr.s_addr); - return hoststr; /* We could call gethostbyaddr() on tsa to try and get the - official hostname but most systems would have already found - it when sending a dotted-quad to gethostbyname(). This is - good enough when that fails. */ - } - eventlog(eventlog_level_error,__FUNCTION__,"could not lookup host \"%s\"",hoststr); - return NULL; - } - -#ifdef HAVE_GETHOSTBYNAME - memcpy(&tsa.sin_addr,(void *)hp->h_addr_list[0],sizeof(struct in_addr)); /* avoid warning */ - *ipaddr = ntohl(tsa.sin_addr.s_addr); - if (hp->h_name) - return hp->h_name; - return hoststr; -#endif -} - - -extern t_addr * addr_create_num(unsigned int ipaddr, unsigned short port) -{ - t_addr * temp; - - temp = xmalloc(sizeof(t_addr)); - temp->str = xstrdup(addr_num_to_addr_str(ipaddr,port)); - temp->str = NULL; - temp->ip = ipaddr; - temp->port = port; - temp->data.p = NULL; - - return temp; -} - - -extern t_addr * addr_create_str(char const * str, unsigned int defipaddr, unsigned short defport) -{ - char * tstr; - t_addr * temp; - unsigned int ipaddr; - unsigned short port; - char const * hoststr; - char * portstr; - char const * hostname; - - if (!str) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL str"); - return NULL; - } - - tstr = xstrdup(str); - - if ((portstr = strrchr(tstr,':'))) - { - char * protstr; - - *portstr = '\0'; - portstr++; - - if ((protstr = strrchr(portstr,'/'))) - { - *protstr = '\0'; - protstr++; - } - - if (portstr[0]!='\0') - { - if (str_to_ushort(portstr,&port)<0) - { -#ifdef HAVE_GETSERVBYNAME - struct servent * sp; - - if (!(sp = getservbyname(portstr,protstr?protstr:"tcp"))) -#endif - { - eventlog(eventlog_level_error,__FUNCTION__,"could not convert \"%s\" to a port number",portstr); - xfree(tstr); - return NULL; - } -#ifdef HAVE_GETSERVBYNAME - port = ntohs(sp->s_port); -#endif - } - } - else - port = defport; - } - else - port = defport; - - if (tstr[0]!='\0') - hoststr = tstr; - else - { - struct sockaddr_in tsa; - - tsa.sin_addr.s_addr = htonl(defipaddr); - hoststr = inet_ntoa(tsa.sin_addr); - } - - if (!(hostname = host_lookup(hoststr,&ipaddr))) - { - eventlog(eventlog_level_error,__FUNCTION__,"could not lookup host \"%s\"",hoststr); - xfree(tstr); - return NULL; - } - - temp = xmalloc(sizeof(t_addr)); - temp->str = xstrdup(hostname); - xfree(tstr); - - temp->ip = ipaddr; - temp->port = port; - temp->data.p = NULL; - - return temp; -} - - -extern int addr_destroy(t_addr const * addr) -{ - if (!addr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr"); - return -1; - } - - if (addr->str) - xfree((void *)addr->str); /* avoid warning */ - xfree((void *)addr); /* avoid warning */ - - return 0; -} - - -/* hostname or IP */ -extern char * addr_get_host_str(t_addr const * addr, char * str, unsigned int len) -{ - if (!addr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr"); - return NULL; - } - if (!str) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL str"); - return NULL; - } - if (len<2) - { - eventlog(eventlog_level_error,__FUNCTION__,"str too short"); - return NULL; - } - - if (!addr->str) - { - eventlog(eventlog_level_error,__FUNCTION__,"addr has NULL str"); - return NULL; - } - - strncpy(str,addr->str,len-1); - str[len-1] = '\0'; - - return str; -} - - -/* IP:port */ -extern char * addr_get_addr_str(t_addr const * addr, char * str, unsigned int len) -{ - if (!addr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr"); - return NULL; - } - if (!str) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL str"); - return NULL; - } - if (len<2) - { - eventlog(eventlog_level_error,__FUNCTION__,"str too short"); - return NULL; - } - - strncpy(str,addr_num_to_addr_str(addr->ip,addr->port),len-1); - str[len-1] = '\0'; - - return str; -} - - -extern unsigned int addr_get_ip(t_addr const * addr) -{ - if (!addr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr"); - return 0; - } - - return addr->ip; -} - - -extern unsigned short addr_get_port(t_addr const * addr) -{ - if (!addr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr"); - return 0; - } - - return addr->port; -} - - -extern int addr_set_data(t_addr * addr, t_addr_data data) -{ - if (!addr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr"); - return -1; - } - - addr->data = data; - return 0; -} - - -extern t_addr_data addr_get_data(t_addr const * addr) -{ - t_addr_data tdata; - - if (!addr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL addr"); - tdata.p = NULL; - return tdata; - } - - return addr->data; -} - - -extern t_netaddr * netaddr_create_str(char const * netstr) -{ - t_netaddr * netaddr; - char * temp; - char const * netipstr; - char const * netmaskstr; - unsigned int netip; - unsigned int netmask; - - if (!netstr) - { - eventlog(eventlog_level_error,__FUNCTION__,"unable to allocate memory for netaddr"); - return NULL; - } - - temp = xstrdup(netstr); - if (!(netipstr = strtok(temp,"/"))) - { - xfree(temp); - return NULL; - } - if (!(netmaskstr = strtok(NULL,"/"))) - { - xfree(temp); - return NULL; - } - - netaddr = xmalloc(sizeof(t_netaddr)); - - /* FIXME: call getnetbyname() first, then host_lookup() */ - if (!host_lookup(netipstr,&netip)) - { - eventlog(eventlog_level_error,__FUNCTION__,"could not lookup net"); - xfree(netaddr); - xfree(temp); - return NULL; - } - netaddr->ip = netip; - - if (str_to_uint(netmaskstr,&netmask)<0) - { - struct sockaddr_in tsa; - - if (inet_aton(netmaskstr,&tsa.sin_addr)) - netmask = ntohl(tsa.sin_addr.s_addr); - else - { - eventlog(eventlog_level_error,__FUNCTION__,"could not convert mask"); - xfree(netaddr); - xfree(temp); - return NULL; - } - } - else - { - if (netmask>32) - { - eventlog(eventlog_level_error,__FUNCTION__,"network bits must be less than or equal to 32 (%u)",netmask); - xfree(netaddr); - xfree(temp); - return NULL; - } - /* for example, 8 -> 11111111000000000000000000000000 */ - if (netmask!=0) - netmask = ~((1<<(32-netmask))-1); - } - netaddr->mask = netmask; - - xfree(temp); // [zap-zero] 20020731 - (hopefully) fixed memory leak - - return netaddr; -} - - -extern int netaddr_destroy(t_netaddr const * netaddr) -{ - if (!netaddr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL netaddr"); - return -1; - } - - xfree((void *)netaddr); /* avoid warning */ - - return 0; -} - - -extern char * netaddr_get_addr_str(t_netaddr const * netaddr, char * str, unsigned int len) -{ - if (!netaddr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL netaddr"); - return NULL; - } - if (!str) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL str"); - return NULL; - } - if (len<2) - { - eventlog(eventlog_level_error,__FUNCTION__,"str too short"); - return NULL; - } - - strncpy(str,netaddr_num_to_addr_str(netaddr->ip,netaddr->mask),len-1); /* FIXME: format nicely with x.x.x.x/bitcount */ - str[len-1] = '\0'; - - return str; -} - - -extern int netaddr_contains_addr_num(t_netaddr const * netaddr, unsigned int ipaddr) -{ - if (!netaddr) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL netaddr"); - return -1; - } - - return (ipaddr&netaddr->mask)==netaddr->ip; -} - - -extern int addrlist_append(t_addrlist * addrlist, char const * str, unsigned int defipaddr, unsigned short defport) -{ - t_addr * addr; - char * tstr; - char * tok; - - assert(addrlist != NULL); - - if (!str) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL str"); - return -1; - } - - tstr = xstrdup(str); - for (tok=strtok(tstr,","); tok; tok=strtok(NULL,",")) /* strtok modifies the string it is passed */ - { - if (!(addr = addr_create_str(tok,defipaddr,defport))) - { - eventlog(eventlog_level_error,__FUNCTION__,"could not create addr"); - xfree(tstr); - return -1; - } - list_append_data(addrlist,addr); - } - - xfree(tstr); - - return 0; -} - -extern t_addrlist * addrlist_create(char const * str, unsigned int defipaddr, unsigned short defport) -{ - t_addrlist * addrlist; - - if (!str) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL str"); - return NULL; - } - - addrlist = list_create(); - - if (addrlist_append(addrlist,str,defipaddr,defport)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"could not append to newly created addrlist"); - list_destroy(addrlist); - return NULL; - } - - return addrlist; -} - -extern int addrlist_destroy(t_addrlist * addrlist) -{ - t_elem * curr; - t_addr * addr; - - if (!addrlist) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL addrlist"); - return -1; - } - - LIST_TRAVERSE(addrlist,curr) - { - if (!(addr = elem_get_data(curr))) - eventlog(eventlog_level_error,__FUNCTION__,"found NULL addr in list"); - else - addr_destroy(addr); - list_remove_elem(addrlist,&curr); - } - - return list_destroy(addrlist); -} - - -extern int addrlist_get_length(t_addrlist const * addrlist) -{ - return list_get_length(addrlist); -} diff --git a/d2pack109/src/common/addr.h b/d2pack109/src/common/addr.h deleted file mode 100644 index da5f69e..0000000 --- a/d2pack109/src/common/addr.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 1999,2000,2001 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_ADDR_TYPES -#define INCLUDED_ADDR_TYPES - -#ifdef JUST_NEED_TYPES -# include "common/list.h" -#else -# define JUST_NEED_TYPES -# include "common/list.h" -# undef JUST_NEED_TYPES -#endif - -typedef union -{ - unsigned long n; - int i; - void * p; -} t_addr_data; - -typedef struct addr_struct -#ifdef ADDR_INTERNAL_ACCESS -{ - char const * str; /* hostname or ip */ - unsigned int ip; - unsigned int port; - t_addr_data data; /* data argument */ -} -#endif -t_addr; - -typedef struct netaddr_struct -#ifdef ADDR_INTERNAL_ACCESS -{ - unsigned int ip; - unsigned int mask; -} -#endif -t_netaddr; - -typedef t_list t_addrlist; - -#endif - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_ADDR_PROTOS -#define INCLUDED_ADDR_PROTOS - -/* ipaddr and port are in host byte order */ -extern char const * addr_num_to_addr_str(unsigned int ipaddr, unsigned short port); -/* ipaddr is in host byte order */ -extern char const * addr_num_to_ip_str(unsigned int ipaddr); - -extern char const * host_lookup(char const * hoststr, unsigned int * ipaddr); - -/* ipaddr and port are in host byte order */ -extern t_addr * addr_create_num(unsigned int ipaddr, unsigned short port) ; - -/* defipaddr and defport are in host byte order */ -extern t_addr * addr_create_str(char const * str, unsigned int defipaddr, unsigned short defport) ; - -extern int addr_destroy(t_addr const * addr); -extern char * addr_get_host_str(t_addr const * addr, char * str, unsigned int len); -extern char * addr_get_addr_str(t_addr const * addr, char * str, unsigned int len); -/* returned in host byte order */ -extern unsigned int addr_get_ip(t_addr const * addr); -/* returned in host byte order */ -extern unsigned short addr_get_port(t_addr const * addr); -extern int addr_set_data(t_addr * addr, t_addr_data data); -extern t_addr_data addr_get_data(t_addr const * addr); -extern t_netaddr * netaddr_create_str(char const * str) ; -extern int netaddr_destroy(t_netaddr const * netaddr); -extern char * netaddr_get_addr_str(t_netaddr const * netaddr, char * str, unsigned int len); -extern int netaddr_contains_addr_num(t_netaddr const * netaddr, unsigned int ipaddr); - -/* defipaddr and defport are in host byte order */ -extern int addrlist_append(t_addrlist * addrlist, char const * str, unsigned int defipaddr, unsigned short defport); -extern t_addrlist * addrlist_create(char const * str, unsigned int defipaddr, unsigned short defport) ; -extern int addrlist_destroy(t_addrlist * addrlist); -extern int addrlist_get_length(t_addrlist const * addrlist); - -#endif -#endif diff --git a/d2pack109/src/common/bn_type.c b/d2pack109/src/common/bn_type.c deleted file mode 100644 index 59fab41..0000000 --- a/d2pack109/src/common/bn_type.c +++ /dev/null @@ -1,665 +0,0 @@ -/* - * Copyright (C) 1998,1999,2001 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_MEMORY_H -# include -#endif -#include "compat/memcpy.h" -#include "common/eventlog.h" -#include "common/bn_type.h" -#include "common/setup_after.h" - - -/************************************************************/ - - -extern int bn_byte_tag_get(bn_byte const * src, char * dst, unsigned int len) -{ - unsigned int i; - - if (!dst) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst"); - return -1; - } - if (!src) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL src"); - return -1; - } - if (len<1) - { - eventlog(eventlog_level_error,__FUNCTION__,"got zero len"); - return -1; - } - - for (i=0; i> 8) ); - return 0; -} - - -extern int bn_short_nset(bn_short * dst, t_uint16 src) -{ - if (!dst) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst"); - return -1; - } - - (*dst)[0] = (unsigned char)((src>> 8) ); - (*dst)[1] = (unsigned char)((src )&0xff); - return 0; -} - - -extern int bn_int_set(bn_int * dst, t_uint32 src) -{ - if (!dst) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst"); - return -1; - } - - (*dst)[0] = (unsigned char)((src )&0xff); - (*dst)[1] = (unsigned char)((src>> 8)&0xff); - (*dst)[2] = (unsigned char)((src>>16)&0xff); - (*dst)[3] = (unsigned char)((src>>24) ); - return 0; -} - - -extern int bn_int_nset(bn_int * dst, t_uint32 src) -{ - if (!dst) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst"); - return -1; - } - - (*dst)[0] = (unsigned char)((src>>24) ); - (*dst)[1] = (unsigned char)((src>>16)&0xff); - (*dst)[2] = (unsigned char)((src>> 8)&0xff); - (*dst)[3] = (unsigned char)((src )&0xff); - return 0; -} - - -#ifdef HAVE_T_LONG -extern int bn_long_set(bn_long * dst, t_uint64 src) -{ - if (!dst) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst"); - return -1; - } - - (*dst)[0] = (unsigned char)((src )&0xff); - (*dst)[1] = (unsigned char)((src>> 8)&0xff); - (*dst)[2] = (unsigned char)((src>>16)&0xff); - (*dst)[3] = (unsigned char)((src>>24)&0xff); - (*dst)[4] = (unsigned char)((src>>32)&0xff); - (*dst)[5] = (unsigned char)((src>>40)&0xff); - (*dst)[6] = (unsigned char)((src>>48)&0xff); - (*dst)[7] = (unsigned char)((src>>56) ); - return 0; -} - - -extern int bn_long_nset(bn_long * dst, t_uint64 src) -{ - if (!dst) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst"); - return -1; - } - - (*dst)[0] = (unsigned char)((src>>56) ); - (*dst)[1] = (unsigned char)((src>>48)&0xff); - (*dst)[2] = (unsigned char)((src>>40)&0xff); - (*dst)[3] = (unsigned char)((src>>32)&0xff); - (*dst)[4] = (unsigned char)((src>>24)&0xff); - (*dst)[5] = (unsigned char)((src>>16)&0xff); - (*dst)[6] = (unsigned char)((src>> 8)&0xff); - (*dst)[7] = (unsigned char)((src )&0xff); - return 0; -} -#endif - - -extern int bn_long_set_a_b(bn_long * dst, t_uint32 srca, t_uint32 srcb) -{ - if (!dst) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst"); - return -1; - } - - (*dst)[0] = (unsigned char)((srcb )&0xff); - (*dst)[1] = (unsigned char)((srcb>> 8)&0xff); - (*dst)[2] = (unsigned char)((srcb>>16)&0xff); - (*dst)[3] = (unsigned char)((srcb>>24)&0xff); - (*dst)[4] = (unsigned char)((srca )&0xff); - (*dst)[5] = (unsigned char)((srca>> 8)&0xff); - (*dst)[6] = (unsigned char)((srca>>16)&0xff); - (*dst)[7] = (unsigned char)((srca>>24) ); - return 0; -} - - -extern int bn_long_nset_a_b(bn_long * dst, t_uint32 srca, t_uint32 srcb) -{ - if (!dst) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst"); - return -1; - } - - (*dst)[0] = (unsigned char)((srca>>24) ); - (*dst)[1] = (unsigned char)((srca>>16)&0xff); - (*dst)[2] = (unsigned char)((srca>> 8)&0xff); - (*dst)[3] = (unsigned char)((srca )&0xff); - (*dst)[4] = (unsigned char)((srcb>>24)&0xff); - (*dst)[5] = (unsigned char)((srcb>>16)&0xff); - (*dst)[6] = (unsigned char)((srcb>> 8)&0xff); - (*dst)[7] = (unsigned char)((srcb )&0xff); - return 0; -} - - -/************************************************************/ - - -extern int bn_raw_set(void * dst, void const * src, unsigned int len) -{ - if (!dst) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL dst"); - return -1; - } - if (!src) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL src"); - return -1; - } - - memcpy(dst,src,len); - return 0; -} - - -/************************************************************/ - - -extern int bn_byte_tag_eq(bn_byte const src, char const * tag) -{ - bn_byte temp; - - if (!src) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL src"); - return -1; - } - if (!tag) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL tag"); - return -1; - } - - if (bn_byte_tag_set(&temp,tag)<0) - return -1; - if (bn_byte_get(src)==bn_byte_get(temp)) - return 0; - - return -1; -} - - -extern int bn_short_tag_eq(bn_short const src, char const * tag) -{ - bn_short temp; - - if (!src) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL src"); - return -1; - } - if (!tag) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL tag"); - return -1; - } - - if (bn_short_tag_set(&temp,tag)<0) - return -1; - if (bn_short_get(src)==bn_short_get(temp)) - return 0; - - return -1; -} - - -extern int bn_int_tag_eq(bn_int const src, char const * tag) -{ - bn_int temp; - - if (!src) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL src"); - return -1; - } - if (!tag) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL tag"); - return -1; - } - - if (bn_int_tag_set(&temp,tag)<0) - return -1; - if (bn_int_get(src)==bn_int_get(temp)) - return 0; - - return -1; -} - - -extern int bn_long_tag_eq(bn_long const src, char const * tag) -{ - bn_long temp; - - if (!src) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL src"); - return -1; - } - if (!tag) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL tag"); - return -1; - } - - if (bn_long_tag_set(&temp,tag)<0) - return -1; - if (bn_long_get_a(src)==bn_long_get_a(temp) && - bn_long_get_b(src)==bn_long_get_b(temp)) - return 0; - - return -1; -} - - -/************************************************************/ - - -extern int uint32_to_int(t_uint32 num) -{ - if (num<(1UL<<30)) - return (int)num; - return (-(int)((~(num))+1)); -} diff --git a/d2pack109/src/common/bn_type.h b/d2pack109/src/common/bn_type.h deleted file mode 100644 index c706dca..0000000 --- a/d2pack109/src/common/bn_type.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_BN_TYPE_TYPES -#define INCLUDED_BN_TYPE_TYPES - -#ifdef JUST_NEED_TYPES -# include "compat/uint.h" -#else -# define JUST_NEED_TYPES -# include "compat/uint.h" -# undef JUST_NEED_TYPES -#endif - -typedef t_uint8 bn_basic; -typedef bn_basic bn_byte[1]; -typedef bn_basic bn_short[2]; -typedef bn_basic bn_int[4]; -typedef bn_basic bn_long[8]; - -#endif - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_BN_TYPE_PROTOS -#define INCLUDED_BN_TYPE_PROTOS - -#define JUST_NEED_TYPES -# include "compat/uint.h" -#undef JUST_NEED_TYPES - -extern int bn_byte_tag_get(bn_byte const * src, char * dst, unsigned int len); -extern int bn_short_tag_get(bn_short const * src, char * dst, unsigned int len); -extern int bn_int_tag_get(bn_int const * src, char * dst, unsigned int len); -extern int bn_long_tag_get(bn_long const * src, char * dst, unsigned int len); - -extern int bn_byte_tag_set(bn_byte * dst, char const * tag); -extern int bn_short_tag_set(bn_short * dst, char const * tag); -extern int bn_int_tag_set(bn_int * dst, char const * tag); -extern int bn_long_tag_set(bn_long * dst, char const * tag); - -extern t_uint8 bn_byte_get(bn_byte const src) ; -extern t_uint16 bn_short_get(bn_short const src) ; -extern t_uint16 bn_short_nget(bn_short const src) ; -extern t_uint32 bn_int_get(bn_int const src) ; -extern t_uint32 bn_int_nget(bn_int const src) ; -#ifdef HAVE_T_UINT64 -extern t_uint64 bn_long_get(bn_long const src) ; -#endif -extern t_uint32 bn_long_get_a(bn_long const src) ; -extern t_uint32 bn_long_get_b(bn_long const src) ; - -extern int bn_byte_set(bn_byte * dst, t_uint8 src); -extern int bn_short_set(bn_short * dst, t_uint16 src); -extern int bn_short_nset(bn_short * dst, t_uint16 src); -extern int bn_int_set(bn_int * dst, t_uint32 src); -extern int bn_int_nset(bn_int * dst, t_uint32 src); -#ifdef HAVE_T_UINT64 -extern int bn_long_set(bn_long * dst, t_uint64 src); -extern int bn_long_nset(bn_long * dst, t_uint64 src); -#endif -extern int bn_long_set_a_b(bn_long * dst, t_uint32 srca, t_uint32 srcb); -extern int bn_long_nset_a_b(bn_long * dst, t_uint32 srca, t_uint32 srcb); - -extern int bn_raw_set(void * dst, void const * src, unsigned int len); - -extern int bn_byte_tag_eq(bn_byte const src, char const * tag) ; -extern int bn_short_tag_eq(bn_short const src, char const * tag) ; -extern int bn_int_tag_eq(bn_int const src, char const * tag) ; -extern int bn_long_tag_eq(bn_long const src, char const * tag) ; - -extern int uint32_to_int(t_uint32 num); - -#endif -#endif diff --git a/d2pack109/src/common/d2game_protocol.h b/d2pack109/src/common/d2game_protocol.h deleted file mode 100644 index 7092f08..0000000 --- a/d2pack109/src/common/d2game_protocol.h +++ /dev/null @@ -1,551 +0,0 @@ -/* - * Copyright (C) 2000 Otto Chan (kenshin_@hotmail.com) - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * Copyright (C) 2000 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2GAME_PROTOCOL_TYPES -#define INCLUDED_D2GAME_PROTOCOL_TYPES - -#ifdef JUST_NEED_TYPES -# include "bn_type.h" -#else -# define JUST_NEED_TYPES -# include "bn_type.h" -# undef JUST_NEED_TYPES -#endif - - -/* - * The protocol for communicating between a Diablo II client - * and game server. - * FIXME: put the #define's into the PROTO section - */ - - -/******************************************************/ -typedef struct -{ -#ifdef NOTONLYER - bn_short magic; - bn_short size; - bn_byte type; -/* FIXME: the two sets of packets don't jive... did the beta have a different - game protocol or am I just confused (could easily be the later). */ -#else - bn_byte type; -#endif -} t_d2game_header; -/******************************************************/ - - -/******************************************************/ -typedef struct -{ - t_d2game_header h; -} t_d2game_generic; -/******************************************************/ - - -/******************************************************/ -/* -D2 00 05 00 00 -*/ -#define SERVER_00 0x00 /* beta-only? */ -typedef struct -{ - t_d2game_header h; - bn_byte unknown1; /* data request #? */ -} PACKED_ATTR() t_server_00_req; -#define SERVER_00 0x00 -/******************************************************/ - - -/******************************************************/ -/* -D2 00 20 00 01 E2 5E 13 BE 4C 02 04 CA 00 00 00 .........L...... -6C 69 6C 6A 6F 65 00 00 64 25 42 00 1C E9 50 00 liljoe..d.B...P. -*/ -#define CLIENT_01 0x01 /* beta-only? */ -typedef struct /* game select? */ -{ - t_d2game_header h; - bn_byte unknown1; /* data reply #? */ - bn_int gameid1; /* same as in auth 04 reply */ - bn_short gameid2; /* same as in auth 04 reply */ - bn_byte unknown2[5]; - /* character name */ - /* 00 64 25 42 00 1C E9 50 00 unknown... string or numeric? */ -} PACKED_ATTR() t_client_01; -/******************************************************/ - - -/******************************************************/ -/* -0030 22 38 32 5D 00 00 97 20 20 20 20 20 "82]........ -*/ -#define D2GAME_SERVER_WELCOME 0x97 -typedef struct -{ - t_d2game_header h; -} t_d2game_server_welcome; - - -/* -0000: 60 00 27 04 18 79 27 04 A8 00 00 00 07 02 00 00 `.'..y'......... -0010: B0 01 01 00 00 6F 6E 6C 79 65 72 00 B8 6A F7 BF .....onlyer..j.. -0020: 00 00 00 00 34 00 00 04 00 00 00 00 00 ....4........ - -0000: 60 00 27 04 18 79 27 04 30 0D 00 00 07 02 00 00 `.'..y'.0....... -0010: B0 01 04 00 01 41 4C 42 45 52 54 00 B8 6A F7 BF .....ALBERT..j.. -0020: 00 00 00 00 34 00 00 04 00 00 00 00 00 ....4........ - -0000: 60 00 27 04 18 79 27 04 A0 0A 00 00 07 02 00 00 `.'..y'......... -0010: B0 01 04 00 02 41 4C 42 45 52 54 00 B8 6A F7 BF .....ALBERT..j.. -0020: 00 00 00 00 34 00 00 04 00 00 00 00 00 ....4........ - -0000: 60 00 AB 04 18 79 AB 04 DE 00 9F 00 0C 02 00 00 `....y.......... -0010: 60 01 04 00 00 62 62 62 00 71 DF 77 A6 C0 E6 77 `....bbb.q.w...w -0020: A6 C0 E6 77 34 05 00 04 00 00 00 00 00 ...w4........ - -*/ - - -#define D2GAME_CLIENT_CREATEGAMEREQ 0x60 - -typedef bn_basic bn_charname[16]; - -typedef struct -{ - t_d2game_header h; - char gamename[16]; - bn_byte servertype; /* servertype=0, data not send to client and have no host */ - /* creator changed to newbie data saved in server machine*/ - /* servertype=1, data send to client and have host */ - /* servertype=2, data send to client and have no host */ - /* servertype=3, client all newbie,seems to be wrong */ - /* data is saved in server machine */ - /* client is loaded from server machine */ - bn_byte class; - bn_byte template; /* character template */ - /* affect the reply in 0x01 */ - /* should less than the lines of excel/CharTemplate.txt */ - bn_byte difficulty; - bn_charname charname; - bn_short arena; - bn_int gameflag; - bn_byte unknownb2; /* unused */ - bn_byte unknownb3; /* unused */ -} t_d2game_client_creategamereq; - - -typedef struct -{ - bn_byte flag1; /* "test gameflag,06" should not be zero,or will be bad gameflag */ - /* flag1 should be set with bit 0x04 or will fail or crash */ - /* bit 0x10,0x20,0x08 is ignored in reply */ - - bn_byte flag2; /* hardcore and softcore */ - /* 0x0 means softcore,0x1 template mode,0x8 means hardcore */ - /* bit 0x02,0x04,0xF0 is ignored in reply */ - /* have sth to do with char template */ - /* opengame */ - - bn_byte flag3; /* guild data (not in reply) */ - /* 0x01 means have guild */ - /* others bits seems all unused */ - - bn_byte flag4; /* seems to be unused */ - -} t_d2game_gameflag; - - - -/* -0030 22 37 86 D7 00 00 61 65 00 00 00 00 00 01 03 00 "7....ae........ -0040 00 00 6F 6E 6C 79 65 72 2D 63 6E 61 61 00 24 E0 ..onlyer-cnaa.$. -0050 7B 05 {. -*/ - -#define D2GAME_CLIENT_JOINGAMEREQ 0x61 -typedef struct -{ - t_d2game_header h; - bn_int token; - bn_short gameid; - bn_byte charclass; /* 00=Amazon 01=Sor 02=Nec 03=Pal 04=Bar */ - bn_int version; - bn_charname charname; - /* 16 bytes playe name (including 0x0 ending) */ -} t_d2game_client_joingamereq; - - -/* -0030 22 1C C9 65 00 00 20 20 20 20 20 20 "..e........ -*/ - -#define D2GAME_SERVER_NOOP 0x20 -typedef struct -{ - t_d2game_header h; - /* 5 \x20 noop */ -} t_d2game_server_noop; - - - -/* -0030 22 37 17 07 00 00 66 91 4B A1 00 00 00 00 00 "7....f.K...... -*/ -#define D2GAME_CLIENT_UNKNOWN_66 0x66 /* echo message? */ -typedef struct -{ - t_d2game_header h; - bn_int unknown1; - bn_int unknown2; -} t_d2game_client_unknown_66; - -/* -0000: 8F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -0020: 00 . -*/ - -#define D2GAME_SERVER_UNKNOWN_8F 0x8f /* echo reply? */ -typedef struct -{ - t_d2game_header h; - bn_int unknown1; - bn_int unknown2; - bn_int unknown3; - bn_int unknown4; - bn_int unknown5; - bn_int unknown6; - bn_int unknown7; /* all here for open char is zero */ -} t_d2game_server_unknown_8f; - - - -/* -0030 22 1C C4 53 00 00 01 00 04 00 00 00 00 02 "..S.......... -*/ -#define D2GAME_SERVER_JOINOK 0x01 -/* this message will appear after - * 1. CLIENT_CREATEGAEM valid - * 2. CLIENT_JOINGAME valid - */ -typedef struct -{ - t_d2game_header h; - bn_byte difficulty; - bn_short gameflag; - bn_byte template; - bn_short unknown1; - bn_short unknown2; -} t_d2game_server_joinok; - - -/* -0030 22 2F 65 38 00 00 64 "/e8..d -*/ - -#define D2GAME_CLIENT_JOINACTREQ 0x64 -typedef struct -{ - t_d2game_header h; - /* none */ -} t_d2game_client_joinactreq; - - -#define D2GAME_SERVER_UNKNOWN_59 0x59 -typedef struct -{ - t_d2game_header h; -} t_d2game_server_unknown_59; - - -/* -0030 22 0E 0C 01 00 00 65 82 82 00 00 00 55 AA 55 AA ".....e.....U.U. -0040 47 00 00 00 6F 6E 6C 79 65 72 2D 63 6E 61 00 00 G...onlyer-cna.. -0050 00 00 00 00 01 00 00 00 DD 00 10 00 82 00 01 00 ................ -0060 01 00 01 01 01 01 01 FF FF FF 01 01 FF FF FF FF ................ -0070 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................ -0080 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -00A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -00B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FC ............... -*/ - - -#define D2GAME_CLIENT_PLAYERSAVE 0x65 -typedef struct -{ - t_d2game_header h; - bn_byte size; - bn_int total_size; - /* player save file */ - /* an append */ -} t_d2game_client_playersave; - - -#define D2GAME_SERVER_ERROR 0x9c -typedef struct -{ - t_d2game_header h; - bn_int errorno; -} t_d2game_server_error; - -#define D2GAME_SERVER_ERROR_UNKNOWN_FAILURE 0 /* error biger than 22 is also unknown */ -#define D2GAME_SERVER_ERROR_CHAR_VER 1 -#define D2GAME_SERVER_ERROR_QUEST_DATA 2 -#define D2GAME_SERVER_ERROR_WP_DATA 3 -#define D2GAME_SERVER_ERROR_STAT_DATA 4 -#define D2GAME_SERVER_ERROR_SKILL_DATA 5 -#define D2GAME_SERVER_ERROR_UNABLE_ENTER 6 -#define D2GAME_SERVER_ERROR_INVENTORY_DATA 7 -#define D2GAME_SERVER_ERROR_DEAD_BODY 8 -#define D2GAME_SERVER_ERROR_HEADER 9 -#define D2GAME_SERVER_ERROR_HIREABLES 10 -#define D2GAME_SERVER_ERROR_INTRO_DATA 11 -#define D2GAME_SERVER_ERROR_ITEM 12 -#define D2GAME_SERVER_ERROR_DEAD_BODY_ITEM 13 -#define D2GAME_SERVER_ERROR_GENERIC_BAD_FILE 14 -#define D2GAME_SERVER_ERROR_GAME_FULL 15 -#define D2GAME_SERVER_ERROR_GAME_VER 16 -#define D2GAME_SERVER_ERROR_NIGHTMARE 17 -#define D2GAME_SERVER_ERROR_HELL 18 -#define D2GAME_SERVER_ERROR_NORMAL_HARDCORE 19 -#define D2GAME_SERVER_ERROR_HARDCORE_NORMAL 20 -#define D2GAME_SERVER_ERROR_DEAD_HARDCORE 21 -/* -0000: 15 01 00 69 20 77 69 6C 6C 20 67 6F 00 00 00 ...i will go... - -0000: 15 01 00 74 68 61 6E 6B 73 20 66 6F 72 20 79 6F ...thanks for yo -0010: 75 72 20 68 65 6C 70 00 00 00 ur help... - -0000: 15 01 00 73 65 65 20 75 00 00 00 ...see u... - - -*/ - -#define D2GAME_CLIENT_CHAT_MESSAGE 0x15 -typedef struct -{ - t_d2game_header h; - bn_short unknown1; - /* chat message */ -} t_d2game_client_chat_message; - - -/* -0000: 26 01 00 02 00 00 00 00 00 01 6F 6E 6C 79 65 72 &.........onlyer -0010: 2D 63 6E 61 61 00 69 20 77 69 6C 6C 20 67 6F 00 -cnaa.i will go. - -0000: 26 01 00 02 00 00 00 00 00 01 6F 6E 6C 79 65 72 &.........onlyer -0010: 2D 63 6E 61 61 00 74 68 61 6E 6B 73 20 66 6F 72 -cnaa.thanks for -0020: 20 79 6F 75 72 20 68 65 6C 70 00 your help. - -0000: 26 01 00 02 00 00 00 00 00 01 6F 6E 6C 79 65 72 &.........onlyer -0010: 2D 63 6E 61 61 00 73 65 65 20 75 00 -cnaa.see u. - -0000: 26 01 00 02 00 00 00 00 00 17 63 63 00 62 79 65 &.........cc.bye -0010: 00 67 49 00 00 00 01 86 17 32 12 01 00 07 00 05 .gI......2...... - -*/ - -#define D2GAME_SERVER_CHAT_MESSAGE 0x26 -typedef struct -{ - t_d2game_header h; - bn_short unknown1; - bn_int unknown2; - bn_short unknown3; - bn_byte unknown4; /* id or token? a fixed number for each char*/ - /* player name */ - /* message */ -} t_d2game_server_chat_message; - -#define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN1 0x0001 -#define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN2 0x00000002 -#define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN3 0x0000 -#define D2GAME_SERVER_CHAT_MESSAGE_UNKNOWN4 0x01 - - -/* -0000: 62 b -*/ - -#define D2GAME_CLIENT_QUITGAME 0x62 -typedef struct -{ - t_d2game_header h; -} t_d2game_client_quitgame; - - -/* -0000: 9B FF 01 4E 03 00 00 55 AA 55 AA 47 00 00 00 6F ...N...U.U.G...o -0010: 6E 6C 79 65 72 2D 63 6E 61 61 00 00 00 00 00 00 nlyer-cnaa...... -0020: 00 00 00 DD 00 10 00 82 00 01 00 01 00 FF FF FF ................ -0030: FF FF 53 FF FF FF FF FF FF FF FF FF FF FF FF FF ..S............. -0040: FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 FF ................ -0050: 00 FF 00 FF 00 FF 00 FF 00 FF 00 FF 00 00 24 00 ..............$. -0060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -0070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -0080: 00 00 00 00 00 5E 17 41 5F 57 6F 6F 21 06 00 00 .....^.A_Woo!... -0090: 00 2A 01 01 00 00 00 00 00 00 00 00 00 00 00 00 .*.............. -00A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -00B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -00C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -00D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -00E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -00F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ -0100: 00 00 00 00 00 00 ...... - - - - -*/ - -#define D2GAME_SERVER_PLAYERSAVE 0x9b -typedef struct -{ - t_d2game_header h; - bn_byte size; - bn_byte start; - bn_int total_size; - /* player save file */ -} t_d2game_server_playersave; - - -/* -0000: 98 05 06 -*/ - -#define D2GAME_SERVER_CLOSEGAME 0x98 -typedef struct -{ - t_d2game_header h; - bn_short unknown1; -} t_d2game_server_closegame; - -/* -0000: 5A 02 04 00 00 00 00 03 61 72 63 68 5F 6E 61 67 Z.......arch_nag -0010: 61 00 00 00 B0 FD B6 08 00 FF FF FF 78 07 39 04 a...........x.9. -0020: D5 16 2D 04 01 FD B6 08 ..-..... -*/ - -#define D2GAME_SERVER_JOINGAME_MESSAGE 0x5a -typedef struct -{ - t_d2game_header h; - bn_byte unknown1; - bn_byte unknown2; - bn_int unknown3; - bn_byte unknown4; - /* char name */ -} t_d2game_joingame_message; - - - -#define D2GAME_CLIENT_DIE 0x41 -typedef struct -{ - t_d2game_header h; -} t_d2game_client_die; - - -/* -0000: 02 73 00 00 00 4E 00 8B 0F 7B 14 00 00 .s...N...{... - -#define D2GAME_SERVER_UNKNOWN_2 0x2 - -*/ - -/* -0000: 67 06 00 00 00 01 B2 0F 6B 14 01 00 07 00 05 g.......k...... - -0000: 67 06 00 00 00 01 B2 0F 71 14 01 00 07 00 05 g.......q...... - -0000: 67 0A 00 00 00 01 72 0F 63 14 01 00 07 00 05 g.....r.c...... - - -#define D2GAME_SERVER_UNKNOWN_67 0x67 - -*/ - - -/* -0000: 6D 0A 00 00 00 76 0F 64 14 80 m....v.d.. - -0000: 6D 0A 00 00 00 72 0F 63 14 80 m....r.c.. - -0000: 6D 06 00 00 00 B2 0F 71 14 80 8A 01 0B 00 00 00 m......q........ - -0000: 6D 06 00 00 00 B2 0F 6B 14 80 m......k.. - - - -#define D2GAME_SERVER_UNKNOWN_6D 0x6d - -*/ - -/* -0000: 8A 01 0B 00 00 00 6D 0B 00 00 00 9B 0F 70 14 80 ......m......p.. -0010: 2C 01 0B 00 00 00 11 00 ,....... - -0000: 8A 01 0B 00 00 00 ...... - - -#define D2GAME_SERVER_UNKNOWN_8A 0x8a - -*/ - - -/* -0000: 96 59 80 CC 07 36 8A 4C 36 .Y...6.L6 - -#define D2GAME_SERVER_UNKNOWN_96 0x96 - -*/ - -/* -0000: 24 62 00 00 00 $b... - -#define D2GAME_CLIENT_UNKNOWN_24 0x24 - -*/ - - -/* -CLIENT: - -0000: 2F 01 00 00 00 49 00 00 00 /....I... - -0000: 31 49 00 00 00 00 00 00 00 1I....... - -0000: 30 01 00 00 00 49 00 00 00 0....I... - -0000: 03 8C 17 2E 12 ..... - -0000: 03 87 17 27 12 ...'. command ? - - - -SERVER: - - -*/ - -#endif diff --git a/d2pack109/src/common/elist.h b/d2pack109/src/common/elist.h deleted file mode 100644 index 7bf296c..0000000 --- a/d2pack109/src/common/elist.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2004 Dizzy (dizzy@roedu.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_ELIST_TYPES -#define INCLUDED_ELIST_TYPES - -typedef struct elist_struct { - struct elist_struct *next, *prev; -} t_elist; - -#endif /* INCLUDED_ELIST_TYPES */ - -#ifndef INCLUDED_ELIST_PROTOS -#define INCLUDED_ELIST_PROTOS - -#ifdef HAVE_STDDEF_H -# include -#endif - -/* access to it's members */ -#define elist_next(ptr) ((ptr)->next) -#define elist_prev(ptr) ((ptr)->prev) - -#define __elist_init(elist,val) { (elist)->next = (elist)->prev = (val); } -#define elist_init(elist) __elist_init(elist,elist) -#define DECLARE_ELIST_INIT(var) \ - t_elist var = { &var, &var }; - -/* link an new node just after "where" */ -static inline void elist_add(t_elist *where, t_elist *what) -{ - what->next = where->next; - where->next->prev = what; - what->prev = where; - where->next = what; -} - -/* link a new node just before "where" (usefull in creating queues) */ -static inline void elist_add_tail(t_elist *where, t_elist *what) -{ - what->prev = where->prev; - where->prev->next = what; - what->next = where; - where->prev = what; -} - -/* unlink "what" from it's list */ -static inline void elist_del(t_elist *what) -{ - what->next->prev = what->prev; - what->prev->next = what->next; -} - -/* finds out the container address by computing it from the list node - * address substracting the offset inside the container of the list node - * member */ -#define elist_entry(ptr,type,member) ((type*)(((char*)ptr)-offsetof(type,member))) - -/* DONT remove while traversing with this ! */ -#define elist_for_each(pos,head) \ - for (pos = (head)->next; pos != (head); pos = pos->next) - -#define elist_for_each_rev(pos,head) \ - for (pos = (head)->prev; pos != (head); pos = pos->prev) - -/* safe for removals while traversing */ -#define elist_for_each_safe(pos,head,save) \ - for (pos = (head)->next, save = pos->next; pos != (head); \ - pos = save, save = pos->next) - -#define elist_for_each_safe_rev(pos,head,save) \ - for (pos = (head)->prev, save = pos->prev; pos != (head); \ - pos = save, save = pos->prev) - -#define elist_empty(ptr) ((ptr)->next == (ptr)) - -#endif /* INCLUDED_ELIST_PROTOS */ diff --git a/d2pack109/src/common/eventlog.c b/d2pack109/src/common/eventlog.c deleted file mode 100644 index 24b21eb..0000000 --- a/d2pack109/src/common/eventlog.c +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com) - * Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#include "compat/strerror.h" -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "compat/strcasecmp.h" -#ifdef HAVE_STDARG_H -# include -#else -# ifdef HAVE_VARARGS_H -# include -# endif -#endif -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#include "compat/strftime.h" -#ifdef HAVE_UNISTD_H -# include -#endif -#include "common/eventlog.h" -#include "common/setup_after.h" - -#ifdef WIN32_GUI -# include "win32/winmain.h" -#endif - -static FILE * eventstrm=NULL; -static t_eventlog_level currlevel=eventlog_level_debug| - eventlog_level_info| - eventlog_level_warn| - eventlog_level_error| - eventlog_level_fatal; -/* FIXME: maybe this should be default for win32 */ -static int eventlog_debugmode=0; - -extern void eventlog_set_debugmode(int debugmode) -{ - eventlog_debugmode = debugmode; -} - -extern void eventlog_set(FILE * fp) -{ - eventstrm = fp; -} - -extern FILE * eventlog_get(void) -{ - return eventstrm; -} - -extern int eventlog_close(void) -{ - fclose(eventstrm); - return 0; -} - -extern int eventlog_open(char const * filename) -{ - FILE * temp; - - if (!filename) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL filename"); - return -1; - } - - if (!(temp = fopen(filename,"a"))) - { - eventlog(eventlog_level_error,__FUNCTION__,"could not open file \"%s\" for appending (fopen: %s)",filename,strerror(errno)); - return -1; - } - - if (eventstrm && eventstrm!=stderr) /* close old one */ - if (fclose(eventstrm)<0) - { - eventstrm = temp; - eventlog(eventlog_level_error,__FUNCTION__,"could not close previous logfile after writing (fclose: %s)",strerror(errno)); - return 0; - } - eventstrm = temp; - - return 0; -} - - -extern void eventlog_clear_level(void) -{ - currlevel = eventlog_level_none; -} - - -extern int eventlog_add_level(char const * levelname) -{ - if (!levelname) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL levelname"); - return -1; - } - - if (strcasecmp(levelname,"trace")==0) - { - currlevel |= eventlog_level_trace; - return 0; - } - if (strcasecmp(levelname,"debug")==0) - { - currlevel |= eventlog_level_debug; - return 0; - } - if (strcasecmp(levelname,"info")==0) - { - currlevel |= eventlog_level_info; - return 0; - } - if (strcasecmp(levelname,"warn")==0) - { - currlevel |= eventlog_level_warn; - return 0; - } - if (strcasecmp(levelname,"error")==0) - { - currlevel |= eventlog_level_error; - return 0; - } - if (strcasecmp(levelname,"fatal")==0) - { - currlevel |= eventlog_level_fatal; - return 0; - } - - eventlog(eventlog_level_error,__FUNCTION__,"got bad levelname \"%s\"",levelname); - return -1; -} - - -extern int eventlog_del_level(char const * levelname) -{ - if (!levelname) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL levelname"); - return -1; - } - - if (strcasecmp(levelname,"trace")==0) - { - currlevel &= ~eventlog_level_trace; - return 0; - } - if (strcasecmp(levelname,"debug")==0) - { - currlevel &= ~eventlog_level_debug; - return 0; - } - if (strcasecmp(levelname,"info")==0) - { - currlevel &= ~eventlog_level_info; - return 0; - } - if (strcasecmp(levelname,"warn")==0) - { - currlevel &= ~eventlog_level_warn; - return 0; - } - if (strcasecmp(levelname,"error")==0) - { - currlevel &= ~eventlog_level_error; - return 0; - } - if (strcasecmp(levelname,"fatal")==0) - { - currlevel &= ~eventlog_level_fatal; - return 0; - } - - - eventlog(eventlog_level_error,__FUNCTION__,"got bad levelname \"%s\"",levelname); - return -1; -} - -extern char const * eventlog_get_levelname_str(t_eventlog_level level) -{ - switch (level) - { - case eventlog_level_trace: - return "trace"; - case eventlog_level_debug: - return "debug"; - case eventlog_level_info: - return "info "; - case eventlog_level_warn: - return "warn "; - case eventlog_level_error: - return "error"; - case eventlog_level_fatal: - return "fatal"; - default: - return "unknown"; - } -} - - -#ifdef DEBUGMODSTRINGS -extern void eventlog_real(t_eventlog_level level, char const * module, char const * fmt, ...) -#else -extern void eventlog(t_eventlog_level level, char const * module, char const * fmt, ...) -#endif -{ - va_list args; - char time_string[EVENT_TIME_MAXLEN]; - struct tm * tmnow; - time_t now; - - if (!(level&currlevel)) - return; - if (!eventstrm) - return; - - /* get the time before parsing args */ - time(&now); - if (!(tmnow = localtime(&now))) - strcpy(time_string,"?"); - else - strftime(time_string,EVENT_TIME_MAXLEN,EVENT_TIME_FORMAT,tmnow); - - if (!module) - { - fprintf(eventstrm,"%s [error] eventlog: got NULL module\n",time_string); -#ifdef WIN32_GUI - gui_lprintf(eventlog_level_error,"%s [error] eventlog: got NULL module\n",time_string); -#endif - fflush(eventstrm); - return; - } - - if (!fmt) - { - fprintf(eventstrm,"%s [error] eventlog: got NULL fmt\n",time_string); -#ifdef WIN32_GUI - gui_lprintf(eventlog_level_error,"%s [error] eventlog: got NULL fmt\n",time_string); -#endif - fflush(eventstrm); - return; - } - - fprintf(eventstrm,"%s [%s] %s: ",time_string,eventlog_get_levelname_str(level),module); -#ifdef WIN32_GUI - gui_lprintf(level,"%s [%s] %s: ",time_string,eventlog_get_levelname_str(level),module); -#endif - - va_start(args,fmt); - -#ifdef HAVE_VPRINTF - vfprintf(eventstrm,fmt,args); -#ifdef WIN32_GUI - gui_lvprintf(level,fmt,args); -#endif -#else -# if HAVE__DOPRNT - _doprnt(fmt,args,eventstrm); -# else - fprintf(eventstrm,"sorry, vfprintf() and _doprnt() are not available on this system"); -# endif -#endif - va_end(args); - fprintf(eventstrm,"\n"); -#ifdef WIN32_GUI - gui_lprintf(level,"\n"); -#endif - - if (eventlog_debugmode) { - printf("%s [%s] %s: ",time_string,eventlog_get_levelname_str(level),module); - va_start(args,fmt); -#ifdef HAVE_VPRINTF - vprintf(fmt,args); -#else -# if HAVE__DOPRNT - _doprnt(fmt,args,stdout); -# else - printf("sorry, vfprintf() and _doprnt() are not available on this system"); -# endif -#endif - va_end(args); - printf("\n"); - fflush(stdout); - } - fflush(eventstrm); -} - - -extern void eventlog_step(char const * filename, t_eventlog_level level, char const * module, char const * fmt, ...) -{ - va_list args; - char time_string[EVENT_TIME_MAXLEN]; - struct tm * tmnow; - time_t now; - FILE * fp; - - if (!(level&currlevel)) - return; - if (!eventstrm) - return; - - if (!(fp = fopen(filename, "a"))) - return; - - /* get the time before parsing args */ - time(&now); - if (!(tmnow = localtime(&now))) - strcpy(time_string,"?"); - else - strftime(time_string,EVENT_TIME_MAXLEN,EVENT_TIME_FORMAT,tmnow); - - if (!module) - { - fprintf(fp,"%s [error] eventlog_step: got NULL module\n",time_string); - fclose(fp); - return; - } - if (!fmt) - { - fprintf(fp,"%s [error] eventlog_step: got NULL fmt\n",time_string); - fclose(fp); - return; - } - - fprintf(fp,"%s [%s] %s: ",time_string,eventlog_get_levelname_str(level),module); - va_start(args,fmt); -#ifdef HAVE_VPRINTF - vfprintf(fp,fmt,args); -#else -# if HAVE__DOPRNT - _doprnt(fmt,args,fp); -# else - fprintf(fp,"sorry, vfprintf() and _doprnt() are not available on this system"); -# endif -#endif - va_end(args); - fprintf(fp,"\n"); - fclose(fp); -} diff --git a/d2pack109/src/common/eventlog.h b/d2pack109/src/common/eventlog.h deleted file mode 100644 index eadca0d..0000000 --- a/d2pack109/src/common/eventlog.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu) - * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_EVENTLOG_TYPES -#define INCLUDED_EVENTLOG_TYPES - -typedef enum -{ - eventlog_level_none = 0, - eventlog_level_trace= 1, - eventlog_level_debug= 2, - eventlog_level_info = 4, - eventlog_level_warn = 8, - eventlog_level_error=16, - eventlog_level_fatal=32 -} t_eventlog_level; - -#endif - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_EVENTLOG_PROTOS -#define INCLUDED_EVENTLOG_PROTOS - -#define JUST_NEED_TYPES -#include -#undef JUST_NEED_TYPES - -extern void eventlog_set_debugmode(int debugmode); -extern void eventlog_set(FILE * fp); -extern FILE * eventlog_get(void); -extern int eventlog_open(char const * filename); -extern int eventlog_close(void); -extern void eventlog_clear_level(void); -extern int eventlog_add_level(char const * levelname); -extern int eventlog_del_level(char const * levelname); -extern char const * eventlog_get_levelname_str(t_eventlog_level level); -#ifdef DEBUGMODSTRINGS - -extern void eventlog_real(t_eventlog_level level, char const * module, char const * fmt, ...) PRINTF_ATTR(3,4); -# if __STDC_VERSION__+1 >= 199901L -# define eventlog(l,m,f,args...) eventlog_real(l,"@(" __FILE__ ":" m "@@" __func__ ")@",f,##args) -# else -# if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2) -# define eventlog(l,m,f,args...) eventlog_real(l,"@(" __FILE__ ":" m "@@" __PRETTY_FUNCTION__ ")@",f,##args) -# else -# error "No function macro available, either don't define DEBUGMODSTRINGS or don't use -pedantic" -# endif -# endif - -#else - -extern void eventlog(t_eventlog_level level, char const * module, char const * fmt, ...); -extern void eventlog_step(char const * filename, t_eventlog_level level, char const * module, char const * fmt, ...); - -#endif - -#endif -#endif diff --git a/d2pack109/src/common/fdwatch.c b/d2pack109/src/common/fdwatch.c deleted file mode 100644 index 2dd7a99..0000000 --- a/d2pack109/src/common/fdwatch.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "common/setup_before.h" -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include "common/eventlog.h" -#define FDWATCH_BACKEND -#include "fdwatch.h" -#ifdef HAVE_SELECT -#include "fdwatch_select.h" -#endif -#ifdef HAVE_POLL -#include "fdwatch_poll.h" -#endif -#ifdef HAVE_KQUEUE -#include "fdwatch_kqueue.h" -#endif -#ifdef HAVE_EPOLL -#include "fdwatch_epoll.h" -#endif -#include "common/rlimit.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -int fdw_maxcons; -t_fdwatch_fd *fdw_fds = NULL; - -static t_fdw_backend * fdw = NULL; -static DECLARE_ELIST_INIT(freelist); -static DECLARE_ELIST_INIT(uselist); - -extern int fdwatch_init(int maxcons) -{ - int i, maxsys; - - maxsys = get_socket_limit(); - if (maxsys > 0) maxcons = (maxcons < maxsys) ? maxcons : maxsys; - if (maxcons < 32) { - eventlog(eventlog_level_fatal, __FUNCTION__, "too few sockets available (%d)",maxcons); - return -1; - } - fdw_maxcons = maxcons; - - fdw_fds = xmalloc(sizeof(t_fdwatch_fd) * fdw_maxcons); - memset(fdw_fds, 0, sizeof(t_fdwatch_fd) * fdw_maxcons); - /* add all slots to the freelist */ - for(i = 0; i < fdw_maxcons; i++) - elist_add_tail(&freelist,&(fdw_fds[i].freelist)); - -#ifdef HAVE_EPOLL - fdw = &fdw_epoll; - if (!fdw->init(fdw_maxcons)) goto ok; -#endif -#ifdef HAVE_KQUEUE - fdw = &fdw_kqueue; - if (!fdw->init(fdw_maxcons)) goto ok; -#endif -#ifdef HAVE_POLL - fdw = &fdw_poll; - if (!fdw->init(fdw_maxcons)) goto ok; - goto ok; -#endif -#ifdef HAVE_SELECT - fdw = &fdw_select; - if (!fdw->init(fdw_maxcons)) goto ok; -#endif - - eventlog(eventlog_level_fatal, __FUNCTION__, "Found no working fdwatch layer"); - fdw = NULL; - fdwatch_close(); - return -1; - -ok: - return 0; -} - -extern int fdwatch_close(void) -{ - if (fdw) { fdw->close(); fdw = NULL; } - if (fdw_fds) { xfree((void*)fdw_fds); fdw_fds = NULL; } - elist_init(&freelist); - elist_init(&uselist); - - return 0; -} - -extern int fdwatch_add_fd(int fd, t_fdwatch_type rw, fdwatch_handler h, void *data) -{ - t_fdwatch_fd *cfd; - - if (elist_empty(&freelist)) return -1; /* max sockets reached */ - - cfd = elist_entry(elist_next(&freelist),t_fdwatch_fd,freelist); - fdw_fd(cfd) = fd; - - if (fdw->add_fd(fdw_idx(cfd), rw)) return -1; - - /* add it to used sockets list, remove it from free list */ - elist_add_tail(&uselist,&cfd->uselist); - elist_del(&cfd->freelist); - - fdw_rw(cfd) = rw; - fdw_data(cfd) = data; - fdw_hnd(cfd) = h; - - return fdw_idx(cfd); -} - -extern int fdwatch_update_fd(int idx, t_fdwatch_type rw) -{ - if (idx<0 || idx>=fdw_maxcons) { - eventlog(eventlog_level_error,__FUNCTION__,"out of bounds idx [%d] (max: %d)",idx, fdw_maxcons); - return -1; - } - /* do not allow completly reset the access because then backend codes - * can get confused */ - if (!rw) { - eventlog(eventlog_level_error,__FUNCTION__,"tried to reset rw, not allowed"); - return -1; - } - - if (!fdw_rw(fdw_fds + idx)) { - eventlog(eventlog_level_error,__FUNCTION__,"found reseted rw"); - return -1; - } - - if (fdw->add_fd(idx, rw)) return -1; - fdw_rw(&fdw_fds[idx]) = rw; - - return 0; -} - -extern int fdwatch_del_fd(int idx) -{ - t_fdwatch_fd *cfd; - - if (idx<0 || idx>=fdw_maxcons) { - eventlog(eventlog_level_error,__FUNCTION__,"out of bounds idx [%d] (max: %d)",idx, fdw_maxcons); - return -1; - } - - cfd = fdw_fds + idx; - if (!fdw_rw(cfd)) { - eventlog(eventlog_level_error,__FUNCTION__,"found reseted rw"); - return -1; - } - - fdw->del_fd(idx); - - /* remove it from uselist, add it to freelist */ - elist_del(&cfd->uselist); - elist_add_tail(&freelist,&cfd->freelist); - - fdw_fd(cfd) = 0; - fdw_rw(cfd) = 0; - fdw_data(cfd) = NULL; - fdw_hnd(cfd) = NULL; - - return 0; -} - -extern int fdwatch(long timeout_msec) -{ - return fdw->watch(timeout_msec); -} - -extern void fdwatch_handle(void) -{ - fdw->handle(); -} - -extern void fdwatch_traverse(t_fdw_cb cb, void *data) -{ - t_elist *curr; - - elist_for_each(curr,&uselist) - { - if (cb(elist_entry(curr,t_fdwatch_fd,uselist),data)) break; - } -} diff --git a/d2pack109/src/common/fdwatch.h b/d2pack109/src/common/fdwatch.h deleted file mode 100644 index 1ba97fb..0000000 --- a/d2pack109/src/common/fdwatch.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __FDWATCH_INCLUDED__ -#define __FDWATCH_INCLUDED__ - -#include "common/elist.h" - -typedef enum { - fdwatch_type_none = 0, - fdwatch_type_read = 1, - fdwatch_type_write = 2 -} t_fdwatch_type; - -typedef int (*fdwatch_handler)(void *data, t_fdwatch_type); - -typedef struct { - int fd; - int rw; - fdwatch_handler hnd; - void *data; - - t_elist uselist; - t_elist freelist; -} t_fdwatch_fd; - -#ifdef FDWATCH_BACKEND -typedef int (*t_fdw_cb)(t_fdwatch_fd *cfd, void *data); -#endif - -typedef struct { - int (*init)(int nfds); - int (*close)(void); - int (*add_fd)(int idx, t_fdwatch_type rw); - int (*del_fd)(int idx); - int (*watch)(long timeout_msecs); - void (*handle)(void); -} t_fdw_backend; - -extern int fdw_maxcons; -extern t_fdwatch_fd *fdw_fds; - -#define fdw_idx(ptr) ((ptr) - fdw_fds) -#define fdw_fd(ptr) ((ptr)->fd) -#define fdw_rw(ptr) ((ptr)->rw) -#define fdw_data(ptr) ((ptr)->data) -#define fdw_hnd(ptr) ((ptr)->hnd) -extern int fdwatch_init(int maxcons); -extern int fdwatch_close(void); -extern int fdwatch_add_fd(int fd, t_fdwatch_type rw, fdwatch_handler h, void *data); -extern int fdwatch_update_fd(int idx, t_fdwatch_type rw); -extern int fdwatch_del_fd(int idx); -extern int fdwatch(long timeout_msecs); -extern void fdwatch_handle(void); -#ifdef FDWATCH_BACKEND -extern void fdwatch_traverse(t_fdw_cb cb, void *data); -#endif - -#endif /* __FDWATCH_INCLUDED__ */ diff --git a/d2pack109/src/common/fdwatch_epoll.c b/d2pack109/src/common/fdwatch_epoll.c deleted file mode 100644 index 0435955..0000000 --- a/d2pack109/src/common/fdwatch_epoll.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * Linux epoll(4) based backend - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "common/setup_before.h" -#ifdef HAVE_EPOLL - -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#ifdef HAVE_SYS_EPOLL_H -# include "compat/uint.h" -# include -#endif -#include "fdwatch.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static int sr; -static int epfd; -static struct epoll_event *epevents = NULL; /* events to investigate */ -static struct epoll_event tmpev; - -static int fdw_epoll_init(int nfds); -static int fdw_epoll_close(void); -static int fdw_epoll_add_fd(int idx, t_fdwatch_type rw); -static int fdw_epoll_del_fd(int idx); -static int fdw_epoll_watch(long timeout_msecs); -static void fdw_epoll_handle(void); - -t_fdw_backend fdw_epoll = { - fdw_epoll_init, - fdw_epoll_close, - fdw_epoll_add_fd, - fdw_epoll_del_fd, - fdw_epoll_watch, - fdw_epoll_handle -}; - -static int fdw_epoll_init(int nfds) -{ - if ((epfd = epoll_create(nfds)) < 0) - return -1; - epevents = (struct epoll_event *) xmalloc(sizeof(struct epoll_event) * nfds); - - memset(epevents, 0, sizeof(struct epoll_event) * nfds); - sr = 0; - - eventlog(eventlog_level_info, __FUNCTION__, "fdwatch epoll() based layer initialized (max %d sockets)", nfds); - return 0; -} - -static int fdw_epoll_close(void) -{ - if (epevents != NULL) - xfree((void *) epevents); - sr = 0; - - return 0; -} - -static int fdw_epoll_add_fd(int idx, t_fdwatch_type rw) -{ - int op; -// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d rw: %d", fd, rw); - - tmpev.events = 0; - if (rw & fdwatch_type_read) - tmpev.events |= EPOLLIN; - if (rw & fdwatch_type_write) - tmpev.events |= EPOLLOUT; - - if (fdw_rw(fdw_fds + idx)) op = EPOLL_CTL_MOD; - else op = EPOLL_CTL_ADD; - - tmpev.data.fd = idx; - if (epoll_ctl(epfd, op, fdw_fd(fdw_fds + idx), &tmpev)) { - eventlog(eventlog_level_error, __FUNCTION__, "got error from epoll_ctl()"); - return -1; - } - - return 0; -} - -static int fdw_epoll_del_fd(int idx) -{ -// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d", fd); - if (sr > 0) - eventlog(eventlog_level_error, __FUNCTION__, "BUG: called while still handling sockets"); - - if (fdw_rw(fdw_fds + idx)) { - tmpev.events = 0; - tmpev.data.fd = idx; - if (epoll_ctl(epfd, EPOLL_CTL_DEL, fdw_fd(fdw_fds + idx), &tmpev)) { - eventlog(eventlog_level_error, __FUNCTION__, "got error from epoll_ctl()"); - return -1; - } - } - - return 0; -} - -static int fdw_epoll_watch(long timeout_msec) -{ - return (sr = epoll_wait(epfd, epevents, fdw_maxcons, timeout_msec)); -} - -static void fdw_epoll_handle(void) -{ - struct epoll_event *ev; - t_fdwatch_fd *cfd; - -// eventlog(eventlog_level_trace, __FUNCTION__, "called"); - for (ev = epevents; sr; sr--, ev++) - { -// eventlog(eventlog_level_trace, __FUNCTION__, "checking %d ident: %d read: %d write: %d", i, kqevents[i].ident, kqevents[i].filter & EVFILT_READ, kqevents[i].filter & EVFILT_WRITE); - cfd = fdw_fds + ev->data.fd; - - if (fdw_rw(cfd) & fdwatch_type_read && ev->events & (EPOLLIN | EPOLLERR | EPOLLHUP)) - if (fdw_hnd(cfd) (fdw_data(cfd), fdwatch_type_read) == -2) - continue; - - if (fdw_rw(cfd) & fdwatch_type_write && ev->events & (EPOLLOUT | EPOLLERR | EPOLLHUP)) - fdw_hnd(cfd) (fdw_data(cfd), fdwatch_type_write); - } - sr = 0; -} - -#endif /* HAVE_EPOLL */ diff --git a/d2pack109/src/common/fdwatch_epoll.h b/d2pack109/src/common/fdwatch_epoll.h deleted file mode 100644 index dd7a226..0000000 --- a/d2pack109/src/common/fdwatch_epoll.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * Linux epoll(4) based backend - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef __INCLUDED_FDWATCH_EPOLL__ -#define __INCLUDED_FDWATCH_EPOLL__ - -extern t_fdw_backend fdw_epoll; - -#endif /* __INCLUDED_FDWATCH_EPOLL__ */ diff --git a/d2pack109/src/common/fdwatch_kqueue.c b/d2pack109/src/common/fdwatch_kqueue.c deleted file mode 100644 index 1b91f6e..0000000 --- a/d2pack109/src/common/fdwatch_kqueue.c +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * *BSD kqueue(2) based backend - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "common/setup_before.h" -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_EVENT_H -# include -#endif -#ifdef HAVE_SYS_TIME_H -# include -#endif -#include "fdwatch.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -#ifdef HAVE_KQUEUE -static int sr; -static int kq; -static struct kevent *kqchanges = NULL; /* changes to make to kqueue */ -static struct kevent *kqevents = NULL; /* events to investigate */ -/* r/w indices from idx to the kqchanges index where the change is stored */ -static int *_rridx, *_wridx; -static unsigned nochanges; - -static int fdw_kqueue_init(int nfds); -static int fdw_kqueue_close(void); -static int fdw_kqueue_add_fd(int idx, t_fdwatch_type rw); -static int fdw_kqueue_del_fd(int idx); -static int fdw_kqueue_watch(long timeout_msecs); -static void fdw_kqueue_handle(void); - -t_fdw_backend fdw_kqueue = { - fdw_kqueue_init, - fdw_kqueue_close, - fdw_kqueue_add_fd, - fdw_kqueue_del_fd, - fdw_kqueue_watch, - fdw_kqueue_handle -}; - -static int fdw_kqueue_init(int nfds) -{ - int i; - - if ((kq = kqueue()) == -1) - return -1; - kqevents = (struct kevent *) xmalloc(sizeof(struct kevent) * nfds); - kqchanges = (struct kevent *) xmalloc(sizeof(struct kevent) * nfds * 2); - _rridx = (int *) xmalloc(sizeof(int) * nfds); - _wridx = (int *) xmalloc(sizeof(int) * nfds); - - memset(kqchanges, 0, sizeof(struct kevent) * nfds); - for (i = 0; i < nfds; i++) - { - _rridx[i] = -1; - _wridx[i] = -1; - } - sr = 0; - nochanges = 0; - - eventlog(eventlog_level_info, __FUNCTION__, "fdwatch kqueue() based layer initialized (max %d sockets)", nfds); - return 0; -} - -static int fdw_kqueue_close(void) -{ - if (_rridx) { xfree((void *) _rridx); _rridx = NULL; } - if (_wridx) { xfree((void *) _wridx); _wridx = NULL; } - if (kqchanges) { xfree((void *) kqchanges); kqchanges = NULL; } - if (kqevents) { xfree((void *) kqevents); kqevents = NULL; } - sr = 0; - nochanges = 0; - - return 0; -} - -static int fdw_kqueue_add_fd(int idx, t_fdwatch_type rw) -{ - static int ridx; - t_fdwatch_fd *cfd; - -/* eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d rw: %d", fd, rw); */ - - cfd = fdw_fds + idx; - /* adding read event filter */ - if (!(fdw_rw(cfd) & fdwatch_type_read) && rw & fdwatch_type_read) - { - if (_rridx[idx] >= 0 && _rridx[idx] < nochanges && kqchanges[_rridx[idx]].ident == fdw_fd(cfd)) - { - ridx = _rridx[idx]; -/* eventlog(eventlog_level_trace, __FUNCTION__, "updating change event (read) fd on %d", ridx); */ - } else { - ridx = nochanges++; - _rridx[idx] = ridx; -/* eventlog(eventlog_level_trace, __FUNCTION__, "adding new change event (read) fd on %d", ridx); */ - } - EV_SET(kqchanges + ridx, fdw_fd(cfd), EVFILT_READ, EV_ADD, 0, 0, (void*)idx); - } - else if (fdw_rw(cfd) & fdwatch_type_read && !( rw & fdwatch_type_read)) - { - if (_rridx[idx] >= 0 && _rridx[idx] < nochanges && kqchanges[_rridx[idx]].ident == fdw_fd(cfd)) - { - ridx = _rridx[idx]; -/* eventlog(eventlog_level_trace, __FUNCTION__, "updating change event (read) fd on %d", ridx); */ - } else { - ridx = nochanges++; - _rridx[idx] = ridx; -/* eventlog(eventlog_level_trace, __FUNCTION__, "adding new change event (read) fd on %d", ridx); */ - } - EV_SET(kqchanges + ridx, fdw_fd(cfd), EVFILT_READ, EV_DELETE, 0, 0, (void*)idx); - } - - /* adding write event filter */ - if (!(fdw_rw(cfd) & fdwatch_type_write) && rw & fdwatch_type_write) - { - if (_wridx[idx] >= 0 && _wridx[idx] < nochanges && kqchanges[_wridx[idx]].ident == fdw_fd(cfd)) - { - ridx = _wridx[idx]; -/* eventlog(eventlog_level_trace, __FUNCTION__, "updating change event (write) fd on %d", ridx); */ - } else { - ridx = nochanges++; - _wridx[idx] = ridx; -/* eventlog(eventlog_level_trace, __FUNCTION__, "adding new change event (write) fd on %d", ridx); */ - } - EV_SET(kqchanges + ridx, fdw_fd(cfd), EVFILT_WRITE, EV_ADD, 0, 0, (void*)idx); - } - else if (fdw_rw(cfd) & fdwatch_type_write && !(rw & fdwatch_type_write)) - { - if (_wridx[idx] >= 0 && _wridx[idx] < nochanges && kqchanges[_wridx[idx]].ident == fdw_fd(cfd)) - { - ridx = _wridx[idx]; -/* eventlog(eventlog_level_trace, __FUNCTION__, "updating change event (write) fd on %d", ridx); */ - } else { - ridx = nochanges++; - _wridx[idx] = ridx; -/* eventlog(eventlog_level_trace, __FUNCTION__, "adding new change event (write) fd on %d", ridx); */ - } - EV_SET(kqchanges + ridx, fdw_fd(cfd), EVFILT_WRITE, EV_DELETE, 0, 0, (void*)idx); - } - - return 0; -} - -static int fdw_kqueue_del_fd(int idx) -{ - t_fdwatch_fd *cfd; - -/* eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d", fd); */ - if (sr > 0) - eventlog(eventlog_level_error, __FUNCTION__, "BUG: called while still handling sockets"); - - cfd = fdw_fds + idx; - /* the last event changes about this fd has not yet been sent to kernel */ - if (fdw_rw(cfd) & fdwatch_type_read && - nochanges && _rridx[idx] >= 0 && _rridx[idx] < nochanges && - kqchanges[_rridx[idx]].ident == fdw_fd(cfd)) - { - nochanges--; - if (_rridx[idx] < nochanges) - { - int oidx; - - oidx = (int)(kqchanges[nochanges].udata); - if (kqchanges[nochanges].filter == EVFILT_READ && - _rridx[oidx] == nochanges) - { -/* eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", kqchanges[rnfds].ident); */ - _rridx[oidx] = _rridx[idx]; - memcpy(kqchanges + _rridx[idx], kqchanges + nochanges, sizeof(struct kevent)); - } - - if (kqchanges[nochanges].filter == EVFILT_WRITE && - _wridx[oidx] == nochanges) - { -/* eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", kqchanges[rnfds].ident); */ - _wridx[oidx] = _rridx[idx]; - memcpy(kqchanges + _rridx[idx], kqchanges + nochanges, sizeof(struct kevent)); - } - } - _rridx[idx] = -1; - } - - if (fdw_rw(cfd) & fdwatch_type_write && - nochanges && _wridx[idx] >= 0 && _wridx[idx] < nochanges && - kqchanges[_wridx[idx]].ident == fdw_fd(cfd)) - { - nochanges--; - if (_wridx[idx] < nochanges) - { - int oidx; - - oidx = (int)(kqchanges[nochanges].udata); - if (kqchanges[nochanges].filter == EVFILT_READ && - _rridx[oidx] == nochanges) - { -/* eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", kqchanges[rnfds].ident); */ - _rridx[oidx] = _wridx[idx]; - memcpy(kqchanges + _wridx[idx], kqchanges + nochanges, sizeof(struct kevent)); - } - - if (kqchanges[nochanges].filter == EVFILT_WRITE && - _wridx[oidx] == nochanges) - { -/* eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", kqchanges[rnfds].ident); */ - _wridx[oidx] = _wridx[idx]; - memcpy(kqchanges + _wridx[idx], kqchanges + nochanges, sizeof(struct kevent)); - } - } - _wridx[idx] = -1; - } - -/* here we presume the calling code does close() on the socket and if so - * it is automatically removed from any kernel kqueues */ - - return 0; -} - -static int fdw_kqueue_watch(long timeout_msec) -{ - static struct timespec ts; - - ts.tv_sec = timeout_msec / 1000L; - ts.tv_nsec = (timeout_msec % 1000L) * 1000000L; - sr = kevent(kq, nochanges > 0 ? kqchanges : NULL, nochanges, kqevents, fdw_maxcons, &ts); - nochanges = 0; - return sr; -} - -static void fdw_kqueue_handle(void) -{ - register unsigned i; - t_fdwatch_fd *cfd; - -/* eventlog(eventlog_level_trace, __FUNCTION__, "called"); */ - for (i = 0; i < sr; i++) - { -/* eventlog(eventlog_level_trace, __FUNCTION__, "checking %d ident: %d read: %d write: %d", i, kqevents[i].ident, kqevents[i].filter & EVFILT_READ, kqevents[i].filter & EVFILT_WRITE); */ - cfd = fdw_fds + (int)kqevents[i].udata; - if (fdw_rw(cfd) & fdwatch_type_read && kqevents[i].filter == EVFILT_READ) - if (fdw_hnd(cfd) (fdw_data(cfd), fdwatch_type_read) == -2) - continue; - - if (fdw_rw(cfd) & fdwatch_type_write && kqevents[i].filter == EVFILT_WRITE) - fdw_hnd(cfd) (fdw_data(cfd), fdwatch_type_write); - } - sr = 0; -} - -#endif /* HAVE_KQUEUE */ diff --git a/d2pack109/src/common/fdwatch_kqueue.h b/d2pack109/src/common/fdwatch_kqueue.h deleted file mode 100644 index 50cec30..0000000 --- a/d2pack109/src/common/fdwatch_kqueue.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * *BSD kqueue() based backend - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef __INCLUDED_FDWATCH_KQUEUE__ -#define __INCLUDED_FDWATCH_KQUEUE__ - -extern t_fdw_backend fdw_kqueue; - -#endif /* __INCLUDED_FDWATCH_KQUEUE__ */ diff --git a/d2pack109/src/common/fdwatch_poll.c b/d2pack109/src/common/fdwatch_poll.c deleted file mode 100644 index b76405c..0000000 --- a/d2pack109/src/common/fdwatch_poll.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * poll(2) based backend - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "common/setup_before.h" -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#ifdef HAVE_POLL_H -# include -#else -# ifdef HAVE_SYS_POLL_H -# include -# endif -#endif -#include "fdwatch.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -#ifdef HAVE_POLL -static int sr; -static struct pollfd *fds = NULL; /* working set */ -static int *_rridx = NULL; -static int *_ridx = NULL; -static unsigned nofds; - -static int fdw_poll_init(int nfds); -static int fdw_poll_close(void); -static int fdw_poll_add_fd(int idx, t_fdwatch_type rw); -static int fdw_poll_del_fd(int idx); -static int fdw_poll_watch(long timeout_msecs); -static void fdw_poll_handle(void); - -t_fdw_backend fdw_poll = { - fdw_poll_init, - fdw_poll_close, - fdw_poll_add_fd, - fdw_poll_del_fd, - fdw_poll_watch, - fdw_poll_handle -}; - -static int fdw_poll_init(int nfds) -{ - int i; - - _ridx = xmalloc(sizeof(int) * nfds); - fds = xmalloc(sizeof(struct pollfd) * nfds); - _rridx = xmalloc(sizeof(int) * nfds); - - memset(fds, 0, sizeof(struct pollfd) * nfds); - memset(_rridx, 0, sizeof(int) * nfds); -/* I would use a memset with 255 but that is dirty and doesnt gain us anything */ - for(i = 0; i < nfds; i++) _ridx[i] = -1; - nofds = sr = 0; - - eventlog(eventlog_level_info, __FUNCTION__, "fdwatch poll() based layer initialized (max %d sockets)", nfds); - return 0; -} - -static int fdw_poll_close(void) -{ - if (fds) { xfree((void *)fds); fds = NULL; } - if (_ridx) { xfree((void *)_ridx); _ridx = NULL; } - if (_rridx) { xfree((void *)_rridx); _rridx = NULL; } - nofds = sr = 0; - - return 0; -} - -static int fdw_poll_add_fd(int idx, t_fdwatch_type rw) -{ - static int ridx; - -// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d rw: %d", fd, rw); - if (_ridx[idx] < 0) { - ridx = nofds++; - fds[ridx].fd = fdw_fd(fdw_fds + idx); - _ridx[idx] = ridx; - _rridx[ridx] = idx; -// eventlog(eventlog_level_trace, __FUNCTION__, "adding new fd on %d", ridx); - } else { - if (fds[_ridx[idx]].fd != fdw_fd(fdw_fds + idx)) { - eventlog(eventlog_level_error,__FUNCTION__,"BUG: found existent poll_fd entry for same idx with different fd"); - return -1; - } - ridx = _ridx[idx]; -// eventlog(eventlog_level_trace, __FUNCTION__, "updating fd on %d", ridx); - } - - fds[ridx].events = 0; - if (rw & fdwatch_type_read) fds[ridx].events |= POLLIN; - if (rw & fdwatch_type_write) fds[ridx].events |= POLLOUT; - - return 0; -} - -static int fdw_poll_del_fd(int idx) -{ -// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d", fd); - if (_ridx[idx] < 0 || !nofds) return -1; - if (sr > 0) - eventlog(eventlog_level_error, __FUNCTION__, "BUG: called while still handling sockets"); - - /* move the last entry to the deleted one and decrement nofds count */ - nofds--; - if (_ridx[idx] < nofds) { -// eventlog(eventlog_level_trace, __FUNCTION__, "not last, moving %d", tfds[nofds].fd); - _ridx[_rridx[nofds]] = _ridx[idx]; - _rridx[_ridx[idx]] = _rridx[nofds]; - memcpy(fds + _ridx[idx], fds + nofds, sizeof(struct pollfd)); - } - _ridx[idx] = -1; - - return 0; -} - -static int fdw_poll_watch(long timeout_msec) -{ - return (sr = poll(fds, nofds, timeout_msec)); -} - -static void fdw_poll_handle(void) -{ - register unsigned i; - int changed; - t_fdwatch_fd *cfd; - - for(i = 0; i < nofds && sr; i++) { - changed = 0; - cfd = fdw_fds + _rridx[i]; - - if (fdw_rw(cfd) & fdwatch_type_read && - fds[i].revents & (POLLIN | POLLERR | POLLHUP | POLLNVAL)) - { - if (fdw_hnd(cfd)(fdw_data(cfd), fdwatch_type_read) == -2) { - sr--; - continue; - } - changed = 1; - } - - if (fdw_rw(cfd) & fdwatch_type_write && - fds[i].revents & (POLLOUT | POLLERR | POLLHUP | POLLNVAL)) - { - fdw_hnd(cfd)(fdw_data(cfd), fdwatch_type_write); - changed = 1; - } - - if (changed) sr--; - } -} - -#endif /* HAVE_POLL */ diff --git a/d2pack109/src/common/fdwatch_poll.h b/d2pack109/src/common/fdwatch_poll.h deleted file mode 100644 index 7d688d3..0000000 --- a/d2pack109/src/common/fdwatch_poll.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * poll() based backend - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef __INCLUDED_FDWATCH_POLL__ -#define __INCLUDED_FDWATCH_POLL__ - -extern t_fdw_backend fdw_poll; - -#endif /* __INCLUDED_FDWATCH_POLL__ */ diff --git a/d2pack109/src/common/fdwatch_select.c b/d2pack109/src/common/fdwatch_select.c deleted file mode 100644 index 00a0a21..0000000 --- a/d2pack109/src/common/fdwatch_select.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * select() based backend - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#define FDWATCH_BACKEND -#include "common/setup_before.h" -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -/* According to earlier standards */ -#ifdef HAVE_SYS_TIME_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -/* According to POSIX 1003.1-2001 */ -#ifdef HAVE_SYS_SELECT_H -# include -#endif -#include "compat/psock.h" -#include "fdwatch.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/elist.h" -#include "common/setup_after.h" - -#ifdef HAVE_SELECT - -static int sr; -static int smaxfd; -static t_psock_fd_set *rfds = NULL, *wfds = NULL, /* working sets (updated often) */ - *trfds = NULL, *twfds = NULL; /* templates (updated rare) */ - -static int fdw_select_init(int nfds); -static int fdw_select_close(void); -static int fdw_select_add_fd(int idx, t_fdwatch_type rw); -static int fdw_select_del_fd(int idx); -static int fdw_select_watch(long timeout_msecs); -static void fdw_select_handle(void); - -t_fdw_backend fdw_select = { - fdw_select_init, - fdw_select_close, - fdw_select_add_fd, - fdw_select_del_fd, - fdw_select_watch, - fdw_select_handle -}; - -static int fdw_select_init(int nfds) -{ - if (nfds > FD_SETSIZE) return -1; /* this should not happen */ - - rfds = xmalloc(sizeof(t_psock_fd_set)); - wfds = xmalloc(sizeof(t_psock_fd_set)); - trfds = xmalloc(sizeof(t_psock_fd_set)); - twfds = xmalloc(sizeof(t_psock_fd_set)); - - PSOCK_FD_ZERO(trfds); PSOCK_FD_ZERO(twfds); - smaxfd = sr = 0; - - eventlog(eventlog_level_info, __FUNCTION__, "fdwatch select() based layer initialized (max %d sockets)", nfds); - return 0; -} - -static int fdw_select_close(void) -{ - if (rfds) { xfree((void *)rfds); rfds = NULL; } - if (wfds) { xfree((void *)wfds); wfds = NULL; } - if (trfds) { xfree((void *)trfds); trfds = NULL; } - if (twfds) { xfree((void *)twfds); twfds = NULL; } - smaxfd = sr = 0; - - return 0; -} - -static int fdw_select_add_fd(int idx, t_fdwatch_type rw) -{ - int fd; - -// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d rw: %d", fd, rw); - fd = fdw_fd(fdw_fds + idx); - - /* select() interface is limited by FD_SETSIZE max socket value */ - if (fd >= FD_SETSIZE) return -1; - - if (rw & fdwatch_type_read) PSOCK_FD_SET(fd, trfds); - else PSOCK_FD_CLR(fd, trfds); - if (rw & fdwatch_type_write) PSOCK_FD_SET(fd, twfds); - else PSOCK_FD_CLR(fd, twfds); - if (smaxfd < fd) smaxfd = fd; - - return 0; -} - -static int fdw_select_del_fd(int idx) -{ - int fd; - - fd = fdw_fd(fdw_fds + idx); -// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d", fd); - if (sr > 0) - eventlog(eventlog_level_error, __FUNCTION__, "BUG: called while still handling sockets"); - PSOCK_FD_CLR(fd, trfds); - PSOCK_FD_CLR(fd, twfds); - - return 0; -} - -static int fdw_select_watch(long timeout_msec) -{ - static struct timeval tv; - - tv.tv_sec = timeout_msec / 1000; - tv.tv_usec = timeout_msec % 1000; - - /* set the working sets based on the templates */ - memcpy(rfds, trfds, sizeof(t_psock_fd_set)); - memcpy(wfds, twfds, sizeof(t_psock_fd_set)); - - return (sr = psock_select(smaxfd + 1, rfds, wfds, NULL, &tv)); -} - -static int fdw_select_cb(t_fdwatch_fd *cfd, void *data) -{ -// eventlog(eventlog_level_trace, __FUNCTION__, "idx: %d fd: %d", idx, fdw_fd->fd); - if (fdw_rw(cfd) & fdwatch_type_read && PSOCK_FD_ISSET(fdw_fd(cfd), rfds) - && fdw_hnd(cfd)(fdw_data(cfd), fdwatch_type_read) == -2) return 0; - if (fdw_rw(cfd) & fdwatch_type_write && PSOCK_FD_ISSET(fdw_fd(cfd), wfds)) - fdw_hnd(cfd)(fdw_data(cfd), fdwatch_type_write); - - return 0; -} - -static void fdw_select_handle(void) -{ -// eventlog(eventlog_level_trace, __FUNCTION__, "called nofds: %d", fdw_nofds); - fdwatch_traverse(fdw_select_cb,NULL); - sr = 0; -} - -#endif /* HAVE_SELECT */ diff --git a/d2pack109/src/common/fdwatch_select.h b/d2pack109/src/common/fdwatch_select.h deleted file mode 100644 index 34394e4..0000000 --- a/d2pack109/src/common/fdwatch_select.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Abstraction API/layer for the various ways PvPGN can inspect sockets state - * 2003 (C) dizzy@roedu.net - * - * Code is based on the ideas found in thttpd project. - * - * select() based backend - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef __INCLUDED_FDWATCH_SELECT__ -#define __INCLUDED_FDWATCH_SELECT__ - -extern t_fdw_backend fdw_select; - -#endif /* __INCLUDED_FDWATCH_SELECT__ */ diff --git a/d2pack109/src/common/field_sizes.h b/d2pack109/src/common/field_sizes.h deleted file mode 100644 index 19079ea..0000000 --- a/d2pack109/src/common/field_sizes.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_FIELD_SIZES_TYPES -#define INCLUDED_FIELD_SIZES_TYPES - -#define MAX_PACKET_SIZE 3072 -#define MAX_NORMAL_TYPE 0xffff -#define MAX_FILE_TYPE 0xffff -#define MAX_AUTH_TYPE 0xff -#define MAX_GAMES_LIST 20 -#define MAX_MESSAGE_LEN 255 -#define MAX_COMMAND_LEN 32 -#define USER_NAME_MAX 16 /* including terminating NUL char */ -#define USER_NAME_MIN 2 -#define UNCHECKED_NAME_STR 32 /* including terminating NUL char */ - /* (longer than USER_NAME_MAX and CHAR_NAME_LEN so that - * proper error packets can be returned) */ -#define MAX_CLANNAME_LEN 64 -#define CHANNEL_NAME_LEN 64 -#define CHAR_NAME_LEN 16 /* including terminating NUL char */ -#define REALM_NAME_LEN 32 -#define GAME_NAME_LEN 32 -#define GAME_PASS_LEN 32 -#define GAME_INFO_LEN 256 -#define MAP_NAME_LEN 64 -#define BNETHASH_LEN 20 /* uint32*5, see bnethash.h */ -#define MAX_EXEINFO_STR 256 /* including terminating NUL char */ -#define MAX_OWNER_STR 128 /* including terminating NUL char */ -#define MAX_CDKEY_STR 128 /* including terminating NUL char */ -#define MAX_EMAIL_STR 128 /* including terminating NUL char */ -#define MAX_WINHOST_STR 128 /* including terminating NUL char */ -#define MAX_WINUSER_STR 128 /* including terminating NUL char */ -#define MAX_LANG_STR 64 /* including terminating NUL char */ -#define MAX_COUNTRYNAME_STR 128 /* including terminating NUL char */ -#define MAX_FILENAME_STR 2048 /* including terminating NUL char */ -#define MAX_GAMEREP_HEAD_STR 2048 /* including terminating NUL char */ -#define MAX_GAMEREP_BODY_STR 8192 /* including terminating NUL char */ -#define MAX_PLAYERINFO_STR 2048 /* including terminating NUL char */ -#define MAX_COUNTRYCODE_STR 32 /* including terminating NUL char */ -#define MAX_COUNTRY_STR 32 /* including terminating NUL char */ -#define MAX_ATTRKEY_STR 1024 /* including terminating NUL char */ -#define MAX_ATTRVAL_STR 4096 /* including terminating NUL char */ -#define MAX_IRC_MESSAGE_LEN 512 /* including CRLF (according to RFC 2812) */ -#define MAX_TOPIC_LEN 201 /* including terminating NUL char */ -#define CLANSHORT_NAME_MAX 4 -#define CLAN_NAME_MAX 25 /* including terminating NUL char */ - -#endif diff --git a/d2pack109/src/common/flags.h b/d2pack109/src/common/flags.h deleted file mode 100644 index 7cea849..0000000 --- a/d2pack109/src/common/flags.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2004 Dizzy (dizzy@roedu.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef INCLUDED_FLAGS_H -#define INCLUDED_FLAGS_H - -#define FLAG_ZERO(var) *(var) = 0 -#define FLAG_SET(var,flag) *(var) |= flag -#define FLAG_CLEAR(var,flag) *(var) &= ~flag -#define FLAG_ISSET(var,flag) (var & flag) - -#endif /* INCLUDED_FLAGS_H */ diff --git a/d2pack109/src/common/hashtable.c b/d2pack109/src/common/hashtable.c deleted file mode 100644 index 772011b..0000000 --- a/d2pack109/src/common/hashtable.c +++ /dev/null @@ -1,593 +0,0 @@ -/* - * Copyright (C) 2000,2001 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#define HASHTABLE_INTERNAL_ACCESS -#include "common/setup_before.h" -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include "common/eventlog.h" -#include "common/hashtable.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - - -static int nodata; /* if data points to this, then the entry was actually deleted */ - - -static t_entry * hashtable_entry_export(t_internentry * entry, t_hashtable const * hashtable, unsigned int row); - - -static t_entry * hashtable_entry_export(t_internentry * entry, t_hashtable const * hashtable, unsigned int row) -{ - t_entry * temp; - - if (!entry) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry"); - return NULL; - } - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return NULL; - } - if (row>=hashtable->num_rows) - { - eventlog(eventlog_level_error,__FUNCTION__,"got bad row %u (max %u)",row,hashtable->num_rows-1); - return NULL; - } - - temp = xmalloc(sizeof(t_entry)); - temp->row = row; - temp->real = entry; - temp->hashtable = hashtable; - - return temp; -} - - -extern t_hashtable * hashtable_create(unsigned int num_rows) -{ - t_hashtable * new; - unsigned int i; - - if (num_rows<1) - { - eventlog(eventlog_level_error,__FUNCTION__,"num_rows must be at least 1"); - return NULL; - } - - new = xmalloc(sizeof(t_hashtable)); - new->rows = xmalloc(sizeof(t_internentry *)*num_rows); - new->num_rows = num_rows; - new->len = 0; - for (i=0; irows[i] = NULL; - - return new; -} - - -extern int hashtable_destroy(t_hashtable * hashtable) -{ - unsigned int i; - - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return -1; - } - - hashtable_purge(hashtable); - for (i=0; inum_rows; i++) - if (hashtable->rows[i]) - eventlog(eventlog_level_error,__FUNCTION__,"got non-empty hashtable"); - - xfree(hashtable->rows); - xfree(hashtable); - - return 0; -} - - -extern int hashtable_purge(t_hashtable * hashtable) -{ - unsigned int row; - t_internentry * curr; - t_internentry * head; - t_internentry * next; - t_internentry * * change; - - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return -1; - } - -#ifdef HASHTABLE_DEBUG - hashtable_check(hashtable); -#endif - - for (row=0; rownum_rows; row++) - { - head = NULL; - change = NULL; - for (curr=hashtable->rows[row]; curr; curr=next) - { - next = curr->next; - if (curr->data==&nodata) - { - if (change) - *change = next; - xfree(curr); - } - else - { - if (!head) - head = curr; - change = &curr->next; - } - } - hashtable->rows[row] = head; - } - - return 0; -} - - -extern int hashtable_check(t_hashtable const * hashtable) -{ - unsigned int emptycnt; - unsigned int validcnt; - unsigned int row; - unsigned int temp; - t_internentry const * tail; - t_internentry const * curr; - - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return -1; - } - if (hashtable->num_rows<1) - { - eventlog(eventlog_level_error,__FUNCTION__,"num_rows=%u",hashtable->num_rows); - return -1; - } - if (!hashtable->rows) - { - eventlog(eventlog_level_error,__FUNCTION__,"hashtable->rows is NULL"); - return -1; - } - - emptycnt=validcnt = 0; - for (row=0; rownum_rows; row++) - { - tail = NULL; - for (curr=hashtable->rows[row]; curr; curr=curr->next) - { - if (tail) - { - if (curr==tail) /* tail is currently the previous node */ - { - eventlog(eventlog_level_error,__FUNCTION__,"row %u is circular (curr==prev==%p)",row,curr); - return -1; - } - if (curr->next==tail) - { - eventlog(eventlog_level_error,__FUNCTION__,"row %u is circular (curr->next==prev==%p)",row,curr); - return -1; - } - for (temp=0; tempnum_rows; temp++) - if (curr==hashtable->rows[temp]) - { - eventlog(eventlog_level_error,__FUNCTION__,"row %u is circular (curr==rows[%u]==%p)",row,temp,curr); - return -1; - } - } - if (curr->data==&nodata) - emptycnt++; - else - validcnt++; - tail = curr; - } - } - - if (emptycnt>10 && emptycnt>validcnt+5) /* arbitrary heuristic to detect missing list_purge() cal -ls */ - eventlog(eventlog_level_warn,__FUNCTION__,"emptycnt=%u but validcnt=%u",emptycnt,validcnt); - if (hashtable->len!=validcnt) - { - eventlog(eventlog_level_error,__FUNCTION__,"hashtable->len=%u but validcnt=%u",hashtable->len,validcnt); - return -1; - } - - return 0; -} - - -extern unsigned int hashtable_get_length(t_hashtable const * hashtable) -{ - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return 0; - } - - return hashtable->len; -} - - -extern int hashtable_insert_data(t_hashtable * hashtable, void * data, unsigned int hash) -{ - unsigned int row; - t_internentry * entry; - - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return -1; - } - - entry = xmalloc(sizeof(t_internentry)); - entry->data = data; - - row = hash%hashtable->num_rows; - entry->next = hashtable->rows[row]; - hashtable->rows[row] = entry; - hashtable->len++; - - return 0; -} - - -extern t_entry * hashtable_get_entry_by_data(t_hashtable const * hashtable, void const * data, unsigned int hash) -{ - unsigned int row; - t_internentry * curr; - - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return NULL; - } - - row = hash%hashtable->num_rows; - for (curr=hashtable->rows[row]; curr; curr=curr->next) - if (curr->data==data) - return hashtable_entry_export(curr,hashtable,row); - - return NULL; -} - - -extern t_entry const * hashtable_get_entry_by_data_const(t_hashtable const * hashtable, void const * data, unsigned int hash) -{ - unsigned int row; - t_internentry * curr; - - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return NULL; - } - - row = hash%hashtable->num_rows; - for (curr=hashtable->rows[row]; curr; curr=curr->next) - if (curr->data==data) - return hashtable_entry_export(curr,hashtable,row); - - return NULL; -} - - -extern int hashtable_remove_entry(t_hashtable * hashtable, t_entry * entry) -{ - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return -1; - } - if (!entry) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry"); - return -1; - } - if (!entry->real) - { - eventlog(eventlog_level_error,__FUNCTION__,"entry has NULL real pointer"); - return -1; - } - if (entry->real->data==&nodata) - { - eventlog(eventlog_level_error,__FUNCTION__,"got deleted entry"); - return -1; - } - - entry->real->data = &nodata; - hashtable->len--; - - return 0; -} - - -extern int hashtable_remove_data(t_hashtable * hashtable, void const * data, unsigned int hash) -{ - t_entry * entry; - int retval; - - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return -1; - } - - if (!(entry = hashtable_get_entry_by_data(hashtable,data,hash))) - return -1; - - retval = hashtable_remove_entry(hashtable,entry); - - hashtable_entry_release(entry); - - return retval; -} - - -extern void * entry_get_data(t_entry const * entry) -{ - if (!entry) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry"); - return NULL; - } - if (!entry->real) - { - eventlog(eventlog_level_error,__FUNCTION__,"entry has NULL real pointer"); - return NULL; - } - if (entry->real->data==&nodata) - { - eventlog(eventlog_level_error,__FUNCTION__,"got deleted entry"); - return NULL; - } - - return entry->real->data; -} - - -extern void * hashtable_get_data_by_pos(t_hashtable const * hashtable, unsigned int pos) -{ - t_internentry const * curr; - unsigned int row; - unsigned int len; - - if (!hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); - return NULL; - } - - len = 0; - row = 0; - curr = NULL; - for (;;) - { - if (!curr) - { - if (row>=hashtable->num_rows) - break; - curr = hashtable->rows[row++]; - continue; - } - if (curr->data!=&nodata && len++==pos) - return curr->data; - curr = curr->next; - } - - eventlog(eventlog_level_error,__FUNCTION__,"requested position %u but len=%u",pos,len); - return NULL; -} - - -#ifdef HASHTABLE_DEBUG -extern t_entry * hashtable_get_first_real(t_hashtable const * hashtable, char const * fn, unsigned int ln) -#else -extern t_entry * hashtable_get_first(t_hashtable const * hashtable) -#endif -{ - unsigned int row; - t_internentry * curr; - - if (!hashtable) - { -#ifdef HASHTABLE_DEBUG - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable from %s:%u",fn,ln); -#else - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); -#endif - return NULL; - } - - for (row=0; rownum_rows; row++) - for (curr=hashtable->rows[row]; curr; curr=curr->next) - if (curr->data!=&nodata) - return hashtable_entry_export(curr,hashtable,row); - - return NULL; -} - - -extern t_entry * entry_get_next(t_entry * entry) -{ - t_hashtable const * hashtable; - unsigned int row; - t_internentry * curr; - - if (!entry) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry"); - return NULL; - } - - hashtable = entry->hashtable; - - for (curr=entry->real->next; curr; curr=curr->next) - if (curr->data!=&nodata) - { - entry->real = curr; - return entry; - } - - for (row=entry->row+1; rownum_rows; row++) - for (curr=hashtable->rows[row]; curr; curr=curr->next) - if (curr->data!=&nodata) - { - entry->real = curr; - entry->row = row; - return entry; - } - - hashtable_entry_release(entry); - return NULL; -} - - -#ifdef HASHTABLE_DEBUG -extern t_entry * hashtable_get_first_matching_real(t_hashtable const * hashtable, unsigned int hash, char const * fn, unsigned int ln) -#else -extern t_entry * hashtable_get_first_matching(t_hashtable const * hashtable, unsigned int hash) -#endif -{ - unsigned int row; - t_internentry * curr; - - if (!hashtable) - { -#ifdef HASHTABLE_DEBUG - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable from %s:%u",fn,ln); -#else - eventlog(eventlog_level_error,__FUNCTION__,"got NULL hashtable"); -#endif - return NULL; - } - - row = hash%hashtable->num_rows; - for (curr=hashtable->rows[row]; curr; curr=curr->next) - if (curr->data!=&nodata) - return hashtable_entry_export(curr,hashtable,row); - - return NULL; -} - - -extern t_entry * entry_get_next_matching(t_entry * entry) -{ - t_internentry * curr; - - if (!entry) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry"); - return NULL; - } - - for (curr=entry->real->next; curr; curr=curr->next) - if (curr->data!=&nodata) - { - entry->real = curr; - return entry; - } - - hashtable_entry_release(entry); - return NULL; -} - - -extern int hashtable_entry_release(t_entry * entry) -{ - if (!entry) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL entry"); - return -1; - } - if (!entry->hashtable) - { - eventlog(eventlog_level_error,__FUNCTION__,"got entry with NULL hashtable"); - return -1; - } - if (!entry->real) - { - eventlog(eventlog_level_error,__FUNCTION__,"got entry with NULL real pointer"); - return -1; - } - if (entry->row>=entry->hashtable->num_rows) - { - eventlog(eventlog_level_error,__FUNCTION__,"entry has bad row %u (max %u)",entry->row,entry->hashtable->num_rows-1); - return -1; - } - -#ifdef HASHTABLE_DEBUG - hashtable_check(entry->hashtable); -#endif - xfree(entry); - return 0; -} - - -extern int hashtable_stats(t_hashtable * hashtable) -{ - unsigned int row; - t_internentry * curr; - unsigned int rcount, max, min; - - if (!hashtable) - { - eventlog(eventlog_level_error, __FUNCTION__,"got NULL hashtable"); - return -1; - } - -#ifdef HASHTABLE_DEBUG - hashtable_check(hashtable); -#endif - - max = 0; - min = hashtable->len; - for (row=0; rownum_rows; row++) - { - rcount = 0; - for (curr=hashtable->rows[row]; curr; curr=curr->next) - if (curr->data!=&nodata) rcount++; - if (rcount > max) max = rcount; - if (rcount < min) min = rcount; - } - - eventlog(eventlog_level_info, __FUNCTION__, "hashsize: %u min: %u max: %u avg: %.2f diff: %.2f%c", hashtable->num_rows, min, max, (float)(min + max)/2, (float)(max - min)/max*100, '%'); - return 0; -} - - diff --git a/d2pack109/src/common/hashtable.h b/d2pack109/src/common/hashtable.h deleted file mode 100644 index 0626714..0000000 --- a/d2pack109/src/common/hashtable.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_HASHTABLE_TYPES -#define INCLUDED_HASHTABLE_TYPES - -#ifdef HASHTABLE_INTERNAL_ACCESS -struct hashtable; /* forward reference for t_entry */ -#endif - -#ifdef HASHTABLE_INTERNAL_ACCESS -typedef struct internentry -{ - void * data; - struct internentry * next; -} -t_internentry; -#endif - -typedef struct entry -#ifdef HASHTABLE_INTERNAL_ACCESS -{ - unsigned int row; - t_internentry * real; - struct hashtable const * hashtable; -} -#endif -t_entry; - -typedef struct hashtable -#ifdef HASHTABLE_INTERNAL_ACCESS -{ - unsigned int num_rows; - unsigned int len; - unsigned int zombies; - t_internentry * * rows; -} -#endif -t_hashtable; - -#endif - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_HASHTABLE_PROTOS -#define INCLUDED_HASHTABLE_PROTOS - -extern t_hashtable * hashtable_create(unsigned int num_rows) ; -extern int hashtable_destroy(t_hashtable * hashtable); -extern int hashtable_purge(t_hashtable * hashtable); -extern int hashtable_check(t_hashtable const * hashtable); -extern unsigned int hashtable_get_length(t_hashtable const * hashtable); -extern int hashtable_insert_data(t_hashtable * hashtable, void * data, unsigned int hash); -extern t_entry * hashtable_get_entry_by_data(t_hashtable const * hashtable, void const * data, unsigned int hash); -extern t_entry const * hashtable_get_entry_by_data_const(t_hashtable const * hashtable, void const * data, unsigned int hash); -extern int hashtable_remove_data(t_hashtable * hashtable, void const * data, unsigned int hash); /* delete matching item */ -extern int hashtable_remove_entry(t_hashtable * hashtable, t_entry * entry); -extern void * hashtable_get_data_by_pos(t_hashtable const * hashtable, unsigned int pos); -extern void * entry_get_data(t_entry const * entry); -#ifdef HASHTABLE_DEBUG -extern t_entry * hashtable_match_get_first_real(t_hashtable const * hashtable, unsigned int hash, char const * fn, unsigned int ln); -# define hashtable_match_get_first(L,H) hashtable_match_get_first_real(L,H,__FILE__,__LINE__) -#else -extern t_entry * hashtable_match_get_first(t_hashtable const * hashtable, unsigned int hash); -#endif -extern t_entry * entry_match_get_next(t_entry const * entry, unsigned int hash); -#ifdef HASHTABLE_DEBUG -extern t_entry * hashtable_get_first_real(t_hashtable const * hashtable, char const * fn, unsigned int ln); -# define hashtable_get_first(L) hashtable_get_first_real(L,__FILE__,__LINE__) -#else -extern t_entry * hashtable_get_first(t_hashtable const * hashtable); -#endif -extern t_entry * entry_get_next(t_entry * entry); -#ifdef HASHTABLE_DEBUG -extern t_entry * hashtable_get_first_matching_real(t_hashtable const * hashtable, unsigned int hash, char const * fn, unsigned int ln); -# define hashtable_get_first_matching(L,H) hashtable_get_first_matching_real(L,H,__FILE__,__LINE__) -#else -extern t_entry * hashtable_get_first_matching(t_hashtable const * hashtable, unsigned int hash); -#endif -extern t_entry * entry_get_next_matching(t_entry * entry); -extern int hashtable_entry_release(t_entry * entry); -extern int hashtable_stats(t_hashtable * hashtable); - -#define HASHTABLE_TRAVERSE(hashtable,curr) for (curr=hashtable_get_first(hashtable); curr; curr=entry_get_next(curr)) -#define HASHTABLE_TRAVERSE_MATCHING(hashtable,curr,hash) for (curr=hashtable_get_first_matching(hashtable,hash); curr; curr=entry_get_next_matching(curr)) - -#endif -#endif diff --git a/d2pack109/src/common/hexdump.c b/d2pack109/src/common/hexdump.c deleted file mode 100644 index 4b0cb0c..0000000 --- a/d2pack109/src/common/hexdump.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu) - * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include "common/hexdump.h" -#include "common/setup_after.h" - - -extern void hexdump(FILE * stream, void const * data, unsigned int len) -{ - unsigned int i; - unsigned int r,c; - - if (!stream) - return; - if (!data) - return; - - for (r=0,i=0; r<(len/16+(len%16!=0)); r++,i+=16) - { - fprintf(stream,"%04X: ",i); /* location of first byte in line */ - - for (c=i; c=32 && - ((unsigned char const *)data)[c]<127) - fprintf(stream,"%c",((char const *)data)[c]); - else - fprintf(stream,"."); /* put this for non-printables */ - else - fprintf(stream," "); /* pad if short line */ - - fprintf(stream,"\n"); - } - - fflush(stream); -} diff --git a/d2pack109/src/common/hexdump.h b/d2pack109/src/common/hexdump.h deleted file mode 100644 index cda4619..0000000 --- a/d2pack109/src/common/hexdump.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu) - * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - - -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_HEXDUMP_PROTOS -#define INCLUDED_HEXDUMP_PROTOS - -#define JUST_NEED_TYPES -#include -#undef JUST_NEED_TYPES - -extern void hexdump(FILE * stream, void const * data, unsigned int len); - -#endif -#endif diff --git a/d2pack109/src/common/init_protocol.h b/d2pack109/src/common/init_protocol.h deleted file mode 100644 index 28faaa5..0000000 --- a/d2pack109/src/common/init_protocol.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_INIT_PROTOCOL_TYPES -#define INCLUDED_INIT_PROTOCOL_TYPES - -#ifdef JUST_NEED_TYPES -# include "common/bn_type.h" -#else -# define JUST_NEED_TYPES -# include "common/bn_type.h" -# undef JUST_NEED_TYPES -#endif - -/* There is no header for this packet class and there is only - * one packet type. - */ - -/* - * There is a single byte sent upon initial connections that - * reports the connection type. - */ - -/******************************************************/ -#define CLIENT_INITCONN 0x1 -typedef struct -{ - bn_byte class; -} PACKED_ATTR() t_client_initconn; -/******************************************************/ - -#endif - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_INIT_PROTOCOL_PROTOS -#define INCLUDED_INIT_PROTOCOL_PROTOS - -#define CLIENT_INITCONN_CLASS_DEFER 0x01 /* great... means either "bnet protocol" or "auth protocol" */ -#define CLIENT_INITCONN_CLASS_FILE 0x02 -#define CLIENT_INITCONN_CLASS_BOT 0x03 -#define CLIENT_INITCONN_CLASS_ENC 0x04 /* encrypted connection */ -#define CLIENT_INITCONN_CLASS_TELNET 0x0d /* Hack alert: look for user to hit \r when they connect */ -#define CLIENT_INITCONN_CLASS_D2CS 0x01 -#define CLIENT_INITCONN_CLASS_D2GS 0x64 -#define CLIENT_INITCONN_CLASS_D2CS_BNETD 0x65 - -#endif -#endif diff --git a/d2pack109/src/common/list.c b/d2pack109/src/common/list.c deleted file mode 100644 index c5170ff..0000000 --- a/d2pack109/src/common/list.c +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#define LIST_INTERNAL_ACCESS -#include "common/setup_before.h" -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_ASSERT_H -# include -#endif -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/list.h" -#include "common/setup_after.h" - - -static t_elem listhead; - - -extern t_list * list_create(void) -{ - t_list * new; - - new = xmalloc(sizeof(t_list)); - new->head = NULL; - new->tail = NULL; - new->len = 0; - - return new; -} - - -extern int list_destroy(t_list * list) -{ - if (!list) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list"); - return -1; - } - - if (list->head) - eventlog(eventlog_level_error,__FUNCTION__,"got non-empty list"); - - xfree(list); - - return 0; -} - -extern unsigned int list_get_length(t_list const * list) -{ - if (!list) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list"); - return 0; - } - - return list->len; -} - - -extern int list_prepend_data(t_list * list, void * data) -{ - t_elem * elem; - - assert(list != NULL); - - elem = xmalloc(sizeof(t_elem)); - elem->data = data; - - if (list->head) - list->head->prev = elem; - elem->next = list->head; - elem->prev = NULL; - list->head = elem; - if (!list->tail) - list->tail = elem; - list->len++; - - return 0; -} - - -extern int list_append_data(t_list * list, void * data) -{ - t_elem * elem; - - assert(list != NULL); - - elem = xmalloc(sizeof(t_elem)); - elem->data = data; - - elem->next = NULL; - if (!list->head) - { - list->head = elem; - elem->prev = NULL; - } - if (list->tail) - { - elem->prev = list->tail; - list->tail->next = elem; - } - list->tail = elem; - list->len++; - - return 0; -} - - -extern t_elem * list_get_elem_by_data(t_list const * list, void const * data) -{ - t_elem * curr; - - if (!list) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list"); - return NULL; - } - - LIST_TRAVERSE(list,curr) - if (curr->data==data) - return curr; - - return NULL; -} - - -extern t_elem const * list_get_elem_by_data_const(t_list const * list, void const * data) -{ - t_elem const * curr; - - if (!list) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list"); - return NULL; - } - - LIST_TRAVERSE_CONST(list,curr) - if (curr->data==data) - return curr; - - return NULL; -} - - -extern int list_remove_elem(t_list * list, t_elem ** elem) -{ - t_elem * target; - - if (!list) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list"); - return -1; - } - - if (!elem) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL *elem"); - return -1; - } - - target = *elem; - - if (target->prev) - { - target->prev->next = target->next; - } - if (target->next) - { - target->next->prev = target->prev; - } - - if (target == list->tail) - { - list->tail = target->prev; - } - if (target == list->head) - { - list->head = target->next; - *elem = &listhead; - } - else - *elem = target->prev; - - target->next = NULL; - target->prev = NULL; - xfree(target); - - list->len--; - - return 0; -} - - -extern int list_remove_data(t_list * list, void const * data, t_elem ** elem) -{ - if (!list) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list"); - return -1; - } - - if (!(*elem = list_get_elem_by_data(list,data))) - return -1; - - return list_remove_elem(list,elem); -} - - -extern int elem_set_data(t_elem * elem, void * data) -{ - if (!elem) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem"); - return -1; - } - - elem->data = data; - - return 0; -} - - -extern void * elem_get_data(t_elem const * elem) -{ - if (!elem) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem"); - return NULL; - } - - return elem->data; -} - - -extern void * list_get_data_by_pos(t_list const * list, unsigned int pos) -{ - t_elem const * curr; - unsigned int len; - - len = 0; - LIST_TRAVERSE_CONST(list,curr) - if (len++==pos) - return curr->data; - - eventlog(eventlog_level_error,__FUNCTION__,"requested position %u but len=%u",pos,len); - return NULL; -} - - -#ifdef LIST_DEBUG -extern t_elem * list_get_first_real(t_list const * list, char const * fn, unsigned int ln) -#else -extern t_elem * list_get_first(t_list const * list) -#endif -{ - if (!list) - { -#ifdef LIST_DEBUG - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list from %s:%u",fn,ln); -#else - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list"); -#endif - return NULL; - } - - - return list->head; -} - - -#ifdef LIST_DEBUG -extern t_elem const * list_get_first_const_real(t_list const * list, char const * fn, unsigned int ln) -#else -extern t_elem const * list_get_first_const(t_list const * list) -#endif -{ - if (!list) - { -#ifdef LIST_DEBUG - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list from %s:%u",fn,ln); -#else - eventlog(eventlog_level_error,__FUNCTION__,"got NULL list"); -#endif - return NULL; - } - - return list->head; -} - - -extern t_elem * elem_get_next_real(t_list const * list, t_elem const * elem, char const * fn, unsigned int ln) -{ - if (!elem) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem from %s:%u",fn,ln); - return NULL; - } - - if (elem == &listhead) - return list->head; - else - return elem->next; -} - - -extern t_elem const * elem_get_next_const(t_list const * list, t_elem const * elem) -{ - if (!elem) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL elem"); - return NULL; - } - - if (elem == &listhead) - return list->head; - else - return elem->next; -} diff --git a/d2pack109/src/common/list.h b/d2pack109/src/common/list.h deleted file mode 100644 index 48958fe..0000000 --- a/d2pack109/src/common/list.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_LIST_TYPES -#define INCLUDED_LIST_TYPES - -typedef struct elem -#ifdef LIST_INTERNAL_ACCESS -{ - void * data; - struct elem * prev; - struct elem * next; -} -#endif -t_elem; - -typedef struct list -#ifdef LIST_INTERNAL_ACCESS -{ - unsigned int len; - t_elem * head; - t_elem * tail; -} -#endif -t_list; - -#endif - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_LIST_PROTOS -#define INCLUDED_LIST_PROTOS - -extern t_list * list_create(void) ; -extern int list_destroy(t_list * list); -extern unsigned int list_get_length(t_list const * list); -extern int list_prepend_data(t_list * list, void * data); -extern int list_append_data(t_list * list, void * data); -extern t_elem * list_get_elem_by_data(t_list const * list, void const * data); -extern t_elem const * list_get_elem_by_data_const(t_list const * list, void const * data); - -/* note changed API for those commands: - due to direct removal of elements from list, you need to take special care during list traversal. - a pointer to the traversal variable needs to be passed to the list_remove functions, so they - can properly modify it to point to the "previous" element (the one before the element to be deleted) - so the next elem_get_next call will address the "next" element (the one after the element to be deleted) */ - -extern int list_remove_data(t_list * list, void const * data, t_elem ** elem); /* delete matching item */ -extern int list_remove_elem(t_list * list, t_elem ** elem); - -extern void * list_get_data_by_pos(t_list const * list, unsigned int pos); -#ifdef LIST_DEBUG -extern t_elem * list_get_first_real(t_list const * list, char const * fn, unsigned int ln); -# define list_get_first(L) list_get_first_real(L,__FILE__,__LINE__) -#else -extern t_elem * list_get_first(t_list const * list); -#endif -#ifdef LIST_DEBUG -extern t_elem const * list_get_first_const_real(t_list const * list, char const * fn, unsigned int ln); -# define list_get_first_const(L) list_get_first_const_real(L,__FILE__,__LINE__) -#else -extern t_elem const * list_get_first_const(t_list const * list); -#endif - -extern void * elem_get_data(t_elem const * elem); -extern int elem_set_data(t_elem * elem, void * data); -#define elem_get_next(list,elem) elem_get_next_real(list,elem,__FILE__,__LINE__) -extern t_elem * elem_get_next_real(t_list const * list, t_elem const * elem,char const * fn, unsigned int ln); -extern t_elem const * elem_get_next_const(t_list const * list, t_elem const * elem); - -#define LIST_TRAVERSE(list,curr) for (curr=(list)?list_get_first(list):(NULL); curr; curr=elem_get_next(list,curr)) -#define LIST_TRAVERSE_CONST(list,curr) for (curr=(list)?list_get_first_const(list):(NULL); curr; curr=elem_get_next_const(list,curr)) - -#endif -#endif diff --git a/d2pack109/src/common/network.c b/d2pack109/src/common/network.c deleted file mode 100644 index 3f7d527..0000000 --- a/d2pack109/src/common/network.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu) - * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#include -#include "compat/strerror.h" -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/socket.h" -#include "compat/recv.h" -#include "compat/send.h" -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#include "compat/psock.h" -#include "common/packet.h" -#include "common/eventlog.h" -#include "common/field_sizes.h" -#include "common/network.h" -#include "common/setup_after.h" - - -extern int net_recv_packet(int sock, t_packet * packet, unsigned int * currsize) -{ - int addlen; - unsigned int header_size; - void * temp; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] got NULL packet (closing connection)",sock); - return -1; - } - if (!currsize) - { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] got NULL currsize (closing connection)",sock); - return -1; - } - - if ((header_size = packet_get_header_size(packet))>=MAX_PACKET_SIZE) - { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] could not determine header size (closing connection)",sock); - return -1; - } - - if (!(temp = packet_get_raw_data_build(packet,*currsize))) - { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] could not obtain raw data pointer at offset %u (closing connection)",sock,*currsize); - return -1; - } - - if (*currsize=total_size) - { - eventlog(eventlog_level_warn,__FUNCTION__,"[%d] more data requested for already complete packet (total_size=%u currsize=%u) (closing connection)",sock,total_size,*currsize); - return -1; - } - - addlen = psock_recv(sock, - temp, - total_size-*currsize, - 0); - } - - if (addlen==0) - { - eventlog(eventlog_level_debug,__FUNCTION__,"[%d] remote host closed connection",sock); - return -1; - } - if (addlen<0) - { - if ( -#ifdef PSOCK_EINTR - psock_errno()==PSOCK_EINTR || -#endif -#ifdef PSOCK_EAGAIN - psock_errno()==PSOCK_EAGAIN || -#endif -#ifdef PSOCK_EWOULDBLOCK - psock_errno()==PSOCK_EWOULDBLOCK || -#endif -#ifdef PSOCK_ENOMEM - psock_errno()==PSOCK_ENOMEM || -#endif - 0) /* try later */ - return 0; - if ( -#ifdef PSOCK_ENOTCONN - psock_errno()==PSOCK_ENOTCONN || -#endif -#ifdef PSOCK_ECONNRESET - psock_errno()==PSOCK_ECONNRESET || -#endif - 0) - { -/* eventlog(eventlog_level_debug,__FUNCTION__,"[%d] remote host closed connection (psock_recv: %s)",sock,strerror(psock_errno())); */ - return -1; /* common error: close connection, but no message */ - } - eventlog(eventlog_level_debug,__FUNCTION__,"[%d] receive error (closing connection) (psock_recv: %s)",sock,strerror(psock_errno())); - return -1; - } - - *currsize += addlen; - - if (*currsize>=header_size && *currsize==packet_get_size(packet)) - return 1; - - return 0; -} - - -extern int net_send_packet(int sock, t_packet const * packet, unsigned int * currsize) -{ - unsigned int size; - int addlen; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] got NULL packet (closing connection)",sock); - return -1; - } - if (!currsize) - { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] got NULL currsize (closing connection)",sock); - return -1; - } - - if ((size = packet_get_size(packet))<1) - { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] packet to send is empty (skipping it)",sock); - *currsize = 0; - return 1; - } - - addlen = psock_send(sock, - packet_get_raw_data_const(packet,*currsize), - size-*currsize, - 0); - - if (addlen<0) - { - if ( -#ifdef PSOCK_EINTR - psock_errno()==PSOCK_EINTR || -#endif -#ifdef PSOCK_EAGAIN - psock_errno()==PSOCK_EAGAIN || -#endif -#ifdef PSOCK_EWOULDBLOCK - psock_errno()==PSOCK_EWOULDBLOCK || -#endif -#ifdef PSOCK_ENOBUFS - psock_errno()==PSOCK_ENOBUFS || -#endif -#ifdef PSOCK_ENOMEM - psock_errno()==PSOCK_ENOMEM || -#endif - 0) - return 0; /* try again later */ - - if ( -#ifdef PSOCK_EPIPE - psock_errno()!=PSOCK_EPIPE && -#endif -#ifdef PSOCK_ECONNRESET - psock_errno()!=PSOCK_ECONNRESET && -#endif - 1) eventlog(eventlog_level_debug,__FUNCTION__,"[%d] could not send data (closing connection) (psock_send: %s)",sock,strerror(psock_errno())); - return -1; - } - - if (addlen==0) - { - eventlog(eventlog_level_debug,__FUNCTION__,"[%d] no data sent (closing connection)",sock); - return -1; - } - - *currsize += addlen; - - /* sent all data in this packet? */ - if (size==*currsize) - { - *currsize = 0; - return 1; - } - - return 0; -} diff --git a/d2pack109/src/common/network.h b/d2pack109/src/common/network.h deleted file mode 100644 index 9b49c5c..0000000 --- a/d2pack109/src/common/network.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu) - * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_NETWORK_PROTOS -#define INCLUDED_NETWORK_PROTOS - -#define JUST_NEED_TYPES -#include "common/packet.h" -#undef JUST_NEED_TYPES - -extern int net_recv_packet(int sock, t_packet * packet, unsigned int * currsize); -extern int net_send_packet(int sock, t_packet const * packet, unsigned int * currsize); - -#endif -#endif diff --git a/d2pack109/src/common/packet.c b/d2pack109/src/common/packet.c deleted file mode 100644 index 4283332..0000000 --- a/d2pack109/src/common/packet.c +++ /dev/null @@ -1,787 +0,0 @@ -/* - * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * Copyright (C) 1999,2000,2001 Marco Ziech (mmz@gmx.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#ifdef HAVE_MEMORY_H -# include -#endif -#include "compat/memcpy.h" -#include "common/eventlog.h" -#include "common/bn_type.h" -#include "common/field_sizes.h" -#include "common/xalloc.h" -#include "common/packet.h" -#include "common/setup_after.h" - - -extern t_packet * packet_create(t_packet_class class) -{ - t_packet * temp; - - if (class!=packet_class_init && - class!=packet_class_raw && - class!=packet_class_d2game && - class!=packet_class_d2cs && - class!=packet_class_d2gs && - class!=packet_class_d2cs_bnetd) - { - eventlog(eventlog_level_error,__FUNCTION__,"invalid packet class %d",(int)class); - return NULL; - } - - temp = xmalloc(sizeof(t_packet)); - temp->ref = 1; - temp->class = class; - temp->flags = 0; - packet_set_size(temp,0); - - return temp; -} - - -extern void packet_destroy(t_packet const * packet) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return; - } - - xfree((void *)packet); /* avoid warning */ -} - - -extern t_packet * packet_add_ref(t_packet * packet) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return NULL; - } - - packet->ref++; - return packet; -} - - -extern void packet_del_ref(t_packet * packet) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return; - } - - if (packet->ref<2) /* if would go to zero */ - packet_destroy(packet); - else - packet->ref--; -} - - -extern t_packet_class packet_get_class(t_packet const * packet) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return packet_class_none; - } - - switch (packet->class) - { - case packet_class_init: - return packet_class_init; - case packet_class_raw: - return packet_class_raw; - case packet_class_d2game: - return packet_class_d2game; - case packet_class_d2cs: - return packet_class_d2cs; - case packet_class_d2gs: - return packet_class_d2gs; - case packet_class_d2cs_bnetd: - return packet_class_d2cs_bnetd; - case packet_class_none: - return packet_class_none; - default: - eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class); - return packet_class_none; - } -} - - -extern char const * packet_get_class_str(t_packet const * packet) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return "unknown"; - } - - switch (packet->class) - { - case packet_class_init: - return "init"; - case packet_class_raw: - return "raw"; - case packet_class_d2game: - return "d2game"; - case packet_class_d2gs: - return "d2gs"; - case packet_class_d2cs_bnetd: - return "d2cs_bnetd"; - case packet_class_d2cs: - return "d2cs"; - case packet_class_none: - return "none"; - default: - eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class); - return "unknown"; - } -} - - -extern int packet_set_class(t_packet * packet, t_packet_class class) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return -1; - } - if (packet->class!=packet_class_raw) - { - eventlog(eventlog_level_error,__FUNCTION__,"got non-raw packet"); - return -1; - } - if (class!=packet_class_init && - class!=packet_class_raw && - class!=packet_class_d2game && - class!=packet_class_d2cs && - class!=packet_class_d2gs && - class!=packet_class_d2cs_bnetd) - { - eventlog(eventlog_level_error,__FUNCTION__,"invalid packet class %d",(int)class); - return -1; - } - - packet->class = class; - return 0; -} - - -extern unsigned int packet_get_type(t_packet const * packet) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return 0; - } - - switch (packet->class) - { - case packet_class_init: - return CLIENT_INITCONN; /* all init packets are of this type */ - - case packet_class_raw: - return 0; /* raw packets don't have a type, but don't warn because the packet dump tries anyway */ - - case packet_class_d2game: - if (packet_get_size(packet)u.d2game.h.type); - - case packet_class_d2gs: - if (packet_get_size(packet)u.d2cs_d2gs.h.type); - case packet_class_d2cs_bnetd: - if (packet_get_size(packet)u.d2cs_d2gs.h.type); - - case packet_class_d2cs: - if (packet_get_size(packet)u.d2cs_client.h.type); - - default: - eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class); - return 0; - } -} - - -extern char const * packet_get_type_str(t_packet const * packet, t_packet_dir dir) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return "unknown"; - } - - switch (dir) - { - case packet_dir_from_client: - switch (packet->class) - { - case packet_class_init: - return "CLIENT_INITCONN"; - case packet_class_raw: - return "CLIENT_RAW"; - - case packet_class_d2game: - if (packet_get_size(packet)u.d2game.h.type)) - { - default: - return "CLIENT_D2GAME"; - } - return "unknown"; - - case packet_class_d2cs: - return "D2CS"; - case packet_class_d2gs: - return "D2GS"; - case packet_class_d2cs_bnetd: - return "D2CS_BNETD"; - - case packet_class_none: - return "unknown"; - } - - eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class); - return "unknown"; - - case packet_dir_from_server: - switch (packet->class) - { - case packet_class_init: - return "unknown"; - case packet_class_raw: - return "SERVER_RAW"; - - case packet_class_d2game: - if (packet_get_size(packet)u.d2game.h.type)) - { - default: - return "SERVER_D2GAME"; - } - return "unknown"; - - case packet_class_d2cs: - return "D2CS"; - case packet_class_d2gs: - return "D2GS"; - case packet_class_d2cs_bnetd: - return "D2CS_BNETD"; - - case packet_class_none: - return "unknown"; - } - - eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class); - return "unknown"; - } - - eventlog(eventlog_level_error,__FUNCTION__,"got unknown direction %d",(int)dir); - return "unknown"; -} - - -extern int packet_set_type(t_packet * packet, unsigned int type) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return -1; - } - - switch (packet->class) - { - case packet_class_init: - if (type!=CLIENT_INITCONN) - { - eventlog(eventlog_level_error,__FUNCTION__,"init packet type 0x%08x is not valid",type); - return -1; - } - return 0; - - case packet_class_d2game: - if (packet_get_size(packet)u.d2game.h.type,type); - return 0; - - case packet_class_d2gs: - if (packet_get_size(packet)u.d2cs_d2gs.h.type,type); - return 0; - - case packet_class_d2cs_bnetd: - if (packet_get_size(packet)u.d2cs_bnetd.h.type,type); - return 0; - - case packet_class_d2cs: - if (packet_get_size(packet)u.d2cs_client.h.type,type); - return 0; - - case packet_class_raw: - eventlog(eventlog_level_error,__FUNCTION__,"can not set packet type for raw packet"); - return 0; - - default: - eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class); - return -1; - } -} - - -/* size of the _complete_ packet, not the amount currently received or sent */ -extern unsigned int packet_get_size(t_packet const * packet) -{ - unsigned int size; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return 0; - } - - switch (packet->class) - { - case packet_class_init: - size = sizeof(t_client_initconn); - break; - case packet_class_raw: - size = packet->len; - break; - case packet_class_d2game: - size = packet->len; /* FIXME: does header not contain the size? */ - break; - case packet_class_d2gs: - size = (unsigned int)bn_short_get(packet->u.d2cs_d2gs.h.size); - break; - case packet_class_d2cs_bnetd: - size = (unsigned int)bn_short_get(packet->u.d2cs_bnetd.h.size); - break; - case packet_class_d2cs: - size = (unsigned int)bn_short_get(packet->u.d2cs_client.h.size); - break; - default: - eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class); - return 0; - } - - if (size>MAX_PACKET_SIZE) - { - eventlog(eventlog_level_error,__FUNCTION__,"packet has bad size %u",size); - return 0; - } - return size; -} - - -extern int packet_set_size(t_packet * packet, unsigned int size) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return -1; - } - if (size>MAX_PACKET_SIZE) - { - eventlog(eventlog_level_error,__FUNCTION__,"got bad size %u",size); - return -1; - } - - switch (packet->class) - { - case packet_class_init: - if (size!=0 && size!=sizeof(t_client_initconn)) - { - eventlog(eventlog_level_error,__FUNCTION__,"invalid size %u for init packet",size); - return -1; - } - packet->len = size; - return 0; - case packet_class_raw: - packet->len = size; - return 0; - case packet_class_d2game: - packet->len = size; /* FIXME: does header not contain the size? */ - return 0; - case packet_class_d2cs: - bn_short_set(&packet->u.d2cs_client.h.size,size); - return 0; - case packet_class_d2gs: - bn_short_set(&packet->u.d2cs_d2gs.h.size,size); - return 0; - case packet_class_d2cs_bnetd: - bn_short_set(&packet->u.d2cs_bnetd.h.size,size); - return 0; - default: - eventlog(eventlog_level_error,__FUNCTION__,"packet has invalid class %d",(int)packet->class); - return -1; - } -} - - -extern unsigned int packet_get_header_size(t_packet const * packet) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return MAX_PACKET_SIZE; - } - - switch (packet_get_class(packet)) - { - case packet_class_init: - return 0; - case packet_class_raw: - return 0; - case packet_class_d2game: - return 0; /* FIXME: is there no game packet header? */ - case packet_class_d2cs: - return sizeof(t_d2cs_client_header); - case packet_class_d2gs: - return sizeof(t_d2cs_d2gs_header); - case packet_class_d2cs_bnetd: - return sizeof(t_d2cs_bnetd_header); - default: - eventlog(eventlog_level_error,__FUNCTION__,"packet has bad class %d",(int)packet_get_class(packet)); - return MAX_PACKET_SIZE; - } -} - - -extern unsigned int packet_get_flags(t_packet const * packet) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return 0; - } - - return packet->flags; -} - - -extern int packet_set_flags(t_packet * packet, unsigned int flags) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return -1; - } - - packet->flags = flags; - return 0; -} - - -extern int packet_append_string(t_packet * packet, char const * str) -{ - unsigned int len; - unsigned short addlen; - unsigned short size; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return -1; - } - if (!str) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL string"); - return -1; - } - - len = strlen(str)+1; - size = packet_get_size(packet); - if (size>=MAX_PACKET_SIZE) - return -1; - - if (MAX_PACKET_SIZE-(unsigned int)size>len) - addlen = len; - else - addlen = MAX_PACKET_SIZE-size; - if (addlen<1) - return -1; - - memcpy(packet->u.data+size,str,addlen-1); - packet->u.data[size+addlen-1] = '\0'; - packet_set_size(packet,size+addlen); - - return (int)addlen; -} - - -extern int packet_append_ntstring(t_packet * packet, char const * str) -{ - unsigned int len; - unsigned short addlen; - unsigned short size; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return -1; - } - if (!str) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL string"); - return -1; - } - - len = strlen(str); - size = packet_get_size(packet); - if (size>=MAX_PACKET_SIZE) - return -1; - - if (MAX_PACKET_SIZE-(unsigned int)size>len) - addlen = len; - else - addlen = MAX_PACKET_SIZE-size; - if (addlen<1) - return -1; - - memcpy(packet->u.data+size,str,addlen); - packet_set_size(packet,size+addlen); - - return (int)addlen; -} - - -extern int packet_append_data(t_packet * packet, void const * data, unsigned int len) -{ - unsigned short addlen; - unsigned short size; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return -1; - } - if (!data) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL data"); - return -1; - } - - size = packet_get_size(packet); - if (size>=MAX_PACKET_SIZE) - return -1; - - if (MAX_PACKET_SIZE-(unsigned int)size>len) - addlen = len; - else - addlen = MAX_PACKET_SIZE-size; - if (addlen<1) - return -1; - - memcpy(packet->u.data+size,data,addlen); - packet_set_size(packet,size+addlen); - - return (int)addlen; -} - - -extern void const * packet_get_raw_data_const(t_packet const * packet, unsigned int offset) -{ - unsigned int size; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return NULL; - } - size = (unsigned int)packet_get_size(packet); - if (offset>=size || offset>=MAX_PACKET_SIZE) - { - eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u for packet size %u",offset,size); - return NULL; - } - - return packet->u.data+offset; -} - - -extern void * packet_get_raw_data(t_packet * packet, unsigned int offset) -{ - unsigned int size; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return NULL; - } - size = (unsigned int)packet_get_size(packet); - if (offset>=size || offset>=MAX_PACKET_SIZE) - { - eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u for packet size %u",offset,size); - return NULL; - } - - return packet->u.data+offset; -} - - -extern void * packet_get_raw_data_build(t_packet * packet, unsigned int offset) -{ - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return NULL; - } - - if (offset>=MAX_PACKET_SIZE) - { - eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u for packet",offset); - return NULL; - } - - return packet->u.data+offset; -} - - -/* maxlen includes room for NUL char */ -extern char const * packet_get_str_const(t_packet const * packet, unsigned int offset, unsigned int maxlen) -{ - unsigned int size; - unsigned int pos; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return NULL; - } - size = (unsigned int)packet_get_size(packet); - if (offset>=size) - { - eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u for packet size %u",offset,size); - return NULL; - } - - for (pos=offset; packet->u.data[pos]!='\0'; pos++) - if (pos>=size || pos-offset>=maxlen) - return NULL; - if (pos>=size || pos-offset>=maxlen) /* NUL must be inside too */ - return NULL; - return packet->u.data+offset; -} - - -extern void const * packet_get_data_const(t_packet const * packet, unsigned int offset, unsigned int len) -{ - unsigned int size; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return NULL; - } - if (len<1) - { - eventlog(eventlog_level_error,__FUNCTION__,"got zero length"); - return NULL; - } - size = (unsigned int)packet_get_size(packet); - if (offset+len>size) - { - eventlog(eventlog_level_error,__FUNCTION__,"got bad offset %u and length %u for packet size %u",offset,len,size); - return NULL; - } - - return packet->u.data+offset; -} - - -extern t_packet * packet_duplicate(t_packet const * src) -{ - t_packet * p; - - if (!(p = packet_create(packet_get_class(src)))) - { - eventlog(eventlog_level_error,__FUNCTION__,"could not create packet"); - return NULL; - } - packet_append_data(p,src->u.data,packet_get_size(src)); - packet_set_flags(p,packet_get_flags(src)); - - return p; -} - diff --git a/d2pack109/src/common/packet.h b/d2pack109/src/common/packet.h deleted file mode 100644 index 5e31a3d..0000000 --- a/d2pack109/src/common/packet.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (C) 1998 Mark Baysinger (mbaysng@ucsd.edu) - * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_PACKET_TYPES -#define INCLUDED_PACKET_TYPES - -#ifdef JUST_NEED_TYPES -# include "common/field_sizes.h" -# include "common/init_protocol.h" -# include "common/d2game_protocol.h" -# include "d2cs/d2cs_protocol.h" -# include "d2cs/d2cs_d2gs_protocol.h" -# include "d2cs/d2cs_bnetd_protocol.h" -#else -# define JUST_NEED_TYPES -# include "common/field_sizes.h" -# include "common/init_protocol.h" -# include "common/d2game_protocol.h" -# include "d2cs/d2cs_protocol.h" -# include "d2cs/d2cs_d2gs_protocol.h" -# include "d2cs/d2cs_bnetd_protocol.h" -# undef JUST_NEED_TYPES -#endif - -typedef enum -{ - packet_class_none, - packet_class_init, - packet_class_raw, - packet_class_d2game, - packet_class_d2gs, - packet_class_d2cs, - packet_class_d2cs_bnetd -} t_packet_class; - - -typedef enum -{ - packet_dir_from_client, - packet_dir_from_server -} t_packet_dir; - - -/* These aren't really packets so much as records in a TCP stream. They are variable- - * length structures which make up the Battle.net protocol. It is just easier to call - * them "packets". - */ -typedef struct -{ - unsigned int ref; /* reference count */ - t_packet_class class; - unsigned int flags; /* user-defined flags (used to mark UDP in bnproxy) */ - unsigned int len; /* raw packets have no header, so we use this */ - - /* next part looks just like it would on the network (no padding, byte for byte) */ - union - { - char data[MAX_PACKET_SIZE]; - - t_d2game_generic d2game; - - t_client_initconn client_initconn; - - t_d2cs_bnetd_generic d2cs_bnetd; - t_bnetd_d2cs_authreq bnetd_d2cs_authreq; - t_d2cs_bnetd_authreply d2cs_bnetd_authreply; - t_bnetd_d2cs_authreply bnetd_d2cs_authreply; - t_d2cs_bnetd_accountloginreq d2cs_bnetd_accountloginreq; - t_bnetd_d2cs_accountloginreply bnetd_d2cs_accountloginreply; - t_d2cs_bnetd_charloginreq d2cs_bnetd_charloginreq; - t_bnetd_d2cs_charloginreply bnetd_d2cs_charloginreply; - t_bnetd_d2cs_gameinforeq bnetd_d2cs_gameinforeq; - t_d2cs_bnetd_gameinforeply d2cs_bnetd_gameinforeply; - - t_d2cs_d2gs_generic d2cs_d2gs; - t_d2cs_d2gs_authreq d2cs_d2gs_authreq; - t_d2gs_d2cs_authreply d2gs_d2cs_authreply; - t_d2cs_d2gs_authreply d2cs_d2gs_authreply; - t_d2cs_d2gs_setgsinfo d2cs_d2gs_setgsinfo; - t_d2gs_d2cs_setgsinfo d2gs_d2cs_setgsinfo; - t_d2cs_d2gs_creategamereq d2cs_d2gs_creategamereq; - t_d2gs_d2cs_creategamereply d2gs_d2cs_creategamereply; - t_d2cs_d2gs_joingamereq d2cs_d2gs_joingamereq; - t_d2gs_d2cs_joingamereply d2gs_d2cs_joingamereply; - t_d2gs_d2cs_updategameinfo d2gs_d2cs_updategameinfo; - t_d2gs_d2cs_closegame d2gs_d2cs_closegame; - t_d2cs_d2gs_echoreq d2cs_d2gs_echoreq; - t_d2gs_d2cs_echoreply d2gs_d2cs_echoreply; - t_d2cs_d2gs_control d2cs_d2gs_control; - - t_d2cs_client_generic d2cs_client; - t_client_d2cs_loginreq client_d2cs_loginreq; - t_d2cs_client_loginreply d2cs_client_loginreply; - t_client_d2cs_createcharreq client_d2cs_createcharreq; - t_d2cs_client_createcharreply d2cs_client_createcharreply; - t_client_d2cs_creategamereq client_d2cs_creategamereq; - t_d2cs_client_creategamereply d2cs_client_creategamereply; - t_client_d2cs_joingamereq client_d2cs_joingamereq; - t_d2cs_client_joingamereply d2cs_client_joingamereply; - t_client_d2cs_gamelistreq client_d2cs_gamelistreq; - t_d2cs_client_gamelistreply d2cs_client_gamelistreply; - t_client_d2cs_gameinforeq client_d2cs_gameinforeq; - t_d2cs_client_gameinforeply d2cs_client_gameinforeply; - t_client_d2cs_charloginreq client_d2cs_charloginreq; - t_d2cs_client_charloginreply d2cs_client_charloginreply; - t_client_d2cs_deletecharreq client_d2cs_deletecharreq; - t_d2cs_client_deletecharreply d2cs_client_deletecharreply; - t_client_d2cs_ladderreq client_d2cs_ladderreq; - t_d2cs_client_ladderreply d2cs_client_ladderreply; - t_client_d2cs_motdreq client_d2cs_motdreq; - t_d2cs_client_motdreply d2cs_client_motdreply; - t_client_d2cs_cancelcreategame client_d2cs_cancelcreategame; - t_d2cs_client_creategamewait d2cs_client_creategamewait; - t_client_d2cs_charladderreq client_d2cs_charladderreq; - t_client_d2cs_charlistreq client_d2cs_charlistreq; - t_d2cs_client_charlistreply d2cs_client_charlistreply; - t_client_d2cs_convertcharreq client_d2cs_convertcharreq; - t_d2cs_client_convertcharreply d2cs_client_convertcharreply; - } u; -} t_packet; - -#endif - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_PACKET_PROTOS -#define INCLUDED_PACKET_PROTOS - -extern t_packet * packet_create(t_packet_class class) ; -extern void packet_destroy(t_packet const * packet); -extern t_packet * packet_add_ref(t_packet * packet); -extern void packet_del_ref(t_packet * packet); -extern t_packet_class packet_get_class(t_packet const * packet); -extern char const * packet_get_class_str(t_packet const * packet); -extern int packet_set_class(t_packet * packet, t_packet_class class); -extern unsigned int packet_get_type(t_packet const * packet); -extern char const * packet_get_type_str(t_packet const * packet, t_packet_dir dir); -extern int packet_set_type(t_packet * packet, unsigned int type); -extern unsigned int packet_get_size(t_packet const * packet); -extern int packet_set_size(t_packet * packet, unsigned int size); -extern unsigned int packet_get_header_size(t_packet const * packet); -extern unsigned int packet_get_flags(t_packet const * packet); -extern int packet_set_flags(t_packet * packet, unsigned int flags); -extern int packet_append_string(t_packet * packet, char const * str); -extern int packet_append_ntstring(t_packet * packet, char const * str); -extern int packet_append_data(t_packet * packet, void const * data, unsigned int len); -extern void const * packet_get_raw_data_const(t_packet const * packet, unsigned int offset); -extern void * packet_get_raw_data(t_packet * packet, unsigned int offset); -extern void * packet_get_raw_data_build(t_packet * packet, unsigned int offset); -extern char const * packet_get_str_const(t_packet const * packet, unsigned int offset, unsigned int maxlen); -extern void const * packet_get_data_const(t_packet const * packet, unsigned int offset, unsigned int len); -extern t_packet * packet_duplicate(t_packet const * src); - -#endif -#endif diff --git a/d2pack109/src/common/queue.c b/d2pack109/src/common/queue.c deleted file mode 100644 index 291f4ba..0000000 --- a/d2pack109/src/common/queue.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 1998,1999,2001 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#define QUEUE_INTERNAL_ACCESS -#include "common/setup_before.h" -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "common/packet.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/queue.h" -#include "common/setup_after.h" - -#define QUEUE_QUANTUM 10 /* allocate ring buffer slots for 10 packets at once */ - -extern t_packet * queue_pull_packet(t_queue * * queue) -{ - t_queue * temp; - t_packet * packet; - -// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p", queue); - if (!queue) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer"); - return NULL; - } - - temp = *queue; - - if (!temp || !temp->ulen) - return NULL; - -// eventlog(eventlog_level_debug, __FUNCTION__, "getting element from tail (%d/%d head/tail %d/%d)", temp->alen, temp->ulen, temp->head, temp->tail); - /* getting entry from tail and updating queue */ - packet = temp->ring[temp->tail]; - temp->tail = (temp->tail + 1) % temp->alen; - temp->ulen--; -// eventlog(eventlog_level_debug, __FUNCTION__, "read %p element from tail (%d/%d head/tail %d/%d)", packet, temp->alen, temp->ulen, temp->head, temp->tail); - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"NULL packet in queue"); - return NULL; - } - - return packet; -} - - -extern t_packet * queue_peek_packet(t_queue const * const * queue) -{ - t_packet * packet; - -// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p", queue); - if (!queue) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer"); - return NULL; - } - if (!*queue || !(*queue)->ulen) - return NULL; - - packet = (*queue)->ring[(*queue)->tail]; - - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"NULL packet in queue"); - return NULL; - } - - return packet; -} - - -extern void queue_push_packet(t_queue * * queue, t_packet * packet) -{ - t_queue * temp; - void *ptr; - -// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p packet %p", queue, packet); - if (!queue) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer"); - return; - } - if (!packet) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL packet"); - return; - } - - temp = *queue; - - if (!temp) - { -// eventlog(eventlog_level_debug, __FUNCTION__, "queue is NULL , initilizing"); - temp = xmalloc(sizeof(t_queue)); - temp->alen = temp->ulen = 0; - temp->ring = NULL; - temp->head = temp->tail = 0; - *queue = temp; - } - - if (temp->ulen == temp->alen) { /* ring queue is full, need to allocate some memory */ -/* FIXME: find a solution - if (temp->alen) - eventlog(eventlog_level_error, __FUNCTION__, "queue is full (resizing) (oldsize: %u)", temp->alen); -*/ - - ptr = xrealloc(temp->ring, sizeof(t_packet *) * (temp->alen + QUEUE_QUANTUM)); - temp->ring = (t_packet **)ptr; - temp->alen += QUEUE_QUANTUM; - -// eventlog(eventlog_level_debug, __FUNCTION__, "queue new size %d/%d head/tail %d/%d", temp->alen, temp->ulen, temp->head, temp->tail); - if (temp->head) { - unsigned moved; - - moved = (QUEUE_QUANTUM <= temp->head) ? QUEUE_QUANTUM : temp->head; - memmove(temp->ring + temp->ulen, temp->ring, sizeof(t_packet *) * moved); - if (temp->head > QUEUE_QUANTUM) { - memmove(temp->ring, temp->ring + moved, sizeof(t_packet *) * (temp->head - moved)); - temp->head -= moved; - } else if (temp->head < QUEUE_QUANTUM) - temp->head = temp->ulen + moved; - else temp->head = 0; - } else temp->head = temp->ulen; - - } - - temp->ring[temp->head] = packet_add_ref(packet); - - temp->head = (temp->head + 1) % temp->alen; - temp->ulen++; -// eventlog(eventlog_level_debug, __FUNCTION__, "packet added (%d/%d head/tail %d/%d)", temp->alen, temp->ulen, temp->head, temp->tail); -} - - -extern int queue_get_length(t_queue const * const * queue) -{ -// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p", queue); - if (!queue) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer"); - return 0; - } - - if (*queue == NULL) return 0; - - return (*queue)->ulen; -} - - -extern void queue_clear(t_queue * * queue) -{ - t_packet * temp; - -// eventlog(eventlog_level_debug, __FUNCTION__, "entered: queue %p", queue); - if (!queue) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL queue pointer"); - return; - } - - if (*queue) { - while ((temp = queue_pull_packet(queue))) - packet_del_ref(temp); - - if ((*queue)->ring) xfree((void*)((*queue)->ring)); - xfree((void*)(*queue)); - } -} diff --git a/d2pack109/src/common/queue.h b/d2pack109/src/common/queue.h deleted file mode 100644 index 0f8a460..0000000 --- a/d2pack109/src/common/queue.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_QUEUE_TYPES -#define INCLUDED_QUEUE_TYPES - -#ifdef QUEUE_INTERNAL_ACCESS -#ifdef JUST_NEED_TYPES -# include "common/packet.h" -#else -# define JUST_NEED_TYPES -# include "common/packet.h" -# undef JUST_NEED_TYPES -#endif -#endif - -typedef struct queue -#ifdef QUEUE_INTERNAL_ACCESS -{ - unsigned ulen, alen; - t_packet ** ring; - unsigned head, tail; -} -#endif -t_queue; - -#endif - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_QUEUE_PROTOS -#define INCLUDED_QUEUE_PROTOS - -#define JUST_NEED_TYPES -#include "common/packet.h" -#undef JUST_NEED_TYPES - -extern t_packet * queue_pull_packet(t_queue * * queue); -extern t_packet * queue_peek_packet(t_queue const * const * queue); -extern void queue_push_packet(t_queue * * queue, t_packet * packet); -extern int queue_get_length(t_queue const * const * queue); -extern void queue_clear(t_queue * * queue); - -#endif -#endif diff --git a/d2pack109/src/common/rlimit.c b/d2pack109/src/common/rlimit.c deleted file mode 100644 index 1bf64d2..0000000 --- a/d2pack109/src/common/rlimit.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "common/setup_before.h" -#include -#ifdef HAVE_UNISTD_H -# include -#endif -#include -#include "compat/strerror.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#endif -#ifdef HAVE_SYS_RESOURCE_H -# include -#endif -#include "common/eventlog.h" -#include "common/bn_type.h" -#include "common/setup_after.h" - - -/* file descriptor limit has different name on BSD and Linux */ -#ifdef RLIMIT_NOFILE -# define RLIM_NUMFILES RLIMIT_NOFILE -#else -# ifdef RLIMIT_OFILE -# define RLIM_NUMFILES RLIMIT_OFILE -# endif -#endif - -extern int get_socket_limit(void) -{ - unsigned int socklimit = BNETD_MAX_SOCKETS; -#ifdef HAVE_GETRLIMIT - struct rlimit rlim; - if(getrlimit(RLIM_NUMFILES, &rlim) < 0) - eventlog(eventlog_level_error, __FUNCTION__, "getrlimit returned error: %s", strerror(errno)); - socklimit = rlim.rlim_cur; -#else - /* FIXME: WIN32: somehow get WSAData win32 socket limit here */ -#endif - -#if !(defined HAVE_POLL || defined HAVE_KQUEUE || defined HAVE_EPOLL) - if(FD_SETSIZE < socklimit) - socklimit = FD_SETSIZE; -#endif - - - /* make socket limit smaller than file limit to make sure log files, - db connections and save files will still work */ - socklimit -= 64; - - eventlog(eventlog_level_debug, __FUNCTION__, "limit: %d", socklimit); - - return socklimit; -} diff --git a/d2pack109/src/common/rlimit.h b/d2pack109/src/common/rlimit.h deleted file mode 100644 index 80e7427..0000000 --- a/d2pack109/src/common/rlimit.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/*****/ - -extern int get_socket_limit(void); diff --git a/d2pack109/src/common/setup_before.h b/d2pack109/src/common/setup_before.h deleted file mode 100644 index d71dff4..0000000 --- a/d2pack109/src/common/setup_before.h +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifdef INCLUDED_SETUP_AFTER_H -# error "This file must be included before all other header files" -#endif -#ifndef INCLUDED_SETUP_BEFORE_H -#define INCLUDED_SETUP_BEFORE_H - -/* get autoconf defines */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#ifdef WIN32 -#ifndef __BORLANDC__ /* Borland uses config.h.win32borland instead */ -# include "win32/configwin.h" -#endif -#endif - -/* This file contains compile-time configuration parameters including - * debugging options, default configuration values, and format strings. - */ - -#include "version.h" - -/***************************************************************/ -/* Debugging options */ - -/* print bad calling locations of account functions */ -#define DEBUG_ACCOUNT - -/* make bnchat, etc. print debug messages */ -#define CLIENTDEBUG - -/* make the routines call xxx_check() and notice - xxx_purge() calls during list traversal */ -#undef LIST_DEBUG -#undef HASHTABLE_DEBUG - -/* this will use GCC evensions to verify that all module arguments to - eventlog() are correct. */ -#undef DEBUGMODSTRINGS -/* - After you compile, use this script: - strings bnetd | - egrep '@\([^@]*@@[a-z_]*\)@' | - sed -e 's/@(\([^:]*\):\([a-z_]*\)@@\([a-z_]*\))@/\1 \2 \3/g' | - awk '{ if ( $2 != $3 ) printf("%s: %s->%s\n",$1,$2,$3); }' -*/ - -/* this will test get/unget memory management in account.c */ -#undef TESTUNGET - -/* check ladders for impossible combinations when returning them */ -#define LADDER_DEBUG - -/***************************************************************/ -/* compile-time options */ - -/* how long do we wait for the UDP test reply? */ -#define CLIENT_MAX_UDPTEST_WAIT 5 - -/* length of listen socket queue */ -/* #define LISTEN_QUEUE SOMAXCONN */ -#define LISTEN_QUEUE 10 - -/* the format for account numbers */ -#define UID_FORMAT "#%08u" -#define UID_MAXLEN 8 - -/* the format for game ids */ -#define GAMEID_FORMAT "#%06u" -#define GAMEID_MAXLEN 8 - -/* the format of timestamps in the logfile */ -#define EVENT_TIME_FORMAT "%b %d %H:%M:%S" -#define EVENT_TIME_MAXLEN 32 - -/* the format of the stat times in bnstat */ -#define STAT_TIME_FORMAT "%Y %b %d %H:%M:%S" -#define STAT_TIME_MAXLEN 32 - -/* the format of the file modification time in bnftp */ -#define FILE_TIME_FORMAT "%Y %b %d %H:%M:%S" -#define FILE_TIME_MAXLEN 32 - -/* the format of the dates in the game report and for /gameinfo */ -#define GAME_TIME_FORMAT "%a %b %d %H:%M:%S %Z" -#define GAME_TIME_MAXLEN 32 - -/* the format of the timestamps for the start/end of channel log files */ -#define CHANLOG_TIME_FORMAT "%Y %b %d %H:%M:%S %Z" -#define CHANLOG_TIME_MAXLEN 32 - -/* the format of the timestamps for lines in the channel log files */ -#define CHANLOGLINE_TIME_FORMAT "%b %d %H:%M:%S" -#define CHANLOGLINE_TIME_MAXLEN 32 - -/* adjustable constants */ -#define BNETD_LADDER_DEFAULT_TIME "19764578 0" /* 0:00 1 Jan 1970 GMT */ - -/* for clients if ioctl(TIOCGWINSZ) fails and $LINES and $COLUMNS aren't set */ -#define DEF_SCREEN_WIDTH 80 -#define DEF_SCREEN_HEIGHT 24 - -/***************************************************************/ -/* default values for bnetd.conf */ - -/* default Boolean setup values */ -#define BNETD_CHANLOG 0 - -/* default path configuration values */ -#ifndef BNETD_DEFAULT_CONF_FILE -# define BNETD_DEFAULT_CONF_FILE "conf/bnetd.conf" -#endif -#define BNETD_FILE_DIR "files" -#define BNETD_STORAGE_PATH "" -#define BNETD_REPORT_DIR "reports" -#define BNETD_LOG_FILE "logs/bnetd.log" -#define BNETD_MOTD_FILE "conf/bnmotd.txt" -#define BNETD_NEWS_DIR "news" -#define BNETD_AD_FILE "conf/ad.conf" -#define BNETD_CHANNEL_FILE "conf/channel.list" -#define BNETD_PID_FILE "" /* this means "none" */ -#define BNETD_ACCOUNT_TMP ".bnetd_acct_temp" -#define BNETD_IPBAN_FILE "conf/bnban" -#define BNETD_HELP_FILE "conf/bnhelpfile" -#define BNETD_FORTUNECMD "/usr/games/fortune" -#define BNETD_TRANS_FILE "conf/gametrans" -#define BNETD_CHANLOG_DIR "chanlogs" -#define BNETD_REALM_FILE "conf/realm.list" -#define BNETD_ISSUE_FILE "conf/bnissue.txt" -#define BNETD_MAIL_DIR "var/bnmail" -#define PVPGN_VERSIONCHECK "conf/versioncheck" -#define BNETD_LADDER_DIR "var/ladders" -#define BNETD_STATUS_DIR "var/status" -#define BNETD_TOPIC_FILE "var/topics" -#define BNETD_DBLAYOUT_FILE "conf/sql_DB_layout" - -#define BNETD_COMMAND_GROUPS_FILE "conf/command_groups.txt" -#define BNETD_TOURNAMENT_FILE "conf/tournament.conf" -#define BNETD_ALIASFILE "conf/bnalias.list" -#define BNETD_W3TRANS_FILE "conf/w3trans" -/* ADDED BY UNDYING SOULZZ 4/9/02 */ -/* default identify timeout value */ -#define W3_IDENTTIMEOUT 15 /* seconds */ -/* Added by Soar */ -/* time limit for new member as newer(whom cannot be promoted) in clan, (hrs) */ -#define CLAN_NEWER_TIME 168 -#define CLAN_MAX_MEMBERS 50 - -/* moved from account.h */ -#define MAX_FRIENDS 20 - -/* maximum ammount of bytes sent in a single server.c/sd_tcpoutput call */ -#define BNETD_MAX_OUTBURST 16384 - -/* default files relative to FILE_DIR */ -#define BNETD_TOS_FILE "tos.txt" -#define BNETD_ICON_FILE "icons.bni" -#define BNETD_WAR3_ICON_FILE "icons-WAR3.bni" -#define BNETD_STAR_ICON_FILE "icons_STAR.bni" -#define BNETD_MPQ_FILE "autoupdate" - -/* other default configuration values */ -#define BNETD_LOG_LEVELS "warn,error" -#define BNETD_SERV_ADDRS ":" /* this means "all" */ -#define BNETD_SERV_PORT 6112 -#define BNETD_W3ROUTE_ADDR "0.0.0.0" -#define BNETD_W3ROUTE_PORT 6200 -#define BNETD_IRC_ADDRS "" /* this means none */ -#define BNETD_IRC_PORT 6667 /* used if port not specified */ -#define BNETD_TRACK_ADDRS "track.pvpgn.org" -#define BNETD_TRACK_PORT 6114 /* use this port if not specified */ -#define BNETD_DEF_TEST_PORT 6112 /* default guess for UDP test port */ -#define BNETD_MIN_TEST_PORT 6112 -#define BNETD_MAX_TEST_PORT 6500 -#define BNETD_USERSYNC 300 /* s */ -#define BNETD_USERFLUSH 1000 -#define BNETD_LATENCY 10 /* s */ -#define BNETD_IRC_LATENCY 180 /* s */ /* Ping timeout for IRC connections */ -#define BNETD_DEF_NULLMSG 120 /* s */ -#define BNETD_TRACK_TIME 0 -#define BNETD_POLL_INTERVAL 20 /* 20 ms */ -#define BNETD_JIFFIES 50 /* 50 ms jiffies time quantum */ -#define BNETD_SHUTDELAY 300 /* s */ -#define BNETD_SHUTDECR 60 /* s */ -#define BNETD_DEFAULT_OWNER "PvPGN" -#define BNETD_DEFAULT_KEY "3310541526205" -#define BNETD_DEFAULT_HOST "localhost" -#define BNETD_QUOTA_DOBAE 7 /* lines */ -#define BNETD_QUOTA_LINES 5 /* lines */ -#define BNETD_QUOTA_TIME 5 /* s */ -#define BNETD_QUOTA_WLINE 40 /* chars */ -#define BNETD_QUOTA_MLINE 200 /* chars */ -#define BNETD_LADDER_INIT_RAT 1000 -#define BNETD_MAIL_SUPPORT 0 -#define BNETD_MAIL_QUOTA 5 -#define BNETD_LOG_NOTICE "*** Please note this channel is logged! ***" -#define BNETD_HASHTABLE_SIZE 61 -#define BNETD_REALM_PORT 6113 /* where D2CS listens */ -#define BNETD_TELNET_ADDRS "" /* this means none */ -#define BNETD_TELNET_PORT 23 /* used if port not specified */ -#define BNETD_EXEINFO_MATCH "exact" -#define PVPGN_VERSION_TIMEDIV 3600 /* 1 hour */ -#define PVPGN_CACHE_MEMLIMIT 5000000 /* bytes */ -#define PVPGN_DEFAULT_SYMB "-_[]" - -/***************************************************************/ -/* default values for the tracking server */ - -#define BNTRACKD_EXPIRE 600 -#define BNTRACKD_UPDATE 150 -#define BNTRACKD_GRANULARITY 5 -#define BNTRACKD_SERVER_PORT 6114 -#define BNTRACKD_PIDFILE "" /* this means "none" */ -#define BNTRACKD_OUTFILE "pvpgnlist.txt" -#ifdef WIN32 -#define BNTRACKD_PROCESS "process.pl" -#define BNTRACKD_LOGFILE "bntrackd.log" -#else -#define BNTRACKD_PROCESS "scripts/process.pl" -#define BNTRACKD_LOGFILE "logs/bntrackd.log" -#endif - -/***************************************************************/ -/* default values for W3XP anongameinfo packet */ - -#define PVPGN_DEFAULT_URL "www.pvpgn.org" - -#define PVPGN_PG_1V1_DESC "Solo Games" -#define PVPGN_AT_2V2_DESC "2 player team" -#define PVPGN_AT_3V3_DESC "3 player team" -#define PVPGN_AT_4V4_DESC "4 player team" -#define PVPGN_PG_TEAM_DESC "Team Games" -#define PVPGN_PG_FFA_DESC "Free for All Games" - -#define PVPGN_1V1_GT_DESC "One vs. One" -#define PVPGN_1V1_GT_LONG "Two players fight to the death" - -#define PVPGN_2V2_GT_DESC "Two vs. Two" -#define PVPGN_2V2_GT_LONG "Two teams of two vie for dominance" - -#define PVPGN_3V3_GT_DESC "Three vs. Three" -#define PVPGN_3V3_GT_LONG "Two teams of three face off on the battlefield" - -#define PVPGN_4V4_GT_DESC "Four vs. Four" -#define PVPGN_4V4_GT_LONG "Two teams of four head to battle" - -#define PVPGN_5V5_GT_DESC "Five vs. Five" -#define PVPGN_5V5_GT_LONG "Two teams of five - who will prevail?" - -#define PVPGN_6V6_GT_DESC "Six vs. Six" -#define PVPGN_6V6_GT_LONG "Two teams of six - get ready to rumble!" - -#define PVPGN_SFFA_GT_DESC "Small Free for All" -#define PVPGN_SFFA_GT_LONG "Can you defeat 3-5 opponents alone?" - -#define PVPGN_TFFA_GT_DESC "Team Free for All" -#define PVPGN_TFFA_GT_LONG "Can your team defeat 1-2 others?" - -#define PVPGN_2V2V2_GT_DESC "Two vs. Two vs. Two" -#define PVPGN_2V2V2_GT_LONG "Three teams of two, can you handle it?" - -#define PVPGN_3V3V3_GT_DESC "Three vs. Three vs. Three" -#define PVPGN_3V3V3_GT_LONG "Three teams of three battle each other " - -#define PVPGN_4V4V4_GT_DESC "Four vs. Four vs. Four" -#define PVPGN_4V4V4_GT_LONG "Three teams of four - things getting crowded?" - -#define PVPGN_2V2V2V2_GT_DESC "Two vs. Two vs. Two vs. Two" -#define PVPGN_2V2V2V2_GT_LONG "Four teams of two, is this a challenge?" - -#define PVPGN_3V3V3V3_GT_DESC "Three vs. Three vs. Three vs. Three" -#define PVPGN_3V3V3V3_GT_LONG "Four teams of three, the ultimate challenge!" - -#define PVPGN_AINFO_FILE "conf/anongame_infos.conf" - -/* max number of players in an anongame match [Omega] */ -#define ANONGAME_MAX_GAMECOUNT 12 - -/* max level of players*/ -#define ANONGAME_MAX_LEVEL 100 - -/***************************************************************/ -/* platform dependent features */ - -/* conditionally enabled features */ - -#if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGADDSET) -# define DO_POSIXSIG -#endif - -#if defined(HAVE_FORK) && defined(HAVE_PIPE) -# define DO_SUBPROC -#endif - -#if defined(HAVE_FORK) && defined(HAVE_CHDIR) && (defined(HAVE_SETPGID) || defined(HAVE_SETPGRP)) -# define DO_DAEMONIZE -#endif - - -/* GCC attributes */ - -/* enable format mismatch warnings from gcc */ -#if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) -# if __GNUC__ == 2 && __GNUC_MINOR__ < 7 -/* namespace clean versions were available starting in 2.6.4 */ -# define __format__ format -# define __printf__ printf -# endif -# define PRINTF_ATTR(FMTARG,VARG) __attribute__((__format__(printf,FMTARG,VARG))) -#else -# define PRINTF_ATTR(FMTARG,VARG) -#endif - -/* type attributes */ - -/* set GCC machine storage mode */ -#if defined(__GNUC__) && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ > 2) -# define MODE_ATTR(M) __attribute__((__mode__(M))) -# define HAVE_MODE_ATTR -#else -# define MODE_ATTR(M) -#endif - -/* avoid using padding on GCC, for other compilers you need alternate solutions */ -#if defined(__GNUC__) -# define PACKED_ATTR() __attribute__((__packed__)) -#else -# define PACKED_ATTR() -#endif - -/* default maxim number of sockets in the fdwatch pool */ -#define BNETD_MAX_SOCKETS 1000 - -/* Used for FDSETSIZE redefine (only on WIN32 so so far) */ -#define BNETD_MAX_SOCKVAL 8192 - -/* - * select() hackery... works most places, need to add autoconf checks - * because some systems may redefine FD_SETSIZE, have it as a variable, - * or not have the concept of such a value. - * dizzy: this is a total hack. only WIN32 so far specifies this as beeing - * "legal"; in UNIX in general it should be NOT because the kernel interface - * of select will never notice your userland changes to the fd_sets - */ -/* Win32 defaults to 64, BSD and Linux default to 1024 */ -/* FIXME: how big can this be before things break? */ -#ifdef WIN32 -# define FD_SETSIZE BNETD_MAX_SOCKVAL -#endif - -#ifdef HAVE_EPOLL_CREATE -# define HAVE_EPOLL 1 -#endif - -#endif diff --git a/d2pack109/src/common/tag.c b/d2pack109/src/common/tag.c deleted file mode 100644 index e533ebe..0000000 --- a/d2pack109/src/common/tag.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (C) 2004 Aaron - * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include -#include "errno.h" -#include "compat/strerror.h" -#include "common/eventlog.h" -#include "common/tag.h" -#include "common/setup_after.h" - -/* fixme: have all functions call tag_str_to_uint() */ -extern t_clienttag clienttag_str_to_uint(char const * clienttag) -{ - if (!clienttag) - { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL clienttag"); - return CLIENTTAG_UNKNOWN_UINT; - } - - return tag_str_to_uint(clienttag); -} - -/* fixme: have all fuctions call tag_uint_to_str() */ -extern char const * clienttag_uint_to_str(t_clienttag clienttag) -{ - switch (clienttag) - { - case CLIENTTAG_BNCHATBOT_UINT: - return CLIENTTAG_BNCHATBOT; - case CLIENTTAG_STARCRAFT_UINT: - return CLIENTTAG_STARCRAFT; - case CLIENTTAG_BROODWARS_UINT: - return CLIENTTAG_BROODWARS; - case CLIENTTAG_SHAREWARE_UINT: - return CLIENTTAG_SHAREWARE; - case CLIENTTAG_DIABLORTL_UINT: - return CLIENTTAG_DIABLORTL; - case CLIENTTAG_DIABLOSHR_UINT: - return CLIENTTAG_DIABLOSHR; - case CLIENTTAG_WARCIIBNE_UINT: - return CLIENTTAG_WARCIIBNE; - case CLIENTTAG_DIABLO2DV_UINT: - return CLIENTTAG_DIABLO2DV; - case CLIENTTAG_STARJAPAN_UINT: - return CLIENTTAG_STARJAPAN; - case CLIENTTAG_DIABLO2ST_UINT: - return CLIENTTAG_DIABLO2ST; - case CLIENTTAG_DIABLO2XP_UINT: - return CLIENTTAG_DIABLO2XP; - case CLIENTTAG_WARCRAFT3_UINT: - return CLIENTTAG_WARCRAFT3; - case CLIENTTAG_WAR3XP_UINT: - return CLIENTTAG_WAR3XP; - default: - return CLIENTTAG_UNKNOWN; - } -} - -/*****/ -/* make all letters in string upper case - used in command.c*/ -extern t_tag tag_case_str_to_uint(char const * tag_str) -{ - unsigned int i, len; - char temp_str[5]; - - len = strlen(tag_str); - if (len != 4) - eventlog(eventlog_level_warn,__FUNCTION__,"got unusual sized clienttag '%s'",tag_str); - - for (i=0; i>24) ); - tag_str[1] = ((unsigned char)(tag_uint>>16)&0xff); - tag_str[2] = ((unsigned char)(tag_uint>> 8)&0xff); - tag_str[3] = ((unsigned char)(tag_uint )&0xff); - tag_str[4] = '\0'; - return tag_str; -} - -extern int tag_check_arch(t_tag tag_uint) -{ - switch (tag_uint) - { - case ARCHTAG_WINX86_UINT: - case ARCHTAG_MACPPC_UINT: - case ARCHTAG_OSXPPC_UINT: - return 1; - default: - return 0; - } -} - -extern int tag_check_client(t_tag tag_uint) -{ - switch (tag_uint) - { - case CLIENTTAG_BNCHATBOT_UINT: - case CLIENTTAG_STARCRAFT_UINT: - case CLIENTTAG_BROODWARS_UINT: - case CLIENTTAG_SHAREWARE_UINT: - case CLIENTTAG_DIABLORTL_UINT: - case CLIENTTAG_DIABLOSHR_UINT: - case CLIENTTAG_WARCIIBNE_UINT: - case CLIENTTAG_DIABLO2DV_UINT: - case CLIENTTAG_STARJAPAN_UINT: - case CLIENTTAG_DIABLO2ST_UINT: - case CLIENTTAG_DIABLO2XP_UINT: - case CLIENTTAG_WARCRAFT3_UINT: - case CLIENTTAG_WAR3XP_UINT: - return 1; - default: - return 0; - } -} - -extern int tag_check_gamelang(t_tag gamelang) -{ - switch (gamelang) - { - case GAMELANG_ENGLISH_UINT: /* enUS */ - case GAMELANG_GERMAN_UINT: /* deDE */ - case GAMELANG_CZECH_UINT: /* csCZ */ - case GAMELANG_SPANISH_UINT: /* esES */ - case GAMELANG_FRENCH_UINT: /* frFR */ - case GAMELANG_ITALIAN_UINT: /* itIT */ - case GAMELANG_JAPANESE_UINT: /* jaJA */ - case GAMELANG_KOREAN_UINT: /* koKR */ - case GAMELANG_POLISH_UINT: /* plPL */ - case GAMELANG_RUSSIAN_UINT: /* ruRU */ - case GAMELANG_CHINESE_S_UINT: /* zhCN */ - case GAMELANG_CHINESE_T_UINT: /* zhTW */ - return 1; - default: - return 0; - } -} - -extern char const * clienttag_get_title(t_clienttag clienttag) -{ - switch (clienttag) - { - case CLIENTTAG_WAR3XP_UINT: - return "Warcraft III Frozen Throne"; - case CLIENTTAG_WARCRAFT3_UINT: - return "Warcraft III"; - case CLIENTTAG_DIABLO2XP_UINT: - return "Diablo II Lord of Destruction"; - case CLIENTTAG_DIABLO2DV_UINT: - return "Diablo II"; - case CLIENTTAG_STARJAPAN_UINT: - return "Starcraft (Japan)"; - case CLIENTTAG_WARCIIBNE_UINT: - return "Warcraft II"; - case CLIENTTAG_DIABLOSHR_UINT: - return "Diablo I (Shareware)"; - case CLIENTTAG_DIABLORTL_UINT: - return "Diablo I"; - case CLIENTTAG_SHAREWARE_UINT: - return "Starcraft (Shareware)"; - case CLIENTTAG_BROODWARS_UINT: - return "Starcraft: BroodWars"; - case CLIENTTAG_STARCRAFT_UINT: - return "Starcraft"; - case CLIENTTAG_BNCHATBOT_UINT: - return "Chat"; - default: - return "Unknown"; - } -} - diff --git a/d2pack109/src/common/tag.h b/d2pack109/src/common/tag.h deleted file mode 100644 index a0c1399..0000000 --- a/d2pack109/src/common/tag.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu) - * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_TAG_TYPES -#define INCLUDED_TAG_TYPES - -#ifdef JUST_NEED_TYPES -#include "compat/uint.h" -#else -#define JUST_NEED_TYPES -#include "compat/uint.h" -#undef JUST_NEED_TYPES -#endif - -typedef t_uint32 t_tag; -typedef t_tag t_archtag; -typedef t_tag t_clienttag; -typedef t_tag t_gamelang; - -#endif - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_TAG_PROTOS -#define INCLUDED_TAG_PROTOS - -/* Software tags */ -#define CLIENTTAG_BNCHATBOT "CHAT" /* CHAT bot */ -#define CLIENTTAG_BNCHATBOT_UINT 0x43484154 -#define CLIENTTAG_STARCRAFT "STAR" /* Starcraft (original) */ -#define CLIENTTAG_STARCRAFT_UINT 0x53544152 -#define CLIENTTAG_BROODWARS "SEXP" /* Starcraft EXpansion Pack */ -#define CLIENTTAG_BROODWARS_UINT 0x53455850 -#define CLIENTTAG_SHAREWARE "SSHR" /* Starcraft Shareware */ -#define CLIENTTAG_SHAREWARE_UINT 0x53534852 -#define CLIENTTAG_DIABLORTL "DRTL" /* Diablo ReTaiL */ -#define CLIENTTAG_DIABLORTL_UINT 0x4452544C -#define CLIENTTAG_DIABLOSHR "DSHR" /* Diablo SHaReware */ -#define CLIENTTAG_DIABLOSHR_UINT 0x44534852 -#define CLIENTTAG_WARCIIBNE "W2BN" /* WarCraft II Battle.net Edition */ -#define CLIENTTAG_WARCIIBNE_UINT 0x5732424E -#define CLIENTTAG_DIABLO2DV "D2DV" /* Diablo II Diablo's Victory */ -#define CLIENTTAG_DIABLO2DV_UINT 0x44324456 -#define CLIENTTAG_STARJAPAN "JSTR" /* Starcraft (Japan) */ -#define CLIENTTAG_STARJAPAN_UINT 0x4A535452 -#define CLIENTTAG_DIABLO2ST "D2ST" /* Diablo II Stress Test */ -#define CLIENTTAG_DIABLO2ST_UINT 0x44325354 -#define CLIENTTAG_DIABLO2XP "D2XP" /* Diablo II Extension Pack */ -#define CLIENTTAG_DIABLO2XP_UINT 0x44325850 -/* FIXME: according to FSGS: - SJPN==Starcraft (Japanese) - SSJP==Starcraft (Japanese,Spawn) -*/ -#define CLIENTTAG_WARCRAFT3 "WAR3" /* WarCraft III */ -#define CLIENTTAG_WARCRAFT3_UINT 0x57415233 -#define CLIENTTAG_WAR3XP "W3XP" /* WarCraft III Expansion */ -#define CLIENTTAG_WAR3XP_UINT 0x57335850 - -/* BNETD-specific software tags - we try to use lowercase to avoid collisions */ -#define CLIENTTAG_FREECRAFT "free" /* FreeCraft http://www.freecraft.com/ */ - -#define CLIENTTAG_UNKNOWN "UNKN" -#define CLIENTTAG_UNKNOWN_UINT 0x554E4B4E - -/* Architecture tags */ -#define ARCHTAG_WINX86 "IX86" /* MS Windows on Intel x86 */ -#define ARCHTAG_MACPPC "PMAC" /* MacOS on PowerPC */ -#define ARCHTAG_OSXPPC "XMAC" /* MacOS X on PowerPC */ - -#define ARCHTAG_WINX86_UINT 0x49583836 /* IX86 */ -#define ARCHTAG_MACPPC_UINT 0x504D4143 /* PMAC */ -#define ARCHTAG_OSXPPC_UINT 0x584D4143 /* XMAC */ - -/* game languages */ -#define GAMELANG_ENGLISH_UINT 0x656E5553 /* enUS */ -#define GAMELANG_GERMAN_UINT 0x64654445 /* deDE */ -#define GAMELANG_CZECH_UINT 0x6373435A /* csCZ */ -#define GAMELANG_SPANISH_UINT 0x65734553 /* esES */ -#define GAMELANG_FRENCH_UINT 0x66724652 /* frFR */ -#define GAMELANG_ITALIAN_UINT 0x69744954 /* itIT */ -#define GAMELANG_JAPANESE_UINT 0x6A614A41 /* jaJA */ -#define GAMELANG_KOREAN_UINT 0x6B6F4B52 /* koKR */ -#define GAMELANG_POLISH_UINT 0x706C504C /* plPL */ -#define GAMELANG_RUSSIAN_UINT 0x72755255 /* ruRU */ -#define GAMELANG_CHINESE_S_UINT 0x7A68434E /* zhCN */ -#define GAMELANG_CHINESE_T_UINT 0x7A685457 /* zhTW */ - -#define TAG_UNKNOWN_UINT 0x554E4B4E /* UNKN */ -#define TAG_UNKNOWN "UNKN" - -/* Server tag */ -#define BNETTAG "bnet" /* Battle.net */ - -/* Filetype tags (note these are "backwards") */ -#define EXTENSIONTAG_PCX "xcp." -#define EXTENSIONTAG_SMK "kms." -#define EXTENSIONTAG_MNG "gnm." - -extern t_clienttag clienttag_str_to_uint(char const * clienttag); -extern char const * clienttag_uint_to_str(t_clienttag clienttag); -extern char const * clienttag_get_title(t_clienttag clienttag); - -extern t_tag tag_str_to_uint(char const * tag_str); -extern t_tag tag_case_str_to_uint(char const * tag_str); -extern char * tag_uint_to_str(char * tag_str, t_tag tag_uint); -extern int tag_check_arch(t_tag tag_uint); -extern int tag_check_client(t_tag tag_uint); -extern int tag_check_gamelang(t_tag tag_uint); - -#endif -#endif diff --git a/d2pack109/src/common/trans.c b/d2pack109/src/common/trans.c deleted file mode 100644 index 4b0e094..0000000 --- a/d2pack109/src/common/trans.c +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#define TRANS_INTERNAL_ACCESS -#include "common/setup_before.h" -#include -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "compat/strrchr.h" -#include -#include "compat/strerror.h" -#include "common/eventlog.h" -#include "common/list.h" -#include "common/addr.h" -#include "common/util.h" -#include "common/xalloc.h" -#include "trans.h" -#include "common/setup_after.h" - -#define DEBUG_TRANS - -static t_list * trans_head=NULL; - -extern int trans_load(char const * filename, int program) -{ - FILE *fp; - unsigned int line; - unsigned int pos; - char *buff; - char *temp; - char const *input; - char const *output; - char const *exclude; - char const *include; - unsigned int npos; - char *network; - char *tmp; - char tmp1[32]; - char tmp2[32]; - char tmp3[32]; - t_trans *entry; - - if (!filename) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL filename"); - return -1; - } - if (!(fp = fopen(filename,"r"))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not open file \"%s\" for reading (fopen: %s)",filename,strerror(errno)); - return -1; - } - trans_head = list_create(); - for (line=1; (buff = file_get_line(fp)); line++) { - for (pos=0; buff[pos]=='\t' || buff[pos]==' '; pos++); - if (buff[pos]=='\0' || buff[pos]=='#') { - xfree(buff); - continue; - } - if ((temp = strrchr(buff,'#'))) { - unsigned int len; - unsigned int endpos; - - *temp = '\0'; - len = strlen(buff)+1; - for (endpos=len-1; buff[endpos]=='\t' || buff[endpos]==' '; endpos--); - buff[endpos+1] = '\0'; - } - if (!(input = strtok(buff," \t"))) { /* strtok modifies the string it is passed */ - eventlog(eventlog_level_error,__FUNCTION__,"missing input line %u of file \"%s\"",line,filename); - xfree(buff); - continue; - } - /* check for port number - this tells us what programs will use this entry */ - if (!(temp = strrchr(input,':'))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing port # on input line %u of file \"%s\"",line,filename); - xfree(buff); - continue; - } - temp++; - /* bnetd doesn't want the port 4000 entries */ - if (program==TRANS_BNETD && strcmp(temp,"4000")==0) { -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__,"d2gs input (ignoring) \"%s\"",input); -#endif - xfree(buff); - continue; - } - /* d2cs only wants the port 4000 entries */ - if (program==TRANS_D2CS && strcmp(temp,"4000")!=0) { -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__,"non d2gs input (ignoring) \"%s\"",input); -#endif - xfree(buff); - continue; - } - if (!(output = strtok(NULL," \t"))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing output on line %u of file \"%s\"",line,filename); - xfree(buff); - continue; - } - if (!(exclude = strtok(NULL," \t"))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing exclude on line %u of file \"%s\"",line,filename); - xfree(buff); - continue; - } - if (!(include = strtok(NULL," \t"))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing include on line %u of file \"%s\"",line,filename); - xfree(buff); - continue; - } - /* add exlude networks */ - tmp = xstrdup(exclude); - npos=0; - while (tmp[npos]) { - network = &tmp[npos]; - for (; tmp[npos]!=',' && tmp[npos]!='\0'; npos++); - if (tmp[npos]=='\0') - npos--; - else - tmp[npos]='\0'; - if (strcmp(network,"NONE")==0) { - npos++; - continue; - } - entry = xmalloc(sizeof(t_trans)); - if (!(entry->input = addr_create_str(input,0,0))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for input address"); - xfree(entry); - npos++; - continue; - } - if (!(entry->output = addr_create_str(input,0,0))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for output address"); - addr_destroy(entry->input); - xfree(entry); - npos++; - continue; - } - if (strcmp(network,"ANY")==0) { - if (!(entry->network = netaddr_create_str("0.0.0.0/0"))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address"); - addr_destroy(entry->output); - addr_destroy(entry->input); - xfree(entry); - npos++; - continue; - } - } else { - if (!(entry->network = netaddr_create_str(network))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address"); - addr_destroy(entry->output); - addr_destroy(entry->input); - xfree(entry); - npos++; - continue; - } - } -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__, - "Adding Host -> %s, Output -> %s, Network %s - (exclude)", - addr_get_addr_str(entry->input,tmp1,sizeof(tmp1)), - addr_get_addr_str(entry->output,tmp2,sizeof(tmp2)), - netaddr_get_addr_str(entry->network,tmp3,sizeof(tmp3))); -#endif - list_append_data(trans_head,entry); - npos++; - } - xfree(tmp); - /* add include networks */ - tmp = xstrdup(include); - npos=0; - while (tmp[npos]) { - network = &tmp[npos]; - for (; tmp[npos]!=',' && tmp[npos]!='\0'; npos++); - if (tmp[npos]=='\0') - npos--; - else - tmp[npos]='\0'; - if (strcmp(network,"NONE")==0) { - npos++; - continue; - } - entry = xmalloc(sizeof(t_trans)); - if (!(entry->input = addr_create_str(input,0,0))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for input address"); - xfree(entry); - npos++; - continue; - } - if (!(entry->output = addr_create_str(output,0,0))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for output address"); - addr_destroy(entry->input); - xfree(entry); - npos++; - continue; - } - if (strcmp(network,"ANY")==0) { - if (!(entry->network = netaddr_create_str("0.0.0.0/0"))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address"); - addr_destroy(entry->output); - addr_destroy(entry->input); - xfree(entry); - npos++; - continue; - } - } else { - if (!(entry->network = netaddr_create_str(network))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for network address"); - addr_destroy(entry->output); - addr_destroy(entry->input); - xfree(entry); - npos++; - continue; - } - } -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__, - "Adding Host -> %s, Output -> %s, Network %s - (include)", - addr_get_addr_str(entry->input,tmp1,sizeof(tmp1)), - addr_get_addr_str(entry->output,tmp2,sizeof(tmp2)), - netaddr_get_addr_str(entry->network,tmp3,sizeof(tmp3))); -#endif - list_append_data(trans_head,entry); - npos++; - } - xfree(tmp); - xfree(buff); - } - fclose(fp); - eventlog(eventlog_level_info,__FUNCTION__,"trans file loaded"); - return 0; -} - -extern int trans_unload(void) -{ - t_elem *curr; - t_trans *entry; - - if (trans_head) { - LIST_TRAVERSE(trans_head,curr) - { - if (!(entry = elem_get_data(curr))) { - eventlog(eventlog_level_error,__FUNCTION__,"found NULL entry in list"); - } else { - netaddr_destroy(entry->network); - addr_destroy(entry->output); - addr_destroy(entry->input); - xfree(entry); - } - list_remove_elem(trans_head,&curr); - } - list_destroy(trans_head); - trans_head = NULL; - } - return 0; -} - -extern int trans_reload(char const * filename, int program) -{ - trans_unload(); - if(trans_load(filename,program)<0) return -1; - return 0; -} - -extern int trans_net(unsigned int clientaddr, unsigned int *addr, unsigned short *port) -{ - t_elem const *curr; - t_trans *entry; - char temp1[32]; - char temp2[32]; - char temp3[32]; - char temp4[32]; - -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__,"checking %s for client %s ...", - addr_num_to_addr_str(*addr, *port), - addr_num_to_ip_str(clientaddr)); -#endif - - if (trans_head) { - LIST_TRAVERSE_CONST(trans_head,curr) - { - if (!(entry = elem_get_data(curr))) { - eventlog(eventlog_level_error,__FUNCTION__,"found NULL entry in list"); - continue; - } - -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__,"against entry -> %s output %s network %s", - addr_get_addr_str(entry->input,temp1,sizeof(temp1)), - addr_get_addr_str(entry->output,temp2,sizeof(temp2)), - netaddr_get_addr_str(entry->network,temp3,sizeof(temp3))); -#endif - if (addr_get_ip(entry->input)!=*addr || addr_get_port(entry->input)!=*port) { -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__,"entry does match input address"); -#endif - continue; - } - if (netaddr_contains_addr_num(entry->network,clientaddr)==0) { -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__,"client is not in the correct network"); -#endif - continue; - } -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__,"%s translated to %s", - addr_num_to_addr_str(*addr, *port), - addr_get_addr_str(entry->output,temp4,sizeof(temp4))); -#endif - *addr = addr_get_ip(entry->output); - *port = addr_get_port(entry->output); - return 1; /* match found in list */ - } - } -#ifdef DEBUG_TRANS - eventlog(eventlog_level_debug,__FUNCTION__,"no match found for %s (not translated)", - addr_num_to_addr_str(*addr, *port)); -#endif - return 0; /* no match found in list */ -} diff --git a/d2pack109/src/common/trans.h b/d2pack109/src/common/trans.h deleted file mode 100644 index 3e9bc1b..0000000 --- a/d2pack109/src/common/trans.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_TRANS_TYPES -#define INCLUDED_TRANS_TYPES - -#ifdef TRANS_INTERNAL_ACCESS - -#ifdef JUST_NEED_TYPES -# include "common/addr.h" -#else -# define JUST_NEED_TYPES -# include "common/addr.h" -# undef JUST_NEED_TYPES -#endif - -typedef struct -{ - t_addr *input; - t_addr *output; - t_netaddr *network; -} t_trans; - -#endif - -#endif - -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_TRANS_PROTOS -#define INCLUDED_TRANS_PROTOS - -#define TRANS_BNETD 1 -#define TRANS_D2CS 2 - -extern int trans_load(char const * filename, int program); -extern int trans_unload(void); -extern int trans_reload(char const * filename, int program); -extern int trans_net(unsigned int clientaddr, unsigned int *addr, unsigned short *port); - -#endif -#endif diff --git a/d2pack109/src/common/util.c b/d2pack109/src/common/util.c deleted file mode 100644 index 68fd627..0000000 --- a/d2pack109/src/common/util.c +++ /dev/null @@ -1,634 +0,0 @@ -/* - * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu) - * Copyright (C) 1998,1999,2000,2001 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include "compat/strtoul.h" -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "compat/strcasecmp.h" -#include "compat/strncasecmp.h" -#include "common/xalloc.h" -#include -#include "common/util.h" -#include "common/setup_after.h" - - -extern int strstart(char const * full, char const * part) -{ - size_t strlen_full, strlen_part; - if (!full || !part) - return 1; - strlen_full = strlen(full); - strlen_part = strlen(part); - if (strlen_fullstrlen_part && full[strlen_part]!=' ' && full[strlen_part]!='\0') - return 1; - return strncasecmp(full,part,strlen_part); -} - - -#define DEF_LEN 64 -#define INC_LEN 16 - -extern char * file_get_line(FILE * fp) -{ - char * line; - unsigned int len=DEF_LEN; - unsigned int pos=0; - int prev_char,curr_char; - - line = xmalloc(DEF_LEN); - prev_char = '\0'; - while ((curr_char = fgetc(fp))!=EOF) - { - if (((char)curr_char)=='\r') - continue; /* make DOS line endings look Unix-like */ - if (((char)curr_char)=='\n') - { - if (pos<1 || ((char)prev_char)!='\\') - break; - pos--; /* throw away the backslash */ - prev_char = '\0'; - continue; - } - prev_char = curr_char; - - line[pos++] = (char)curr_char; - if ((pos+1)>=len) - { - len += INC_LEN; - line = xrealloc(line,len); - } - } - - if (curr_char==EOF && pos<1) /* not even an empty line */ - { - xfree(line); - return NULL; - } - - if (pos+1='\000' && str[i]<'\040')) && - (!allow_nl || (str[i]!='\r' && str[i]!='\n'))) - fprintf(fp,"^%c",str[i]+64); - else - fputc((int)str[i],fp); - - return 0; -} - - -extern int str_get_bool(char const * str) -{ - if (!str) - return -1; - - if (strcasecmp(str,"true")==0 || - strcasecmp(str,"yes")==0 || - strcasecmp(str,"on")==0 || - strcmp(str,"1")==0) - return 1; - - if (strcasecmp(str,"false")==0 || - strcasecmp(str,"no")==0 || - strcasecmp(str,"off")==0 || - strcmp(str,"0")==0) - return 0; - - return -1; -} - - -extern char const * seconds_to_timestr(unsigned int totsecs) -{ - static char temp[256]; - int days; - int hours; - int minutes; - int seconds; - - days = totsecs/(24*60*60); - hours = totsecs/(60*60) - days*24; - minutes = totsecs/60 - days*24*60 - hours*60; - seconds = totsecs - days*24*60*60 - hours*60*60 - minutes*60; - - if (days>0) - sprintf(temp,"%d day%s %d hour%s %d minute%s %d second%s", - days,days==1 ? "" : "s", - hours,hours==1 ? "" : "s", - minutes,minutes==1 ? "" : "s", - seconds,seconds==1 ? "" : "s"); - else if (hours>0) - sprintf(temp,"%d hour%s %d minute%s %d second%s", - hours,hours==1 ? "" : "s", - minutes,minutes==1 ? "" : "s", - seconds,seconds==1 ? "" : "s"); - else if (minutes>0) - sprintf(temp,"%d minute%s %d second%s", - minutes,minutes==1 ? "" : "s", - seconds,seconds==1 ? "" : "s"); - else - sprintf(temp,"%d second%s.", - seconds,seconds==1 ? "" : "s"); - - return temp; -} - - -extern int clockstr_to_seconds(char const * clockstr, unsigned int * totsecs) -{ - unsigned int i,j; - unsigned int temp; - - if (!clockstr) - return -1; - if (!totsecs) - return -1; - - for (i=j=temp=0; j= len*3+1 then the buffer was overflowed */ - out[outpos] = '\0'; - - return out; -} - - -extern char * escape_chars(char const * in, unsigned int len) -{ - char * out; - unsigned int inpos; - unsigned int outpos; - - if (!in) - return NULL; - out = xmalloc(len*4+1); /* if all turn into \xxx */ - - for (inpos=0,outpos=0; inpos= len*4+1 then the buffer was overflowed */ - out[outpos] = '\0'; - - return out; -} - - -extern char * unescape_chars(char const * in) -{ - char * out; - unsigned int inpos; - unsigned int outpos; - - if (!in) - return NULL; - out = xmalloc(strlen(in)+1); - - for (inpos=0,outpos=0; inpos255) /* bad escape (including \000), leave it as-is */ - { - out[outpos++] = '\\'; - strcpy(&out[outpos],temp); - outpos += strlen(temp); - } - else - out[outpos++] = (unsigned char)num; - } - } - } - out[outpos] = '\0'; - - return out; -} - - -extern void str_to_hex(char * target, char * data, int datalen) -{ - unsigned char c; - int i; - for (i = 0; i < datalen; i++) - { - c = (data[i]) & 0xff; - - sprintf(target + i*3, "%02X ", c); - target[i*3+3] = '\0'; - - /* fprintf(stderr, "str_to_hex %d | '%02x' '%s'\n", i, c, target); */ - } -} - - -extern int hex_to_str(char const * source, char * data, int datalen) -{ - /* - * TODO: We really need a more robust function here, - * for now, I'll just use this hack for a quick evaluation - */ - char byte; - char c; - int i; - - for (i = 0; i < datalen; i++) - { - byte = 0; - - /* fprintf(stderr, "hex_to_str %d | '%02x'", i, byte); */ - - c = source [i*3 + 0]; - byte += 16 * ( c > '9' ? (c - 'A' + 10) : (c - '0')); - - /* fprintf(stderr, " | '%c' '%02x'", c, byte); */ - - c = source [i*3 + 1]; - byte += 1 * ( c > '9' ? (c - 'A' + 10) : (c - '0')); - - /* fprintf(stderr, " | '%c' '%02x'", c, byte); */ - - /* fprintf(stderr, "\n"); */ - - data[i] = byte; - } - - /* fprintf(stderr, "finished, returning %d from '%s'\n", i, source); */ - - return i; -} diff --git a/d2pack109/src/common/util.h b/d2pack109/src/common/util.h deleted file mode 100644 index 194bf65..0000000 --- a/d2pack109/src/common/util.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 1998,1999,2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_UTIL_PROTOS -#define INCLUDED_UTIL_PROTOS - -#define JUST_NEED_TYPES -#include -#undef JUST_NEED_TYPES - -extern int strstart(char const * full, char const * part) ; -extern char * file_get_line(FILE * fp) ; -extern char * strreverse(char * str); -extern int str_to_uint(char const * str, unsigned int * num); -extern int str_to_ushort(char const * str, unsigned short * num); -extern int str_print_term(FILE * fp, char const * str, unsigned int len, int allow_nl); -extern int str_get_bool(char const * str) ; -extern char const * seconds_to_timestr(unsigned int totsecs); /* FIXME: can this be marked pure? */ -extern int clockstr_to_seconds(char const * clockstr, unsigned int * totsecs); -extern char * escape_fs_chars(char const * in, unsigned int len) ; -extern char * escape_chars(char const * in, unsigned int len) ; -extern char * unescape_chars(char const * in) ; -extern void str_to_hex(char * target, char * data, int datalen); -extern int hex_to_str(char const * source, char * data, int datalen); - -#endif -#endif diff --git a/d2pack109/src/common/version.h b/d2pack109/src/common/version.h deleted file mode 100644 index 68a7cb5..0000000 --- a/d2pack109/src/common/version.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef PVPGN_VERSION -#define PVPGN_VERSION "0.7-CVS" -#endif -#ifndef PVPGN_SOFTWARE -#define PVPGN_SOFTWARE "PvPGN D2Pack109" -#endif diff --git a/d2pack109/src/common/xalloc.c b/d2pack109/src/common/xalloc.c deleted file mode 100644 index 5e8eb29..0000000 --- a/d2pack109/src/common/xalloc.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2004 Dizzy (dizzy@roedu.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "common/setup_before.h" -#ifndef XALLOC_SKIP - -#ifdef HAVE_STDDEF_H -# include -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "compat/strdup.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#define XALLOC_INTERNAL_ACCESS -#include "common/setup_after.h" -#undef XALLOC_INTERNAL_ACCESS - -static t_oom_cb oom_cb = NULL; - -void *xmalloc_real(size_t size, const char *fn, unsigned ln) -{ - void *res; - - res = malloc(size); - if (!res) { - eventlog(eventlog_level_fatal, __FUNCTION__, "out of memory (from %s:%u)",fn,ln); - if (oom_cb && oom_cb() && (res = malloc(size))) return res; - abort(); - } - - return res; -} - -void *xcalloc_real(size_t nmemb, size_t size, const char *fn, unsigned ln) -{ - void *res; - - res = calloc(nmemb,size); - if (!res) { - eventlog(eventlog_level_fatal, __FUNCTION__, "out of memory (from %s:%u)",fn,ln); - if (oom_cb && oom_cb() && (res = calloc(nmemb,size))) return res; - abort(); - } - - return res; -} - -void *xrealloc_real(void *ptr, size_t size, const char *fn, unsigned ln) -{ - void *res; - - res = realloc(ptr,size); - if (!res) { - eventlog(eventlog_level_fatal, __FUNCTION__, "out of memory (from %s:%u)",fn,ln); - if (oom_cb && oom_cb() && (res = realloc(ptr,size))) return res; - abort(); - } - - return res; -} - -char *xstrdup_real(const char *str, const char *fn, unsigned ln) -{ - char *res; - - res = strdup(str); - if (!res) { - eventlog(eventlog_level_fatal, __FUNCTION__, "out of memory (from %s:%u)",fn,ln); - if (oom_cb && oom_cb() && (res = strdup(str))) return res; - abort(); - } - - return res; -} - -void xfree_real(void *ptr, const char *fn, unsigned ln) -{ - if (!ptr) { - eventlog(eventlog_level_error, __FUNCTION__, "got NULL ptr (from %s:%u)",fn,ln); - return; - } - - free(ptr); -} - -void xalloc_setcb(t_oom_cb cb) -{ - oom_cb = cb; -} - -#endif /* XALLOC_SKIP */ diff --git a/d2pack109/src/common/xalloc.h b/d2pack109/src/common/xalloc.h deleted file mode 100644 index b409944..0000000 --- a/d2pack109/src/common/xalloc.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2004 Dizzy (dizzy@roedu.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef INCLUDED_XALLOC_TYPES - -/* out of memory callback function */ -typedef int (*t_oom_cb)(void); - -#define INCLUDED_XALLOC_TYPES - -#endif /* INCLUDED_XALLOC_TYPES */ - -#ifndef INCLUDED_XALLOC_PROTOS -#define INCLUDED_XALLOC_PROTOS - -#ifdef HAVE_STDDEF_H -# include -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif - -#ifndef XALLOC_SKIP - -#define xmalloc(size) xmalloc_real(size,__FILE__,__LINE__) -void *xmalloc_real(size_t size, const char *fn, unsigned ln); -#define xcalloc(no,size) xcalloc_real(no,size,__FILE__,__LINE__) -void *xcalloc_real(size_t nmemb, size_t size, const char *fn, unsigned ln); -#define xrealloc(ptr,size) xrealloc_real(ptr,size,__FILE__,__LINE__) -void *xrealloc_real(void *ptr, size_t size, const char *fn, unsigned ln); -#define xstrdup(str) xstrdup_real(str,__FILE__,__LINE__) -char *xstrdup_real(const char *str, const char *fn, unsigned ln); -#define xfree(ptr) xfree_real(ptr,__FILE__,__LINE__) -void xfree_real(void *ptr, const char *fn, unsigned ln); -void xalloc_setcb(t_oom_cb cb); - -#else /* XALLOC_SKIP */ - -#define xmalloc(size) malloc(size) -#define xcalloc(no,size) calloc(no,size) -#define xrealloc(ptr,size) realloc(ptr,size) -#define xstrdup(str) strdup(str) -#define xfree(ptr) free(ptr) -#define xalloc_setcb(cb) - -#endif - -#endif /* INCLUDED_XALLOC_PROTOS */ diff --git a/d2pack109/src/compat/access.h b/d2pack109/src/compat/access.h deleted file mode 100644 index 079d3ff..0000000 --- a/d2pack109/src/compat/access.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_ACCESS_PROTOS -#define INCLUDED_ACCESS_PROTOS - -#ifdef WIN32 -# include -/* Values for the second argument to access. These may be OR'd together. */ -# define R_OK 4 /* Test for read permission. */ -# define W_OK 2 /* Test for write permission. */ -# define X_OK 1 /* Test for execute permission. */ -# define F_OK 0 /* Test for existence. */ -#endif - -#endif diff --git a/d2pack109/src/compat/char_bit.h b/d2pack109/src/compat/char_bit.h deleted file mode 100644 index 8a32ff6..0000000 --- a/d2pack109/src/compat/char_bit.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2000,2001 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_CHAR_BIT_TYPES -#define INCLUDED_CHAR_BIT_TYPES - -# ifdef HAVE_LIMITS_H -# include -# endif -# ifdef HAVE_SYS_PARAM_H -# include -# endif -# ifndef CHAR_BIT -# ifdef NBBY -# define CHAR_BIT NBBY -# else -# define CHAR_BIT 8 /* well, this is usually true :) */ -# endif -# endif - -#endif diff --git a/d2pack109/src/compat/difftime.c b/d2pack109/src/compat/difftime.c deleted file mode 100644 index be649c8..0000000 --- a/d2pack109/src/compat/difftime.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_DIFFTIME - -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#include "difftime.h" -#include "common/setup_after.h" - - -extern double difftime(time_t after, time_t before) -{ - return ((double)after)-((double)before); -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/difftime.h b/d2pack109/src/compat/difftime.h deleted file mode 100644 index 367d997..0000000 --- a/d2pack109/src/compat/difftime.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_DIFFTIME_PROTOS -#define INCLUDED_DIFFTIME_PROTOS - -#ifndef HAVE_DIFFTIME - -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -extern double difftime(time_t after, time_t before); - -#endif - -#endif diff --git a/d2pack109/src/compat/exitstatus.h b/d2pack109/src/compat/exitstatus.h deleted file mode 100644 index 429de58..0000000 --- a/d2pack109/src/compat/exitstatus.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_EXITSTATUS_PROTOS -#define INCLUDED_EXITSTATUS_PROTOS - -#ifdef EXIT_FAILURE -# if !EXIT_FAILURE -# define STATUS_FAILURE 1 -# else -# define STATUS_FAILURE EXIT_FAILURE -# endif -#else -# define STATUS_FAILURE 1 -#endif - -#ifdef EXIT_SUCCESS -# define STATUS_SUCCESS EXIT_SUCCESS -#else -# define STATUS_SUCCESS 0 -#endif - -#endif diff --git a/d2pack109/src/compat/gethostname.h b/d2pack109/src/compat/gethostname.h deleted file mode 100644 index 4ff4071..0000000 --- a/d2pack109/src/compat/gethostname.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_GETHOSTNAME_PROTOS -#define INCLUDED_GETHOSTNAME_PROTOS - -/* - * This is from unistd.h on Unix systems, but it's included with - * the socket stuff under Windows. This tries to hide that. - */ - -#ifdef WIN32 -# include -#endif - -#ifndef HAVE_GETHOSTNAME -# error "This program requires gethostname()" -#endif - -#endif diff --git a/d2pack109/src/compat/getopt.c b/d2pack109/src/compat/getopt.c deleted file mode 100644 index 20e06eb..0000000 --- a/d2pack109/src/compat/getopt.c +++ /dev/null @@ -1,1009 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - Free Software Foundation, Inc. - - This file is part of the GNU C Library. Its master source is NOT part of - the C library, however. The master source lives in /gd/gnu/lib. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef __WIN32__ /* caused problems/warnings compiling on bcc/vs.net otherwise */ -#include -#endif - -/* This tells Alpha OSF/1 not to define a getopt prototype in . - Ditto for AIX 3.2 and . */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - - -#ifndef HAVE_GETOPT - -#if !defined (__STDC__) || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include -#include - - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2 -#include -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#ifndef ELIDE_CODE - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include -#include -#endif /* GNU C library. */ - -#ifdef VMS -#include -#if HAVE_STRING_H - 0 -#include -#endif -#endif - -#if defined (WIN32) && !defined (__CYGWIN32__) -/* It's not Unix, really. See? Capital letters. */ -#include -#define getpid() GetCurrentProcessId() -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -#ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -#else -# define _(msgid) (msgid) -#endif -#endif - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -#include "common/setup_after.h" - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *optarg = NULL; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int optind = 1; - -/* Formerly, initialization of getopt depended on optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -int __getopt_initialized = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return -1 with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include -#define my_index strchr -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -#if !defined (__STDC__) || !__STDC__ -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -#endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -static const char *nonoption_flags; -static int nonoption_flags_len; - -static int original_argc; -static char *const *original_argv; - -/* Make sure the environment variable bash 2.0 puts in the environment - is valid for the getopt call we must make sure that the ARGV passed - to getopt is that one passed to the process. */ -static void store_args (int argc, char *const *argv) __attribute__ ((unused)); -static void -store_args (int argc, char *const *argv) -{ - /* XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ - original_argc = argc; - original_argv = argv; -} -text_set_element (__libc_subinit, store_args); -#endif - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined (__STDC__) && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined (__STDC__) && __STDC__ -static const char *_getopt_initialize (int, char *const *, const char *); -#endif -static const char * -_getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = optind = 1; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#ifdef _LIBC - if (posixly_correct == NULL - && argc == original_argc && argv == original_argv) - { - /* Bash 2.0 puts a special variable in the environment for each - command it runs, specifying which ARGV elements are the results of - file name wildcard expansion and therefore should not be - considered as options. */ - char var[100]; - sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); - nonoption_flags = getenv (var); - if (nonoption_flags == NULL) - nonoption_flags_len = 0; - else - nonoption_flags_len = strlen (nonoption_flags); - } - else - nonoption_flags_len = 0; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns -1. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - optarg = NULL; - - if (!__getopt_initialized || optind == 0) - { - optstring = _getopt_initialize (argc, argv, optstring); - optind = 1; /* Don't scan ARGV[0], the program name. */ - __getopt_initialized = 1; - } - - /* Test whether ARGV[optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#ifdef _LIBC -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && nonoption_flags[optind] == '1')) -#else -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > optind) - last_nonopt = optind; - if (first_nonopt > optind) - first_nonopt = optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc && NONOPTION_P) - optind++; - last_nonopt = optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[optind - 1][0], pfound->name); - - nextchar += strlen (nextchar); - - optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - if (temp == NULL || c == ':') - { - if (opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct option *p; - const struct option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - - /* optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = nameend + 1; - else - { - if (opterr) - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ - -#endif /* !HAVE_GETOPT */ diff --git a/d2pack109/src/compat/getopt.h b/d2pack109/src/compat/getopt.h deleted file mode 100644 index 561fa53..0000000 --- a/d2pack109/src/compat/getopt.h +++ /dev/null @@ -1,151 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. - - This file is part of the GNU C Library. Its master source is NOT part of - the C library, however. The master source lives in /gd/gnu/lib. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#ifndef _PVPGN_GETOPT_H_ -#define _PVPGN_GETOPT_H_ 1 - -#include "common/setup_before.h" - -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifndef HAVE_GETOPT - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if defined (__STDC__) && __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#ifdef WIN32 -#define extern -#endif - -#if defined (__STDC__) && __STDC__ -#ifdef __GNU_LIBRARY__ -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* __GNU_LIBRARY__ */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* __STDC__ */ - -#ifdef WIN32 -#undef extern -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* !HAVE_GETOPT */ - -#endif /* _PVPGN_GETOPT_H_ */ diff --git a/d2pack109/src/compat/gettimeofday.c b/d2pack109/src/compat/gettimeofday.c deleted file mode 100644 index 6633b34..0000000 --- a/d2pack109/src/compat/gettimeofday.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_GETTIMEOFDAY - -#include -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_SYS_TIMEB_H -# include -#endif -#include "gettimeofday.h" -#include "common/setup_after.h" - - -extern int gettimeofday(struct timeval * tv, struct timezone * tz) -{ -#ifdef HAVE_FTIME - struct timeb tb; -#endif - - if (!tv) - { - errno = EFAULT; - return -1; - } - -#ifdef HAVE_FTIME - tb.millitm = 0; /* apparently the MS CRT version of this doesn't set this member */ - /* FIXME: what would be a more appropriate function for that platform? */ - ftime(&tb); /* FIXME: some versions are void return others int */ - - tv->tv_sec = tb.time; - tv->tv_usec = ((long)tb.millitm)*1000; - if (tz) - { - tz->tz_minuteswest = 0; - tz->tz_dsttime = 0; - } - - return 0; -#else -# error "This program requires either gettimeofday() or ftime()" -#endif -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/gettimeofday.h b/d2pack109/src/compat/gettimeofday.h deleted file mode 100644 index 33164ee..0000000 --- a/d2pack109/src/compat/gettimeofday.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_GETTIMEOFDAY_TYPES -#define INCLUDED_GETTIMEOFDAY_TYPES - -#ifndef HAVE_GETTIMEOFDAY - -/* FIXME: these might already exist even if gettimeofday() doesn't */ -struct timeval -{ - long tv_sec; - long tv_usec; -}; - - -struct timezone -{ - int tz_minuteswest; - int tz_dsttime; -}; - -#endif - -#endif - - -#ifndef INCLUDED_GETTIMEOFDAY_PROTOS -#define INCLUDED_GETTIMEOFDAY_PROTOS - -#ifndef HAVE_GETTIMEOFDAY -extern int gettimeofday(struct timeval * tv, struct timezone * tz); -#endif - -#endif diff --git a/d2pack109/src/compat/inet_aton.c b/d2pack109/src/compat/inet_aton.c deleted file mode 100644 index 9088313..0000000 --- a/d2pack109/src/compat/inet_aton.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * ++Copyright++ 1983, 1990, 1993 - * - - * Copyright (c) 1983, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - - * --Copyright-- - */ -#include "common/setup_before.h" -#ifndef HAVE_INET_ATON - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; -static char rcsid[] = "$Id: inet_aton.c,v 1.1.1.1 2004/03/11 18:57:31 dizzy Exp $"; -#endif /* LIBC_SCCS and not lint */ - -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif -#include "compat/socket.h" /* for Win32 address types, maybe there should be compat/netinet_in.h */ -#include "inet_aton.h" -#include "common/setup_after.h" - - -/* - * Check whether "cp" is a valid ASCII representation - * of an Internet address and convert to a binary address. - * Returns 1 if the address is valid, 0 if not. - * This replaces inet_addr, the return value from which - * cannot distinguish between failure and a local wildcard address. - * Only handles IPv4. - * Assumes 32-bit ints. - */ -extern int inet_aton(char const * cp, struct in_addr * addr) -{ - unsigned int val; - int base, n; - char c; - unsigned int parts[4]; - unsigned int *pp = parts; - - c = *cp; - for (;;) { - /* - * Collect number up to ``.''. - * Values are specified as for C: - * 0x=hex, 0=octal, isdigit=decimal. - */ - if (!isdigit((int)c)) - return (0); - val = 0; base = 10; - if (c == '0') { - c = *++cp; - if (c == 'x' || c == 'X') - base = 16, c = *++cp; - else - base = 8; - } - for (;;) { - if (isascii((int)c) && isdigit((int)c)) { - val = (val * base) + (c - '0'); - c = *++cp; - } else if (base == 16 && isascii((int)c) && isxdigit((int)c)) { - val = (val << 4) | - (c + 10 - (islower((int)c) ? 'a' : 'A')); - c = *++cp; - } else - break; - } - if (c == '.') { - /* - * Internet format: - * a.b.c.d - * a.b.c (with c treated as 16 bits) - * a.b (with b treated as 24 bits) - */ - if (pp >= parts + 3) - return (0); - *pp++ = val; - c = *++cp; - } else - break; - } - /* - * Check for trailing characters. - */ - if (c != '\0' && (!isascii((int)c) || !isspace((int)c))) - return (0); - /* - * Concoct the address according to - * the number of parts specified. - */ - n = pp - parts + 1; - switch (n) { - - case 0: - return (0); /* initial nondigit */ - - case 1: /* a -- 32 bits */ - break; - - case 2: /* a.b -- 8.24 bits */ - if (val > 0xffffff) - return (0); - val |= parts[0] << 24; - break; - - case 3: /* a.b.c -- 8.8.16 bits */ - if (val > 0xffff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16); - break; - - case 4: /* a.b.c.d -- 8.8.8.8 bits */ - if (val > 0xff) - return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); - break; - } - if (addr) - addr->s_addr = htonl(val); - return (1); -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/inet_aton.h b/d2pack109/src/compat/inet_aton.h deleted file mode 100644 index 87a5a0a..0000000 --- a/d2pack109/src/compat/inet_aton.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * ++Copyright++ 1983, 1990, 1993 - * - - * Copyright (c) 1983, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - - * --Copyright-- - */ -#ifndef INCLUDED_INET_ATON_H -#define INCLUDED_INET_ATON_H - -#ifndef HAVE_INET_ATON - -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif - -extern int inet_aton(char const * cp, struct in_addr * addr); - -#endif - -#endif diff --git a/d2pack109/src/compat/inet_ntoa.c b/d2pack109/src/compat/inet_ntoa.c deleted file mode 100644 index 997e52c..0000000 --- a/d2pack109/src/compat/inet_ntoa.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_INET_NTOA - -#include -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef HAVE_SYS_TYPES -# include -#endif -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif -#include "inet_ntoa.h" -#include "common/setup_after.h" - - -extern char const * inet_ntoa(struct in_addr const * addr) -{ - static char buff[16]; - unsigned long val; - - if (!addr) - return NULL; - - val = ntohl(addr->s_addr); - sprintf(buff,"%u.%u.%u.%u", - (val>>24)&0xff, - (val>>16)&0xff, - (val>> 8)&0xff, - (val )&0xff); - return buff; -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/inet_ntoa.h b/d2pack109/src/compat/inet_ntoa.h deleted file mode 100644 index 2f6e6d0..0000000 --- a/d2pack109/src/compat/inet_ntoa.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_INET_NTOA_H -#define INCLUDED_INET_NTOA_H - -#ifndef HAVE_INET_NTOA - -#ifdef HAVE_NETINET_IN_H -# include -#endif -#ifdef HAVE_ARPA_INET_H -# include -#endif - -extern char const * inet_ntoa(struct in_addr const * addr); - -#endif - -#endif diff --git a/d2pack109/src/compat/memcpy.c b/d2pack109/src/compat/memcpy.c deleted file mode 100644 index 89151cf..0000000 --- a/d2pack109/src/compat/memcpy.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_MEMCPY - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef HAVE_BCOPY -# ifdef HAVE_STRING_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "memcpy.h" -#include "common/setup_after.h" - -extern void * memcpy(void * dest, void const * src, unsigned long n) -{ -#ifdef HAVE_BCOPY - bcopy(src,dest,n); - return dest; -#else -/* very slow, but we don't care */ - unsigned char * td=dest; - unsigned char * ts=src; - unsigned long i; - - if (!td || !ts) - return NULL; - - for (i=0; i -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include "memmove.h" -#include "common/setup_after.h" - -extern void * memmove(void * dest, void const * src, unsigned long n) -{ -/* very slow, but we don't care */ -/* FIXME: does this handle all overlapping cases correctly? */ - unsigned char * td=dest; - const unsigned char * ts=src; - unsigned long i; - - if (!td || !ts) - return NULL; - - for (i=0; i -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include "memset.h" -#include "common/setup_after.h" - -/* very slow, but we don't care */ -extern void * memset(void * dest, int c, unsigned long n) -{ - unsigned char * temp=dest; - unsigned long i; - - if (!temp) - return NULL; - - for (i=0; i -#endif -#ifdef HAVE_DIRECT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifdef MKDIR_TAKES_ONE_ARG -# ifdef HAVE_MKDIR -# define p_mkdir(A,B) mkdir(A) -# else -# ifdef HAVE__MKDIR -# define p_mkdir(A,B) _mkdir(A) -# else -# error "This program requires either mkdir() or _mkdir()" -# endif -# endif -#else -# ifdef HAVE_MKDIR -# define p_mkdir mkdir -# else -# ifdef HAVE__MKDIR -# define p_mkdir _mkdir -# else -# error "This program requires either mkdir() or _mkdir()" -# endif -# endif -#endif - -#endif diff --git a/d2pack109/src/compat/mmap.c b/d2pack109/src/compat/mmap.c deleted file mode 100644 index 5105c48..0000000 --- a/d2pack109/src/compat/mmap.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2003 RUSU Mihai (dizzy@roedu.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_MMAP -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#include "common/xalloc.h" -#include "mmap.h" -#ifdef WIN32 -# include -# include -#endif -#include "common/setup_after.h" - -extern void * pmmap(void *addr, unsigned len, int prot, int flags, int fd, unsigned offset) -{ - void *mem; -#ifdef WIN32 - HANDLE hFile, hMapping; - - /* under win32 we only support readonly mappings, the only ones used in pvpgn now :) */ - if (prot != PROT_READ) return NULL; - hFile = (HANDLE) _get_osfhandle(fd); - if (hFile == (HANDLE) - 1) return MAP_FAILED; - hMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL); - if (!hMapping) return MAP_FAILED; - mem = MapViewOfFile(hMapping, FILE_MAP_READ, 0, 0 ,0); -#else /* systems without mmap or win32 */ - unsigned pos; - int res; - - mem = xmalloc(len); - pos = 0; - while(pos < len) { - res = read(fd, (char *)mem + pos, len - pos); - if (res < 0) { - xfree(mem); - return MAP_FAILED; - } - pos += res; - } -#endif - - return mem; -} - -extern int pmunmap(void *addr, unsigned len) -{ -#ifdef WIN32 - UnmapViewOfFile(addr); -#else - xfree(addr); -#endif - return 0; -} -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/mmap.h b/d2pack109/src/compat/mmap.h deleted file mode 100644 index 6900c65..0000000 --- a/d2pack109/src/compat/mmap.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2003 Mihai RUSU (dizzy@roedu.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_PMMAP_PROTOS -#define INCLUDED_PMMAP_PROTOS - -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_MMAN_H -# include -#endif -#ifdef __BORLANDC__ -# include -#endif - -#ifndef PROT_NONE -#define PROT_NONE 0x00 /* no permissions */ -#endif -#ifndef PROT_READ -#define PROT_READ 0x01 /* pages can be read */ -#endif -#ifndef PROT_WRITE -#define PROT_WRITE 0x02 /* pages can be written */ -#endif -#ifndef PROT_EXEC -#define PROT_EXEC 0x04 /* pages can be executed */ -#endif -#ifndef MAP_SHARED -#define MAP_SHARED 0x0001 /* share changes */ -#endif -#ifndef MAP_PRIVATE -#define MAP_PRIVATE 0x0002 /* changes are private */ -#endif -#ifndef MAP_COPY -#define MAP_COPY MAP_PRIVATE /* Obsolete */ -#endif -#ifndef MAP_FAILED -#define MAP_FAILED ((void *)-1) -#endif - -#ifdef HAVE_MMAP -#define pmmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f) -#define pmunmap(a,b) munmap(a,b) -#else - -extern void * pmmap(void *addr, unsigned len, int prot, int flags, int fd, unsigned offset); -extern int pmunmap(void *addr, unsigned len); - -#endif - -#endif diff --git a/d2pack109/src/compat/pdir.c b/d2pack109/src/compat/pdir.c deleted file mode 100644 index 95f9e3f..0000000 --- a/d2pack109/src/compat/pdir.c +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (C) 2001 Dizzy (dizzy@roedu.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#define PDIR_INTERNAL_ACCESS -#include "common/setup_before.h" -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "compat/strdup.h" -#ifdef HAVE_DIRENT_H -# include -#else -# ifdef HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -# define dirent direct -#endif -#ifdef WIN32 -# include /* for _findfirst(), _findnext(), etc */ -#endif -#include -#include "compat/strerror.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "pdir.h" -#include "common/setup_after.h" - - -extern t_pdir * p_opendir(const char * path) { -#ifdef WIN32 - char npath[_MAX_PATH]; -#endif - t_pdir * pdir; - - if (path==NULL) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL path"); - return NULL; - } -/* while(path[strlen(path)]=='/') path[strlen(path)]='\0'; */ - /* win32 can use slash in addition to backslash */ - pdir=xmalloc(sizeof(t_pdir)); - -#ifdef WIN32 - if (strlen(path)+1+3+1>_MAX_PATH) { - eventlog(eventlog_level_error,__FUNCTION__,"WIN32: path too long"); - xfree(pdir); - return NULL; - } - strcpy(npath, path); - strcat(npath, "/*.*"); - pdir->path=xstrdup(npath); - - pdir->status = 0; - memset(&pdir->fileinfo, 0, sizeof(pdir->fileinfo)); /* no need for compat because WIN32 always has memset() */ - pdir->lFindHandle = _findfirst(npath, &pdir->fileinfo); - if (pdir->lFindHandle < 0) { - xfree((void *)pdir->path); /* avoid warning */ - xfree(pdir); - return NULL; - } - -#else /* POSIX style */ - - pdir->path=xstrdup(path); - if ((pdir->dir=opendir(path))==NULL) { - xfree((void *)pdir->path); /* avoid warning */ - xfree(pdir); - return NULL; - } - -#endif /* WIN32-POSIX */ - - return pdir; -} - - -extern int p_rewinddir(t_pdir * pdir) { - if (pdir==NULL) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL pdir"); - return -1; - } - if (pdir->path==NULL) { - eventlog(eventlog_level_error,__FUNCTION__,"got pdir with NULL path"); - return -1; - } -#ifdef WIN32 - /* i dont have any win32 around so i dont know if io.h has any rewinddir equivalent */ - /* FIXME: for the time being ill just close and reopen it */ - if (pdir->status!=-1) - { - if (pdir->lFindHandle<0) { - eventlog(eventlog_level_error,__FUNCTION__,"WIN32: got negative lFindHandle"); - return -1; - } - _findclose(pdir->lFindHandle); - } - pdir->status = 0; - memset(&pdir->fileinfo, 0, sizeof(pdir->fileinfo)); /* no need for compat because WIN32 always has memset() */ - pdir->lFindHandle = _findfirst(pdir->path, &pdir->fileinfo); - if (pdir->lFindHandle < 0) { - pdir->status = -1; - return -1; - } -#else /* POSIX */ - if (pdir->dir==NULL) { - eventlog(eventlog_level_error,__FUNCTION__,"POSIX: got pdir with NULL dir"); - return -1; - } - rewinddir(pdir->dir); -#endif - return 0; -} - - -extern char const * p_readdir(t_pdir * pdir) { - if (pdir==NULL) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL pdir"); - return NULL; - } - if (pdir->path==NULL) { - eventlog(eventlog_level_error,__FUNCTION__,"got pdir with NULL path"); - return NULL; - } -#ifdef WIN32 - switch (pdir->status) - { - default: - case -1: /* couldn't rewind */ - eventlog(eventlog_level_error,__FUNCTION__,"got pdir with status -1"); - return NULL; - case 0: /* freshly opened */ - pdir->status = 1; - return pdir->fileinfo.name; - case 1: /* reading */ - if (_findnext(pdir->lFindHandle, &pdir->fileinfo)<0) - { - pdir->status = 2; - return NULL; - } - else - return pdir->fileinfo.name; - break; - case 2: /* EOF */ - return NULL; - } -#else /* POSIX */ - { - struct dirent * dentry; - - if (pdir->dir==NULL) { - eventlog(eventlog_level_error,__FUNCTION__,"POSIX: got pdir with NULL dir"); - return NULL; - } - if ((dentry=readdir(pdir->dir))==NULL) - return NULL; - return dentry->d_name; - } -#endif /* WIN32-POSIX */ -} - - -extern int p_closedir(t_pdir * pdir) { - int ret; - - if (pdir==NULL) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL pdir"); - return -1; - } - if (pdir->path==NULL) { - eventlog(eventlog_level_error,__FUNCTION__,"got pdir with NULL path"); - return -1; - } - -#ifdef WIN32 - if (pdir->status!=-1) - { - if (pdir->lFindHandle<0) { - eventlog(eventlog_level_info,__FUNCTION__,"WIN32: got NULL findhandle"); - return -1; - } - _findclose(pdir->lFindHandle); /* FIXME: what does _findclose() return on error? */ - } - ret = 0; -#else /* POSIX */ - if (pdir->dir==NULL) { - eventlog(eventlog_level_info,__FUNCTION__,"POSIX: got NULL dir"); - return -1; - } -# ifdef CLOSEDIR_VOID - closedir(pdir->dir); - ret = 0; -# else - ret = closedir(pdir->dir); -# endif -#endif /* WIN32-POSIX */ - - xfree((void *)pdir->path); /* avoid warning */ - xfree(pdir); - return ret; -} diff --git a/d2pack109/src/compat/pdir.h b/d2pack109/src/compat/pdir.h deleted file mode 100644 index 7ec930b..0000000 --- a/d2pack109/src/compat/pdir.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2001 Dizzy (dizzy@roedu.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_PDIR_TYPES -#define INCLUDED_PDIR_TYPES - -#ifdef PDIR_INTERNAL_ACCESS - -#ifdef JUST_NEED_TYPES -# ifdef HAVE_DIRENT_H -# include -# else -# ifdef HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -# define dirent direct -# endif -# ifdef WIN32 -# include /* for _findfirst(), _findnext(), etc */ -# endif -#else -# define JUST_NEED_TYPES -# ifdef HAVE_DIRENT_H -# include -# else -# ifdef HAVE_SYS_NDIR_H -# include -# endif -# if HAVE_SYS_DIR_H -# include -# endif -# if HAVE_NDIR_H -# include -# endif -# define dirent direct -# endif -# ifdef WIN32 -# include /* for _findfirst(), _findnext(), etc */ -# endif -# undef JUST_NEED_TYPES -#endif - -#endif - -typedef struct pdir_struct -#ifdef PDIR_INTERNAL_ACCESS -{ - char const * path; - char const * lastret; -#ifdef WIN32 - long lFindHandle; - struct _finddata_t fileinfo; - int status; /* -1 == failure, 0 == freshly opened, 1 == opened and read, 2 == eof */ -#else /* POSIX */ - DIR * dir; -#endif -} -#endif -t_pdir; - -#endif - -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_PDIR_PROTOS -#define INCLUDED_PDIR_PROTOS - -extern t_pdir * p_opendir(const char * dirname); -extern int p_rewinddir(t_pdir * pdir); -extern char const * p_readdir(t_pdir * pdir); -extern int p_closedir(t_pdir * pdir); - -#endif - -#endif diff --git a/d2pack109/src/compat/psock.c b/d2pack109/src/compat/psock.c deleted file mode 100644 index 0b0013d..0000000 --- a/d2pack109/src/compat/psock.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 1999 Philippe Dubois (pdubois1@hotmail.com) - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifdef WIN32 - -#include -#include "psock.h" -#include "common/setup_after.h" - - -extern int psock_init(void) -{ - WORD wVersionRequested; - WSADATA wsaData; - - wVersionRequested = MAKEWORD(2, 2); - - if (WSAStartup(wVersionRequested, &wsaData)!=0) - { - /* FIXME: Tell the user that we could not find a usable WinSock DLL. */ - return -1; - } - - return 0; -} - -extern int psock_deinit(void) -{ - - if (WSACleanup()!=0) - { - return -1; - } - - return 0; -} - -extern int psock_ctl(int sd, int mode) -{ - unsigned long nParam=1; /* u_long or DWORD or what? */ - - return ioctlsocket(sd,mode,&nParam); -} - -#else - -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_FCNTL_H -# include -#else -# ifdef HAVE_SYS_FILE_H -# include -# endif -#endif -#include "psock.h" -#include "common/setup_after.h" - - -extern int psock_ctl(int sd, long int mode) -{ - long int oldmode; - - if ((oldmode = fcntl(sd,F_GETFL))<0) - oldmode = 0; - oldmode |= mode; - return fcntl(sd,F_SETFL,mode); -} - -#endif diff --git a/d2pack109/src/compat/psock.h b/d2pack109/src/compat/psock.h deleted file mode 100644 index 87f0199..0000000 --- a/d2pack109/src/compat/psock.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (C) 1999 Philippe Dubois (pdubois1@hotmail.com) - * Copyright (C) 1999,2000,2002 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_PSOCK_PROTOS -#define INCLUDED_PSOCK_PROTOS - -/* - * This file is like the other compat header files in that it - * tries to hide differences between systems. It is somewhat - * different in that it doesn't present a "normal" interface - * to the rest of the code, but instead defines its own macros - * and functions. This is done since Win32 uses closesocket() - * instead of close() for sockets, but it can't be remapped - * since it already has a close() for file descriptors. Also, - * this allows us to hide the fact that some systems use - * fcntl() and some use ioctl(). The select() function is - * included here even though it isn't strictly for sockets. - * Just call this version if any of the file descriptors might - * be sockets. - * - * This file must be included _after_ any other socket related - * headers and any other compat socket fixup headers. - */ - -#ifdef WIN32 /* winsock2 */ - -#include - -/* protocol families */ -#define PSOCK_PF_INET PF_INET - -/* address families */ -#define PSOCK_AF_INET AF_INET - -/* socket types */ -#define PSOCK_SOCK_STREAM SOCK_STREAM -#define PSOCK_SOCK_DGRAM SOCK_DGRAM - -/* socket protocols */ -#ifdef IPPROTO_TCP -# define PSOCK_IPPROTO_TCP IPPROTO_TCP -#else -# define PSOCK_IPPROTO_TCP 0 -#endif -#ifdef IPPROTO_UDP -# define PSOCK_IPPROTO_UDP IPPROTO_UDP -#else -# define PSOCK_IPPROTO_UDP 0 -#endif - -/* psock_[gs]etsockopt() flags */ -#define PSOCK_SOL_SOCKET SOL_SOCKET -#define PSOCK_SO_REUSEADDR SO_REUSEADDR -#define PSOCK_SO_KEEPALIVE SO_KEEPALIVE -#define PSOCK_SO_ERROR SO_ERROR - -/* psock_ctl() flags */ -#define PSOCK_NONBLOCK FIONBIO - -/* psock_errno() values */ -#ifdef WSAEWOULDBLOCK -# define PSOCK_EWOULDBLOCK WSAEWOULDBLOCK -#endif -#ifdef WSAEINPROGRESS -# define PSOCK_EINPROGRESS WSAEINPROGRESS -#endif -#ifdef WSAEINTR -# define PSOCK_EINTR WSAEINTR -#endif -#ifdef WSAECONNABORTED -# define PSOCK_ECONNABORTED WSAECONNABORTED -#endif -#ifdef WSATRY_AGAIN -# define PSOCK_EAGAIN WSATRY_AGAIN -#endif -#ifdef WSAECONNRESET -# define PSOCK_ECONNRESET WSAECONNRESET -#endif -#ifdef WSAENOTCONN -# define PSOCK_ENOTCONN WSAENOTCONN -#endif -#ifdef WSAEPIPE -# define PSOCK_EPIPE WSAEPIPE -#endif -#ifdef WSAEPROTO -# define PSOCK_EPROTO WSAEPROTO -#endif -#ifdef WSAENOBUFS -# define PSOCK_ENOBUFS WSAENOBUFS -#endif -#ifdef WSAENOMEM -# define PSOCK_ENOMEM WSAENOMEM -#endif - -/* psock_shutdown() flags */ -#define PSOCK_SHUT_RD 0 -#define PSOCK_SHUT_WR 1 -#define PSOCK_SHUT_RDWR 2 - -/* psock types */ -#define psock_t_socklen int - -/* psock_select() macros and types */ -#define t_psock_fd_set fd_set -#define PSOCK_FD_ZERO FD_ZERO -#define PSOCK_FD_CLR FD_CLR -#define PSOCK_FD_SET FD_SET -#define PSOCK_FD_ISSET FD_ISSET - -/* psock functions */ -extern int psock_init(void); /* a real functions in */ -extern int psock_deinit(void); /* compat/psock.c */ -#define psock_errno() WSAGetLastError() -#define psock_socket(pf, t, ps) socket(pf, t, ps) -#define psock_getsockopt(s, l, o, v, size) getsockopt(s, l, o, (void *)(v), size) -#define psock_setsockopt(s, l, o, v, size) setsockopt(s, l, o, (void *)(v), size) -extern int psock_ctl(int sd, int mode); /* a real function in compat/psock.c */ -#define psock_listen(s, b) listen(s, b) -#define psock_bind(s, a, l) bind(s, a, l) -#define psock_accept(s, a, l) accept(s, a, l) -#define psock_connect(s, a, l) connect(s, a, l) -#define psock_send(s, b, l, f) send(s, (void *)(b), l, f) -#define psock_sendto(s, b, l, f, a, al) sendto(s, (void *)(b), l, f, a, al) -#define psock_recv(s, b, l, f) recv(s, (void *)(b), l, f) -#define psock_recvfrom(s, b, l, f, a, al) recvfrom(s, (void *)(b), l, f, a, al) -#define psock_shutdown(s, how) shutdown(s, how) -#define psock_close(s) closesocket(s) -#define psock_select(s, r, w, e, t) select(s, r, w, e ,t) -#define psock_getsockname(s, a, l) getsockname(s, a, l) - -/* PDubois - 991111 */ -/*#define inet_aton(cp, pAdd) (((*pAdd).s_addr = inet_addr(cp)) != INADDR_NONE)*/ -/* (this should be done in compat/inet_aton.h and this isn't a 100% correct implementation anyway -Ross) */ - -#else /* assume POSIX */ - -/* protocol families */ -#define PSOCK_PF_INET PF_INET - -/* address families */ -#define PSOCK_AF_INET AF_INET - -/* socket types */ -#define PSOCK_SOCK_STREAM SOCK_STREAM -#define PSOCK_SOCK_DGRAM SOCK_DGRAM - -/* socket protocols */ -#ifdef IPPROTO_TCP -# define PSOCK_IPPROTO_TCP IPPROTO_TCP -#else -# define PSOCK_IPPROTO_TCP 0 -#endif -#ifdef IPPROTO_UDP -# define PSOCK_IPPROTO_UDP IPPROTO_UDP -#else -# define PSOCK_IPPROTO_UDP 0 -#endif - -/* psock_[gs]etsockopt() flags */ -#define PSOCK_SOL_SOCKET SOL_SOCKET -#define PSOCK_SO_REUSEADDR SO_REUSEADDR -#define PSOCK_SO_KEEPALIVE SO_KEEPALIVE -#define PSOCK_SO_ERROR SO_ERROR - -/* psock_ctl() flags */ -#define PSOCK_NONBLOCK O_NONBLOCK - -/* psock_errno() values */ -#ifdef EWOULDBLOCK -# define PSOCK_EWOULDBLOCK EWOULDBLOCK -#endif -#ifdef EINPROGRESS -# define PSOCK_EINPROGRESS EINPROGRESS -#endif -#ifdef EINTR -# define PSOCK_EINTR EINTR -#endif -#ifdef ECONNABORTED -# define PSOCK_ECONNABORTED ECONNABORTED -#endif -#ifdef EAGAIN -# define PSOCK_EAGAIN EAGAIN -#endif -#ifdef ECONNRESET -# define PSOCK_ECONNRESET ECONNRESET -#endif -#ifdef ENOTCONN -# define PSOCK_ENOTCONN ENOTCONN -#endif -#ifdef EPIPE -# define PSOCK_EPIPE EPIPE -#endif -#ifdef EPROTO -# define PSOCK_EPROTO EPROTO -#endif -#ifdef ENOBUFS -# define PSOCK_ENOBUFS ENOBUFS -#endif -#ifdef ENOMEM -# define PSOCK_ENOMEM ENOMEM -#endif - -/* psock_shutdown() flags */ -#ifdef SHUT_RD -# define PSOCK_SHUT_RD SHUT_RD -#else -# define PSOCK_SHUT_RD 0 -#endif -#ifdef SHUT_WR -# define PSOCK_SHUT_WR SHUT_WR -#else -# define PSOCK_SHUT_WR 1 -#endif -#ifdef SHUT_RDWR -# define PSOCK_SHUT_RDWR SHUT_RDWR -#else -# define PSOCK_SHUT_RDWR 2 -#endif - -/* psock types */ -/* FIXME: write configure test to check for this type */ -#ifdef HAVE_SOCKLEN_T -# define psock_t_socklen socklen_t -#else -# define psock_t_socklen unsigned int -#endif - -/* psock_select() macros and types */ -#define t_psock_fd_set fd_set -#define PSOCK_FD_ZERO FD_ZERO -#define PSOCK_FD_CLR FD_CLR -#define PSOCK_FD_SET FD_SET -#define PSOCK_FD_ISSET FD_ISSET - -/* psock functions */ -#define psock_init() (0) -#define psock_deinit() (0) -#define psock_errno() (errno) -#define psock_socket(pf, t, ps) socket(pf, t, ps) -#define psock_getsockopt(s, l, o, v, size) getsockopt(s, l, o, (void *)(v), size) -#define psock_setsockopt(s, l, o, v, size) setsockopt(s, l, o, (void *)(v), size) -extern int psock_ctl(int sd, long int mode); /* a real function in compat/psock.c */ -#define psock_listen(s, b) listen(s, b) -#define psock_bind(s, a, l) bind(s, a, l) -#define psock_accept(s, a, l) accept(s, a, l) -#define psock_connect(s, a, l) connect(s, a, l) -#define psock_send(s, b, l, f) send(s, (void *)(b), l, f) -#define psock_sendto(s, b, l, f, a, al) sendto(s, (void *)(b), l, f, a, al) -#define psock_recv(s, b, l, f) recv(s, (void *)(b), l, f) -#define psock_recvfrom(s, b, l, f, a, al) recvfrom(s, (void *)(b), l, f, a, al) -#define psock_shutdown(s, how) shutdown(s, how) -#define psock_close(s) close(s) -#define psock_select(s, r, w, e, t) select(s, r, w, e ,t) -#define psock_getsockname(s, a, l) getsockname(s, a, l) - -#endif - -#endif -#endif diff --git a/d2pack109/src/compat/recv.h b/d2pack109/src/compat/recv.h deleted file mode 100644 index 21f2eb4..0000000 --- a/d2pack109/src/compat/recv.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_RECV_PROTOS -#define INCLUDED_RECV_PROTOS - -#ifndef HAVE_RECV - -/* some recvfrom()s don't handle NULL, but recv is called depreciated on BSD */ -#ifdef HAVE_RECVFROM -# ifdef HAVE_STDDEF_H -# include -# else -# ifndef NULL -# define NULL ((void *)0) -# endif -# endif -# define recv(s, b, l, f) recvfrom(s, b, l, f, NULL, NULL) -#else -# error "This program requires recvfrom()" -#endif - -#endif - -#endif diff --git a/d2pack109/src/compat/rename.h b/d2pack109/src/compat/rename.h deleted file mode 100644 index 5c421ca..0000000 --- a/d2pack109/src/compat/rename.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_RENAME_PROTOS -#define INCLUDED_RENAME_PROTOS - -#ifdef HAVE_UNISTD_H -# include -#endif -#include "compat/access.h" - -static inline int p_rename(const char * old, const char * new) -{ -#ifdef WIN32 - if(access(new, F_OK) == 0) - if(remove(new) < 0) - return -1; -#endif - return rename(old, new); -} - -#endif diff --git a/d2pack109/src/compat/seek.h b/d2pack109/src/compat/seek.h deleted file mode 100644 index 1247253..0000000 --- a/d2pack109/src/compat/seek.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_SEEK_PROTOS -#define INCLUDED_SEEK_PROTOS - -#ifndef SEEK_SET -# ifdef L_SET -# define SEEK_SET L_SET -# else -# define SEEK_SET 0 -# endif -#endif - -#ifndef SEEK_CUR -# ifdef L_INCR -# define SEEK_CUR L_INCR -# else -# define SEEK_CUR 1 -# endif -#endif - -#ifndef SEEK_END -# ifdef L_XTND -# define SEEK_END L_XTND -# else -# define SEEK_END 2 -# endif -#endif - -#endif diff --git a/d2pack109/src/compat/send.h b/d2pack109/src/compat/send.h deleted file mode 100644 index 79823bb..0000000 --- a/d2pack109/src/compat/send.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_SEND_PROTOS -#define INCLUDED_SEND_PROTOS - -#ifndef HAVE_SEND - -/* some sendto()s don't handle NULL, but send is called depreciated on BSD */ -#ifdef HAVE_SENDTO -# ifdef HAVE_STDDEF_H -# include -# else -# ifndef NULL -# define NULL ((void *)0) -# endif -# endif -# define send(s, b, l, f) sendto(s, b, l, f, NULL, NULL) -#else -# error "This program requires sendto()" -#endif - -#endif - -#endif diff --git a/d2pack109/src/compat/signal.h b/d2pack109/src/compat/signal.h deleted file mode 100644 index 75ab812..0000000 --- a/d2pack109/src/compat/signal.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_SIGNAL_PROTOS -#define INCLUDED_SIGNAL_PROTOS - -/* for Cygnus B20.1 on win32 */ -#ifndef SA_RESTART -#define SA_RESTART 0 -#endif - -#endif diff --git a/d2pack109/src/compat/socket.h b/d2pack109/src/compat/socket.h deleted file mode 100644 index f9e881f..0000000 --- a/d2pack109/src/compat/socket.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 1999 Philippe Dubois (pdubois1@hotmail.com) - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_SOCKET_PROTOS -#define INCLUDED_SOCKET_PROTOS - -#ifdef WIN32 /* assume winsock2 is available */ - -# include -/* - * Including that file is basically equivalent to including: - * - * - * - * - * - * - * - * It should be included once for any file needing one or more - * of those headers. - */ - -#endif - -#endif diff --git a/d2pack109/src/compat/stdfileno.h b/d2pack109/src/compat/stdfileno.h deleted file mode 100644 index e88f106..0000000 --- a/d2pack109/src/compat/stdfileno.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_STDFILENO_PROTOS -#define INCLUDED_STDFILENO_PROTOS - -#ifdef STDIN_FILENO -# define STDINFD STDIN_FILENO -#else -# define STDINFD 0 -#endif - -#ifdef STDOUT_FILENO -# define STDOUTFD STDOUT_FILENO -#else -# define STDOUTFD 1 -#endif - -#ifdef STDERR_FILENO -# define STDERRFD STDERR_FILENO -#else -# define STDERRFD 2 -#endif - -#endif diff --git a/d2pack109/src/compat/strcasecmp.c b/d2pack109/src/compat/strcasecmp.c deleted file mode 100644 index 1fdc9af..0000000 --- a/d2pack109/src/compat/strcasecmp.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_STRCASECMP - -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "strcasecmp.h" -#include "common/setup_after.h" - - -extern int strcasecmp(char const * str1, char const * str2) -{ - unsigned int i; - int a; - int b; - - if (!str1 || !str2) - return -1; - - /* some versions of tolower() break when given already lowercase characters */ - for (i=0; str1[i]!='\0' && str2[i]!='\0'; i++) - { - if (isupper((int)str1[i])) - a = (int)tolower((int)str1[i]); - else - a = (int)str1[i]; - - if (isupper((int)str2[i])) - b = (int)tolower((int)str2[i]); - else - b = (int)str2[i]; - - if (ab) - return +1; - } - - if (str1[i]!='\0') - return -1; - if (str2[i]!='\0') - return +1; - return 0; -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/strcasecmp.h b/d2pack109/src/compat/strcasecmp.h deleted file mode 100644 index c55d920..0000000 --- a/d2pack109/src/compat/strcasecmp.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_STRCASECMP_PROTOS -#define INCLUDED_STRCASECMP_PROTOS - -#ifndef HAVE_STRCASECMP - -#ifdef HAVE_STRICMP -# define strcasecmp(s1, s2) stricmp(s1, s2) -# define HAVE_STRCASECMP -#else - -extern int strcasecmp(char const * str1, char const * str2); - -#endif - -#endif - -#endif diff --git a/d2pack109/src/compat/strchr.h b/d2pack109/src/compat/strchr.h deleted file mode 100644 index a4aa853..0000000 --- a/d2pack109/src/compat/strchr.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_STRCHR_PROTOS -#define INCLUDED_STRCHR_PROTOS - -#ifndef HAVE_STRCHR - -#ifdef HAVE_INDEX -# define strchr index -#else -# error "This program requires either strchr() or index()" -#endif - -#endif - -#endif diff --git a/d2pack109/src/compat/strdup.c b/d2pack109/src/compat/strdup.c deleted file mode 100644 index 9a14440..0000000 --- a/d2pack109/src/compat/strdup.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_STRDUP -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "strdup.h" -#include "common/setup_after.h" - - -extern char * strdup(char const * str) -{ - char * out; - - if (!(out = malloc(strlen(str)+1))) - return NULL; - strcpy(out,str); - return out; -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/strdup.h b/d2pack109/src/compat/strdup.h deleted file mode 100644 index 98f52ea..0000000 --- a/d2pack109/src/compat/strdup.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_STRDUP_PROTOS -#define INCLUDED_STRDUP_PROTOS - -#ifndef HAVE_STRDUP - -extern char * strdup(char const * str); - -#endif - -#endif diff --git a/d2pack109/src/compat/strerror.c b/d2pack109/src/compat/strerror.c deleted file mode 100644 index 049cd28..0000000 --- a/d2pack109/src/compat/strerror.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_STRERROR - -#include -#include "strerror.h" -#include "common/setup_after.h" - - -extern char const * strerror(int errornum) -{ - if (errornum==0) - return "No error"; -#ifdef EPERM - if (errornum==EPERM) - return "Operation not permitted"; -#endif -#ifdef ENOENT - if (errornum==ENOENT) - return "No such file or directory"; -#endif -#ifdef ESRCH - if (errornum==ESRCH) - return "No such process"; -#endif -#ifdef EINTR - if (errornum==EINTR) - return "Interrupted system call"; -#endif -#ifdef EIO - if (errornum==EIO) - return "I/O error"; -#endif -#ifdef ENXIO - if (errornum==EIO) - return "No such device or address"; -#endif -#ifdef EBADF - if (errornum==EBADF) - return "Bad file number"; -#endif -#ifdef EAGAIN - if (errornum==EAGAIN) - return "Try again"; -#endif -#ifdef ENOMEM - if (errornum==ENOMEM) - return "Out of memory"; -#endif -#ifdef EACCES - if (errornum==EACCES) - return "Permission denied"; -#endif -#ifdef EFAULT - if (errornum==EFAULT) - return "Bad address"; -#endif -#ifdef EBUSY - if (errornum==EBUSY) - return "Device or resource busy"; -#endif -#ifdef EEXIST - if (errornum==EEXIST) - return "File exists"; -#endif -#ifdef EXDEV - if (errornum==EXDEV) - return "Cross-device link"; -#endif -#ifdef EDEADLK - if (errornum==EXDEV) - return "Resource deadlock would occur"; -#endif -#ifdef EDEADLOCK - if (errornum==EDEADLOCK) - return "Resource deadlock would occur"; -#endif -#ifdef ENODEV - if (errornum==ENODEV) - return "No such device"; -#endif -#ifdef ENOTDIR - if (errornum==ENOTDIR) - return "Not a directory"; -#endif -#ifdef EISDIR - if (errornum==EISDIR) - return "Is a directory"; -#endif -#ifdef EINVAL - if (errornum==EINVAL) - return "Invalid argument"; -#endif -#ifdef ENFILE - if (errornum==ENFILE) - return "Too many open files in system"; -#endif -#ifdef EMFILE - if (errornum==EMFILE) - return "Too many open files"; -#endif -#ifdef ENOTTY - if (errornum==ENOTTY) - return "Not a typewriter"; -#endif -#ifdef ETXTBSY - if (errornum==ETXTBSY) - return "Text file busy"; -#endif -#ifdef EFBIG - if (errornum==EFBIG) - return "File too large"; -#endif -#ifdef ENOSPC - if (errornum==ENOSPC) - return "No space left on device"; -#endif -#ifdef ESPIPE - if (errornum==ESPIPE) - return "Illegal seek"; -#endif -#ifdef EROFS - if (errornum==EROFS) - return "Read-only file system"; -#endif -#ifdef EMLINK - if (errornum==EMLINK) - return "Too many links"; -#endif -#ifdef EPIPE - if (errornum==EPIPE) - return "Broken pipe"; -#endif -#ifdef EDOM - if (errornum==EDOM) - return "Math argument out of domain of func"; -#endif -#ifdef ERANGE - if (errornum==ERANGE) - return "Math result not representable"; -#endif -#ifdef ENAMETOOLONG - if (errornum==ENAMETOOLONG) - return "File name too long"; -#endif -#ifdef ENOLCK - if (errornum==ENOLCK) - return "No record locks available"; -#endif -#ifdef ENOSYS - if (errornum==ENOSYS) - return "Function not implemented"; -#endif -#ifdef ENOTEMPTY - if (errornum==ENOTEMPTY) - return "Directory not empty"; -#endif -#ifdef ELOOP - if (errornum==ELOOP) - return "Too many symbolic links encountered"; -#endif -#ifdef EHOSTDOWN - if (errornum==EHOSTDOWN) - return "Host is down"; -#endif -#ifdef EHOSTUNREACH - if (errornum==EHOSTUNREACH) - return "No route to host"; -#endif -#ifdef EALREADY - if (errornum==EALREADY) - return "Operation already in progress"; -#endif -#ifdef EINPROGRESS - if (errornum==EINPROGRESS) - return "Operation now in progress"; -#endif -#ifdef ESTALE - if (errornum==ESTALE) - return "Stale NFS filehandle"; -#endif -#ifdef EDQUOT - if (errornum==EDQUOT) - return "Quota exceeded"; -#endif -#ifdef EWOULDBLOCK - if (errornum==EWOULDBLOCK) - return "Operation would block"; -#endif -#ifdef ECOMM - if (errornum==ECOMM) - return "Communication error on send"; -#endif -#ifdef EPROTO - if (errornum==EPROTO) - return "Protocol error"; -#endif -#ifdef EPROTONOSUPPORT - if (errornum==EPROTONOSUPPORT) - return "Protocol not supported"; -#endif -#ifdef ESOCKTNOSUPPORT - if (errornum==ESOCKTNOSUPPORT) - return "Socket type not supported"; -#endif -#ifdef ESOCKTNOSUPPORT - if (errornum==EOPNOTSUPP) - return "Operation not supported"; -#endif -#ifdef EPFNOSUPPORT - if (errornum==EPFNOSUPPORT) - return "Protocol family not supported"; -#endif -#ifdef EAFNOSUPPORT - if (errornum==EAFNOSUPPORT) - return "Address family not supported by protocol family"; -#endif -#ifdef EADDRINUSE - if (errornum==EADDRINUSE) - return "Address already in use"; -#endif -#ifdef EADDRNOTAVAIL - if (errornum==EADDRNOTAVAIL) - return "Cannot assign requested address"; -#endif -#ifdef ENETDOWN - if (errornum==ENETDOWN) - return "Network is down"; -#endif -#ifdef ENETUNREACH - if (errornum==ENETUNREACH) - return "Network is unreachable"; -#endif -#ifdef ENETRESET - if (errornum==ENETRESET) - return "Network dropped connection on reset"; -#endif -#ifdef ECONNABORTED - if (errornum==ECONNABORTED) - return "Software caused connection abort"; -#endif -#ifdef ECONNRESET - if (errornum==ECONNRESET) - return " Connection reset by peer"; -#endif -#ifdef ENOBUFS - if (errornum==ENOBUFS) - return "No buffer space available"; -#endif -#ifdef EISCONN - if (errornum==EISCONN) - return "Socket is already connected"; -#endif -#ifdef ENOTCONN - if (errornum==ENOTCONN) - return "Socket is not connected"; -#endif -#ifdef ESHUTDOWN - if (errornum==ESHUTDOWN) - return " Cannot send after socket shutdown"; -#endif -#ifdef ETIMEDOUT - if (errornum==ETIMEDOUT) - return "Connection timed out"; -#endif -#ifdef ECONNREFUSED - if (errornum==ECONNREFUSED) - return "Connection refused"; -#endif - return "Unknown error"; -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/strerror.h b/d2pack109/src/compat/strerror.h deleted file mode 100644 index f9e80ea..0000000 --- a/d2pack109/src/compat/strerror.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_STRERROR_PROTOS -#define INCLUDED_STRERROR_PROTOS - -#ifndef HAVE_STRERROR - -extern char const * strerror(int errornum); - -#endif - -#endif diff --git a/d2pack109/src/compat/strftime.c b/d2pack109/src/compat/strftime.c deleted file mode 100644 index 829c78c..0000000 --- a/d2pack109/src/compat/strftime.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_STRFTIME - -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "strftime.h" -#include "common/setup_after.h" - - -/* We are not even trying to copy the functionality. - We are just trying to get a timestamp. */ -extern int strftime(char * buf, int bufsize, char const * fmt, struct tm const * tm) -{ - if (!buf || !fmt || !tm) - return 0; - - if (bufsize>24) - sprintf(buf,"%.4d %.2d %.2d %02.2d:%02.2d:%02.2d", - tm->tm_year, - tm->tm_mon, - tm->tm_mday, - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - else if (bufsize>10) - sprintf(buf,"%02.2d:%02.2d:%02.2d", - tm->tm_hour, - tm->tm_min, - tm->tm_sec); - else - buf[0] = '\0'; - - return strlen(buf); -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/strftime.h b/d2pack109/src/compat/strftime.h deleted file mode 100644 index 0b053f4..0000000 --- a/d2pack109/src/compat/strftime.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_STRFTIME_PROTOS -#define INCLUDED_STRFTIME_PROTOS - -#ifndef HAVE_STRFTIME - -extern int strftime(char * buf, int bufsize, char const * fmt, struct tm const * tm); - -#endif - -#endif diff --git a/d2pack109/src/compat/strncasecmp.c b/d2pack109/src/compat/strncasecmp.c deleted file mode 100644 index 2c5e752..0000000 --- a/d2pack109/src/compat/strncasecmp.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_STRCASECMP - -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "strncasecmp.h" -#include "common/setup_after.h" - - -extern int strncasecmp(char const * str1, char const * str2, unsigned int cnt) -{ - unsigned int i; - int a; - int b; - - if (!str1 || !str2) - return -1; - - /* some versions of tolower() break when given already lowercase characters */ - for (i=0; ib) - return +1; - } - - if (i -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "compat/strchr.h" -#include "strsep.h" -#include "common/setup_after.h" - - -extern char * strsep(char * * str, char const * delims) -{ - char * begin; - - begin = *str; - - if (!begin) - return NULL; /* already returned last token */ - - /* FIXME: optimiz case of 1 char delims (maybe not worth the effort) */ - for (; **str!='\0'; (*str)++) - if (strchr(delims,**str)) - { - **str = '\0'; /* terminate token */ - (*str)++; /* remember the position of the next char */ - return begin; - } - - *str = NULL; - return begin; /* return the whole input string */ -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/strsep.h b/d2pack109/src/compat/strsep.h deleted file mode 100644 index c4d21dd..0000000 --- a/d2pack109/src/compat/strsep.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2002 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_STRSEP_PROTOS -#define INCLUDED_STRSEP_PROTOS - -#ifndef HAVE_STRSEP - -extern char * strsep(char * * str, char const * delim); - -#endif - -#endif diff --git a/d2pack109/src/compat/strtoul.c b/d2pack109/src/compat/strtoul.c deleted file mode 100644 index fdfb214..0000000 --- a/d2pack109/src/compat/strtoul.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_STRTOUL - -#include "strtoul.h" -#include "common/setup_after.h" - - -extern unsigned long strtoul(char const * str, char * * endptr, int base) -{ - unsigned int pos; - unsigned int i; - unsigned long val; - - if (!str) - return 0; /* EINVAL */ - - for (pos=0; str[pos]==' ' || str[pos]=='\t'; pos++); - if (str[pos]=='-' || str[pos]=='+') - pos++; - if ((base==0 || base==16) && str[pos]=='0' && (str[pos+1]=='x' || str[pos+1]=='X')) - { - base = 16; - pos += 2; /* skip 0x prefix */ - } - else if ((base==0 || base==8) && str[pos]=='0') - { - base = 8; - pos += 1; - } - else if (base==0) - { - base = 10; - } - - if (base<2 || base>16) /* sorry, not complete emulation (should do up to 36) */ - return 0; /* EINVAL */ - - val = 0; - for (i=pos; str[i]!='\0'; i++) - { - val *= base; - - /* we could assume ASCII and subtraction but this isn't too hard */ - if (str[i]=='0') - val += 0; - else if (str[i]=='1') - val += 1; - else if (base>2 && str[i]=='2') - val += 2; - else if (base>3 && str[i]=='3') - val += 3; - else if (base>4 && str[i]=='4') - val += 4; - else if (base>5 && str[i]=='5') - val += 5; - else if (base>6 && str[i]=='6') - val += 6; - else if (base>7 && str[i]=='7') - val += 7; - else if (base>8 && str[i]=='8') - val += 8; - else if (base>9 && str[i]=='9') - val += 9; - else if (base>10 && (str[i]=='a' || str[i]=='A')) - val += 10; - else if (base>11 && (str[i]=='b' || str[i]=='B')) - val += 11; - else if (base>12 && (str[i]=='c' || str[i]=='C')) - val += 12; - else if (base>13 && (str[i]=='d' || str[i]=='D')) - val += 13; - else if (base>14 && (str[i]=='e' || str[i]=='E')) - val += 14; - else if (base>15 && (str[i]=='f' || str[i]=='F')) - val += 15; - else - break; - } - - if (endptr) - *endptr = (void *)&str[i]; /* avoid warning */ - - return val; -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/strtoul.h b/d2pack109/src/compat/strtoul.h deleted file mode 100644 index 50f3324..0000000 --- a/d2pack109/src/compat/strtoul.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_STRTOUL_PROTOS -#define INCLUDED_STRTOUL_PROTOS - -#ifndef HAVE_STRTOUL - -extern unsigned long strtoul(char const * str, char * * endptr, int base); - -#endif - -#endif diff --git a/d2pack109/src/compat/termios.h b/d2pack109/src/compat/termios.h deleted file mode 100644 index c1afd10..0000000 --- a/d2pack109/src/compat/termios.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_TERMIOS_TYPES -#define INCLUDED_TERMIOS_TYPES - -/* FIXME: this might already exist even if termios.h doesn't... check - for the type in autoconf */ -# ifndef HAVE_TERMIOS_H -struct termios -{ - int c_lflag; - int c_cc[1]; -}; - -# define ECHO 1 -# define ICANON 1 -# define VMIN 1 -# define VTIME 1 - -# endif - -#endif - - -#ifndef INCLUDED_TERMIOS_PROTOS -#define INCLUDED_TERMIOS_PROTOS - -/* FIXME: check for functions or macros (autoconf doesn't protect header inclusion for function tests so it isn't easy */ -#ifndef HAVE_TERMIOS_H -# define tcgetattr(F,T) (-1) -#endif - -/* FIXME: check for functions or macros (autoconf doesn't protect header inclusion for function tests so it isn't easy */ -#ifndef HAVE_TERMIOS_H -# define tcsetattr(F,A,T) (-1) -#endif - -#endif diff --git a/d2pack109/src/compat/uint.h b/d2pack109/src/compat/uint.h deleted file mode 100644 index 9b7ce22..0000000 --- a/d2pack109/src/compat/uint.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_UINT_TYPES -#define INCLUDED_UINT_TYPES - -#ifdef HAVE_STDINT_H - -# include -typedef uint8_t t_uint8; -typedef uint16_t t_uint16; -typedef uint32_t t_uint32; -typedef uint64_t t_uint64; -# define HAVE_UINT64_T - -#else -#ifdef HAVE_MODE_ATTR -typedef unsigned int t_uint8 MODE_ATTR(__QI__); -typedef unsigned int t_uint16 MODE_ATTR(__HI__); -typedef unsigned int t_uint32 MODE_ATTR(__SI__); -typedef unsigned int t_uint64 MODE_ATTR(__DI__); /* FIXME: I guess DI is always available... Is there a way to check? */ -# define HAVE_UINT64_T - -# else - -# ifdef HAVE_LIMITS_H -# include -# endif -# ifndef CHAR_BIT -# define MY_CHAR_BIT 8 /* well, this is usually true :) */ -# else -# define MY_CHAR_BIT CHAR_BIT -# endif - -# if SIZEOF_UNSIGNED_CHAR*MY_CHAR_BIT == 8 -typedef unsigned char t_uint8; -# else -# error "Unable to find 8-bit integer type" -# endif - -# if SIZEOF_UNSIGNED_SHORT*MY_CHAR_BIT == 16 -typedef unsigned short t_uint16; -# else -# if SIZEOF_UNSIGNED_INT*MY_CHAR_BIT == 16 -typedef unsigned int t_uint16; -# else -# error "Unable to find 16-bit integer type" -# endif -# endif - -# if SIZEOF_UNSIGNED_SHORT*MY_CHAR_BIT == 32 -typedef unsigned short t_uint32; -# else -# if SIZEOF_UNSIGNED_INT*MY_CHAR_BIT == 32 -typedef unsigned int t_uint32; -# else -# if SIZEOF_UNSIGNED_LONG*MY_CHAR_BIT == 32 -typedef unsigned long t_uint32; -# else -# error "Unable to find 32-bit integer type" -# endif -# endif -# endif - -# if SIZEOF_UNSIGNED_INT*MY_CHAR_BIT == 64 -typedef unsigned int t_uint64; -# define HAVE_UINT64_T -# else -# if SIZEOF_UNSIGNED_LONG*MY_CHAR_BIT == 64 -typedef unsigned long t_uint64; -# define HAVE_UINT64_T -# else -# if SIZEOF_UNSIGNED_LONG_LONG*MY_CHAR_BIT == 64 -typedef unsigned long long t_uint64; -# define HAVE_UINT64_T -# endif -# endif -# endif - -# undef MY_CHAR_BIT - -# endif -#endif - -#endif diff --git a/d2pack109/src/compat/uname.c b/d2pack109/src/compat/uname.c deleted file mode 100644 index a2b3e31..0000000 --- a/d2pack109/src/compat/uname.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#ifndef HAVE_UNAME - -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include -#include "uname.h" -#include "common/setup_after.h" - - -extern int uname(struct utsname * buf) -{ - if (!buf) - { - errno = EFAULT; - return -1; - } - -#ifdef WIN32 -/* FIXME: distinguish between: */ -/* Microsoft Windows 3.1-32s/3.11-32s/95/95SP1/95A/95B/95OSR2/95OSR2.1/95OSR2.5/95B+MSIE/98/98OEM/98SE/2000ME "New Technology" 3.1/3.5 Server/3.51 Server/4.0 Server/4.0SP1 Server/4.0SP2 Server/4.0SP3 Server/4.0SP4 Server/4.0SP6 Server/3.5 Workstation/3.51 Workstation/4.0 Workstation/4.0SP1 Workstation/4.0SP2 Workstation/4.0SP3 Workstation/4.0SP4 Workstation/4.0SP6 Workstation/"2000 Professional Edition"/"2000 Server"/"2000 Advanced Server"/"Windows 2000 Terminal Server" Win CE/"Windows Powered"/"Pocket OS" 1.0/1.1/2.0/2.1 */ -/* maybe report the build number too */ - strcpy(buf->sysname,"Win32"); -#else - strcpy(buf->sysname,""); -#endif - strcpy(buf->nodename,""); - strcpy(buf->release,""); - strcpy(buf->version,""); - strcpy(buf->machine,""); - strcpy(buf->domainname,""); - - return 0; -} - -#else -typedef int filenotempty; /* make ISO standard happy */ -#endif diff --git a/d2pack109/src/compat/uname.h b/d2pack109/src/compat/uname.h deleted file mode 100644 index b1a52f4..0000000 --- a/d2pack109/src/compat/uname.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_UNAME_TYPES -#define INCLUDED_UNAME_TYPES - -#ifndef HAVE_UNAME - -#ifndef SYS_NMLN -# define SYS_NMLN 64 -#endif - -struct utsname -{ - char sysname[SYS_NMLN]; - char nodename[SYS_NMLN]; - char release[SYS_NMLN]; - char version[SYS_NMLN]; - char machine[SYS_NMLN]; - char domainname[SYS_NMLN]; -}; - -#endif - -#endif - - -#ifndef INCLUDED_UNAME_PROTOS -#define INCLUDED_UNAME_PROTOS - -#ifndef HAVE_UNAME -extern int uname(struct utsname * buf); -#endif - -#endif diff --git a/d2pack109/src/configure.in b/d2pack109/src/configure.in deleted file mode 100644 index ee3c8f1..0000000 --- a/d2pack109/src/configure.in +++ /dev/null @@ -1,196 +0,0 @@ -# -# Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com) -# Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# - -# Process this file with autoconf to produce a configure script. -AC_INIT(d2cs/handle_d2gs.c) -AC_CONFIG_HEADER(config.h) - -AUTOCONF_CONFIG_DIR="autoconf" -AC_CONFIG_AUX_DIR(${AUTOCONF_CONFIG_DIR}) -builtin(include,autoconf/ccstdc.m4) -builtin(include,autoconf/mkdir.m4) - -AC_CANONICAL_SYSTEM - -# Checks for programs. -AC_PROG_CC -AC_PROG_INSTALL - -# Checks compiler. -AC_PROG_CPP - -# Checks for systems. -AC_AIX -AC_ISC_POSIX -AC_MINIX - -# Custom checks. -zwarnflags="" -AC_ARG_WITH(warn, [ --with-warn enable compiler warnings], [zwarnflags="-pedantic -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wunreachable-code -Winline -Wpacked -Wno-sign-compare"]) - - -extra_include="" -AC_ARG_WITH(includes, [ --with-includes=DIR search include DIR for header files], [ -case "x$withval" in -x/*|x.*) - AC_MSG_RESULT([adding ${withval} to include search path]) - if test ! -d ${withval}; then - AC_MSG_RESULT([Warning: directory ${withval} does not exist]) - fi - extra_include="${extra_include} -I${withval}" - ;; -*) - AC_MSG_RESULT([not adding any includes]) - ;; -esac]) - -extra_lib_dir="" -AC_ARG_WITH(libraries, [ --with-libraries=DIR search library DIR for libraries], [ -case "x${withval}" in -x/*|x.*) - AC_MSG_RESULT([adding ${withval} to library search path]) - if test ! -d ${withval}; then - AC_MSG_RESULT([Warning: directory ${withval} does not exist]) - fi - extra_lib_dir="${extra_lib_dir} -L${withval}" - ;; -*) - AC_MSG_RESULT([not adding any libs]) - ;; -esac]) - -extra_lib="" -extra_define="" - -LDFLAGS="${LDFLAGS} ${extra_lib_dir}" -LIBS="${LIBS} ${extra_lib}" -CFLAGS="${CFLAGS} ${zwarnflags}" -DEFINES="${DEFINES} ${extra_define}" -CPPFLAGS="${CPPFLAGS} ${extra_include}" - -# This is our invention so we have to substitute it ourselves -# autoconf uses DEFS -AC_SUBST(DEFINES) - -# Checks for compiler quirks. -AC_PROG_GCC_TRADITIONAL -AM_PROG_CC_STDC -AC_C_CONST -AC_C_INLINE -#AC_EXEEXT - -# Checks for libraries. -AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"]) -AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"]) -AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"]) -AC_CHECK_LIB(resolv, inet_aton, [LIBS="$LIBS -lresolv"]) -AC_CHECK_LIB(z, compress, [LIBS="$LIBS -lz"]) -dnl BeOS BONE... -AC_CHECK_LIB(bind, __inet_aton, [LIBS="$LIBS -lbind"]) -case "$host" in - [*-beos*]) - if test "$ac_cv_lib_bind___inet_aton" = "yes"; then - dnl force things, AC_CHECK_FUNC will never get the mangled versions anyway. - echo "Forcing inet_aton() and inet_ntoa() to be enabled" - ac_cv_func_inet_aton='yes' - ac_cv_func_inet_ntoa='yes' - fi - ;; -esac - -mssql_include_path="" -dnl Detecting mssql paths -if test "$ac_with_mssql" = "yes" ; then - echo -n "checking for mssql/FreeTDS include path ... " - mssql_try_includes="/usr/include /usr/include/freetds /usr/local/include /usr/local/include/freetds /usr/local/freetds/include" - for i in `echo ${mssql_try_includes}`; do - if test -f "${i}/sqlfront.h" ; then - echo ${i} - CPPFLAGS="${CPPFLAGS} -I${i}" - mssql_include_path=${i} - break - fi - done -fi - -mssql_lib_path="" -if test "$ac_with_mssql" = "yes" ; then - AC_CHECK_LIB(sybdb, dbinit, [DEFINES="${DEFINES} -DWITH_SQL_MSSQL" ; LIBS="${LIBS} -lsybdb"], [ - echo -n "checking for mssql/FreeTDS lib path ... " - mssql_try_libs="/usr/lib /usr/lib/freetds /usr/local/lib /usr/local/lib/freetds /usr/local/freetds/lib" - for i in `echo ${mssql_try_libs}`; do - if test -f "${i}/libsybdb.so" -o -f "${i}/libsybdb.a" ; then - echo ${i} - save_ldflags="${LDFLAGS}" - LDFLAGS="${LDFLAGS} -L${i}" - AC_CHECK_LIB(sybdb, dbclose, [DEFINES="${DEFINES} -DWITH_SQL_MSSQL" ; LIBS="${LIBS} -lsybdb" ; mssql_lib_path="${i}"], [LDFLAGS="${save_ldflags}"]) - break - fi - done - ]) -fi - -# Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_HEADER_TIME -AC_HEADER_STAT -AC_CHECK_HEADERS(fcntl.h time.h sys/time.h sys/select.h string.h strings.h unistd.h stdarg.h varargs.h malloc.h sys/utsname.h sys/timeb.h sys/socket.h sys/param.h netinet/in.h arpa/inet.h netdb.h termios.h stddef.h memory.h sys/types.h sys/wait.h sys/ioctl.h stdint.h sys/file.h limits.h poll.h sys/poll.h stropts.h sys/stropts.h sys/stat.h pwd.h grp.h dir.h direct.h sys/mman.h sys/event.h sys/epoll.h sys/resource.h assert.h) - -# Checks for typedefs and structures -AC_STRUCT_TM -AC_TYPE_PID_T -AC_TYPE_SIGNAL -AC_TYPE_OFF_T -AC_TYPE_SIZE_T -AC_CHECK_SIZEOF(unsigned char, 1) -AC_CHECK_SIZEOF(unsigned short, 2) -AC_CHECK_SIZEOF(unsigned int, 4) -AC_CHECK_SIZEOF(unsigned long, 4) -AC_CHECK_SIZEOF(unsigned long long, 0) - -# Checks for library functions. -AC_FUNC_MMAP -AC_FUNC_STRFTIME -AC_FUNC_VPRINTF -AC_FUNC_SETPGRP -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_MKDIR_ARGS -AC_CHECK_FUNCS(gethostname gettimeofday select socket strdup strtoul strerror inet_aton inet_ntoa uname recv send recvfrom sendto uname fork getpid sigaction sigprocmask sigaddset setpgid setpgrp ftime strcasecmp strncasecmp stricmp strnicmp chdir difftime strchr strrchr index rindex memcpy memset memmove bcopy wait waitpid pipe getenv ioctl setsid mktime poll gethostbyname getservbyname getlogin pow getpwnam getgrnam getuid getgid setuid setgid mkdir _mkdir strsep getopt kqueue setitimer epoll_create getrlimit) - -if test X"${am_cv_prog_cc_stdc}" = X"no"; then - COMPILEANSI1='${PREPROCESS} $< | sed '"'"'s/^# *\([0-9][0-9]*\) *\([^ ]*[a-z][^ ]*\) *.*$$/#line \1 \2/'"'"' | ${SRC_ACDIR}/ansi2knr > ${SRC_SRCDIR}/.ansi2knr_tmp.c' - COMPILEANSI2='${COMPILE} ${SRC_SRCDIR}/.ansi2knr_tmp.c -o $@' - COMPILEANSI3='@${RMF} ${SRC_SRCDIR}/.ansi2knr_tmp.c' - ANSI2KNR_TMP='${SRC_SRCDIR}/.ansi2knr_tmp.c' - ANSI2KNR_DEP='${SRC_ACDIR}/ansi2knr' -else - COMPILEANSI1='${COMPILE} $< -o $@' - COMPILEANSI2='@:' - COMPILEANSI3='@:' - ANSI2KNR_TMP='' - ANSI2KNR_DEP='' -fi -AC_SUBST(COMPILEANSI1) -AC_SUBST(COMPILEANSI2) -AC_SUBST(COMPILEANSI3) -AC_SUBST(ANSI2KNR_TMP) -AC_SUBST(ANSI2KNR_DEP) - -AC_OUTPUT(Makefile) diff --git a/d2pack109/src/d2cs/bit.h b/d2pack109/src/d2cs/bit.h deleted file mode 100644 index 0e66e47..0000000 --- a/d2pack109/src/d2cs/bit.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_BIT_H -#define INCLUDED_BIT_H - -#define BIT_POS(n) ( 1u << (n) ) -#define BIT_SET_FLAG(n,f) ( (n) |= (f) ) -#define BIT_CLR_FLAG(n,f) ( (n) &= ~(f) ) -#define BIT_TST_FLAG(n,f) ( (n) & (f) ) - -#define BIT_RANGE(n,m) ( BIT_POS((m)+1-(n)) - BIT_POS(n) ) -#define BIT_LSHIFT(n,m) ( (n) << (m) ) -#define BIT_RSHIFT(n,m) ( (n) >> (m) ) - -#endif diff --git a/d2pack109/src/d2cs/bnetd.c b/d2pack109/src/d2cs/bnetd.c deleted file mode 100644 index f3f2ae6..0000000 --- a/d2pack109/src/d2cs/bnetd.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#include "bnetd.h" -#include "prefs.h" -#include "s2s.h" -#include "handle_bnetd.h" -#include "connection.h" -#include "common/eventlog.h" -#include "common/setup_after.h" - -static t_connection * bnetd_connection=NULL; - -extern int bnetd_init(void) -{ - return bnetd_check(); -} - -extern int bnetd_check(void) -{ - static unsigned int prev_connecting_checktime=0; - - if (bnetd_connection) { - if (d2cs_conn_get_state(bnetd_connection)==conn_state_connecting) { - if (time(NULL) - prev_connecting_checktime > prefs_get_s2s_timeout()) { - eventlog(eventlog_level_warn,__FUNCTION__,"connection to bnetd s2s timeout"); - d2cs_conn_set_state(bnetd_connection,conn_state_destroy); - return -1; - } - } - return 0; - } - if (!(bnetd_connection=s2s_create(prefs_get_bnetdaddr(),BNETD_SERV_PORT,conn_class_bnetd))) { - return -1; - } - if (d2cs_conn_get_state(bnetd_connection)==conn_state_init) { - handle_bnetd_init(bnetd_connection); - } else { - prev_connecting_checktime=time(NULL); - } - return 0; -} - - -extern t_connection * bnetd_conn(void) -{ - return bnetd_connection; -} - -extern int bnetd_set_connection(t_connection * c) -{ - bnetd_connection=c; - return 0; -} - -extern int bnetd_destroy(t_connection * c) -{ - if (bnetd_connection != c) { - eventlog(eventlog_level_error,__FUNCTION__,"bnetd connection do not match"); - return -1; - } - bnetd_connection=NULL; - return 0; -} diff --git a/d2pack109/src/d2cs/bnetd.h b/d2pack109/src/d2cs/bnetd.h deleted file mode 100644 index 00c5d8d..0000000 --- a/d2pack109/src/d2cs/bnetd.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_BNETD_H -#define INCLUDED_BNETD_H - -#include "s2s.h" - -extern int bnetd_init(void); -extern int bnetd_check(void); -extern t_connection * bnetd_conn(void); -extern int bnetd_destroy(t_connection * c); -extern int bnetd_set_connection(t_connection * c); -extern int bnetd_keepalive(void); - -#endif diff --git a/d2pack109/src/d2cs/cmdline_parse.c b/d2pack109/src/d2cs/cmdline_parse.c deleted file mode 100644 index bad125c..0000000 --- a/d2pack109/src/d2cs/cmdline_parse.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/memset.h" - -#include "conf.h" -#include "version.h" -#include "cmdline_parse.h" -#include "common/eventlog.h" -#include "common/setup_after.h" - -static t_conf_table param_conf_table[]={ - { "-c", offsetof(t_param,prefs_file), conf_type_str, 0, D2CS_DEFAULT_CONF_FILE}, - { "-l", offsetof(t_param,logfile), conf_type_str, 0, NULL }, - { "-h", offsetof(t_param,help), conf_type_bool,0, NULL }, - { "--help", offsetof(t_param,help), conf_type_bool,0, NULL }, - { "-v", offsetof(t_param,version), conf_type_bool,0, NULL }, - { "--version", offsetof(t_param,version), conf_type_bool,0, NULL }, - { "-f", offsetof(t_param,foreground), conf_type_bool,0, NULL }, - { "--foreground",offsetof(t_param,foreground), conf_type_bool,0, NULL }, - { "-D", offsetof(t_param,debugmode), conf_type_bool,0, NULL }, - { "--debug", offsetof(t_param,debugmode), conf_type_bool,0, NULL }, -#ifdef WIN32 - { "--service", offsetof(t_param,run_as_service),conf_type_bool,0, NULL }, - { "-s", offsetof(t_param,make_service), conf_type_str, 0, NULL }, -#endif - { NULL, 0, conf_type_none,0, NULL } -}; - -static t_param cmdline_param; - -static char help_message[]="\n" -"Usage: d2cs []\n" -" -m : set memory debug logging file to FILE\n" -" -c : set configuration file to FILE\n" -" -l : set log to FILE\n" -" -h, --help: show this help message and exit\n" -" -v, --version: show version information and exit\n" -" -f, --foreground: start in foreground mode (don`t daemonize)\n" -" -D, --debug: run in debug mode (run in foreground and log to stdout)\n" -#ifdef WIN32 -" Running as service functions:\n" -" --service run as service\n" -" -s install install service\n" -" -s uninstall uninstall service\n" -#endif -"\n" -"Notes:\n" -" 1.You should always use absolute path here for all FILE names\n\n"; - -extern void cmdline_show_help(void) -{ - fprintf(stderr,help_message); - return; -} - -extern void cmdline_show_version(void) -{ - fprintf(stderr,D2CS_VERSION); - fprintf(stderr,"\n\n"); - return; -} - -extern int cmdline_parse(int argc, char ** argv) -{ - memset(&cmdline_param,0, sizeof(cmdline_param)); - if (conf_parse_param(argc, argv, param_conf_table, &cmdline_param, sizeof(cmdline_param))<0) { - return -1; - } - return 0; -} - -extern int cmdline_cleanup(void) -{ - return conf_cleanup(param_conf_table, &cmdline_param, sizeof(cmdline_param)); -} - -extern char const * cmdline_get_prefs_file(void) -{ - return cmdline_param.prefs_file; -} - -extern unsigned int cmdline_get_help(void) -{ - return cmdline_param.help; -} - -extern unsigned int cmdline_get_version(void) -{ - return cmdline_param.version; -} - -extern unsigned int cmdline_get_foreground(void) -{ - return cmdline_param.foreground; -} - -extern unsigned int cmdline_get_debugmode(void) -{ - return cmdline_param.debugmode; -} - -extern char const * cmdline_get_logfile(void) -{ - return cmdline_param.logfile; -} - -#ifdef WIN32 -extern unsigned int cmdline_get_run_as_service(void) -{ - return cmdline_param.run_as_service; -} - -extern char const * cmdline_get_make_service(void) -{ - return cmdline_param.make_service; -} - -#endif diff --git a/d2pack109/src/d2cs/cmdline_parse.h b/d2pack109/src/d2cs/cmdline_parse.h deleted file mode 100644 index a41d7cf..0000000 --- a/d2pack109/src/d2cs/cmdline_parse.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_CMDLINE_PARSE_H -#define INCLUDED_CMDLINE_PARSE_H - -typedef struct -{ - char const * prefs_file; - char const * logfile; - unsigned int foreground; - unsigned int help; - unsigned int version; - unsigned int debugmode; - unsigned int run_as_service; - char const * make_service; -} t_param; - -extern int cmdline_parse(int argc, char ** argv); -extern int cmdline_cleanup(void); -extern void cmdline_show_help(void); -extern void cmdline_show_version(void); -extern char const * cmdline_get_prefs_file(void); -extern char const * cmdline_get_logfile(void); -extern unsigned int cmdline_get_version(void); -extern unsigned int cmdline_get_help(void); -extern unsigned int cmdline_get_foreground(void); -extern unsigned int cmdline_get_debugmode(void); -#ifdef WIN32 -extern unsigned int cmdline_get_run_as_service(void); -extern char const * cmdline_get_make_service(void); -#endif - -#endif diff --git a/d2pack109/src/d2cs/conf.c b/d2pack109/src/d2cs/conf.c deleted file mode 100644 index b0fb68b..0000000 --- a/d2pack109/src/d2cs/conf.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strcasecmp.h" -#include "compat/strtoul.h" -#include "compat/memset.h" -#include "compat/strdup.h" -#include -#include "compat/strerror.h" - -#include "xstring.h" -#include "conf.h" -#include "common/util.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static int conf_set_default(t_conf_table * conf_table, void * param_data, int datalen); -static int conf_set_value(t_conf_table * conf, void * param_data, char * value); -static int conf_int_set(void * data, int value); -static int conf_bool_set(void * data, int value); -static int conf_str_set(void * data, char const * value); -static int conf_hexstr_set(void * data, char const * value); -static int conf_type_get_size(e_conf_type type); - -static int conf_int_set(void * data, int value) -{ - int * p; - - p=(int *)data; - *p=value; - return 0; -} - -static int conf_bool_set(void * data, int value) -{ - char * p; - - p=(char *)data; - *p=tf(value); - return 0; -} - -static int conf_str_set(void * data, char const * value) -{ - char * * p; - - p=(char * *)data; - if (*p) xfree(*p); - if (value) *p=xstrdup(value); - else *p=NULL; - - return 0; -} - -static int conf_hexstr_set(void * data, char const * value) -{ - char * * p; - - p=(char * *)data; - if (*p) xfree(*p); - if (value) *p=hexstrdup(value); - else *p=NULL; - return 0; -} - -static int conf_set_default(t_conf_table * conf_table, void * param_data, int datalen) -{ - unsigned int i; - char * p; - - ASSERT(conf_table,-1); - ASSERT(param_data,-1); - memset(param_data,0,datalen); - for (i=0; conf_table[i].name; i++) { - if (conf_table[i].offset + conf_type_get_size(conf_table[i].type) > datalen) { - eventlog(eventlog_level_error,__FUNCTION__,"conf table item %d bad offset %d exceed %d",i,conf_table[i].offset,datalen); - return -1; - } - p=(char *)param_data+conf_table[i].offset; - switch (conf_table[i].type) { - CASE(conf_type_bool, conf_bool_set(p, conf_table[i].def_intval)); - CASE(conf_type_int, conf_int_set(p, conf_table[i].def_intval)); - CASE(conf_type_str, conf_str_set(p, conf_table[i].def_strval)); - CASE(conf_type_hexstr, conf_hexstr_set(p, conf_table[i].def_strval)); - default: - eventlog(eventlog_level_error,__FUNCTION__,"conf table item %d bad type %d",i,conf_table[i].type); - return -1; - } - } - return 0; -} - -static int conf_set_value(t_conf_table * conf, void * param_data, char * value) -{ - char * p; - - ASSERT(conf,-1); - ASSERT(param_data,-1); - ASSERT(value,-1); - p=(char *)param_data+conf->offset; - switch (conf->type) { - CASE(conf_type_bool, conf_bool_set(p, strtoul(value,NULL,0))); - CASE(conf_type_int, conf_int_set(p, strtoul(value,NULL,0))); - CASE(conf_type_str, conf_str_set(p, value)); - CASE(conf_type_hexstr, conf_hexstr_set(p, value)); - default: - eventlog(eventlog_level_error,__FUNCTION__,"got bad conf type %d",conf->type); - return -1; - } - return 0; -} - -static int conf_type_get_size(e_conf_type type) -{ - switch (type) { - case conf_type_bool: - return sizeof(char); - case conf_type_int: - return sizeof(int); - case conf_type_str: - case conf_type_hexstr: - return sizeof(char *); - default: - eventlog(eventlog_level_error,__FUNCTION__,"got bad conf type %d",type); - return 0; - } -} - -extern int conf_parse_param(int argc, char ** argv, t_conf_table * conf_table, void * data, int datalen) -{ - int i; - unsigned int j; - char * p; - int match; - - ASSERT(argc,-1); - ASSERT(argv,-1); - ASSERT(data, -1); - if (conf_set_default(conf_table, data, datalen)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error setting default values"); - return -1; - } - for (i=1; i< argc; i++) { - match=0; - for (j=0; conf_table[j].name; j++) { - if (!strcmp(conf_table[j].name,argv[i])) { - match=1; - p=(char *)data + conf_table[j].offset; - switch (conf_table[j].type) { - case conf_type_bool: - conf_bool_set(p,1); - break; - case conf_type_int: - if (i+1>=argc) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad int conf %s without value",argv[i]); - break; - } - i++; - conf_int_set(p,strtoul(argv[i],NULL,0)); - break; - case conf_type_str: - if (i+1>=argc) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad str conf %s without value",argv[i]); - break; - } - i++; - conf_str_set(p,argv[i]); - break; - case conf_type_hexstr: - if (i+1>=argc) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad hexstr conf %s without value",argv[i]); - break; - } - i++; - conf_hexstr_set(p,argv[i]); - break; - default: - eventlog(eventlog_level_error,__FUNCTION__,"got bad conf type %d",conf_table[i].type); - break; - } - break; - } - } - if (!match) { - eventlog(eventlog_level_error,__FUNCTION__,"bad option \"%s\"",argv[i]); - return -1; - } - } - return 0; -} - -extern int conf_load_file(char const * filename, t_conf_table * conf_table, void * param_data, int datalen) -{ - FILE * fp; - unsigned int i, line, count, match; - char * buff; - char * * item; - - ASSERT(conf_table,-1); - ASSERT(param_data,-1); - if (conf_set_default(conf_table, param_data, datalen)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error setting default values"); - return -1; - } - if (!filename) return 0; - if (!(fp=fopen(filename,"r"))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not open configuration file \"%s\" for reading (fopen: %s)",filename,strerror(errno)); - return -1; - } - for (line=1; (buff=file_get_line(fp)); line++) { - if (buff[0]=='#') { - xfree(buff); - continue; - } - if (!(item=strtoargv(buff,&count))) { - xfree(buff); - continue; - } - xfree(buff); - if (!count) { - xfree(item); - continue; - } - if (count!=3) { - eventlog(eventlog_level_error,__FUNCTION__,"bad item count %d in file %s line %d",count,filename,line); - xfree(item); - continue; - } - if (strcmp(item[1],"=")) { - eventlog(eventlog_level_error,__FUNCTION__,"missing '=' in file %s line %d",filename,line); - xfree(item); - continue; - } - match=0; - for (i=0; conf_table[i].name; i++) { - if (!strcasecmp(conf_table[i].name,item[0])) { - conf_set_value(conf_table+i, param_data, item[2]); - match=1; - } - } - if (!match) { - eventlog(eventlog_level_warn,__FUNCTION__,"got unknown field \"%s\" in line %d,(ignored)",item[0],line); - } - xfree(item); - } - fclose(fp); - return 0; -} - -extern int conf_cleanup(t_conf_table * conf_table, void * param_data, int datalen) -{ - unsigned int i; - char * p; - - ASSERT(conf_table,-1); - ASSERT(param_data,-1); - for (i=0; conf_table[i].name; i++) { - if (conf_table[i].offset + conf_type_get_size(conf_table[i].type) > datalen) { - eventlog(eventlog_level_error,__FUNCTION__,"conf table item %d bad offset %d exceed %d",i,conf_table[i].offset,datalen); - return -1; - } - - p=(char *)param_data+conf_table[i].offset; - switch (conf_table[i].type) { - CASE(conf_type_bool, conf_bool_set(p, 0)); - CASE(conf_type_int, conf_int_set(p, 0)); - CASE(conf_type_str, conf_str_set(p, NULL)); - CASE(conf_type_hexstr, conf_hexstr_set(p, NULL)); - default: - eventlog(eventlog_level_error,__FUNCTION__,"conf table item %d bad type %d",i,conf_table[i].type); - return -1; - } - } - memset(param_data,0,datalen); - return 0; -} diff --git a/d2pack109/src/d2cs/conf.h b/d2pack109/src/d2cs/conf.h deleted file mode 100644 index 639f4af..0000000 --- a/d2pack109/src/d2cs/conf.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_CONFFILE_H -#define INCLUDED_CONFFILE_H - -typedef enum -{ - conf_type_none, - conf_type_bool, - conf_type_int, - conf_type_str, - conf_type_hexstr -} e_conf_type; - -typedef struct -{ - char const * name; - int offset; - e_conf_type type; - int def_intval; - char const * def_strval; -} t_conf_table; - -extern int conf_cleanup(t_conf_table * conf_table, void * param_data, int size); -extern int conf_load_file(char const * filename, t_conf_table * conf_table, void * data, int datalen); -extern int conf_parse_param(int argc, char * * argv, t_conf_table * conf_table, void * data, int datalen); - -#endif diff --git a/d2pack109/src/d2cs/connection.c b/d2pack109/src/d2cs/connection.c deleted file mode 100644 index 02fff92..0000000 --- a/d2pack109/src/d2cs/connection.c +++ /dev/null @@ -1,839 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include "compat/memcpy.h" -#include "compat/strdup.h" -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/psock.h" -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#ifdef HAVE_LIMITS_H -# include -#endif -#include "compat/char_bit.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_ASSERT_H -# include -#endif - -#include "compat/psock.h" -#include "compat/strcasecmp.h" -#include "connection.h" -#include "game.h" -#include "gamequeue.h" -#include "prefs.h" -#include "d2gs.h" -#include "net.h" -#include "s2s.h" -#include "handle_d2gs.h" -#include "handle_d2cs.h" -#include "handle_init.h" -#include "handle_bnetd.h" -#include "d2charfile.h" -#include "common/fdwatch.h" -#include "common/addr.h" -#include "common/introtate.h" -#include "common/network.h" -#include "common/packet.h" -#include "common/hashtable.h" -#include "common/queue.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static t_hashtable * connlist_head=NULL; -static t_hashtable * conn_charname_list_head=NULL; -static t_list * connlist_dead=NULL; -static unsigned int total_connection=0; - -static int conn_handle_connecting(t_connection * c); -static t_packet * conn_create_packet(t_connection * c); -static int conn_handle_packet(t_connection * c, t_packet * packet); -static int conn_handle_read(t_connection * c); -static int conn_handle_write(t_connection * c); -static unsigned int conn_charname_hash(char const * charname); -static unsigned int conn_sessionnum_hash(unsigned int sessionnum); - -static unsigned int conn_sessionnum_hash(unsigned int sessionnum) -{ - return sessionnum; -} - -static unsigned int conn_charname_hash(char const * charname) -{ - unsigned int hash; - unsigned int i, len, pos; - unsigned int ch; - - ASSERT(charname,0); - len=strlen(charname); - for (hash=0, i=0, pos=0; isessionnum==sessionnum) { - hashtable_entry_release(curr); - return c; - } - } - return NULL; -} - -extern t_connection * d2cs_connlist_find_connection_by_charname(char const * charname) -{ - t_entry * curr; - t_connection * c; - unsigned int hash; - - hash=conn_charname_hash(charname); - HASHTABLE_TRAVERSE_MATCHING(connlist_head,curr,hash) - { - if (!(c=entry_get_data(curr))) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection in list"); - } else { - if (!c->charname) continue; - if (!strcmp_charname(c->charname,charname)) { - hashtable_entry_release(curr); - return c; - } - } - } - return NULL; -} - -static t_packet * conn_create_packet(t_connection * c) -{ - t_packet * packet; - - switch (c->class) { - CASE(conn_class_init, packet=packet_create(packet_class_init)); - CASE(conn_class_d2cs, packet=packet_create(packet_class_d2cs)); - CASE(conn_class_d2gs, packet=packet_create(packet_class_d2gs)); - CASE(conn_class_bnetd, packet=packet_create(packet_class_d2cs_bnetd)); - default: - eventlog(eventlog_level_error,__FUNCTION__,"got bad connection class %d",c->class); - return NULL; - } - if (!packet) { - eventlog(eventlog_level_error,__FUNCTION__,"error create packet"); - return NULL; - } - d2cs_conn_set_in_queue(c,packet); - return packet; -} - -static int conn_handle_connecting(t_connection * c) -{ - int retval; - - if (net_check_connected(c->sock)<0) { - eventlog(eventlog_level_warn,__FUNCTION__,"can not connect to %s",addr_num_to_addr_str(c->addr, c->port)); - return -1; - } - eventlog(eventlog_level_info,__FUNCTION__,"connected to %s",addr_num_to_addr_str(c->addr, c->port)); - c->state=conn_state_init; - /* this is a kind of hack to not update fd but updating breaks kqueue - * and the clean fix would require a cache a userland copy of the kernel - * kqueue fds, considering that it also doesnt brake anything else should do - * for the moment - fdwatch_update_fd(c->sock, fdwatch_type_read); */ - switch (c->class) { - case conn_class_bnetd: - retval=handle_bnetd_init(c); - break; - default: - eventlog(eventlog_level_error,__FUNCTION__,"got bad connection class %d",c->class); - return -1; - } - return retval; -} - -static int conn_handle_packet(t_connection * c, t_packet * packet) -{ - int retval; - - switch (c->class) { - CASE (conn_class_init, retval=d2cs_handle_init_packet(c,packet)); - CASE (conn_class_d2cs, retval=d2cs_handle_d2cs_packet(c,packet)); - CASE (conn_class_d2gs, retval=handle_d2gs_packet(c,packet)); - CASE (conn_class_bnetd, retval=handle_bnetd_packet(c,packet)); - default: - eventlog(eventlog_level_error,__FUNCTION__,"got bad connection class %d (close connection)",c->class); - retval=-1; - break; - } - return retval; -} - -static int conn_handle_read(t_connection * c) -{ - t_packet * packet; - int retval; - - packet = d2cs_conn_get_in_queue(c); - if (!packet) { - packet = conn_create_packet(c); - if (!packet) return -1; - c->insize=0; - } - - switch (net_recv_packet(c->sock,packet,&c->insize)) { - case -1: - retval=-1; - break; - case 0: - retval=0; - break; - case 1: - c->insize=0; - d2cs_conn_set_in_queue(c,NULL); - retval=conn_handle_packet(c,packet); - packet_del_ref(packet); - break; - default: - retval=0; - break; - } - return retval; -} - -static int conn_handle_write(t_connection * c) -{ - t_packet * packet; - int retval; - - if (c->state==conn_state_connecting) { - return conn_handle_connecting(c); - } - - if (!(packet=conn_peek_outqueue(c))) return 0; - - switch (net_send_packet(c->sock, packet, &c->outsize)) { - case -1: - retval=-1; - break; - case 0: - retval=0; - break; - case 1: - c->outsize=0; - packet=conn_pull_outqueue(c); - packet_del_ref(packet); - retval=0; - break; - default: - retval = -1; - } - return retval; -} - -extern int conn_handle_socket(t_connection * c) -{ - time_t now; - - ASSERT(c,-1); - now=time(NULL); - if (c->socket_flag & SOCKET_FLAG_READ) { - if (conn_handle_read(c)<0) return -1; - c->last_active=now; - } - if (c->socket_flag & SOCKET_FLAG_WRITE) { - if (conn_handle_write(c)<0) return -1; - c->last_active=now; - } - c->socket_flag=0; - return 0; -} - -extern int connlist_check_timeout(void) -{ - t_connection * c; - time_t now; - - now=time(NULL); - BEGIN_HASHTABLE_TRAVERSE_DATA(connlist_head, c) - { - switch (c->class) { - case conn_class_d2cs: - if (prefs_get_idletime() && (now - c->last_active > prefs_get_idletime())) { - eventlog(eventlog_level_info,__FUNCTION__,"client %d idled too long time, destroy it",c->sessionnum); - d2cs_conn_set_state(c,conn_state_destroy); - } - break; - case conn_class_d2gs: - if (prefs_get_s2s_idletime() && now - c->last_active > prefs_get_s2s_idletime()) { - eventlog(eventlog_level_info,__FUNCTION__,"server %d timed out",c->sessionnum); - d2cs_conn_set_state(c,conn_state_destroy); - } - break; - case conn_class_bnetd: - break; - default: - break; - } - } - END_HASHTABLE_TRAVERSE_DATA() - return 0; -} - -extern t_connection * d2cs_conn_create(int sock, unsigned int local_addr, unsigned short local_port, - unsigned int addr, unsigned short port) -{ - static unsigned int sessionnum=1; - t_connection * c; - - if (sock<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad socket"); - return NULL; - } - c=xmalloc(sizeof(t_connection)); - c->charname=NULL; - c->account=NULL; - c->sock=sock; - c->fdw_idx = -1; - c->socket_flag=0; - c->local_addr=local_addr; - c->local_port=local_port; - c->addr=addr; - c->port=port; - c->class=conn_class_init; - c->state=conn_state_init; - c->sessionnum=sessionnum++; - c->outqueue=NULL; - c->inqueue=NULL; - c->outsize=0; - c->outsizep=0; - c->insize=0; - c->charinfo=NULL; - c->d2gs_id=0; - c->gamequeue=NULL; - c->last_active=time(NULL); - c->sessionnum_hash=conn_sessionnum_hash(c->sessionnum); - c->bnetd_sessionnum=0; - c->charname_hash=0; - if (hashtable_insert_data(connlist_head, c, c->sessionnum_hash)<0) { - xfree(c); - eventlog(eventlog_level_error,__FUNCTION__,"error add connection to list"); - return NULL; - } - total_connection++; - eventlog(eventlog_level_info,__FUNCTION__,"created session=%d socket=%d (%d current connections)", c->sessionnum, sock, total_connection); - return c; -} - -extern int d2cs_conn_destroy(t_connection * c, t_elem ** curr) -{ - t_elem * elem; - - ASSERT(c,-1); - if (c->state==conn_state_destroying) return 0; - if (hashtable_remove_data(connlist_head,c,c->sessionnum_hash)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error remove connection from list"); - return -1; - } - c->state=conn_state_destroying; - if (c->d2gs_id && c->class==conn_class_d2gs) { - d2gs_deactive(d2gslist_find_gs(c->d2gs_id),c); - } - if (c->class==conn_class_bnetd) { - s2s_destroy(c); - } - if (c->gamequeue) { - gq_destroy(c->gamequeue,&elem); - } - if (c->account) xfree((void *)c->account); - if (c->charinfo) xfree((void *)c->charinfo); - if (c->charname) d2cs_conn_set_charname(c,NULL); - if (c->inqueue) packet_del_ref(c->inqueue); - queue_clear(&c->outqueue); - - if (connlist_dead) list_remove_data(connlist_dead, c, curr); - fdwatch_del_fd(c->fdw_idx); - psock_shutdown(c->sock,PSOCK_SHUT_RDWR); - psock_close(c->sock); - - total_connection--; - eventlog(eventlog_level_info,__FUNCTION__,"[%d] closed connection %d (%d left)",c->sock,c->sessionnum,total_connection); - xfree(c); - return 0; -} - -extern int d2cs_conn_get_socket(t_connection const * c) -{ - ASSERT(c,-1); - return c->sock; -} - -extern t_conn_state d2cs_conn_get_state(t_connection const * c) -{ - ASSERT(c,conn_state_none); - return c->state; -} - -extern int d2cs_conn_set_state(t_connection * c, t_conn_state state) -{ - t_elem * curr; - - ASSERT(c,-1); - /* special case for destroying connections, add them to connlist_dead list */ - if (state == conn_state_destroy && c->state != conn_state_destroy) { - if (!connlist_dead) - connlist_dead = list_create(); - list_append_data(connlist_dead, c); - } else if (state != conn_state_destroy && c->state == conn_state_destroy) { - if (list_remove_data(connlist_dead, c, &curr)) { - eventlog(eventlog_level_error, __FUNCTION__, "could not remove dead connection"); - return -1; - } - } - c->state=state; - return 0; -} - -extern t_conn_class d2cs_conn_get_class(t_connection const * c) -{ - ASSERT(c,conn_class_none); - return c->class; -} - -extern int d2cs_conn_set_class(t_connection * c, t_conn_class class) -{ - ASSERT(c,-1); - c->class=class; - return 0; -} - -extern t_packet * d2cs_conn_get_in_queue(t_connection const * c) -{ - ASSERT(c,NULL); - return c->inqueue; -} - -extern void d2cs_conn_set_in_queue(t_connection * c, t_packet *packet) -{ - assert(c); - c->inqueue = packet; -} - -extern unsigned int d2cs_conn_get_out_size(t_connection const * c) -{ - ASSERT(c,0); - return c->outsize; -} - -extern t_queue * * d2cs_conn_get_out_queue(t_connection const * c) -{ - ASSERT(c,NULL); - return (t_queue * *)&c->outqueue; -} - -extern unsigned int d2cs_conn_get_in_size(t_connection const * c) -{ - ASSERT(c,0); - return c->insize; -} - -extern int conn_push_outqueue(t_connection * c, t_packet * packet) -{ - if (!c) - { - eventlog(eventlog_level_error, __FUNCTION__, "got NULL connection"); - return -1; - } - - if (!packet) - { - eventlog(eventlog_level_error, __FUNCTION__, "got NULL packet"); - return -1; - } - - queue_push_packet((t_queue * *)&c->outqueue, packet); - if (!c->outsizep++) fdwatch_update_fd(c->fdw_idx, fdwatch_type_read | fdwatch_type_write); - - return 0; -} - -extern t_packet * conn_peek_outqueue(t_connection * c) -{ - if (!c) - { - eventlog(eventlog_level_error, __FUNCTION__, "got NULL connection"); - return NULL; - } - - return queue_peek_packet((t_queue const * const *)&c->outqueue); -} - -extern t_packet * conn_pull_outqueue(t_connection * c) -{ - if (!c) - { - eventlog(eventlog_level_error, __FUNCTION__, "got NULL connection"); - return NULL; - } - - if (c->outsizep) { - if (!(--c->outsizep)) fdwatch_update_fd(c->fdw_idx, fdwatch_type_read); - return queue_pull_packet((t_queue * *)&c->outqueue); - } - - return NULL; -} - -extern int conn_add_socket_flag(t_connection * c, unsigned int flag) -{ - ASSERT(c,-1); - c->socket_flag |= flag; - return 0; -} - -extern int conn_process_packet(t_connection * c, t_packet * packet, t_packet_handle_table * table, - unsigned int table_size) -{ - unsigned int type; - unsigned int size; - - ASSERT(c,-1); - ASSERT(packet,-1); - ASSERT(table,-1); - type=packet_get_type(packet); - size=packet_get_size(packet); - - if (type >= table_size || !table[type].size) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad packet type %d (class %d)",type,packet_get_class(packet)); - return -1; - } - if (size < table[type].size) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad packet size %d (type %d class %d)",size,type,packet_get_class(packet)); - return -1; - } - if (!(c->state & table[type].state)) { - eventlog(eventlog_level_error,__FUNCTION__,"connection %d state mismatch for packet type %d (class %d)",c->sessionnum, - type,packet_get_class(packet)); - return -1; - } - if (!table[type].handler) { - eventlog(eventlog_level_error,__FUNCTION__,"missing handler for packet type %d (class %d)",type,packet_get_class(packet)); - return -1; - } - return table[type].handler(c,packet); -} - -extern int d2cs_conn_set_account(t_connection * c, char const * account) -{ - ASSERT(c,-1); - if (!account) { - if (c->account) xfree((void *)c->account); - c->account=NULL; - } - if (c->account) xfree((void *)c->account); - c->account=xstrdup(account); - - return 0; -} - -extern char const * d2cs_conn_get_account(t_connection const * c) -{ - ASSERT(c,NULL); - return c->account; -} - -extern int d2cs_conn_set_charname(t_connection * c, char const * charname) -{ - char const * temp; - - ASSERT(c,-1); - temp=NULL; - if (charname) temp=xstrdup(charname); - if (c->charname) { - if (hashtable_remove_data(conn_charname_list_head,c,c->charname_hash) <0) { - eventlog(eventlog_level_error,__FUNCTION__,"error remove charname %s from list",charname); - if (temp) xfree((void *)temp); - return -1; - } - hashtable_purge(conn_charname_list_head); - xfree((void *)c->charname); - } - if (charname) { - c->charname=temp; - c->charname_hash=conn_charname_hash(charname); - if (hashtable_insert_data(conn_charname_list_head,c,c->charname_hash) <0) { - eventlog(eventlog_level_error,__FUNCTION__,"error insert charname %s to list",charname); - xfree((void *)c->charname); - c->charname=NULL; - return -1; - } - } else { - c->charname=NULL; - c->charname_hash=0; - } - return 0; -} - -extern char const * d2cs_conn_get_charname(t_connection const * c) -{ - ASSERT(c,NULL); - return c->charname; -} - -extern unsigned int d2cs_conn_get_sessionnum(t_connection const * c) -{ - ASSERT(c,0); - return c->sessionnum; -} - -extern unsigned int conn_get_charinfo_expansion(t_connection const * c) -{ - ASSERT(c,0); - return d2charinfo_get_expansion(c->charinfo); -} - -extern unsigned int conn_get_charinfo_hardcore(t_connection const * c) -{ - ASSERT(c,0); - return d2charinfo_get_hardcore(c->charinfo); -} - -extern unsigned int conn_get_charinfo_dead(t_connection const * c) -{ - ASSERT(c,0); - return d2charinfo_get_dead(c->charinfo); -} - -extern unsigned int conn_get_charinfo_difficulty(t_connection const * c) -{ - ASSERT(c,0); - return d2charinfo_get_difficulty(c->charinfo); -} - -extern unsigned int conn_get_charinfo_level(t_connection const * c) -{ - ASSERT(c,0); - return d2charinfo_get_level(c->charinfo); -} - -extern unsigned int conn_get_charinfo_class(t_connection const * c) -{ - ASSERT(c,0); - return d2charinfo_get_class(c->charinfo); -} - -extern int conn_set_charinfo(t_connection * c, t_d2charinfo_summary const * charinfo) -{ - ASSERT(c,-1); - if (!charinfo) { - if (c->charinfo) xfree((void *)c->charinfo); - c->charinfo=NULL; - return 0; - } - if (c->charinfo) xfree((void *)c->charinfo); - c->charinfo=xmalloc(sizeof(t_d2charinfo_summary)); - memcpy((void*)c->charinfo,charinfo,sizeof(t_d2charinfo_summary)); - return 0; -} - -extern int conn_set_d2gs_id(t_connection * c, unsigned int d2gs_id) -{ - ASSERT(c,-1) - c->d2gs_id=d2gs_id; - return 0; -} - -extern unsigned int conn_get_d2gs_id(t_connection const * c) -{ - ASSERT(c,0) - return c->d2gs_id; -} - -extern unsigned int d2cs_conn_get_addr(t_connection const * c) -{ - ASSERT(c,0); - return c->addr; -} - -extern unsigned short d2cs_conn_get_port(t_connection const * c) -{ - ASSERT(c,0); - return c->port; -} - -extern t_gq * conn_get_gamequeue(t_connection const * c) -{ - ASSERT(c,NULL); - return c->gamequeue; -} - -extern int conn_set_gamequeue(t_connection * c, t_gq * gq) -{ - ASSERT(c,-1); - c->gamequeue=gq; - return 0; -} - -extern int conn_set_bnetd_sessionnum(t_connection * c, unsigned int sessionnum) -{ - ASSERT(c,-1); - c->bnetd_sessionnum=sessionnum; - return 0; -} - -extern unsigned int conn_get_bnetd_sessionnum(t_connection const * c) -{ - ASSERT(c,-1); - return c->bnetd_sessionnum; -} - -extern int conn_add_fd(t_connection * c, t_fdwatch_type rw, fdwatch_handler handler) -{ - assert(c); - c->fdw_idx = fdwatch_add_fd(c->sock,rw,handler,c); - return c->fdw_idx; -} diff --git a/d2pack109/src/d2cs/connection.h b/d2pack109/src/d2cs/connection.h deleted file mode 100644 index a322211..0000000 --- a/d2pack109/src/d2cs/connection.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_CONNECTION_H -#define INCLUDED_CONNECTION_H - -#include "common/queue.h" -#include "common/hashtable.h" -#include "common/packet.h" -#include "common/fdwatch.h" -#include "d2charfile.h" -#include "gamequeue.h" - -typedef enum -{ - conn_state_none = 0x00, - conn_state_init = 0x01, - conn_state_connecting = 0x02, - conn_state_connected = 0x04, - conn_state_authed = 0x08, - conn_state_char_authed = 0x10, - conn_state_destroy = 0x20, - conn_state_destroying = 0x40, - conn_state_any = 0xff -} t_conn_state; - -typedef enum -{ - conn_class_none, - conn_class_init, - conn_class_d2cs, - conn_class_d2gs, - conn_class_bnetd -} t_conn_class; - -typedef struct -{ - char const * charname; - char const * account; - int sock; - int fdw_idx; - unsigned int socket_flag; - unsigned int addr; - unsigned int local_addr; - unsigned short port; - unsigned short local_port; - unsigned int last_active; - t_conn_class class; - t_conn_state state; - unsigned int sessionnum; - t_queue * outqueue; - unsigned int outsize; - unsigned int outsizep; - t_packet * inqueue; - unsigned int insize; - t_d2charinfo_summary const * charinfo; - unsigned int d2gs_id; - t_gq * gamequeue; - unsigned int bnetd_sessionnum; - unsigned int sessionnum_hash; - unsigned int charname_hash; -} t_connection; - -typedef int ( * packet_handle_func) (t_connection * c, t_packet * packet); -typedef struct -{ - unsigned int size; - t_conn_state state; - packet_handle_func handler; -} t_packet_handle_table; - -#define SOCKET_FLAG_READ 0x1 -#define SOCKET_FLAG_WRITE 0x2 - -extern t_hashtable * d2cs_connlist(void); -extern int d2cs_connlist_destroy(void); -extern int d2cs_connlist_reap(void); -extern int d2cs_connlist_create(void); -extern int conn_check_multilogin(t_connection const * c,char const * charname); -extern t_connection * d2cs_connlist_find_connection_by_sessionnum(unsigned int sessionnum); -extern t_connection * d2cs_connlist_find_connection_by_charname(char const * charname); -extern int conn_handle_socket(t_connection * c); -extern t_connection * d2cs_conn_create(int sock, unsigned int local_addr, unsigned short local_port, - unsigned int addr, unsigned short port); -extern int d2cs_conn_destroy(t_connection * c, t_elem ** elem); -extern int d2cs_conn_get_socket(t_connection const * c); -extern unsigned int d2cs_conn_get_sessionnum(t_connection const * c); -extern t_conn_class d2cs_conn_get_class(t_connection const * c); -extern int d2cs_conn_set_class(t_connection * c, t_conn_class class); -extern t_conn_state d2cs_conn_get_state(t_connection const * c); -extern int d2cs_conn_set_state(t_connection * c, t_conn_state state); -extern t_queue * * d2cs_conn_get_out_queue(t_connection const * c); -extern t_packet * d2cs_conn_get_in_queue(t_connection const * c); -extern void d2cs_conn_set_in_queue(t_connection * c, t_packet * packet); -extern unsigned int d2cs_conn_get_in_size(t_connection const * c); -extern unsigned int d2cs_conn_get_out_size(t_connection const * c); -extern int conn_push_outqueue(t_connection * c, t_packet * packet); -extern t_packet * conn_peek_outqueue(t_connection * c); -extern t_packet * conn_pull_outqueue(t_connection * c); -extern int conn_add_socket_flag(t_connection * c, unsigned int flag); -extern int conn_process_packet(t_connection * c, t_packet * packet, t_packet_handle_table * table, - unsigned int table_size); -extern int d2cs_conn_set_account(t_connection * c, char const * account); -extern int d2cs_conn_set_charname(t_connection * c, char const * charname); -extern char const * d2cs_conn_get_account(t_connection const * c); -extern char const * d2cs_conn_get_charname(t_connection const * c); -extern int conn_set_charinfo(t_connection * c, t_d2charinfo_summary const * charinfo); -extern unsigned int conn_get_charinfo_expansion(t_connection const * c); -extern unsigned int conn_get_charinfo_hardcore(t_connection const * c); -extern unsigned int conn_get_charinfo_dead(t_connection const * c); -extern unsigned int conn_get_charinfo_difficulty(t_connection const * c); -extern unsigned int conn_get_charinfo_level(t_connection const * c); -extern unsigned int conn_get_charinfo_class(t_connection const * c); -extern unsigned int conn_get_d2gs_id(t_connection const * c); -extern int conn_set_d2gs_id(t_connection * c, unsigned int d2gs_id); -extern unsigned int d2cs_conn_get_addr(t_connection const * c); -extern unsigned short d2cs_conn_get_port(t_connection const * c); -extern t_gq * conn_get_gamequeue(t_connection const * c); -extern int conn_set_gamequeue(t_connection * c, t_gq * gq); -extern int conn_set_bnetd_sessionnum(t_connection * c, unsigned int sessionnum); -extern unsigned int conn_get_bnetd_sessionnum(t_connection const * c); -extern int conn_add_fd(t_connection * c, t_fdwatch_type rw, fdwatch_handler handler); -extern int connlist_check_timeout(void); - -#endif diff --git a/d2pack109/src/d2cs/d2charfile.c b/d2pack109/src/d2cs/d2charfile.c deleted file mode 100644 index 9847804..0000000 --- a/d2pack109/src/d2cs/d2charfile.c +++ /dev/null @@ -1,763 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include "compat/memset.h" -#include "compat/memcpy.h" -#include -#include "compat/strerror.h" -#ifdef HAVE_UNISTD_H -# include -#endif -#include "compat/access.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif - -#include "d2charfile.h" -#include "prefs.h" -#include "xstring.h" -#include "common/bn_type.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static int d2charsave_init(void * buffer,char const * charname,unsigned char class,unsigned short status); -static int d2charinfo_init(t_d2charinfo_file * chardata, char const * account, char const * charname, - unsigned char class, unsigned short status); -static int d2charsave_checksum(unsigned char const * data, unsigned int len, unsigned int offset); - - -static int d2charsave_init(void * buffer,char const * charname,unsigned char class,unsigned short status) -{ - ASSERT(buffer,-1); - ASSERT(charname,-1); - bn_byte_set((bn_byte *)((char *)buffer+D2CHARSAVE_CLASS_OFFSET), class); - bn_short_set((bn_short *)((char *)buffer+D2CHARSAVE_STATUS_OFFSET),status); - strncpy((char *)buffer+D2CHARSAVE_CHARNAME_OFFSET,charname,MAX_CHARNAME_LEN); - return 0; -} - - -static int d2charinfo_init(t_d2charinfo_file * chardata, char const * account, char const * charname, - unsigned char class, unsigned short status) -{ - unsigned int i; - time_t now; - - now=time(NULL); - bn_int_set(&chardata->header.magicword,D2CHARINFO_MAGICWORD); - bn_int_set(&chardata->header.version,D2CHARINFO_VERSION); - bn_int_set(&chardata->header.create_time,now); - bn_int_set(&chardata->header.last_time,now); - - memset(chardata->header.charname,0,MAX_CHARNAME_LEN); - strncpy(chardata->header.charname,charname,MAX_CHARNAME_LEN); - memset(chardata->header.account, 0,MAX_ACCTNAME_LEN); - strncpy(chardata->header.account,account,MAX_ACCTNAME_LEN); - memset(chardata->header.realmname, 0,MAX_REALMNAME_LEN); - strncpy(chardata->header.realmname,prefs_get_realmname(),MAX_REALMNAME_LEN); - bn_int_set(&chardata->header.checksum,0); - for (i=0; iheader.reserved); i++) { - bn_int_set(&chardata->header.reserved[i],0); - } - bn_int_set(&chardata->summary.charlevel,1); - bn_int_set(&chardata->summary.experience,0); - bn_int_set(&chardata->summary.charclass,class); - bn_int_set(&chardata->summary.charstatus,status); - - memset(chardata->portrait.gfx,D2CHARINFO_PORTRAIT_PADBYTE,sizeof(chardata->portrait.gfx)); - memset(chardata->portrait.color,D2CHARINFO_PORTRAIT_PADBYTE,sizeof(chardata->portrait.color)); - memset(chardata->portrait.u2,D2CHARINFO_PORTRAIT_PADBYTE,sizeof(chardata->portrait.u2)); - memset(chardata->portrait.u1,D2CHARINFO_PORTRAIT_MASK,sizeof(chardata->portrait.u1)); - memset(chardata->pad,0,sizeof(chardata->pad)); - - bn_short_set(&chardata->portrait.header,D2CHARINFO_PORTRAIT_HEADER); - bn_byte_set(&chardata->portrait.status,status|D2CHARINFO_PORTRAIT_MASK); - bn_byte_set(&chardata->portrait.class,class+1); - bn_byte_set(&chardata->portrait.level,1); - bn_byte_set(&chardata->portrait.end,'\0'); - memset(chardata->pad,0,sizeof(chardata->pad)); - return 0; -} - - -extern int d2char_create(char const * account, char const * charname, unsigned char class, unsigned short status) -{ - t_d2charinfo_file chardata; - char * savefile, * infofile; - char buffer[1024]; - unsigned int size; - FILE * fp; - - - ASSERT(account,-1); - ASSERT(charname,-1); - if (class>D2CHAR_MAX_CLASS) class=0; - status &= 0xFF; - charstatus_set_init(status,1); - -/* We need to make sure we are creating the correct character (Classic or Expansion) - for the type of game server we are running. If lod_realm = 1 then only Expansion - characters can be created and if set to 0 then only Classic character can - be created */ - - if (!(prefs_get_lod_realm() == 2)) { - if (prefs_get_lod_realm() && ((status & 0x20) != 0x20)) { - eventlog(eventlog_level_warn,__FUNCTION__,"This Realm is for LOD Characters Only"); - return -1; - } - if (!prefs_get_lod_realm() && ((status & 0x20) != 0x00)) { - eventlog(eventlog_level_warn,__FUNCTION__,"This Realm is for Classic Characters Only"); - return -1; - } - } - -/* Once correct type of character is varified then continue with creation of character */ - - if (!prefs_allow_newchar()) { - eventlog(eventlog_level_warn,__FUNCTION__,"creation of new character is disabled"); - return -1; - } - if (d2char_check_charname(charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad character name \"%s\"",charname); - return -1; - } - if (d2char_check_acctname(account)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad account name \"%s\"",account); - return -1; - } - size=sizeof(buffer); - if (file_read(prefs_get_charsave_newbie(), buffer, &size)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error loading newbie save file"); - return -1; - } - if (size>=sizeof(buffer)) { - eventlog(eventlog_level_error,__FUNCTION__,"newbie save file \"%s\" is corrupt (length %lu, expected <%lu)",prefs_get_charsave_newbie(),(unsigned long)size,(unsigned long)sizeof(buffer)); - return -1; - } - - savefile=xmalloc(strlen(prefs_get_charsave_dir())+1+strlen(charname)+1); - d2char_get_savefile_name(savefile,charname); - if ((fp=fopen(savefile,"rb"))) { - eventlog(eventlog_level_warn,__FUNCTION__,"character save file \"%s\" for \"%s\" already exist",savefile,charname); - fclose(fp); - xfree(savefile); - return -1; - } - - infofile=xmalloc(strlen(prefs_get_charinfo_dir())+1+strlen(account)+1+strlen(charname)+1); - d2char_get_infofile_name(infofile,account,charname); - - d2charsave_init(buffer,charname,class,status); - d2charinfo_init(&chardata,account,charname,class,status); - - if (file_write(infofile,&chardata,sizeof(chardata))<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error writing info file \"%s\"",infofile); - remove(infofile); - xfree(infofile); - xfree(savefile); - return -1; - } - - if (file_write(savefile,buffer,size)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error writing save file \"%s\"",savefile); - remove(infofile); - remove(savefile); - xfree(savefile); - xfree(infofile); - return -1; - } - xfree(savefile); - xfree(infofile); - eventlog(eventlog_level_info,__FUNCTION__,"character %s(*%s) class %d status 0x%X created",charname,account,class,status); - return 0; -} - - -extern int d2char_find(char const * account, char const * charname) -{ - char * file; - FILE * fp; - - ASSERT(account,-1); - ASSERT(charname,-1); - file=xmalloc(strlen(prefs_get_charinfo_dir())+1+strlen(account)+1+strlen(charname)+1); - d2char_get_infofile_name(file,account,charname); - fp=fopen(file,"rb"); - xfree(file); - if (fp) { - fclose(fp); - return 0; - } - return -1; -} - - -extern int d2char_convert(char const * account, char const * charname) -{ - FILE * fp; - char * file; - unsigned char buffer[MAX_SAVEFILE_SIZE]; - unsigned int status_offset; - unsigned char status; - unsigned int charstatus; - t_d2charinfo_file charinfo; - unsigned int size; - unsigned int version; - unsigned int checksum; - - ASSERT(account,-1); - ASSERT(charname,-1); - -/* Playing with a expanstion char on a classic realm - will cause the game server to crash, therefore - I recommed setting allow_convert = 0 in the d2cs.conf - We need to do this to prevent creating classic char - and converting to expantion on a classic realm. - LOD Char must be created on LOD realm */ - - if (!prefs_get_allow_convert()) { - eventlog(eventlog_level_info,__FUNCTION__,"Convert char has been disabled"); - return -1; - } - -/* Procedure is stopped here and returned if - allow_convet = 0 in d2cs.conf */ - - if (d2char_check_charname(charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad character name \"%s\"",charname); - return -1; - } - if (d2char_check_acctname(account)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad account name \"%s\"",account); - return -1; - } - file=xmalloc(strlen(prefs_get_charinfo_dir())+1+strlen(account)+1+strlen(charname)+1); - d2char_get_infofile_name(file,account,charname); - if (!(fp=fopen(file,"rb+"))) { - eventlog(eventlog_level_error,__FUNCTION__,"unable to open charinfo file \"%s\" for reading and writing (fopen: %s)",file,strerror(errno)); - xfree(file); - return -1; - } - xfree(file); - if (fread(&charinfo,1,sizeof(charinfo),fp)!=sizeof(charinfo)) { - eventlog(eventlog_level_error,__FUNCTION__,"error reading charinfo file for character \"%s\" (fread: %s)",charname,strerror(errno)); - fclose(fp); - return -1; - } - charstatus=bn_int_get(charinfo.summary.charstatus); - charstatus_set_expansion(charstatus,1); - bn_int_set(&charinfo.summary.charstatus,charstatus); - - status=bn_byte_get(charinfo.portrait.status); - charstatus_set_expansion(status,1); - bn_byte_set(&charinfo.portrait.status,status); - - fseek(fp,0,SEEK_SET); /* FIXME: check return */ - if (fwrite(&charinfo,1,sizeof(charinfo),fp)!=sizeof(charinfo)) { - eventlog(eventlog_level_error,__FUNCTION__,"error writing charinfo file for character \"%s\" (fwrite: %s)",charname,strerror(errno)); - fclose(fp); - return -1; - } - if (fclose(fp)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"could not close charinfo file for character \"%s\" after writing (fclose: %s)",charname,strerror(errno)); - return -1; - } - - file=xmalloc(strlen(prefs_get_charsave_dir())+1+strlen(charname)+1); - d2char_get_savefile_name(file,charname); - if (!(fp=fopen(file,"rb+"))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not open charsave file \"%s\" for reading and writing (fopen: %s)",file,strerror(errno)); - xfree(file); - return -1; - } - xfree(file); - size=fread(buffer,1,sizeof(buffer),fp); - if (!feof(fp)) { - eventlog(eventlog_level_error,__FUNCTION__,"error reading charsave file for character \"%s\" (fread: %s)",charname,strerror(errno)); - fclose(fp); - return -1; - } - version=bn_int_get(buffer+D2CHARSAVE_VERSION_OFFSET); - if (version>=0x0000005C) { - status_offset=D2CHARSAVE_STATUS_OFFSET_109; - } else { - status_offset=D2CHARSAVE_STATUS_OFFSET; - } - status=bn_byte_get(buffer+status_offset); - charstatus_set_expansion(status,1); - bn_byte_set((bn_byte *)(buffer+status_offset),status); /* FIXME: shouldn't abuse bn_*_set()... what's the best way to do this? */ - if (version>=0x0000005C) { - checksum=d2charsave_checksum(buffer,size,D2CHARSAVE_CHECKSUM_OFFSET); - bn_int_set((bn_int *)(buffer+D2CHARSAVE_CHECKSUM_OFFSET),checksum); /* FIXME: shouldn't abuse bn_*_set()... what's the best way to do this? */ - } - fseek(fp,0,SEEK_SET); /* FIXME: check return */ - if (fwrite(buffer,1,size,fp)!=size) { - eventlog(eventlog_level_error,__FUNCTION__,"error writing charsave file for character %s (fwrite: %s)",charname,strerror(errno)); - fclose(fp); - return -1; - } - if (fclose(fp)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"could not close charsave file for character \"%s\" after writing (fclose: %s)",charname,strerror(errno)); - return -1; - } - eventlog(eventlog_level_info,__FUNCTION__,"character %s(*%s) converted to expansion",charname,account); - return 0; -} - - -extern int d2char_delete(char const * account, char const * charname) -{ - char * file; - - ASSERT(account,-1); - ASSERT(charname,-1); - if (d2char_check_charname(charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad character name \"%s\"",charname); - return -1; - } - if (d2char_check_acctname(account)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad account name \"%s\"",account); - return -1; - } - - /* charsave file */ - file=xmalloc(strlen(prefs_get_charinfo_dir())+1+strlen(account)+1+strlen(charname)+1); - d2char_get_infofile_name(file,account,charname); - if (remove(file)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to delete charinfo file \"%s\" (remove: %s)",file,strerror(errno)); - xfree(file); - return -1; - } - xfree(file); - - /* charinfo file */ - file=xmalloc(strlen(prefs_get_charsave_dir())+1+strlen(charname)+1); - d2char_get_savefile_name(file,charname); - if (remove(file)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to delete charsave file \"%s\" (remove: %s)",file,strerror(errno)); - } - xfree(file); - - /* bak charsave file */ - file=xmalloc(strlen(prefs_get_bak_charinfo_dir())+1+strlen(account)+1+strlen(charname)+1); - d2char_get_bak_infofile_name(file,account,charname); - if (access(file, F_OK) == 0) { - if (remove(file)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to delete bak charinfo file \"%s\" (remove: %s)",file,strerror(errno)); - } - } - xfree(file); - - /* bak charinfo file */ - file=xmalloc(strlen(prefs_get_bak_charsave_dir())+1+strlen(charname)+1); - d2char_get_bak_savefile_name(file,charname); - if (access(file, F_OK) == 0) { - if (remove(file)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to delete bak charsave file \"%s\" (remove: %s)",file,strerror(errno)); - } - } - xfree(file); - - eventlog(eventlog_level_info,__FUNCTION__,"character %s(*%s) deleted",charname,account); - return 0; -} - - -extern int d2char_get_summary(char const * account, char const * charname,t_d2charinfo_summary * charinfo) -{ - t_d2charinfo_file data; - - ASSERT(account,-1); - ASSERT(charname,-1); - ASSERT(charinfo,-1); - if (d2charinfo_load(account, charname, &data)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error loading character %s(*%s)",charname,account); - return -1; - } - memcpy(charinfo,&data.summary,sizeof(data.summary)); - eventlog(eventlog_level_info,__FUNCTION__,"character %s difficulty %d expansion %d hardcore %d dead %d loaded",charname, - d2charinfo_get_difficulty(charinfo), d2charinfo_get_expansion(charinfo), - d2charinfo_get_hardcore(charinfo),d2charinfo_get_dead(charinfo)); - return 0; -} - - -extern int d2charinfo_load(char const * account, char const * charname, t_d2charinfo_file * data) -{ - char * file; - unsigned int size; - - if (d2char_check_charname(charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad character name \"%s\"",charname); - return -1; - } - if (d2char_check_acctname(account)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad account name \"%s\"",account); - return -1; - } - file=xmalloc(strlen(prefs_get_charinfo_dir())+1+strlen(account)+1+strlen(charname)+1); - d2char_get_infofile_name(file,account,charname); - size=sizeof(t_d2charinfo_file); - if (file_read(file,data,&size)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error loading character file %s",file); - xfree(file); - return -1; - } - xfree(file); - if (size!=sizeof(t_d2charinfo_file)) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad charinfo file %s (length %d)",charname,size); - return -1; - } - d2char_portrait_init(&data->portrait); - return d2charinfo_check(data); -} - - -extern int d2charinfo_check(t_d2charinfo_file * data) -{ - ASSERT(data,-1); - if (bn_int_get(data->header.magicword) != D2CHARINFO_MAGICWORD) { - eventlog(eventlog_level_error,__FUNCTION__,"info data check failed (header 0x%08X)",bn_int_get(data->header.magicword)); - return -1; - } - if (bn_int_get(data->header.version) != D2CHARINFO_VERSION) { - eventlog(eventlog_level_error,__FUNCTION__,"info data check failed (version 0x%08X)",bn_int_get(data->header.version)); - return -1; - } - return 0; -} - - -extern int d2char_portrait_init(t_d2charinfo_portrait * portrait) -{ - unsigned int i; - unsigned char * p; - - p=(unsigned char *)portrait; - for (i=0; i= MIN_NAME_LEN || i<= MAX_CHARNAME_LEN) return 0; - return -1; -} - - -extern int d2char_check_acctname(char const * name) -{ - unsigned int i; - unsigned char ch; - - if (!name) return -1; - if (!isalnum((int)name[0])) return -1; - - for (i=1; i<=MAX_CHARNAME_LEN; i++) { - ch=name[i]; - if (ch=='\0') break; - if (isalnum(ch)) continue; - if (strchr(prefs_get_d2cs_account_allowed_symbols(),ch)) continue; - return -1; - } - if (i >= MIN_NAME_LEN || i<= MAX_ACCTNAME_LEN) return 0; - return -1; -} - - -extern int d2char_get_savefile_name(char * filename, char const * charname) -{ - char tmpchar[MAX_CHARNAME_LEN]; - - ASSERT(filename,-1); - ASSERT(charname,-1); - strncpy(tmpchar,charname,sizeof(tmpchar)); - tmpchar[sizeof(tmpchar)-1]='\0'; - strtolower(tmpchar); - sprintf(filename,"%s/%s",prefs_get_charsave_dir(),tmpchar); - return 0; -} - - -extern int d2char_get_bak_savefile_name(char * filename, char const * charname) -{ - char tmpchar[MAX_CHARNAME_LEN]; - - ASSERT(filename,-1); - ASSERT(charname,-1); - strncpy(tmpchar,charname,sizeof(tmpchar)); - tmpchar[sizeof(tmpchar)-1]='\0'; - strtolower(tmpchar); - sprintf(filename,"%s/%s",prefs_get_bak_charsave_dir(),tmpchar); - return 0; -} - - -extern int d2char_get_infodir_name(char * filename, char const * account) -{ - char tmpacct[MAX_ACCTNAME_LEN]; - - ASSERT(filename,-1); - ASSERT(account,-1); - - strncpy(tmpacct,account,sizeof(tmpacct)); - tmpacct[sizeof(tmpacct)-1]='\0'; - strtolower(tmpacct); - sprintf(filename,"%s/%s",prefs_get_charinfo_dir(),tmpacct); - return 0; -} - - -extern int d2char_get_infofile_name(char * filename, char const * account, char const * charname) -{ - char tmpchar[MAX_CHARNAME_LEN]; - char tmpacct[MAX_ACCTNAME_LEN]; - - ASSERT(filename,-1); - ASSERT(account,-1); - ASSERT(charname,-1); - strncpy(tmpchar,charname,sizeof(tmpchar)); - tmpchar[sizeof(tmpchar)-1]='\0'; - strtolower(tmpchar); - - strncpy(tmpacct,account,sizeof(tmpacct)); - tmpchar[sizeof(tmpacct)-1]='\0'; - strtolower(tmpacct); - sprintf(filename,"%s/%s/%s",prefs_get_charinfo_dir(),tmpacct,tmpchar); - return 0; -} - - -extern int d2char_get_bak_infofile_name(char * filename, char const * account, char const * charname) -{ - char tmpchar[MAX_CHARNAME_LEN]; - char tmpacct[MAX_ACCTNAME_LEN]; - - ASSERT(filename,-1); - ASSERT(account,-1); - ASSERT(charname,-1); - strncpy(tmpchar,charname,sizeof(tmpchar)); - tmpchar[sizeof(tmpchar)-1]='\0'; - strtolower(tmpchar); - - strncpy(tmpacct,account,sizeof(tmpacct)); - tmpchar[sizeof(tmpacct)-1]='\0'; - strtolower(tmpacct); - sprintf(filename,"%s/%s/%s",prefs_get_bak_charinfo_dir(),tmpacct,tmpchar); - return 0; -} - - - -extern unsigned int d2charinfo_get_expansion(t_d2charinfo_summary const * charinfo) -{ - ASSERT(charinfo,0); - return charstatus_get_expansion(bn_int_get(charinfo->charstatus)); -} - - -extern unsigned int d2charinfo_get_level(t_d2charinfo_summary const * charinfo) -{ - ASSERT(charinfo,0); - return bn_int_get(charinfo->charlevel); -} - - -extern unsigned int d2charinfo_get_class(t_d2charinfo_summary const * charinfo) -{ - ASSERT(charinfo,0); - return bn_int_get(charinfo->charclass); -} - - -extern unsigned int d2charinfo_get_hardcore(t_d2charinfo_summary const * charinfo) -{ - ASSERT(charinfo,0); - return charstatus_get_hardcore(bn_int_get(charinfo->charstatus)); -} - - -extern unsigned int d2charinfo_get_dead(t_d2charinfo_summary const * charinfo) -{ - ASSERT(charinfo,0); - return charstatus_get_dead(bn_int_get(charinfo->charstatus)); -} - - -extern unsigned int d2charinfo_get_difficulty(t_d2charinfo_summary const * charinfo) -{ - unsigned int difficulty; - - ASSERT(charinfo,0); - if (d2charinfo_get_expansion(charinfo)) { - difficulty=charstatus_get_difficulty_expansion(bn_int_get(charinfo->charstatus)); - } else { - difficulty=charstatus_get_difficulty(bn_int_get(charinfo->charstatus)); - } - if (difficulty>2) difficulty=2; - return difficulty; -} - - -static int d2charsave_checksum(unsigned char const * data, unsigned int len,unsigned int offset) -{ - int checksum; - unsigned int i; - unsigned int ch; - - if (!data) return 0; - checksum=0; - for (i=0; i=offset && i> 0x08) & 0x0f )/4) -#define charstatus_get_difficulty_expansion(status) ((( status >> 0x08) & 0x0f )/5) - -#ifndef JUST_NEED_TYPES -#include "d2cs_d2gs_character.h" - -extern int d2char_create(char const * account, char const * charname, unsigned char class, - unsigned short status); -extern int d2char_delete(char const * account, char const * charname); -extern int d2char_get_summary(char const * account, char const * charname,t_d2charinfo_summary * charinfo); -extern int d2char_get_portrait(char const * account, char const * filename, t_d2charinfo_portrait * portrait); -extern int d2char_portrait_init(t_d2charinfo_portrait * portrait); -extern int d2charinfo_load(char const * account, char const * charname, t_d2charinfo_file * data); -extern int d2charinfo_check(t_d2charinfo_file * data); -extern unsigned int d2charinfo_get_expansion(t_d2charinfo_summary const * charinfo); -extern unsigned int d2charinfo_get_level(t_d2charinfo_summary const * charinfo); -extern unsigned int d2charinfo_get_class(t_d2charinfo_summary const * charinfo); -extern unsigned int d2charinfo_get_hardcore(t_d2charinfo_summary const * charinfo); -extern unsigned int d2charinfo_get_dead(t_d2charinfo_summary const * charinfo); -extern unsigned int d2charinfo_get_difficulty(t_d2charinfo_summary const * charinfo); -extern int d2char_convert(char const * account, char const * charname); -extern int d2char_find(char const * account, char const * charname); -extern int d2char_get_savefile_name(char * filename,char const * charname); -extern int d2char_get_infofile_name(char * filename,char const * account, char const * charname); -extern int d2char_get_bak_savefile_name(char * filename,char const * charname); -extern int d2char_get_bak_infofile_name(char * filename,char const * account, char const * charname); -extern int d2char_get_infodir_name(char * filename,char const * account); -extern int d2char_check_acctname(char const * name); -extern int d2char_check_charname(char const * name); - -extern int file_write(char const * filename, void * data, unsigned int size); -extern int file_read(char const * filename, void * data, unsigned int * size); -#endif - - -#endif diff --git a/d2pack109/src/d2cs/d2charlist.c b/d2pack109/src/d2cs/d2charlist.c deleted file mode 100644 index efba8cd..0000000 --- a/d2pack109/src/d2cs/d2charlist.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2004 ls_sons (ls@gamelife.org) - * Copyright (C) 2004 Olaf Freyer (aaron@cs.tu-berlin.de) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif - -#include "connection.h" -#include "prefs.h" -#include "common/eventlog.h" -#include "compat/strcasecmp.h" -#include "compat/strncasecmp.h" -#include "compat/strdup.h" -#include "common/xalloc.h" -#include "common/elist.h" -#include "d2charlist.h" -#include "common/setup_after.h" - -extern int d2charlist_add_char(t_elist * list_head, t_d2charinfo_file * charinfo, unsigned int expiration_time) -{ - t_d2charlist * charlist, * ccharlist; - char const * d2char_sort; - t_elist * curr; - - d2char_sort = prefs_get_charlist_sort(); - charlist = xmalloc(sizeof(t_d2charlist)); - charlist->charinfo = charinfo; - charlist->expiration_time = expiration_time; - - if (elist_empty(list_head)) - elist_add(list_head,&charlist->list); - else - { - if (strcasecmp(d2char_sort, "name")==0) - { - elist_for_each(curr,list_head) - { - ccharlist = elist_entry(curr,t_d2charlist,list); - if (strncasecmp(charinfo->header.charname,ccharlist->charinfo->header.charname,strlen(charinfo->header.charname))<0) - break; - } - elist_add_tail(curr,&charlist->list); - } - else if (strcasecmp(d2char_sort, "mtime")==0) - { - elist_for_each(curr,list_head) - { - ccharlist = elist_entry(curr,t_d2charlist,list); - if (bn_int_get(charinfo->header.last_time) < bn_int_get(ccharlist->charinfo->header.last_time)) - break; - } - elist_add_tail(curr,&charlist->list); - } - else if (strcasecmp(d2char_sort, "level")==0) - { - elist_for_each(curr,list_head) - { - ccharlist = elist_entry(curr,t_d2charlist,list); - if (bn_int_get(charinfo->summary.experience) < bn_int_get(ccharlist->charinfo->summary.experience)) - break; - } - elist_add_tail(curr,&charlist->list); - } - else - { - eventlog(eventlog_level_debug,__FUNCTION__,"unsorted"); - elist_add_tail(list_head,&charlist->list); - } - } - return 0; -} - diff --git a/d2pack109/src/d2cs/d2charlist.h b/d2pack109/src/d2cs/d2charlist.h deleted file mode 100644 index e6794fa..0000000 --- a/d2pack109/src/d2cs/d2charlist.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2004 ls_sons (ls@gamelife.org) - * Copyright (C) 2004 Olaf Freyer (aaron@cs.tu-berlin.de) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "common/elist.h" -#include "d2cs_d2gs_character.h" - -typedef struct d2charlist{ - t_d2charinfo_file *charinfo; - int expiration_time; - t_elist list; -} t_d2charlist; - -extern int d2charlist_add_char(t_elist *, t_d2charinfo_file *i, unsigned int); diff --git a/d2pack109/src/d2cs/d2cs_bnetd_protocol.h b/d2pack109/src/d2cs/d2cs_bnetd_protocol.h deleted file mode 100644 index bcbb7d7..0000000 --- a/d2pack109/src/d2cs/d2cs_bnetd_protocol.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2CS_BNETD_PROTOCOL_H -#define INCLUDED_D2CS_BNETD_PROTOCOL_H - -#include "common/bn_type.h" - -typedef struct -{ - bn_short size; - bn_short type; - bn_int seqno; /* seqno, set by the sender */ -} t_d2cs_bnetd_header; - -typedef struct -{ - t_d2cs_bnetd_header h; -} t_d2cs_bnetd_generic; - -#define BNETD_D2CS_AUTHREQ 0x01 -typedef struct -{ - t_d2cs_bnetd_header h; - bn_int sessionnum; -} t_bnetd_d2cs_authreq; - -#define D2CS_BNETD_AUTHREPLY 0x02 -typedef struct -{ - t_d2cs_bnetd_header h; - bn_int version; - /* realm name */ -} t_d2cs_bnetd_authreply; - -#define BNETD_D2CS_AUTHREPLY 0x02 -typedef struct -{ - t_d2cs_bnetd_header h; - bn_int reply; -} t_bnetd_d2cs_authreply; -#define BNETD_D2CS_AUTHREPLY_SUCCEED 0x00 -#define BNETD_D2CS_AUTHREPLY_BAD_VERSION 0x01 - -#define D2CS_BNETD_ACCOUNTLOGINREQ 0x10 -typedef struct -{ - t_d2cs_bnetd_header h; - bn_int seqno; - bn_int sessionnum; - bn_int sessionkey; - bn_int secret_hash[5]; - /* account name */ -} t_d2cs_bnetd_accountloginreq; - -#define BNETD_D2CS_ACCOUNTLOGINREPLY 0x10 -typedef struct -{ - t_d2cs_bnetd_header h; - bn_int reply; -} t_bnetd_d2cs_accountloginreply; -#define BNETD_D2CS_ACCOUNTLOGINREPLY_SUCCEED 0x00 -#define BNETD_D2CS_ACCOUNTLOGINREPLY_FAILED 0x01 - -#define D2CS_BNETD_CHARLOGINREQ 0x11 -typedef struct -{ - t_d2cs_bnetd_header h; - bn_int sessionnum; - /* character name */ - /* character portrait */ -} t_d2cs_bnetd_charloginreq; - -#define BNETD_D2CS_CHARLOGINREPLY 0x11 -typedef struct -{ - t_d2cs_bnetd_header h; - bn_int reply; -} t_bnetd_d2cs_charloginreply; -#define BNETD_D2CS_CHARLOGINREPLY_SUCCEED 0x00 -#define BNETD_D2CS_CHARLOGINREPLY_FAILED 0x01 - -#define BNETD_D2CS_GAMEINFOREQ 0x12 -typedef struct -{ - t_d2cs_bnetd_header h; - /* gamename */ -} t_bnetd_d2cs_gameinforeq; - -#define D2CS_BNETD_GAMEINFOREPLY 0x12 -typedef struct -{ - t_d2cs_bnetd_header h; - bn_byte difficulty; - /* gamename */ -} t_d2cs_bnetd_gameinforeply; - -#endif diff --git a/d2pack109/src/d2cs/d2cs_d2dbs_ladder.h b/d2pack109/src/d2cs/d2cs_d2dbs_ladder.h deleted file mode 100644 index 981d7e1..0000000 --- a/d2pack109/src/d2cs/d2cs_d2dbs_ladder.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2CS_D2DBS_LADDER_H -#define INCLUDED_D2CS_D2DBS_LADDER_H - -#include "common/bn_type.h" - -typedef struct -{ - bn_int type; - bn_int offset; - bn_int number; -} t_d2ladderfile_ladderindex; - -typedef struct -{ - bn_int experience; - bn_short status; - bn_byte level; - bn_byte class; - char charname[MAX_CHARNAME_LEN]; -} t_d2ladderfile_ladderinfo; - -typedef struct -{ - bn_int maxtype; - bn_int checksum; -} t_d2ladderfile_header; - - -#define LADDER_FILE_PREFIX "ladder" - -#define D2LADDER_HC_OVERALL 0x00 -#define D2LADDER_STD_OVERALL 0x09 -#define D2LADDER_EXP_HC_OVERALL 0x13 -#define D2LADDER_EXP_STD_OVERALL 0x1B -#define D2CHAR_CLASS_MAX 0x04 -#define D2CHAR_EXP_CLASS_MAX 0x06 - -#endif diff --git a/d2pack109/src/d2cs/d2cs_d2gs_character.h b/d2pack109/src/d2cs/d2cs_d2gs_character.h deleted file mode 100644 index 16c6a18..0000000 --- a/d2pack109/src/d2cs/d2cs_d2gs_character.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * Copyright (C) 2001 faster (lqx@cic.tsinghua.edu.cn) - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2CS_D2GS_CHARACTER_H -#define INCLUDED_D2CS_D2GS_CHARACTER_H - -#ifdef D2CS -# include "common/bn_type.h" -#endif - -#ifdef D2GS -# include "bn_types.h" -#pragma pack(push, character_h, 1) -#endif - -#define D2CHARINFO_MAGICWORD 0x12345678 -#define D2CHARINFO_VERSION 0x00010000 -#define D2CHARINFO_PORTRAIT_PADSIZE 30 - -typedef struct -{ - bn_int magicword; /* static for check */ - bn_int version; /* charinfo file version */ - bn_int create_time; /* character creation time */ - bn_int last_time; /* character last access time */ - bn_int checksum; - bn_int reserved[7]; - unsigned char charname[MAX_CHARNAME_LEN]; - unsigned char account[MAX_ACCTNAME_LEN]; - unsigned char realmname[MAX_REALMNAME_LEN]; -} t_d2charinfo_header; - -typedef struct -{ - bn_int experience; - bn_int charstatus; - bn_int charlevel; - bn_int charclass; -} t_d2charinfo_summary; - -typedef struct -{ - bn_short header; /* 0x84 0x80 */ - bn_byte gfx[11]; - bn_byte class; - bn_byte color[11]; - bn_byte level; - bn_byte status; - bn_byte u1[3]; - bn_byte u2[3]; - bn_byte end; /* 0x00 */ -} t_d2charinfo_portrait; - -typedef struct -{ - t_d2charinfo_header header; - t_d2charinfo_portrait portrait; - bn_byte pad[D2CHARINFO_PORTRAIT_PADSIZE]; - t_d2charinfo_summary summary; -} t_d2charinfo_file; - -#ifdef D2GS -#pragma pack(pop, character_h) -#endif - -#endif diff --git a/d2pack109/src/d2cs/d2cs_d2gs_protocol.h b/d2pack109/src/d2cs/d2cs_d2gs_protocol.h deleted file mode 100644 index 23b3e94..0000000 --- a/d2pack109/src/d2cs/d2cs_d2gs_protocol.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * Copyright (C) 2001 faster (lqx@cic.tsinghua.edu.cn) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2CS_D2GS_PROTOCOL_H -#define INCLUDED_D2CS_D2GS_PROTOCOL_H -/* - * there is only little comments in this header file - * check the documents for more details -*/ - -/* include your own header files here */ -#ifdef D2CS -# include "common/bn_type.h" -#endif - -#ifdef D2GS -# include "bn_types.h" -#pragma pack(push, pack01, 1) -#endif - -typedef struct -{ - bn_short size; - bn_short type; - bn_int seqno; /* seqno, set by the sender */ -} t_d2cs_d2gs_header; - -typedef struct -{ - t_d2cs_d2gs_header h; -} t_d2cs_d2gs_generic; - -#define D2CS_D2GS_AUTHREQ 0x10 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int sessionnum; - /* realm name */ -} t_d2cs_d2gs_authreq; - -#define D2GS_D2CS_AUTHREPLY 0x11 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int version; - bn_int checksum; -} t_d2gs_d2cs_authreply; - -#define D2CS_D2GS_AUTHREPLY 0x11 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int reply; -} t_d2cs_d2gs_authreply; -#define D2CS_D2GS_AUTHREPLY_SUCCEED 0x00 -#define D2CS_D2GS_AUTHREPLY_BAD_VERSION 0x01 -#define D2CS_D2GS_AUTHREPLY_BAD_CHECKSUM 0x02 - -#define D2GS_D2CS_SETGSINFO 0x12 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int maxgame; - bn_int gameflag; -} t_d2gs_d2cs_setgsinfo; - -#define D2CS_D2GS_SETGSINFO 0x12 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int maxgame; - bn_int gameflag; -} t_d2cs_d2gs_setgsinfo; - -#define D2CS_D2GS_ECHOREQ 0x13 -typedef struct -{ - t_d2cs_d2gs_header h; -} t_d2cs_d2gs_echoreq; - -#define D2GS_D2CS_ECHOREPLY 0x13 -typedef struct -{ - t_d2cs_d2gs_header h; -} t_d2gs_d2cs_echoreply; - -#define D2CS_D2GS_CONTROL 0x14 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int cmd; - bn_int value; -} t_d2cs_d2gs_control; -#define D2CS_D2GS_CONTROL_CMD_RESTART 0x01 -#define D2CS_D2GS_CONTROL_CMD_SHUTDOWN 0x02 -#define D2CS_D2GS_CONTROL_VALUE_DEFAULT 0x00 - -#define D2CS_D2GS_CREATEGAMEREQ 0x20 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_byte expansion; - bn_byte difficulty; - bn_byte hardcore; - /* gamename */ -} t_d2cs_d2gs_creategamereq; -#define D2GAME_DIFFICULTY_NORMAL 0 -#define D2GAME_DIFFICULTY_NIGHTMARE 1 -#define D2GAME_DIFFICULTY_HELL 2 - -#define D2GS_D2CS_CREATEGAMEREPLY 0x20 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int result; - bn_int gameid; -} t_d2gs_d2cs_creategamereply; -#define D2GS_D2CS_CREATEGAME_SUCCEED 0 -#define D2GS_D2CS_CREATEGAME_FAILED 1 -#define D2GS_D2CS_JOINGAME_GAME_FULL 2 - -#define D2CS_D2GS_JOINGAMEREQ 0x21 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int gameid; - bn_int token; - /* character name */ - /* account name */ -} t_d2cs_d2gs_joingamereq; - -#define D2GS_D2CS_JOINGAMEREPLY 0x21 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int result; - bn_int gameid; -} t_d2gs_d2cs_joingamereply; -#define D2GS_D2CS_JOINGAME_SUCCEED 0 -#define D2GS_D2CS_JOINGAME_FAILED 1 - -#define D2GS_D2CS_UPDATEGAMEINFO 0x22 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int flag; - bn_int gameid; - bn_int charlevel; - bn_int charclass; - /* charname */ -} t_d2gs_d2cs_updategameinfo; -#define D2GS_D2CS_UPDATEGAMEINFO_FLAG_UPDATE 0 -#define D2GS_D2CS_UPDATEGAMEINFO_FLAG_ENTER 1 -#define D2GS_D2CS_UPDATEGAMEINFO_FLAG_LEAVE 2 - -#define D2GS_D2CS_CLOSEGAME 0x23 -typedef struct -{ - t_d2cs_d2gs_header h; - bn_int gameid; -} t_d2gs_d2cs_closegame; - -#ifdef D2GS -#pragma pack(pop, pack01) -#endif - -#endif diff --git a/d2pack109/src/d2cs/d2cs_protocol.h b/d2pack109/src/d2cs/d2cs_protocol.h deleted file mode 100644 index ba21fe1..0000000 --- a/d2pack109/src/d2cs/d2cs_protocol.h +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2CS_PROTOCOL_H -#define INCLUDED_D2CS_PROTOCOL_H - -#include "common/bn_type.h" - -typedef struct -{ - bn_short size; - bn_byte type; -} t_d2cs_client_header; - -typedef struct -{ - t_d2cs_client_header h; -} t_d2cs_client_generic; - -#define CLIENT_D2CS_LOGINREQ 0x01 -typedef struct -{ - t_d2cs_client_header h; - bn_int seqno; - bn_int u1; - bn_int bncs_addr1; - bn_int sessionnum; - bn_int sessionkey; /* always zero,self define */ - bn_int cdkey_id; - bn_int u5; - bn_int clienttag; - bn_int bnversion; - bn_int bncs_addr2; - bn_int u6; /* zero */ - bn_int secret_hash[5]; - /* account name */ -} t_client_d2cs_loginreq; - -#define D2CS_CLIENT_LOGINREPLY 0x01 -typedef struct -{ - t_d2cs_client_header h; - bn_int reply; -} t_d2cs_client_loginreply; -#define D2CS_CLIENT_LOGINREPLY_SUCCEED 0x00 -#define D2CS_CLIENT_LOGINREPLY_BADPASS 0x0c - -#define CLIENT_D2CS_CREATECHARREQ 0x02 -typedef struct -{ - t_d2cs_client_header h; - bn_short class; /* character class */ - bn_short u1; /* always zero */ - bn_short status; /* same as in .d2s file */ - /* character name */ -} t_client_d2cs_createcharreq; - -#define D2CS_CLIENT_CREATECHARREPLY 0x02 -typedef struct -{ - t_d2cs_client_header h; - bn_int reply; -} t_d2cs_client_createcharreply; -#define D2CS_CLIENT_CREATECHARREPLY_SUCCEED 0x00 -#define D2CS_CLIENT_CREATECHARREPLY_FAILED 0x01 -#define D2CS_CLIENT_CREATECHARREPLY_ALREADY_EXIST 0x14 - - -#define CLIENT_D2CS_CREATEGAMEREQ 0x03 -typedef struct -{ - t_d2cs_client_header h; - bn_short seqno; - bn_int gameflag; /* just difficulty is set here */ - bn_byte u1; /* always 1 */ - bn_byte leveldiff; /* Only allow people of +/- n level to join */ - bn_byte maxchar; /* Maximum number of chars allowed in game */ - /* game name */ - /* game pass */ - /* game desc */ -} t_client_d2cs_creategamereq; - -#define D2CS_CLIENT_CREATEGAMEREPLY 0x03 -typedef struct -{ - t_d2cs_client_header h; - bn_short seqno; - bn_short gameid; - bn_short u1; /* always zero */ - bn_int reply; -} t_d2cs_client_creategamereply; -#define D2CS_CLIENT_CREATEGAMEREPLY_SUCCEED 0x00 -#define D2CS_CLIENT_CREATEGAMEREPLY_FAILED 0x01 -#define D2CS_CLIENT_CREATEGAMEREPLY_INVALID_NAME 0x1e -#define D2CS_CLIENT_CREATEGAMEREPLY_NAME_EXIST 0x1f -#define D2CS_CLIENT_CREATEGAMEREPLY_SERVER_DOWN 0x20 -#define D2CS_CLIENT_CREATEGAMEREPLY_NOT_AVAILABLE 0x32 -#define D2CS_CLIENT_CREATEGAMEREPLY_U1 0x33 - -#define CLIENT_D2CS_JOINGAMEREQ 0x04 -typedef struct -{ - t_d2cs_client_header h; - bn_short seqno; - /* game name */ - /* game pass */ -} t_client_d2cs_joingamereq; - -#define D2CS_CLIENT_JOINGAMEREPLY 0x04 -typedef struct -{ - t_d2cs_client_header h; - bn_short seqno; - bn_short gameid; - bn_short u1; /* always zero */ - bn_int addr; - bn_int token; - bn_int reply; -} t_d2cs_client_joingamereply; -#define D2CS_CLIENT_JOINGAMEREPLY_SUCCEED 0x00 -#define D2CS_CLIENT_JOINGAMEREPLY_BAD_PASS 0x29 -#define D2CS_CLIENT_JOINGAMEREPLY_NOT_EXIST 0x2a -#define D2CS_CLIENT_JOINGAMEREPLY_GAME_FULL 0x2b -#define D2CS_CLIENT_JOINGAMEREPLY_LEVEL_LIMIT 0x2c -#define D2CS_CLIENT_JOINGAMEREPLY_HARDCORE_SOFTCORE 0x71 -#define D2CS_CLIENT_JOINGAMEREPLY_NORMAL_NIGHTMARE 0x73 -#define D2CS_CLIENT_JOINGAMEREPLY_NIGHTMARE_HELL 0x74 -#define D2CS_CLIENT_JOINGAMEREPLY_CLASSIC_EXPANSION 0x78 -#define D2CS_CLIENT_JOINGAMEREPLY_EXPANSION_CLASSIC 0x79 -#define D2CS_CLIENT_JOINGAMEREPLY_FAILED 0x01 - -#define CLIENT_D2CS_GAMELISTREQ 0x05 -typedef struct -{ - t_d2cs_client_header h; - bn_short seqno; - bn_int gameflag; /* only hardcore is set here */ - /* bn_byte u1; string game name to search? */ -} t_client_d2cs_gamelistreq; - -#define D2CS_CLIENT_GAMELISTREPLY 0x05 -typedef struct -{ - t_d2cs_client_header h; - bn_short seqno; - bn_int token; - bn_byte currchar; /* current number of characters in game */ - bn_int gameflag; /* 0x04 is always set here */ - /* game name */ - /* game desc */ -} t_d2cs_client_gamelistreply; - -#define CLIENT_D2CS_GAMEINFOREQ 0x06 -typedef struct -{ - t_d2cs_client_header h; - bn_short seqno; - /* game name */ -} t_client_d2cs_gameinforeq; - -#define D2CS_CLIENT_GAMEINFOREPLY 0x06 -typedef struct -{ - t_d2cs_client_header h; - bn_short seqno; - bn_int gameflag; - bn_int etime; - bn_byte charlevel; - bn_byte leveldiff; - bn_byte maxchar; - bn_byte currchar; - bn_byte class[16]; /* 16 character class */ - bn_byte level[16]; /* 16 character level */ - bn_byte u1; /* always zero */ - /* currchar number of character names */ -} t_d2cs_client_gameinforeply; - -#define CLIENT_D2CS_CHARLOGINREQ 0x07 -typedef struct -{ - t_d2cs_client_header h; - /* character name */ -} t_client_d2cs_charloginreq; - -#define D2CS_CLIENT_CHARLOGINREPLY 0x07 -typedef struct -{ - t_d2cs_client_header h; - bn_int reply; -} t_d2cs_client_charloginreply; -#define D2CS_CLIENT_CHARLOGINREPLY_SUCCEED 0x00 -#define D2CS_CLIENT_CHARLOGINREPLY_FAILED 0x01 -#define D2CS_CLIENT_CHARLOGINREPLY_NOT_FOUND 0x46 -#define D2CS_CLIENT_CHARLOGINREPLY_EXPIRED 0x7b - -#define CLIENT_D2CS_DELETECHARREQ 0x0a -typedef struct -{ - t_d2cs_client_header h; - bn_short u1; /* always zero */ - /* character name */ -} t_client_d2cs_deletecharreq; - -#define D2CS_CLIENT_DELETECHARREPLY 0x0a -typedef struct -{ - t_d2cs_client_header h; - bn_short u1; /* always zero */ - bn_int reply; -} t_d2cs_client_deletecharreply; -#define D2CS_CLIENT_DELETECHARREPLY_SUCCEED 0x00 -#define D2CS_CLIENT_DELETECHARREPLY_FAILED 0x01 - - -#define CLIENT_D2CS_LADDERREQ 0x11 -typedef struct -{ - t_d2cs_client_header h; - bn_byte type; /* jadder type request */ - bn_short start_pos; /* list ladder from what position */ -} t_client_d2cs_ladderreq; - -#define D2CS_CLIENT_LADDERREPLY 0x11 -typedef struct -{ - t_d2cs_client_header h; - bn_byte type; /* ladder type request */ - bn_short total_len; /* total length of the ladder data */ - - bn_short curr_len; /* length of ladder data in this packet */ - bn_short cont_len; /* length of ladder data in previous packets */ - /* length here include the header but - exclude this packet */ -} t_d2cs_client_ladderreply; - -typedef struct -{ - bn_short start_pos; /* start position of ladder */ - bn_short u1; /* always zero */ - bn_int count1; /* always 0x10 */ -} t_d2cs_client_ladderheader; - -typedef struct -{ - bn_int count2; /* 0x10 for first packet or 0x0 for continue */ -} t_d2cs_client_ladderinfoheader; - -typedef struct -{ - bn_int explow; - bn_int exphigh; /* always zero */ - bn_short status; - bn_byte level; - bn_byte u1; /* always zero */ - char charname[16]; -} t_d2cs_client_ladderinfo; -#define LADDERSTATUS_FLAG_DEAD 0x10 -#define LADDERSTATUS_FLAG_HARDCORE 0x20 -#define LADDERSTATUS_FLAG_EXPANSION 0x40 -#define LADDERSTATUS_FLAG_DIFFICULTY 0x0f00 - -#define CLIENT_D2CS_MOTDREQ 0x12 -typedef struct -{ - t_d2cs_client_header h; -} t_client_d2cs_motdreq; - -#define D2CS_CLIENT_MOTDREPLY 0x12 -typedef struct -{ - t_d2cs_client_header h; - bn_byte u1; - /* message */ -} t_d2cs_client_motdreply; - -#define CLIENT_D2CS_CANCELCREATEGAME 0x13 -typedef struct -{ - t_d2cs_client_header h; -} t_client_d2cs_cancelcreategame; - -#define D2CS_CLIENT_CREATEGAMEWAIT 0x14 -typedef struct -{ - t_d2cs_client_header h; - bn_int position; -} t_d2cs_client_creategamewait; - -#define D2CS_CLIENT_CHARLADDERREQ 0x16 -typedef struct -{ - t_d2cs_client_header h; - bn_int hardcore; - bn_int expansion; - /* character name */ -} t_client_d2cs_charladderreq; -/* use 0x11 LADDER reply for this request */ - -#define CLIENT_D2CS_CHARLISTREQ 0x17 -typedef struct -{ - t_d2cs_client_header h; - bn_short maxchar; - bn_short u1; -} t_client_d2cs_charlistreq; - -#define D2CS_CLIENT_CHARLISTREPLY 0x17 -typedef struct -{ - t_d2cs_client_header h; - bn_short maxchar; - bn_short currchar; - bn_short u1; /* always zero */ - bn_short currchar2; - /* character name */ - /* character portrait blocks */ - /* each block is 0x22 bytes static length */ -} t_d2cs_client_charlistreply; - -#define CLIENT_D2CS_CONVERTCHARREQ 0x18 -typedef struct -{ - t_d2cs_client_header h; - /* character name */ -} t_client_d2cs_convertcharreq; - -#define D2CS_CLIENT_CONVERTCHARREPLY 0x18 -typedef struct -{ - t_d2cs_client_header h; - bn_int reply; -} t_d2cs_client_convertcharreply; -#define D2CS_CLIENT_CONVERTCHARREPLY_SUCCEED 0x00 -#define D2CS_CLIENT_CONVERTCHARREPLY_FAILED 0x01 - -#endif diff --git a/d2pack109/src/d2cs/d2gs.c b/d2pack109/src/d2cs/d2gs.c deleted file mode 100644 index fb94ffb..0000000 --- a/d2pack109/src/d2cs/d2gs.c +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -#endif -#include "compat/strsep.h" -#include "compat/char_bit.h" -#ifdef HAVE_SYS_TYPES_H -# include /* needed to include netinet/in.h */ -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/socket.h" -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#ifdef HAVE_ARPA_INET_H -# include /* FIXME: probably not needed... do some systems put types in here or something? */ -#endif -#include "compat/psock.h" - -#include "d2gs.h" -#include "game.h" -#include "net.h" -#include "bit.h" -#include "prefs.h" -#include "connection.h" -#include "common/introtate.h" -#include "common/addr.h" -#include "common/list.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static t_list * d2gslist_head=NULL; -static unsigned int d2gs_id=0; -static unsigned int total_d2gs=0; - -extern t_list * d2gslist(void) -{ - return d2gslist_head; -} - -extern int d2gslist_create(void) -{ - d2gslist_head=list_create(); - return d2gslist_reload(prefs_get_d2gs_list()); -} - -extern int d2gslist_reload(char const * gslist) -{ - t_addrlist * gsaddrs; - t_d2gs * gs; - - if (!d2gslist_head) return -1; - - BEGIN_LIST_TRAVERSE_DATA(d2gslist_head,gs) - { - BIT_CLR_FLAG(gs->flag, D2GS_FLAG_VALID); - } - END_LIST_TRAVERSE_DATA() - - gsaddrs = addrlist_create(gslist, INADDR_ANY, 0); - if (gsaddrs) { - t_elem const *acurr; - t_addr * curr_laddr; - - LIST_TRAVERSE_CONST(gsaddrs, acurr) - { - curr_laddr = (t_addr*)elem_get_data(acurr); - if (!curr_laddr) { - eventlog(eventlog_level_error, __FUNCTION__, "found NULL value in gslist"); - continue; - } - if (!(gs=d2gslist_find_gs_by_ip(addr_get_ip(curr_laddr)))) - gs = d2gs_create(addr_num_to_ip_str(addr_get_ip(curr_laddr))); - if (gs) BIT_SET_FLAG(gs->flag, D2GS_FLAG_VALID); - } - addrlist_destroy(gsaddrs); - } - - BEGIN_LIST_TRAVERSE_DATA(d2gslist_head,gs) - { - if (!BIT_TST_FLAG(gs->flag, D2GS_FLAG_VALID)) { - d2gs_destroy(gs,&curr_elem_); - } - } - END_LIST_TRAVERSE_DATA() - return 0; -} - -extern int d2gslist_destroy(void) -{ - t_d2gs * gs; - - BEGIN_LIST_TRAVERSE_DATA_CONST(d2gslist_head,gs) - { - d2gs_destroy(gs,(t_elem **)&curr_elem_); - } - END_LIST_TRAVERSE_DATA_CONST() - d2cs_connlist_reap(); - - if (list_destroy(d2gslist_head)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error destroy d2gs list"); - return -1; - } - d2gslist_head=NULL; - return 0; -} - -extern t_d2gs * d2gslist_find_gs_by_ip(unsigned int ip) -{ - t_d2gs * gs; - - BEGIN_LIST_TRAVERSE_DATA_CONST(d2gslist_head,gs) - { - if (gs->ip==ip) return gs; - } - END_LIST_TRAVERSE_DATA_CONST() - return NULL; -} - -extern t_d2gs * d2gslist_find_gs(unsigned int id) -{ - t_d2gs * gs; - - BEGIN_LIST_TRAVERSE_DATA_CONST(d2gslist_head,gs) - { - if (gs->id==id) return gs; - } - END_LIST_TRAVERSE_DATA_CONST() - return NULL; -} - -extern t_d2gs * d2gs_create(char const * ipaddr) -{ - t_d2gs * gs; - unsigned int ip; - - ASSERT(ipaddr,NULL); - if ((ip=net_inet_addr(ipaddr))==~0U) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad ip address %s",ipaddr); - return NULL; - } - if (d2gslist_find_gs_by_ip(ntohl(ip))) { - eventlog(eventlog_level_error,__FUNCTION__,"game server %s already in list",ipaddr); - return NULL; - } - gs=xmalloc(sizeof(t_d2gs)); - gs->ip=ntohl(ip); - gs->id=++d2gs_id; - gs->active=0; - gs->token=0; - gs->state=d2gs_state_none; - gs->gamenum=0; - gs->maxgame=0; - gs->connection=NULL; - - if (list_append_data(d2gslist_head,gs)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error add gs to list"); - xfree(gs); - return NULL; - } - eventlog(eventlog_level_info,__FUNCTION__,"added game server %s (id: %d) to list",ipaddr,gs->id); - return gs; -} - -extern int d2gs_destroy(t_d2gs * gs, t_elem ** curr) -{ - ASSERT(gs,-1); - if (list_remove_data(d2gslist_head,gs,curr)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error remove gs from list"); - return -1; - } - if (gs->active && gs->connection) { - d2cs_conn_set_state(gs->connection, conn_state_destroy); - d2gs_deactive(gs, gs->connection); - } - eventlog(eventlog_level_info,__FUNCTION__,"removed game server %s (id: %d) from list",addr_num_to_ip_str(gs->ip),gs->id); - xfree(gs); - return 0; -} - -extern t_d2gs * d2gslist_get_server_by_id(unsigned int id) -{ - t_d2gs * gs; - - BEGIN_LIST_TRAVERSE_DATA_CONST(d2gslist_head,gs) - { - if (gs->id==id) return gs; - } - END_LIST_TRAVERSE_DATA_CONST() - return NULL; -} - -extern t_d2gs * d2gslist_choose_server(void) -{ - t_d2gs * gs; - t_d2gs * ogs; - unsigned int percent; - unsigned int min_percent=100; - - ogs=NULL; - BEGIN_LIST_TRAVERSE_DATA_CONST(d2gslist_head,gs) - { - if (!gs->active) continue; - if (!gs->connection) continue; - if (gs->state!=d2gs_state_authed) continue; - if (!gs->maxgame) continue; - if (gs->gamenum>=gs->maxgame) continue; - percent=100*gs->gamenum/gs->maxgame; - if (percentstate=state; - return 0; -} - -extern t_d2gs_state d2gs_get_state(t_d2gs const * gs) -{ - ASSERT(gs,d2gs_state_none); - return gs->state; -} - -extern int d2gs_add_gamenum(t_d2gs * gs, int number) -{ - ASSERT(gs,-1); - gs->gamenum += number; - return 0; -} - -extern unsigned int d2gs_get_gamenum(t_d2gs const * gs) -{ - ASSERT(gs,0); - return gs->gamenum; -} - - -extern int d2gs_set_maxgame(t_d2gs * gs,unsigned int maxgame) -{ - ASSERT(gs,-1); - gs->maxgame=maxgame; - return 0; -} - -extern unsigned int d2gs_get_maxgame(t_d2gs const * gs) -{ - ASSERT(gs,0); - return gs->maxgame; -} - -extern unsigned int d2gs_get_id(t_d2gs const * gs) -{ - ASSERT(gs,0); - return gs->id; -} - -extern unsigned int d2gs_get_ip(t_d2gs const * gs) -{ - ASSERT(gs,0); - return gs->ip; -} - -extern unsigned int d2gs_get_token(t_d2gs const * gs) -{ - return gs->token; -} - -extern unsigned int d2gs_add_token(t_d2gs * gs) -{ - return ++(gs->token); -} - -extern t_connection * d2gs_get_connection(t_d2gs const * gs) -{ - ASSERT(gs,NULL); - return gs->connection; -} - -extern int d2gs_active(t_d2gs * gs, t_connection * c) -{ - ASSERT(gs,-1); - ASSERT(c,-1); - - if (gs->active && gs->connection) { - eventlog(eventlog_level_warn,__FUNCTION__,"game server %d is already actived, deactive previous connection first",gs->id); - d2gs_deactive(gs, gs->connection); - } - total_d2gs++; - eventlog(eventlog_level_info,__FUNCTION__,"game server %s (id: %d) actived (%d total)",addr_num_to_addr_str(d2cs_conn_get_addr(c), - d2cs_conn_get_port(c)),gs->id,total_d2gs); - gs->state=d2gs_state_authed; - gs->connection=c; - gs->active=1; - gs->gamenum=0; - gs->maxgame=0; - return 0; -} - -extern int d2gs_deactive(t_d2gs * gs, t_connection * c) -{ - t_game * game; - - ASSERT(gs,-1); - if (!gs->active || !gs->connection) { - eventlog(eventlog_level_warn,__FUNCTION__,"game server %d is not actived yet", gs->id); - return -1; - } - if (gs->connection != c) { - eventlog(eventlog_level_debug,__FUNCTION__,"game server %d connection mismatch,ignore it", gs->id); - return 0; - } - total_d2gs--; - eventlog(eventlog_level_info,__FUNCTION__,"game server %s (id: %d) deactived (%d left)",addr_num_to_addr_str(d2cs_conn_get_addr(gs->connection),d2cs_conn_get_port(gs->connection)),gs->id,total_d2gs); - gs->state=d2gs_state_none; - gs->connection=NULL; - gs->active=0; - gs->maxgame=0; - eventlog(eventlog_level_info,__FUNCTION__,"destroying all games on game server %d",gs->id); - BEGIN_LIST_TRAVERSE_DATA(d2cs_gamelist(),game) - { - if (game_get_d2gs(game)==gs) game_destroy(game,&curr_elem_); - } - END_LIST_TRAVERSE_DATA() - if (gs->gamenum!=0) { - eventlog(eventlog_level_error,__FUNCTION__,"game server %d deactived but still with games left",gs->id); - } - gs->gamenum=0; - return 0; -} - -extern unsigned int d2gs_calc_checksum(t_connection * c) -{ - unsigned int sessionnum, checksum, port, addr; - unsigned int i, len, ch; - char const * realmname; - char const * password; - - ASSERT(c,0); - sessionnum=d2cs_conn_get_sessionnum(c); - checksum=prefs_get_d2gs_checksum(); - port=d2cs_conn_get_port(c); - addr=d2cs_conn_get_addr(c); - realmname=prefs_get_realmname(); - password=prefs_get_d2gs_password(); - - len=strlen(realmname); - for (i=0; iu.d2cs_d2gs.h.seqno,0); - BEGIN_LIST_TRAVERSE_DATA(d2gslist_head,gs) - { - if (gs->active && gs->connection) { - conn_push_outqueue(gs->connection,packet); - } - } - END_LIST_TRAVERSE_DATA() - packet_del_ref(packet); - return 0; -} - -extern int d2gs_restart_all_gs(void) -{ - t_packet * packet; - t_d2gs * gs; - - if (!(packet=packet_create(packet_class_d2gs))) { - eventlog(eventlog_level_error, __FUNCTION__, "error creating packet"); - return -1; - } - packet_set_size(packet,sizeof(t_d2cs_d2gs_control)); - packet_set_type(packet,D2CS_D2GS_CONTROL); - /* FIXME: sequence number not set */ - bn_int_set(&packet->u.d2cs_d2gs.h.seqno,0); - bn_int_set(&packet->u.d2cs_d2gs_control.cmd, D2CS_D2GS_CONTROL_CMD_RESTART); - bn_int_set(&packet->u.d2cs_d2gs_control.value, prefs_get_d2gs_restart_delay()); - - BEGIN_LIST_TRAVERSE_DATA(d2gslist_head,gs) - { - if (gs->connection && gs->d2gs_version > 0x1090007) { - conn_push_outqueue(gs->connection,packet); - } - } - - END_LIST_TRAVERSE_DATA() - packet_del_ref(packet); - return 0; -} - diff --git a/d2pack109/src/d2cs/d2gs.h b/d2pack109/src/d2cs/d2gs.h deleted file mode 100644 index 6f89adb..0000000 --- a/d2pack109/src/d2cs/d2gs.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2GS_H -#define INCLUDED_D2GS_H - -#include "common/list.h" -#include "connection.h" - -typedef enum -{ - d2gs_state_none, - d2gs_state_connected, - d2gs_state_authed -} t_d2gs_state; - -typedef struct d2gs -{ - unsigned int ip; - unsigned int id; - unsigned int flag; - unsigned int active; - unsigned int token; - t_d2gs_state state; - unsigned int maxgame; - unsigned int gamenum; - t_connection * connection; - unsigned int d2gs_version; -} t_d2gs; - -#define D2GS_FLAG_VALID 0x01 - -extern t_list * d2gslist(void); -extern int d2gslist_create(void); -extern int d2gslist_destroy(void); -extern int d2gslist_reload(char const * gslist); -extern t_d2gs * d2gs_create(char const * ip); -extern int d2gs_destroy(t_d2gs * gs,t_elem ** curr); -extern t_d2gs * d2gslist_get_server_by_id(unsigned int id); -extern t_d2gs * d2gslist_choose_server(void); -extern t_d2gs * d2gslist_find_gs(unsigned int id); -extern t_d2gs * d2gslist_find_gs_by_ip(unsigned int ip); -extern unsigned int d2gs_get_id(t_d2gs const * gs); -extern unsigned int d2gs_get_ip(t_d2gs const * gs); -extern t_d2gs_state d2gs_get_state(t_d2gs const * gs); -extern int d2gs_set_state(t_d2gs * gs, t_d2gs_state state); -extern unsigned int d2gs_get_maxgame(t_d2gs const * gs); -extern int d2gs_set_maxgame(t_d2gs * gs,unsigned int maxgame); -extern unsigned int d2gs_get_gamenum(t_d2gs const * gs); -extern int d2gs_add_gamenum(t_d2gs * gs,int number); -extern unsigned int d2gs_get_token(t_d2gs const * gs); -extern unsigned int d2gs_add_token(t_d2gs * gs); -extern t_connection * d2gs_get_connection(t_d2gs const * gs); -extern int d2gs_active(t_d2gs * gs, t_connection * c); -extern int d2gs_deactive(t_d2gs * gs, t_connection * c); -extern unsigned int d2gs_calc_checksum(t_connection * c); -extern int d2gs_keepalive(void); -extern int d2gs_restart_all_gs(void); - -#endif diff --git a/d2pack109/src/d2cs/d2ladder.c b/d2pack109/src/d2cs/d2ladder.c deleted file mode 100644 index ca67a61..0000000 --- a/d2pack109/src/d2cs/d2ladder.c +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strcasecmp.h" -#include "compat/memset.h" -#include -#include "compat/strerror.h" -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif - -#include "prefs.h" -#include "d2charfile.h" -#include "d2ladder.h" -#include "d2cs_protocol.h" -#include "common/tag.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static t_d2ladder * ladder_data=NULL; -static unsigned int max_ladder_type=0; - -static int d2ladderlist_create(unsigned int maxtype); -static int d2ladder_create(unsigned int type, unsigned int len); -static int d2ladder_append_ladder(unsigned int type, t_d2ladderfile_ladderinfo * info); -static int d2ladder_readladder(void); - -extern int d2ladder_init(void) -{ - if (d2ladder_readladder()<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to initialize ladder data"); - return -1; - } - eventlog(eventlog_level_info,__FUNCTION__,"ladder data initialized"); - return 0; -} - -static int d2ladder_readladder(void) -{ - FILE * fp; - t_d2ladderfile_ladderindex * ladderheader; - t_d2ladderfile_ladderinfo * ladderinfo; - char * ladderfile; - t_d2ladderfile_header header; - unsigned int i, n, temp, count, type, number; - - ladderfile=xmalloc(strlen(prefs_get_ladder_dir())+1+strlen(LADDER_FILE_PREFIX)+1+ - strlen(CLIENTTAG_DIABLO2DV)+1); - sprintf(ladderfile,"%s/%s.%s",prefs_get_ladder_dir(),LADDER_FILE_PREFIX,CLIENTTAG_DIABLO2DV); - if (!(fp=fopen(ladderfile,"rb"))) { - eventlog(eventlog_level_error,__FUNCTION__,"error opening ladder file \"%s\" for reading (fopen: %s)",ladderfile,strerror(errno)); - xfree(ladderfile); - return -1; - } - xfree(ladderfile); - if (fread(&header,1,sizeof(header),fp)!=sizeof(header)) { - eventlog(eventlog_level_error,__FUNCTION__,"error reading ladder file"); - fclose(fp); - return -1; - } - max_ladder_type= bn_int_get(header.maxtype); - if (d2ladderlist_create(max_ladder_type)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error create ladder list"); - fclose(fp); - return -1; - } - temp= max_ladder_type * sizeof(*ladderheader); - ladderheader=xmalloc(temp); - if (fread(ladderheader,1,temp,fp)!=temp) { - eventlog(eventlog_level_error,__FUNCTION__,"error read ladder file"); - xfree(ladderheader); - fclose(fp); - return -1; - } - for (i=0, count=0; i< max_ladder_type ; i++) { - type=bn_int_get(ladderheader[i].type); - number=bn_int_get(ladderheader[i].number); - if (d2ladder_create(type,number)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error create ladder %d",type); - continue; - } - fseek(fp,bn_int_get(ladderheader[i].offset),SEEK_SET); - temp=number * sizeof(*ladderinfo); - ladderinfo=xmalloc(temp); - if (fread(ladderinfo,1,temp,fp)!=temp) { - eventlog(eventlog_level_error,__FUNCTION__,"error read ladder file"); - xfree(ladderinfo); - continue; - } - for (n=0; n< number; n++) { - d2ladder_append_ladder(type,ladderinfo+n); - } - xfree(ladderinfo); - if (number) count++; - } - xfree(ladderheader); - fclose(fp); - eventlog(eventlog_level_info,__FUNCTION__,"ladder file loaded successfully (%d types %d maxtype)",count,max_ladder_type); - return 0; -} - -static int d2ladderlist_create(unsigned int maxtype) -{ - ladder_data=xmalloc(maxtype * sizeof(*ladder_data)); - memset(ladder_data,0, maxtype * sizeof(*ladder_data)); - return 0; -} - -extern int d2ladder_refresh(void) -{ - d2ladder_destroy(); - return d2ladder_readladder(); -} - -static int d2ladder_create(unsigned int type, unsigned int len) -{ - if (type>max_ladder_type) { - eventlog(eventlog_level_error,__FUNCTION__,"ladder type %d exceed max ladder type %d",type,max_ladder_type); - return -1; - } - ladder_data[type].info=xmalloc(sizeof(t_d2cs_client_ladderinfo) * len); - ladder_data[type].len=len; - ladder_data[type].type=type; - ladder_data[type].curr_len=0; - return 0; -} - -static int d2ladder_append_ladder(unsigned int type, t_d2ladderfile_ladderinfo * info) -{ - t_d2cs_client_ladderinfo * ladderinfo; - unsigned short ladderstatus; - unsigned short status; - unsigned char class; - - if (!info) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL info"); - return -1; - } - if (type > max_ladder_type) { - eventlog(eventlog_level_error,__FUNCTION__,"ladder type %d exceed max ladder type %d",type,max_ladder_type); - return -1; - } - if (!ladder_data[type].info) { - eventlog(eventlog_level_error,__FUNCTION__,"ladder data info not initialized"); - return -1; - } - if (ladder_data[type].curr_len >= ladder_data[type].len) { - eventlog(eventlog_level_error,__FUNCTION__,"ladder data overflow %d > %d", ladder_data[type].curr_len, ladder_data[type].len); - return -1; - } - status = bn_short_get(info->status); - class = bn_byte_get(info->class); - ladderstatus = (status & LADDERSTATUS_FLAG_DIFFICULTY); - if (charstatus_get_hardcore(status)) { - ladderstatus |= LADDERSTATUS_FLAG_HARDCORE; - if (charstatus_get_dead(status)) { - ladderstatus |= LADDERSTATUS_FLAG_DEAD; - } - } - if (charstatus_get_expansion(status)) { - ladderstatus |= LADDERSTATUS_FLAG_EXPANSION; - ladderstatus |= min(class,D2CHAR_EXP_CLASS_MAX); - } else { - ladderstatus |= min(class,D2CHAR_CLASS_MAX); - } - ladderinfo=ladder_data[type].info+ladder_data[type].curr_len; - bn_int_set(&ladderinfo->explow, bn_int_get(info->experience)); - bn_int_set(&ladderinfo->exphigh,0); - bn_short_set(&ladderinfo->status,ladderstatus); - bn_byte_set(&ladderinfo->level, bn_int_get(info->level)); - bn_byte_set(&ladderinfo->u1, 0); - strncpy(ladderinfo->charname, info->charname, MAX_CHARNAME_LEN); - ladder_data[type].curr_len++; - return 0; -} - -extern int d2ladder_destroy(void) -{ - unsigned int i; - - if (ladder_data) { - for (i=0; i< max_ladder_type; i++) { - if (ladder_data[i].info) { - xfree(ladder_data[i].info); - ladder_data[i].info=NULL; - } - } - xfree(ladder_data); - ladder_data=NULL; - } - max_ladder_type=0; - return 0; -} - -extern int d2ladder_get_ladder(unsigned int * from, unsigned int * count, unsigned int type, - t_d2cs_client_ladderinfo const * * info) -{ - t_d2ladder * ladder; - - if (!ladder_data) return -1; - ladder=ladder_data+type; - if (!ladder->curr_len || !ladder->info) { - eventlog(eventlog_level_warn,__FUNCTION__,"ladder type %d not found",type); - return -1; - } - if (ladder->type != type) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad ladder data"); - return -1; - } - if (ladder->curr_len < *count) { - *from = 0; - *count=ladder->curr_len; - } else if (*from + *count> ladder->curr_len) { - *from= ladder->curr_len - *count; - } - *info = ladder->info+ *from; - return 0; -} - -extern int d2ladder_find_character_pos(unsigned int type, char const * charname) -{ - unsigned int i; - t_d2ladder * ladder; - - if (!ladder_data) return -1; - ladder=ladder_data+type; - if (!ladder->curr_len || !ladder->info) { - eventlog(eventlog_level_warn,__FUNCTION__,"ladder type %d not found",type); - return -1; - } - if (ladder->type != type) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad ladder data"); - return -1; - } - for (i=0; i< ladder->curr_len; i++) { - if (!strcasecmp(ladder->info[i].charname,charname)) return i; - } - return -1; -} diff --git a/d2pack109/src/d2cs/d2ladder.h b/d2pack109/src/d2cs/d2ladder.h deleted file mode 100644 index 9a9af3d..0000000 --- a/d2pack109/src/d2cs/d2ladder.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2LADDER_H -#define INCLUDED_D2LADDER_H - -#include "common/bn_type.h" -#include "d2cs_protocol.h" -#include "d2cs_d2dbs_ladder.h" - -typedef struct -{ - unsigned int type; - unsigned int len; - unsigned int curr_len; - t_d2cs_client_ladderinfo * info; -} t_d2ladder; - -extern int d2ladder_init(void); -extern int d2ladder_refresh(void); -extern int d2ladder_destroy(void); -extern int d2ladder_get_ladder(unsigned int * from, unsigned int * count, unsigned int type, - t_d2cs_client_ladderinfo const * * info); -extern int d2ladder_find_character_pos(unsigned int type, char const * charname); - -#endif diff --git a/d2pack109/src/d2cs/game.c b/d2pack109/src/d2cs/game.c deleted file mode 100644 index def652f..0000000 --- a/d2pack109/src/d2cs/game.c +++ /dev/null @@ -1,517 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strcasecmp.h" -#include "compat/strdup.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#include "prefs.h" -#include "game.h" -#include "common/list.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static t_list * gamelist_head=NULL; -static t_elem const * gamelist_curr_elem=NULL; -static unsigned int total_game=0; -static unsigned int game_id=0; -static t_game_charinfo * game_find_character(t_game * game, char const * charname); - -extern t_list * d2cs_gamelist(void) -{ - return gamelist_head; -} - -extern t_elem const * gamelist_get_curr_elem(void) -{ - return gamelist_curr_elem; -} - -extern void gamelist_set_curr_elem(t_elem const * elem) -{ - gamelist_curr_elem=elem; - return; -} - -extern int d2cs_gamelist_create(void) -{ - gamelist_head=list_create(); - return 0; -} - -extern int d2cs_gamelist_destroy(void) -{ - t_game * game; - - BEGIN_LIST_TRAVERSE_DATA(gamelist_head, game) - { - game_destroy(game,&curr_elem_); - } - END_LIST_TRAVERSE_DATA(); - - if (list_destroy(gamelist_head)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error destroy connection list"); - return -1; - } - gamelist_head=NULL; - return 0; -} - -extern t_game * d2cs_gamelist_find_game(char const * gamename) -{ - t_game * game; - - ASSERT(gamename,NULL); - BEGIN_LIST_TRAVERSE_DATA(gamelist_head,game) - { - if (!strcasecmp(game->name,gamename)) return game; - } - END_LIST_TRAVERSE_DATA() - return NULL; -} - -extern t_game * gamelist_find_game_by_id(unsigned int id) -{ - t_game * game; - - BEGIN_LIST_TRAVERSE_DATA(gamelist_head,game) - { - if (game->id==id) return game; - } - END_LIST_TRAVERSE_DATA() - return NULL; -} - -extern t_game * gamelist_find_game_by_d2gs_and_id(unsigned int d2gs_id, unsigned int d2gs_gameid) -{ - t_game * game; - - BEGIN_LIST_TRAVERSE_DATA(gamelist_head,game) - { - if (!game->created) continue; - if (game->d2gs_gameid!=d2gs_gameid) continue; - if (d2gs_get_id(game->d2gs) != d2gs_id) continue; - return game; - } - END_LIST_TRAVERSE_DATA() - return NULL; -} - -extern t_game * gamelist_find_character(char const * charname) -{ - t_game * game; - - ASSERT(charname,NULL); - BEGIN_LIST_TRAVERSE_DATA(gamelist_head, game) - { - if (game_find_character(game,charname)) return game; - } - END_LIST_TRAVERSE_DATA(); - return NULL; -} - -extern void d2cs_gamelist_check_voidgame(void) -{ - t_game * game; - time_t now; - int timeout; - - timeout=prefs_get_max_game_idletime(); - if (!timeout) return; - now=time(NULL); - BEGIN_LIST_TRAVERSE_DATA(gamelist_head, game) - { - if (!game->currchar) { - if ((now-game->lastaccess_time)>timeout) { - eventlog(eventlog_level_info,__FUNCTION__,"game %s is empty too long time,destroying it",game->name); - game_destroy(game,&curr_elem_); - } - } - } - END_LIST_TRAVERSE_DATA() -} - -extern t_game * d2cs_game_create(char const * gamename, char const * gamepass, char const * gamedesc, - unsigned int gameflag) -{ - t_game * game; - time_t now; - - ASSERT(gamename,NULL); - ASSERT(gamepass,NULL); - ASSERT(gamedesc,NULL); - if (d2cs_gamelist_find_game(gamename)) { - eventlog(eventlog_level_error,__FUNCTION__,"game %s already exist",gamename); - return NULL; - } - game=xmalloc(sizeof(t_game)); - game->name=xstrdup(gamename); - game->pass=xstrdup(gamepass); - game->desc=xstrdup(gamedesc); - game->charlist=list_create(); - now=time(NULL); - game_id++; - if (game_id==0) game_id=1; - game->id=game_id; - game->created=0; - game->create_time=now; - game->lastaccess_time=now; - game->gameflag=gameflag; - game->charlevel=0; - game->leveldiff=0; - game->d2gs_gameid=0; - game->d2gs=NULL; - game->maxchar=MAX_CHAR_PER_GAME; - game->currchar=0; - list_prepend_data(gamelist_head,game); - total_game++; - eventlog(eventlog_level_info,__FUNCTION__,"game %s pass=%s desc=%s gameflag=0x%08X created (%d total)",gamename,gamepass, - gamedesc,gameflag,total_game); - return game; -} - -extern int game_destroy(t_game * game, t_elem ** elem) -{ - t_elem * curr; - t_game_charinfo * charinfo; - - ASSERT(game,-1); - if (gamelist_curr_elem && (game==elem_get_data(gamelist_curr_elem))) { - gamelist_curr_elem=elem_get_next_const(gamelist_head,gamelist_curr_elem); - } - if (list_remove_data(gamelist_head,game,elem)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error remove game %s on game list",game->name); - return -1; - } - total_game--; - eventlog(eventlog_level_info,__FUNCTION__,"game %s removed from game list (%d left)",game->name,total_game); - LIST_TRAVERSE(game->charlist,curr) - { - if ((charinfo=elem_get_data(curr))) { - if (charinfo->charname) xfree((void *)charinfo->charname); - xfree(charinfo); - } - list_remove_elem(game->charlist,&curr); - } - list_destroy(game->charlist); - - if (game->d2gs) { - d2gs_add_gamenum(game->d2gs,-1); - if (d2gs_get_gamenum(game->d2gs) < d2gs_get_maxgame(game->d2gs)) { - gqlist_check_creategame(); - } - } - if (game->desc) xfree((void *)game->desc); - if (game->pass) xfree((void *)game->pass); - if (game->name) xfree((void *)game->name); - xfree(game); - return 0; -} - -static t_game_charinfo * game_find_character(t_game * game, char const * charname) -{ - t_game_charinfo * charinfo; - - ASSERT(game,NULL); - ASSERT(charname,NULL); - if (!game->charlist) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL character list in game %s",game->name); - return NULL; - } - BEGIN_LIST_TRAVERSE_DATA(game->charlist,charinfo) - { - if (!charinfo->charname) continue; - if (!strcmp_charname(charinfo->charname,charname)) return charinfo; - } - END_LIST_TRAVERSE_DATA() - return NULL; -} - -extern int game_add_character(t_game * game, char const * charname, unsigned char class, - unsigned char level) -{ - t_game_charinfo * charinfo; - - ASSERT(game,-1); - ASSERT(charname,-1); - charinfo=game_find_character(game,charname); - if (charinfo) { - eventlog(eventlog_level_info,__FUNCTION__,"updating character %s (game %s) status", charname,game->name); - charinfo->class=class; - charinfo->level=level; - return 0; - } - charinfo=xmalloc(sizeof(t_game_charinfo)); - charinfo->charname=xstrdup(charname); - charinfo->class=class; - charinfo->level=level; - list_append_data(game->charlist,charinfo); - game->currchar++; - game->lastaccess_time=time(NULL); - eventlog(eventlog_level_info,__FUNCTION__,"added character %s to game %s (%d total)",charname,game->name,game->currchar); - return 0; -} - -extern int game_del_character(t_game * game, char const * charname) -{ - t_game_charinfo * charinfo; - t_elem * elem; - - ASSERT(game,-1); - ASSERT(charname,-1); - if (!(charinfo=game_find_character(game,charname))) { - eventlog(eventlog_level_error,__FUNCTION__,"character %s not found in game %s",charname,game->name); - return -1; - } - if (list_remove_data(game->charlist,charinfo,&elem)) { - eventlog(eventlog_level_error,__FUNCTION__,"error remove character %s from game %s",charname,game->name); - return -1; - } - if (charinfo->charname) xfree((void *)charinfo->charname); - xfree(charinfo); - game->currchar--; - game->lastaccess_time=time(NULL); - eventlog(eventlog_level_info,__FUNCTION__,"removed character %s from game %s (%d left)",charname,game->name,game->currchar); - return 0; -} - -extern int game_set_d2gs_gameid(t_game * game, unsigned int d2gs_gameid) -{ - ASSERT(game,-1); - game->d2gs_gameid=d2gs_gameid; - return 0; -} - -extern unsigned int game_get_d2gs_gameid(t_game const * game) -{ - ASSERT(game,0); - return game->d2gs_gameid; -} - -extern unsigned int d2cs_game_get_id(t_game const * game) -{ - ASSERT(game,0); - return game->id; -} - -extern int game_set_d2gs(t_game * game, t_d2gs * gs) -{ - ASSERT(game,-1); - game->d2gs=gs; - return 0; -} - -extern t_d2gs * game_get_d2gs(t_game const * game) -{ - ASSERT(game,NULL); - return game->d2gs; -} - -extern int game_set_leveldiff(t_game * game, unsigned int leveldiff) -{ - ASSERT(game,-1); - game->leveldiff=leveldiff; - return 0; -} - -extern int game_set_charlevel(t_game * game, unsigned int charlevel) -{ - ASSERT(game,-1); - game->charlevel=charlevel; - return 0; -} - -extern unsigned int game_get_charlevel(t_game const * game) -{ - ASSERT(game,0); - return game->charlevel; -} - -extern unsigned int game_get_leveldiff(t_game const * game) -{ - ASSERT(game,0); - return game->leveldiff; -} - -extern unsigned int game_get_maxlevel(t_game const * game) -{ - int maxlevel; - - ASSERT(game,0); - maxlevel=game->charlevel+game->leveldiff; - if (maxlevel>0xff) maxlevel=0xff; - return maxlevel; -} - -extern unsigned int game_get_minlevel(t_game const * game) -{ - int minlevel; - - ASSERT(game,0); - minlevel=game->charlevel-game->leveldiff; - if (minlevel<0) minlevel=0; - return minlevel; -} - -extern unsigned int game_get_gameflag_expansion(t_game const * game) -{ - ASSERT(game,0); - return gameflag_get_expansion(game->gameflag); -} - -extern unsigned int game_get_gameflag_hardcore(t_game const * game) -{ - ASSERT(game,0); - return gameflag_get_hardcore(game->gameflag); -} - -extern unsigned int game_get_gameflag_difficulty(t_game const * game) -{ - ASSERT(game,0); - return gameflag_get_difficulty(game->gameflag); -} - -extern int game_set_gameflag_expansion(t_game * game, unsigned int expansion) -{ - ASSERT(game,-1); - gameflag_set_expansion(game->gameflag,expansion); - return 0; -} - -extern int game_set_gameflag_hardcore(t_game * game, unsigned int hardcore) -{ - ASSERT(game,-1); - gameflag_set_hardcore(game->gameflag,hardcore); - return 0; -} - -extern int game_set_gameflag_difficulty(t_game * game, unsigned int difficulty) -{ - ASSERT(game,-1); - gameflag_set_difficulty(game->gameflag,difficulty); - return 0; -} - -extern unsigned int game_get_created(t_game const * game) -{ - ASSERT(game,0); - return game->created; -} - -extern int game_set_created(t_game * game, unsigned int created) -{ - ASSERT(game,-1); - game->created=created; - return 0; -} - -extern unsigned int game_get_maxchar(t_game const * game) -{ - ASSERT(game,0); - return game->maxchar; -} - -extern int game_set_maxchar(t_game * game, unsigned int maxchar) -{ - ASSERT(game,-1); - game->maxchar=maxchar; - return 0; -} - -extern unsigned int game_get_currchar(t_game const * game) -{ - ASSERT(game,0); - return game->currchar; -} - -extern char const * d2cs_game_get_name(t_game const * game) -{ - ASSERT(game,NULL); - return game->name; -} - -extern char const * game_get_desc(t_game const * game) -{ - ASSERT(game,NULL); - return game->desc; -} - -extern char const * d2cs_game_get_pass(t_game const * game) -{ - ASSERT(game,NULL); - return game->pass; -} - -extern unsigned int game_get_gameflag(t_game const * game) -{ - ASSERT(game,0); - return game->gameflag; -} - -extern int d2cs_game_get_create_time(t_game const * game) -{ - ASSERT(game,-1); - return game->create_time; -} - -extern int game_set_create_time(t_game * game, int create_time) -{ - ASSERT(game,-1); - game->create_time=create_time; - return 0; -} - -extern t_list * game_get_charlist(t_game const * game) -{ - ASSERT(game,NULL); - return game->charlist; -} - -extern unsigned int gamelist_get_totalgame(void) -{ - return total_game; -} diff --git a/d2pack109/src/d2cs/game.h b/d2pack109/src/d2cs/game.h deleted file mode 100644 index 0cbd703..0000000 --- a/d2pack109/src/d2cs/game.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_GAME_H -#define INCLUDED_GAME_H - -#include "d2gs.h" -#include "connection.h" - -typedef struct -{ - unsigned char class; - unsigned char level; - char const * charname; -} t_game_charinfo; - -typedef struct -{ - unsigned int id; - char const * name; - char const * pass; - char const * desc; - int create_time; - int lastaccess_time; - unsigned int created; - unsigned int gameflag; - unsigned int charlevel; - unsigned int leveldiff; - unsigned int d2gs_gameid; - unsigned int maxchar; - unsigned int currchar; - t_list * charlist; - t_d2gs * d2gs; -} t_game; - -#define gameflag_get_difficulty(gameflag) ( (gameflag >> 0x0C) & 0x07 ) -#define gameflag_get_expansion(gameflag) tf( gameflag & 0x100000 ) -#define gameflag_get_hardcore(gameflag) tf( gameflag & 0x800 ) - -#define gameflag_set_difficulty(gameflag,n) ( gameflag |= ((n & 0x07) << 0x0C) ) -#define gameflag_set_expansion(gameflag,n) ( gameflag |= (n ? 0x100000 : 0)) -#define gameflag_set_hardcore(gameflag,n) ( gameflag |= (n ? 0x800 : 0)) - -#define gameflag_create(e,h,d) (0x04|(e?0x100000:0) | (h?0x800:0) | ((d & 0x07) << 0x0c)) - - -extern t_list * d2cs_gamelist(void); -extern int d2cs_gamelist_destroy(void); -extern int d2cs_gamelist_create(void); -extern t_game * d2cs_gamelist_find_game(char const * gamename); -extern t_game * gamelist_find_game_by_id(unsigned int id); -extern t_game * gamelist_find_game_by_d2gs_and_id(unsigned int d2gs_id, unsigned int d2gs_gameid); -extern void d2cs_gamelist_check_voidgame(void); -extern t_game * d2cs_game_create(char const * gamename, char const * gamepass, char const * gamedesc, - unsigned int gameflag); -extern int game_destroy(t_game * game, t_elem ** elem); -extern int game_add_character(t_game * game, char const * charname, - unsigned char class, unsigned char level); -extern int game_del_character(t_game * game, char const * charname); - -extern t_d2gs * game_get_d2gs(t_game const * game); -extern int game_set_d2gs(t_game * game, t_d2gs * gs); -extern int game_set_d2gs_gameid(t_game * game, unsigned int gameid); -extern unsigned int game_get_d2gs_gameid(t_game const * game); -extern int game_set_id(t_game * game, unsigned int id); -extern unsigned int d2cs_game_get_id(t_game const * game); -extern int game_set_created(t_game * game, unsigned int created); -extern unsigned int game_get_created(t_game const * game); -extern int game_set_leveldiff(t_game * game, unsigned int leveldiff); -extern int game_set_charlevel(t_game * game, unsigned int charlevel); -extern unsigned int game_get_charlevel(t_game const * game); -extern unsigned int game_get_leveldiff(t_game const * game); -extern unsigned int game_get_maxlevel(t_game const * game); -extern unsigned int game_get_minlevel(t_game const * game); -extern int game_set_gameflag_expansion(t_game * game, unsigned int hardcore); -extern int game_set_gameflag_hardcore(t_game * game, unsigned int hardcore); -extern int game_set_gameflag_difficulty(t_game * game, unsigned int hardcore); -extern unsigned int game_get_gameflag_expansion(t_game const * game); -extern unsigned int game_get_gameflag_hardcore(t_game const * game); -extern unsigned int game_get_gameflag_difficulty(t_game const * game); -extern int game_set_maxchar(t_game * game, unsigned int maxchar); -extern unsigned int game_get_maxchar(t_game const * game); -extern unsigned int game_get_currchar(t_game const * game); -extern char const * d2cs_game_get_name(t_game const * game); -extern char const * d2cs_game_get_pass(t_game const * game); -extern char const * game_get_desc(t_game const * game); -extern unsigned int game_get_gameflag(t_game const * game); -extern int d2cs_game_get_create_time(t_game const * game); -extern int game_set_create_time(t_game * game,int create_time); -extern t_list * game_get_charlist(t_game const * game); -extern t_game * gamelist_find_character(char const * charname); -extern unsigned int gamelist_get_totalgame(void); -extern t_elem const * gamelist_get_curr_elem(void); -extern void gamelist_set_curr_elem(t_elem const * elem); - -#endif diff --git a/d2pack109/src/d2cs/gamequeue.c b/d2pack109/src/d2cs/gamequeue.c deleted file mode 100644 index dec7ed7..0000000 --- a/d2pack109/src/d2cs/gamequeue.c +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strcasecmp.h" - -#include "connection.h" -#include "gamequeue.h" -#include "handle_d2cs.h" -#include "common/packet.h" -#include "common/list.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static t_list * gqlist_head=NULL; -static unsigned int gqlist_seqno=0; - -extern t_list * gqlist(void) -{ - return gqlist_head; -} - -extern int gqlist_create(void) -{ - gqlist_head=list_create(); - return 0; -} - -extern int gqlist_destroy(void) -{ - t_gq * gq; - - BEGIN_LIST_TRAVERSE_DATA(gqlist_head,gq) - { - gq_destroy(gq,(t_elem **)curr_elem_); - } - END_LIST_TRAVERSE_DATA() - - if (list_destroy(gqlist_head)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error destroy game queue list"); - return -1; - } - gqlist_head=NULL; - return 0; -} - -extern t_gq * gq_create(unsigned int clientid, t_packet * packet, char const * gamename) -{ - t_gq * gq; - - gq=xmalloc(sizeof(t_gq)); - gq->seqno=++gqlist_seqno; - gq->clientid=clientid; - gq->packet=packet; - strncpy(gq->gamename, gamename, MAX_GAMENAME_LEN); - if (packet) packet_add_ref(packet); - list_append_data(gqlist_head,gq); - return gq; -} - -extern int gq_destroy(t_gq * gq, t_elem ** elem) -{ - ASSERT(gq,-1); - if (list_remove_data(gqlist_head,gq,elem)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error remove game queue from list"); - return -1; - } - if (gq->packet) packet_del_ref(gq->packet); - xfree(gq); - return 0; -} - -extern unsigned int gq_get_clientid(t_gq const * gq) -{ - ASSERT(gq,0); - return gq->clientid; -} - -extern int gqlist_check_creategame(void) -{ - t_connection * c; - t_gq * gq; - - BEGIN_LIST_TRAVERSE_DATA(gqlist_head,gq) - { - c=d2cs_connlist_find_connection_by_sessionnum(gq->clientid); - if (!c) { - eventlog(eventlog_level_error,__FUNCTION__,"client %d not found (gamename: %s)",gq->clientid,gq->gamename); - gq_destroy(gq,&curr_elem_); - continue; - } else if (!conn_get_gamequeue(c)) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL game queue for client %s",d2cs_conn_get_account(c)); - gq_destroy(gq,&curr_elem_); - continue; - } else { - eventlog(eventlog_level_info,__FUNCTION__,"try create game %s for account %s",gq->gamename,d2cs_conn_get_account(c)); - d2cs_handle_client_creategame(c,gq->packet); - conn_set_gamequeue(c,NULL); - gq_destroy(gq,&curr_elem_); - break; - } - } - END_LIST_TRAVERSE_DATA() - return 0; -} - -extern int gqlist_update_all_clients(void) -{ - t_connection * c; - t_gq * gq; - unsigned int n; - - n=0; - BEGIN_LIST_TRAVERSE_DATA(gqlist_head,gq) - { - c=d2cs_connlist_find_connection_by_sessionnum(gq->clientid); - if (!c) { - eventlog(eventlog_level_error,__FUNCTION__,"client %d not found (gamename: %s)",gq->clientid,gq->gamename); - gq_destroy(gq,&curr_elem_); - continue; - } else { - n++; - eventlog(eventlog_level_debug,__FUNCTION__,"update client %s position to %d",d2cs_conn_get_account(c),n); - d2cs_send_client_creategamewait(c,n); - } - } - END_LIST_TRAVERSE_DATA() - if (n) eventlog(eventlog_level_info,__FUNCTION__,"total %d game queues",n); - return 0; -} - -extern unsigned int gqlist_get_gq_position(t_gq * gq) -{ - t_gq * tmp; - unsigned int pos; - - pos=0; - BEGIN_LIST_TRAVERSE_DATA(gqlist_head,tmp) - { - pos++; - if (tmp==gq) return pos; - } - END_LIST_TRAVERSE_DATA() - return 0; -} - -extern unsigned int gqlist_get_length(void) -{ - return list_get_length(gqlist_head); -} - -extern t_gq * gqlist_find_game(char const * gamename) -{ - t_gq * gq; - - BEGIN_LIST_TRAVERSE_DATA(gqlist_head,gq) - { - if (!strcasecmp(gq->gamename,gamename)) return gq; - } - END_LIST_TRAVERSE_DATA() - return NULL; -} diff --git a/d2pack109/src/d2cs/gamequeue.h b/d2pack109/src/d2cs/gamequeue.h deleted file mode 100644 index 95166f6..0000000 --- a/d2pack109/src/d2cs/gamequeue.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_GAMEQUEUE_H -#define INCLUDED_GAMEQUEUE_H - -#include "common/packet.h" -#include "common/list.h" - -typedef struct -{ - unsigned int seqno; - unsigned int clientid; - t_packet * packet; - char gamename[MAX_GAMENAME_LEN]; -} t_gq; - -extern unsigned int gq_get_clientid(t_gq const * gq); -extern int gq_destroy(t_gq * gq, t_elem ** elem); -extern t_gq * gq_create(unsigned int clientid, t_packet * packet, char const * gamename); -extern int gqlist_destroy(void); -extern int gqlist_create(void); -extern t_list * gqlist(void); -extern unsigned int gqlist_get_gq_position(t_gq * gq); -extern int gqlist_update_all_clients(void); -extern int gqlist_check_creategame(void); -extern t_gq * gqlist_find_game(char const * gamename); -extern unsigned int gqlist_get_length(void); - -#endif diff --git a/d2pack109/src/d2cs/handle_bnetd.c b/d2pack109/src/d2cs/handle_bnetd.c deleted file mode 100644 index 87edc1c..0000000 --- a/d2pack109/src/d2cs/handle_bnetd.c +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif - -#include "connection.h" -#include "handle_bnetd.h" -#include "serverqueue.h" -#include "d2cs_bnetd_protocol.h" -#include "d2cs_protocol.h" -#include "version.h" -#include "prefs.h" -#include "game.h" -#include "common/init_protocol.h" -#include "common/packet.h" -#include "common/eventlog.h" -#include "common/setup_after.h" - -DECLARE_PACKET_HANDLER(on_bnetd_accountloginreply) -DECLARE_PACKET_HANDLER(on_bnetd_charloginreply) -DECLARE_PACKET_HANDLER(on_bnetd_authreq) -DECLARE_PACKET_HANDLER(on_bnetd_authreply) -DECLARE_PACKET_HANDLER(on_bnetd_gameinforeq) - -static t_packet_handle_table bnetd_packet_handle_table[]={ -/* 0x00 */ { 0, conn_state_none, NULL }, -/* 0x01 */ { sizeof(t_bnetd_d2cs_authreq), conn_state_connected, on_bnetd_authreq }, -/* 0x02 */ { sizeof(t_bnetd_d2cs_authreply), conn_state_connected, on_bnetd_authreply }, -/* 0x03 */ { 0, conn_state_none, NULL }, -/* 0x04 */ { 0, conn_state_none, NULL }, -/* 0x05 */ { 0, conn_state_none, NULL }, -/* 0x06 */ { 0, conn_state_none, NULL }, -/* 0x07 */ { 0, conn_state_none, NULL }, -/* 0x08 */ { 0, conn_state_none, NULL }, -/* 0x09 */ { 0, conn_state_none, NULL }, -/* 0x0a */ { 0, conn_state_none, NULL }, -/* 0x0b */ { 0, conn_state_none, NULL }, -/* 0x0c */ { 0, conn_state_none, NULL }, -/* 0x0d */ { 0, conn_state_none, NULL }, -/* 0x03 */ { 0, conn_state_none, NULL }, -/* 0x0f */ { 0, conn_state_none, NULL }, -/* 0x10 */ { sizeof(t_bnetd_d2cs_accountloginreply), conn_state_authed, on_bnetd_accountloginreply }, -/* 0x11 */ { sizeof(t_bnetd_d2cs_charloginreply), conn_state_authed, on_bnetd_charloginreply }, -/* 0x12 */ { sizeof(t_bnetd_d2cs_gameinforeq), conn_state_authed, on_bnetd_gameinforeq } -}; - -extern int handle_bnetd_packet(t_connection * c, t_packet * packet) -{ - conn_process_packet(c,packet,bnetd_packet_handle_table,NELEMS(bnetd_packet_handle_table)); - return 0; -} - -extern int handle_bnetd_init(t_connection * c) -{ - t_packet * packet; - - packet=packet_create(packet_class_init); - packet_set_size(packet,sizeof(t_client_initconn)); - bn_byte_set(&packet->u.client_initconn.class, CLIENT_INITCONN_CLASS_D2CS_BNETD); - conn_push_outqueue(c,packet); - packet_del_ref(packet); - d2cs_conn_set_state(c,conn_state_connected); - eventlog(eventlog_level_info,__FUNCTION__,"sent init class packet to bnetd"); - return 0; -} - -static int on_bnetd_authreq(t_connection * c, t_packet * packet) -{ - t_packet * rpacket; - unsigned int sessionnum; - - sessionnum=bn_int_get(packet->u.bnetd_d2cs_authreq.sessionnum); - eventlog(eventlog_level_info,__FUNCTION__,"received bnetd sessionnum %d",sessionnum); - if ((rpacket=packet_create(packet_class_d2cs_bnetd))) { - packet_set_size(rpacket,sizeof(t_d2cs_bnetd_authreply)); - packet_set_type(rpacket,D2CS_BNETD_AUTHREPLY); - bn_int_set(&rpacket->u.d2cs_bnetd_authreply.h.seqno,1); - bn_int_set(&rpacket->u.d2cs_bnetd_authreply.version,D2CS_VERSION_NUMBER); - packet_append_string(rpacket,prefs_get_realmname()); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - return 0; -} - -static int on_bnetd_authreply(t_connection * c, t_packet * packet) -{ - unsigned int reply; - - reply=bn_int_get(packet->u.bnetd_d2cs_authreply.reply); - if (reply == BNETD_D2CS_AUTHREPLY_SUCCEED) { - eventlog(eventlog_level_info,__FUNCTION__,"authed by bnetd"); - d2cs_conn_set_state(c,conn_state_authed); - } else { - eventlog(eventlog_level_error,__FUNCTION__,"failed to auth by bnetd (error=%d)",reply); - d2cs_conn_set_state(c,conn_state_destroy); - } - return 0; -} - -static int on_bnetd_accountloginreply(t_connection * c, t_packet * packet) -{ - unsigned int seqno; - t_sq * sq; - t_packet * opacket, * rpacket; - t_connection * client; - int result, reply; - char const * account; - t_elem * elem; - - if (!packet || !c) - return -1; - - seqno=bn_int_get(packet->u.d2cs_bnetd.h.seqno); - if (!(sq=sqlist_find_sq(seqno))) { - eventlog(eventlog_level_error,__FUNCTION__,"seqno %d not found",seqno); - return -1; - } - if (!(client=d2cs_connlist_find_connection_by_sessionnum(sq_get_clientid(sq)))) { - eventlog(eventlog_level_error,__FUNCTION__,"client %d not found",sq_get_clientid(sq)); - sq_destroy(sq,&elem); - return -1; - } - if (!(opacket=sq_get_packet(sq))) { - eventlog(eventlog_level_error,__FUNCTION__,"previous packet missing (seqno: %d)",seqno); - sq_destroy(sq,&elem); - return -1; - } - result=bn_int_get(packet->u.bnetd_d2cs_accountloginreply.reply); - if (result==BNETD_D2CS_CHARLOGINREPLY_SUCCEED) { - reply=D2CS_CLIENT_LOGINREPLY_SUCCEED; - account=packet_get_str_const(opacket,sizeof(t_client_d2cs_loginreq),MAX_CHARNAME_LEN); - d2cs_conn_set_account(client,account); - d2cs_conn_set_state(client,conn_state_authed); - eventlog(eventlog_level_info,__FUNCTION__,"account %s authed",account); - } else { - eventlog(eventlog_level_warn,__FUNCTION__,"client %d login request was rejected by bnetd",sq_get_clientid(sq)); - reply=D2CS_CLIENT_LOGINREPLY_BADPASS; - } - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_loginreply)); - packet_set_type(rpacket,D2CS_CLIENT_LOGINREPLY); - bn_int_set(&rpacket->u.d2cs_client_loginreply.reply,reply); - conn_push_outqueue(client,rpacket); - packet_del_ref(rpacket); - } - sq_destroy(sq,&elem); - return 0; -} - -static int on_bnetd_charloginreply(t_connection * c, t_packet * packet) -{ - unsigned int seqno; - t_sq * sq; - t_connection * client; - t_packet * opacket, * rpacket; - int result, reply, type; - char const * charname; - t_elem * elem; - - if (!packet || !c) - return -1; - - seqno=bn_int_get(packet->u.d2cs_bnetd.h.seqno); - if (!(sq=sqlist_find_sq(seqno))) { - eventlog(eventlog_level_error,__FUNCTION__,"seqno %d not found",seqno); - return -1; - } - if (!(client=d2cs_connlist_find_connection_by_sessionnum(sq_get_clientid(sq)))) { - eventlog(eventlog_level_error,__FUNCTION__,"client %d not found",sq_get_clientid(sq)); - sq_destroy(sq,&elem); - return -1; - } - if (!(opacket=sq_get_packet(sq))) { - eventlog(eventlog_level_error,__FUNCTION__,"previous packet missing (seqno: %d)",seqno); - sq_destroy(sq,&elem); - return -1; - } - type=packet_get_type(opacket); - result=bn_int_get(packet->u.bnetd_d2cs_charloginreply.reply); - if (type==CLIENT_D2CS_CREATECHARREQ) { - charname=packet_get_str_const(opacket,sizeof(t_client_d2cs_createcharreq),MAX_CHARNAME_LEN); - if (result==BNETD_D2CS_CHARLOGINREPLY_SUCCEED) { - if (conn_check_multilogin(client,charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"character %s is already logged in",charname); - reply = D2CS_CLIENT_CHARLOGINREPLY_FAILED; - } else { - reply= D2CS_CLIENT_CREATECHARREPLY_SUCCEED; - eventlog(eventlog_level_info,__FUNCTION__,"character %s authed",charname); - d2cs_conn_set_charname(client,charname); - d2cs_conn_set_state(client,conn_state_char_authed); - } - } else { - reply = D2CS_CLIENT_CREATECHARREPLY_FAILED; - eventlog(eventlog_level_error,__FUNCTION__,"failed to auth character %s",charname); - } - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_createcharreply)); - packet_set_type(rpacket,D2CS_CLIENT_CREATECHARREPLY); - bn_int_set(&rpacket->u.d2cs_client_createcharreply.reply,reply); - conn_push_outqueue(client,rpacket); - packet_del_ref(rpacket); - } - } else if (type==CLIENT_D2CS_CHARLOGINREQ) { - charname=packet_get_str_const(opacket,sizeof(t_client_d2cs_charloginreq),MAX_CHARNAME_LEN); - if (result==BNETD_D2CS_CHARLOGINREPLY_SUCCEED) { - if (conn_check_multilogin(client,charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"character %s is already logged in",charname); - reply = D2CS_CLIENT_CHARLOGINREPLY_FAILED; - } else { - reply = D2CS_CLIENT_CHARLOGINREPLY_SUCCEED; - eventlog(eventlog_level_info,__FUNCTION__,"character %s authed",charname); - d2cs_conn_set_charname(client,charname); - d2cs_conn_set_state(client,conn_state_char_authed); - } - } else { - reply = D2CS_CLIENT_CHARLOGINREPLY_FAILED; - eventlog(eventlog_level_error,__FUNCTION__,"failed to auth character %s",charname); - } - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_charloginreply)); - packet_set_type(rpacket,D2CS_CLIENT_CHARLOGINREPLY); - bn_int_set(&rpacket->u.d2cs_client_charloginreply.reply,reply); - conn_push_outqueue(client,rpacket); - packet_del_ref(rpacket); - } - } else { - eventlog(eventlog_level_error,__FUNCTION__,"got bad packet type %d",type); - sq_destroy(sq,&elem); - return -1; - } - sq_destroy(sq,&elem); - return 0; -} - -int on_bnetd_gameinforeq(t_connection * c, t_packet * packet) -{ - t_packet * rpacket; - t_game * game; - - char const * gamename; - - if (!(c)) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL connection"); - return -1; - } - - if (!(gamename = packet_get_str_const(packet,sizeof(t_bnetd_d2cs_gameinforeq),GAME_NAME_LEN))) - { - eventlog(eventlog_level_error,__FUNCTION__,"missing or too long gamename"); - return -1; - } - - if (!(game = d2cs_gamelist_find_game(gamename))) - { - eventlog(eventlog_level_error,__FUNCTION__,"request for unknown game \"%s\"",gamename); - return -1; - } - - if ((rpacket=packet_create(packet_class_d2cs_bnetd))) { - packet_set_size(rpacket, sizeof(t_d2cs_bnetd_gameinforeply)); - packet_set_type(rpacket, D2CS_BNETD_GAMEINFOREPLY); - bn_int_set(&rpacket->u.d2cs_bnetd_gameinforeply.h.seqno,0); - packet_append_string(rpacket, gamename); - - bn_byte_set(&rpacket->u.d2cs_bnetd_gameinforeply.difficulty, game_get_gameflag_difficulty(game)); - - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - return 0; -} - diff --git a/d2pack109/src/d2cs/handle_bnetd.h b/d2pack109/src/d2cs/handle_bnetd.h deleted file mode 100644 index 75a9f5b..0000000 --- a/d2pack109/src/d2cs/handle_bnetd.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_HANDLE_BNETD_H -#define INCLUDED_HANDLE_BNETD_H - -#include "connection.h" -#include "common/packet.h" - -extern int handle_bnetd_packet(t_connection * c, t_packet * packet); -extern int handle_bnetd_init(t_connection * c); - -#endif diff --git a/d2pack109/src/d2cs/handle_d2cs.c b/d2pack109/src/d2cs/handle_d2cs.c deleted file mode 100644 index df726d6..0000000 --- a/d2pack109/src/d2cs/handle_d2cs.c +++ /dev/null @@ -1,984 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * Copyright (C) 2004 Olaf Freyer (aaron@cs.tu-berlin.de) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include "compat/memcpy.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif - -#include "compat/pdir.h" -#include "compat/mkdir.h" -#include "d2charfile.h" -#include "connection.h" -#include "game.h" -#include "bnetd.h" -#include "d2cs_protocol.h" -#include "d2cs_bnetd_protocol.h" -#include "handle_d2cs.h" -#include "d2ladder.h" -#include "gamequeue.h" -#include "serverqueue.h" -#include "prefs.h" -#include "common/bn_type.h" -#include "common/queue.h" -#include "common/packet.h" -#include "common/eventlog.h" -#include "d2charlist.h" -#include "common/elist.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - - -static int d2cs_send_client_ladder(t_connection * c, unsigned char type, unsigned short from); -static unsigned int d2cs_try_joingame(t_connection const * c, t_game const * game, char const * gamepass); - -DECLARE_PACKET_HANDLER(on_client_loginreq) -DECLARE_PACKET_HANDLER(on_client_createcharreq) -DECLARE_PACKET_HANDLER(on_client_creategamereq) -DECLARE_PACKET_HANDLER(on_client_joingamereq) -DECLARE_PACKET_HANDLER(on_client_gamelistreq) -DECLARE_PACKET_HANDLER(on_client_gameinforeq) -DECLARE_PACKET_HANDLER(on_client_charloginreq) -DECLARE_PACKET_HANDLER(on_client_deletecharreq) -DECLARE_PACKET_HANDLER(on_client_ladderreq) -DECLARE_PACKET_HANDLER(on_client_motdreq) -DECLARE_PACKET_HANDLER(on_client_cancelcreategame) -DECLARE_PACKET_HANDLER(on_client_charladderreq) -DECLARE_PACKET_HANDLER(on_client_charlistreq) -DECLARE_PACKET_HANDLER(on_client_convertcharreq) - - -static t_packet_handle_table d2cs_packet_handle_table[]={ -/* 0x00 */ { 0, conn_state_none, NULL }, -/* 0x01 */ { sizeof(t_client_d2cs_loginreq), conn_state_connected, on_client_loginreq }, -/* 0x02 */ { sizeof(t_client_d2cs_createcharreq), conn_state_authed|conn_state_char_authed, on_client_createcharreq }, -/* 0x03 */ { sizeof(t_client_d2cs_creategamereq), conn_state_char_authed, on_client_creategamereq }, -/* 0x04 */ { sizeof(t_client_d2cs_joingamereq), conn_state_char_authed, on_client_joingamereq }, -/* 0x05 */ { sizeof(t_client_d2cs_gamelistreq), conn_state_char_authed, on_client_gamelistreq }, -/* 0x06 */ { sizeof(t_client_d2cs_gameinforeq), conn_state_char_authed, on_client_gameinforeq }, -/* 0x07 */ { sizeof(t_client_d2cs_charloginreq), conn_state_authed|conn_state_char_authed, on_client_charloginreq }, -/* 0x08 */ { 0, conn_state_none, NULL }, -/* 0x09 */ { 0, conn_state_none, NULL }, -/* 0x0a */ { sizeof(t_client_d2cs_deletecharreq), conn_state_authed|conn_state_char_authed, on_client_deletecharreq }, -/* 0x0b */ { 0, conn_state_none, NULL }, -/* 0x0c */ { 0, conn_state_none, NULL }, -/* 0x0d */ { 0, conn_state_none, NULL }, -/* 0x0e */ { 0, conn_state_none, NULL }, -/* 0x0f */ { 0, conn_state_none, NULL }, -/* 0x10 */ { 0, conn_state_none, NULL }, -/* 0x11 */ { sizeof(t_client_d2cs_ladderreq), conn_state_char_authed, on_client_ladderreq }, -/* 0x12 */ { sizeof(t_client_d2cs_motdreq), conn_state_char_authed, on_client_motdreq }, -/* 0x13 */ { sizeof(t_client_d2cs_cancelcreategame),conn_state_char_authed, on_client_cancelcreategame}, -/* 0x14 */ { 0, conn_state_none, NULL }, -/* 0x15 */ { 0, conn_state_none, NULL }, -/* 0x16 */ { sizeof(t_client_d2cs_charladderreq), conn_state_char_authed, on_client_charladderreq }, -/* 0x17 */ { sizeof(t_client_d2cs_charlistreq), conn_state_authed|conn_state_char_authed, on_client_charlistreq }, -/* 0x18 */ { sizeof(t_client_d2cs_convertcharreq), conn_state_authed|conn_state_char_authed, on_client_convertcharreq } -}; - - -extern int d2cs_handle_d2cs_packet(t_connection * c, t_packet * packet) -{ - return conn_process_packet(c,packet,d2cs_packet_handle_table,NELEMS(d2cs_packet_handle_table)); -} - -static int on_client_loginreq(t_connection * c, t_packet * packet) -{ - t_packet * bnpacket; - char const * account; - t_sq * sq; - unsigned int sessionnum; - - if (!(account=packet_get_str_const(packet,sizeof(t_client_d2cs_loginreq),MAX_CHARNAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad account name"); - return -1; - } - if (d2char_check_acctname(account)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad account name"); - return -1; - } - if (!bnetd_conn()) { - eventlog(eventlog_level_warn,__FUNCTION__,"d2cs is offline with bnetd, login request will be rejected"); - return -1; - } - sessionnum=bn_int_get(packet->u.client_d2cs_loginreq.sessionnum); - conn_set_bnetd_sessionnum(c,sessionnum); - eventlog(eventlog_level_info,__FUNCTION__,"got client (*%s) login request sessionnum=0x%X",account,sessionnum); - if ((bnpacket=packet_create(packet_class_d2cs_bnetd))) { - if ((sq=sq_create(d2cs_conn_get_sessionnum(c),packet,0))) { - packet_set_size(bnpacket,sizeof(t_d2cs_bnetd_accountloginreq)); - packet_set_type(bnpacket,D2CS_BNETD_ACCOUNTLOGINREQ); - bn_int_set(&bnpacket->u.d2cs_bnetd_accountloginreq.h.seqno,sq_get_seqno(sq)); - bn_int_set(&bnpacket->u.d2cs_bnetd_accountloginreq.seqno, - bn_int_get(packet->u.client_d2cs_loginreq.seqno)); - bn_int_set(&bnpacket->u.d2cs_bnetd_accountloginreq.sessionkey, - bn_int_get(packet->u.client_d2cs_loginreq.sessionkey)); - bn_int_set(&bnpacket->u.d2cs_bnetd_accountloginreq.sessionnum,sessionnum); - memcpy(bnpacket->u.d2cs_bnetd_accountloginreq.secret_hash, - packet->u.client_d2cs_loginreq.secret_hash, - sizeof(bnpacket->u.d2cs_bnetd_accountloginreq.secret_hash)); - packet_append_string(bnpacket,account); - conn_push_outqueue(bnetd_conn(),bnpacket); - } - packet_del_ref(bnpacket); - } - return 0; -} - -static int on_client_createcharreq(t_connection * c, t_packet * packet) -{ - t_packet * rpacket, * bnpacket; - char const * charname; - char const * account; - char * path; - t_pdir * dir; - t_sq * sq; - unsigned int reply; - unsigned short status, class; - t_d2charinfo_file data; - - if (!(charname=packet_get_str_const(packet,sizeof(t_client_d2cs_createcharreq),MAX_CHARNAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad character name"); - return -1; - } - if (!(account=d2cs_conn_get_account(c))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing account for character %s",charname); - return -1; - } - class=bn_short_get(packet->u.client_d2cs_createcharreq.class); - status=bn_short_get(packet->u.client_d2cs_createcharreq.status); - - path=xmalloc(strlen(prefs_get_charinfo_dir())+1+strlen(account)+1); - d2char_get_infodir_name(path,account); - if (!(dir=p_opendir(path))) { - eventlog(eventlog_level_info,__FUNCTION__,"(*%s) charinfo directory do not exist, building it",account); - p_mkdir(path,S_IRWXU); - } else p_closedir(dir); - xfree(path); - - if (d2char_create(account,charname,class,status)<0) { - eventlog(eventlog_level_warn,__FUNCTION__,"error create character %s for account %s",charname,account); - reply=D2CS_CLIENT_CREATECHARREPLY_ALREADY_EXIST; - } else if (d2charinfo_load(account,charname,&data)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error loading charinfo for character %s(*%s)",charname,account); - reply=D2CS_CLIENT_CREATECHARREPLY_FAILED; - } else { - eventlog(eventlog_level_info,__FUNCTION__,"character %s(*%s) created",charname,account); - reply=D2CS_CLIENT_CREATECHARREPLY_SUCCEED; - conn_set_charinfo(c,&data.summary); - if ((bnpacket=packet_create(packet_class_d2cs_bnetd))) { - if ((sq=sq_create(d2cs_conn_get_sessionnum(c),packet,0))) { - packet_set_size(bnpacket,sizeof(t_d2cs_bnetd_charloginreq)); - packet_set_type(bnpacket,D2CS_BNETD_CHARLOGINREQ); - bn_int_set(&bnpacket->u.d2cs_bnetd_charloginreq.h.seqno,sq_get_seqno(sq)); - bn_int_set(&bnpacket->u.d2cs_bnetd_charloginreq.sessionnum, - conn_get_bnetd_sessionnum(c)); - packet_append_string(bnpacket,charname); - packet_append_string(bnpacket,(char const *)&data.portrait); - conn_push_outqueue(bnetd_conn(),bnpacket); - } - packet_del_ref(bnpacket); - } - return 0; - } - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_createcharreply)); - packet_set_type(rpacket,D2CS_CLIENT_CREATECHARREPLY); - bn_int_set(&rpacket->u.d2cs_client_createcharreply.reply,reply); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - return 0; -} - -static int on_client_creategamereq(t_connection * c, t_packet * packet) -{ - char const * gamename; - char const * gamepass; - char const * gamedesc; - t_game * game; - t_d2gs * gs; - t_gq * gq; - unsigned int tempflag,gameflag; - unsigned int leveldiff, maxchar, difficulty, expansion, hardcore; - unsigned int seqno, reply; - unsigned int pos; - t_elem * elem; - - pos=sizeof(t_client_d2cs_creategamereq); - if (!(gamename=packet_get_str_const(packet,pos,MAX_GAMENAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad game name"); - return -1; - } - pos+=strlen(gamename)+1; - if (!(gamepass=packet_get_str_const(packet,pos,MAX_GAMEPASS_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad game pass"); - return -1; - } - pos+=strlen(gamepass)+1; - if (!(gamedesc=packet_get_str_const(packet,pos,MAX_GAMEDESC_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad game desc"); - return -1; - } - tempflag=bn_int_get(packet->u.client_d2cs_creategamereq.gameflag); - leveldiff=bn_byte_get(packet->u.client_d2cs_creategamereq.leveldiff); - maxchar=bn_byte_get(packet->u.client_d2cs_creategamereq.maxchar); - difficulty=gameflag_get_difficulty(tempflag); - if (difficulty > conn_get_charinfo_difficulty(c)) { - eventlog(eventlog_level_error,__FUNCTION__,"game difficulty exceed character limit %d %d",difficulty, - conn_get_charinfo_difficulty(c)); - return 0; - } - expansion=conn_get_charinfo_expansion(c); - hardcore=conn_get_charinfo_hardcore(c); - gameflag=gameflag_create(expansion,hardcore,difficulty); - - gs = NULL; - game = NULL; - gq=conn_get_gamequeue(c); - if (d2cs_gamelist_find_game(gamename)) { - eventlog(eventlog_level_info,__FUNCTION__,"game name %s is already exist in gamelist",gamename); - reply=D2CS_CLIENT_CREATEGAMEREPLY_NAME_EXIST; - } else if (!gq && gqlist_find_game(gamename)) { - eventlog(eventlog_level_info,__FUNCTION__,"game name %s is already exist in game queue",gamename); - reply=D2CS_CLIENT_CREATEGAMEREPLY_NAME_EXIST; - } else if (!(gs=d2gslist_choose_server())) { - if (gq) { - eventlog(eventlog_level_error,__FUNCTION__,"client %d is already in game queue",d2cs_conn_get_sessionnum(c)); - conn_set_gamequeue(c,NULL); - gq_destroy(gq,&elem); - return 0; - } else if ((gq=gq_create(d2cs_conn_get_sessionnum(c), packet, gamename))) { - conn_set_gamequeue(c,gq); - d2cs_send_client_creategamewait(c,gqlist_get_length()); - return 0; - } - reply=D2CS_CLIENT_CREATEGAMEREPLY_FAILED; - } else if (hardcore && conn_get_charinfo_dead(c)) { - reply=D2CS_CLIENT_CREATEGAMEREPLY_FAILED; - } else if (!(game=d2cs_game_create(gamename,gamepass,gamedesc,gameflag))) { - reply=D2CS_CLIENT_CREATEGAMEREPLY_NAME_EXIST; - } else { - reply=D2CS_CLIENT_CREATEGAMEREPLY_SUCCEED; - game_set_d2gs(game,gs); - d2gs_add_gamenum(gs, 1); - game_set_gameflag_expansion(game,expansion); - game_set_created(game,0); - game_set_leveldiff(game,leveldiff); - game_set_charlevel(game,conn_get_charinfo_level(c)); - game_set_maxchar(game,maxchar); - game_set_gameflag_difficulty(game,difficulty); - game_set_gameflag_hardcore(game,hardcore); - } - - seqno=bn_short_get(packet->u.client_d2cs_creategamereq.seqno); - if (reply!=D2CS_CLIENT_CREATEGAMEREPLY_SUCCEED) { - t_packet * rpacket; - - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_creategamereply)); - packet_set_type(rpacket,D2CS_CLIENT_CREATEGAMEREPLY); - bn_short_set(&rpacket->u.d2cs_client_creategamereply.seqno,seqno); - bn_short_set(&rpacket->u.d2cs_client_creategamereply.u1,0); - bn_short_set(&rpacket->u.d2cs_client_creategamereply.gameid,0); - bn_int_set(&rpacket->u.d2cs_client_creategamereply.reply,reply); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - } else { - t_packet * gspacket; - t_sq * sq; - - if ((gspacket=packet_create(packet_class_d2gs))) { - if ((sq=sq_create(d2cs_conn_get_sessionnum(c),packet,d2cs_game_get_id(game)))) { - packet_set_size(gspacket,sizeof(t_d2cs_d2gs_creategamereq)); - packet_set_type(gspacket,D2CS_D2GS_CREATEGAMEREQ); - bn_int_set(&gspacket->u.d2cs_d2gs_creategamereq.h.seqno,sq_get_seqno(sq)); - bn_byte_set(&gspacket->u.d2cs_d2gs_creategamereq.difficulty,difficulty); - bn_byte_set(&gspacket->u.d2cs_d2gs_creategamereq.hardcore,hardcore); - bn_byte_set(&gspacket->u.d2cs_d2gs_creategamereq.expansion,expansion); - packet_append_string(gspacket,gamename); - conn_push_outqueue(d2gs_get_connection(gs),gspacket); - } - packet_del_ref(gspacket); - eventlog(eventlog_level_info,__FUNCTION__,"request create game %s on gs %d",gamename,d2gs_get_id(gs)); - } - } - return 0; -} - -static int on_client_joingamereq(t_connection * c, t_packet * packet) -{ - char const * gamename; - char const * gamepass; - char const * charname; - char const * account; - t_game * game; - t_d2gs * gs; - int reply; - unsigned int pos; - unsigned int seqno; - - gs = NULL; - pos=sizeof(t_client_d2cs_joingamereq); - if (!(gamename=packet_get_str_const(packet,pos,MAX_GAMENAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad game name"); - return -1; - } - pos+=strlen(gamename)+1; - if (!(gamepass=packet_get_str_const(packet,pos,MAX_GAMEPASS_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad game pass"); - return -1; - } - if (!(charname=d2cs_conn_get_charname(c))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing character name for connection"); - return -1; - } - if (!(account=d2cs_conn_get_account(c))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing account for connection"); - return -1; - } - if (conn_check_multilogin(c,charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"character %s is already logged in",charname); - return -1; - } - if (!(game=d2cs_gamelist_find_game(gamename))) { - eventlog(eventlog_level_info,__FUNCTION__,"game %s not found",gamename); - reply=D2CS_CLIENT_JOINGAMEREPLY_NOT_EXIST; - } else if (!(gs=game_get_d2gs(game))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing game server for game %s",gamename); - reply=D2CS_CLIENT_JOINGAMEREPLY_NOT_EXIST; - } else { - reply=d2cs_try_joingame(c,game,gamepass); - } - - seqno=bn_short_get(packet->u.client_d2cs_joingamereq.seqno); - if (reply!=D2CS_CLIENT_JOINGAMEREPLY_SUCCEED) { - t_packet * rpacket; - - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_joingamereply)); - packet_set_type(rpacket,D2CS_CLIENT_JOINGAMEREPLY); - bn_short_set(&rpacket->u.d2cs_client_joingamereply.seqno,seqno); - bn_short_set(&rpacket->u.d2cs_client_joingamereply.u1,0); - bn_short_set(&rpacket->u.d2cs_client_joingamereply.gameid,0); - bn_int_set(&rpacket->u.d2cs_client_joingamereply.addr,0); - bn_int_set(&rpacket->u.d2cs_client_joingamereply.token,0); - bn_int_set(&rpacket->u.d2cs_client_joingamereply.reply,reply); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - } else { - t_packet * gspacket; - t_sq * sq; - - if ((gspacket=packet_create(packet_class_d2gs))) { - if ((sq=sq_create(d2cs_conn_get_sessionnum(c),packet,d2cs_game_get_id(game)))) { - packet_set_size(gspacket,sizeof(t_d2cs_d2gs_joingamereq)); - packet_set_type(gspacket,D2CS_D2GS_JOINGAMEREQ); - bn_int_set(&gspacket->u.d2cs_d2gs_joingamereq.h.seqno,sq_get_seqno(sq)); - bn_int_set(&gspacket->u.d2cs_d2gs_joingamereq.gameid, - game_get_d2gs_gameid(game)); - sq_set_gametoken(sq,d2gs_add_token(gs)); - bn_int_set(&gspacket->u.d2cs_d2gs_joingamereq.token,sq_get_gametoken(sq)); - packet_append_string(gspacket,charname); - packet_append_string(gspacket,account); - conn_push_outqueue(d2gs_get_connection(gs),gspacket); - } - packet_del_ref(gspacket); - eventlog(eventlog_level_info,__FUNCTION__,"request join game %s for character %s on gs %d",gamename, - charname,d2gs_get_id(gs)); - } - } - return 0; -} - -static int on_client_gamelistreq(t_connection * c, t_packet * packet) -{ - t_packet * rpacket; - t_game * game; - unsigned int count; - unsigned int seqno; - time_t now; - int maxlifetime; - t_elem const * start_elem; - t_elem const * elem; - - seqno=bn_short_get(packet->u.client_d2cs_gamelistreq.seqno); - /* if (seqno%2) return 0; */ - count=0; - now=time(NULL); - maxlifetime=prefs_get_game_maxlifetime(); - - elem=start_elem=gamelist_get_curr_elem(); - if (!elem) elem=list_get_first_const(d2cs_gamelist()); - else elem=elem_get_next_const(d2cs_gamelist(),elem); - - for (; elem != start_elem; elem=elem_get_next_const(d2cs_gamelist(),elem)) { - if (!elem) { - elem=list_get_first_const(d2cs_gamelist()); - if (elem == start_elem) break; - } - if (!(game=elem_get_data(elem))) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL game"); - break; - } - if (maxlifetime && (now-game->create_time>maxlifetime)) continue; - if (!game_get_currchar(game)) continue; - if (!prefs_allow_gamelist_showall()) { - if (conn_get_charinfo_difficulty(c)!=game_get_gameflag_difficulty(game)) continue; - } - if (d2cs_try_joingame(c,game,"")!=D2CS_CLIENT_JOINGAMEREPLY_SUCCEED) continue; - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_gamelistreply)); - packet_set_type(rpacket,D2CS_CLIENT_GAMELISTREPLY); - bn_short_set(&rpacket->u.d2cs_client_gamelistreply.seqno,seqno); - bn_int_set(&rpacket->u.d2cs_client_gamelistreply.token,d2cs_game_get_id(game)); - bn_byte_set(&rpacket->u.d2cs_client_gamelistreply.currchar,game_get_currchar(game)); - bn_int_set(&rpacket->u.d2cs_client_gamelistreply.gameflag,game_get_gameflag(game)); - packet_append_string(rpacket,d2cs_game_get_name(game)); - packet_append_string(rpacket,game_get_desc(game)); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - count++; - if (prefs_get_maxgamelist() && count>=prefs_get_maxgamelist()) break; - } - } - gamelist_set_curr_elem(elem); - if (count) { - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_gamelistreply)); - packet_set_type(rpacket,D2CS_CLIENT_GAMELISTREPLY); - bn_short_set(&rpacket->u.d2cs_client_gamelistreply.seqno,seqno); - bn_int_set(&rpacket->u.d2cs_client_gamelistreply.token,0); - bn_byte_set(&rpacket->u.d2cs_client_gamelistreply.currchar,0); - bn_int_set(&rpacket->u.d2cs_client_gamelistreply.gameflag,0); - packet_append_string(rpacket,""); - packet_append_string(rpacket,""); - packet_append_string(rpacket,""); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - } - return 0; -} - -static int on_client_gameinforeq(t_connection * c, t_packet * packet) -{ - t_game_charinfo * info; - t_packet * rpacket; - char const * gamename; - t_game * game; - unsigned int seqno, n; - - if (!(gamename=packet_get_str_const(packet,sizeof(t_client_d2cs_gameinforeq),MAX_GAMENAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad game name"); - return -1; - } - if (!(game=d2cs_gamelist_find_game(gamename))) { - eventlog(eventlog_level_error,__FUNCTION__,"game %s not found",gamename); - return 0; - } - seqno=bn_short_get(packet->u.client_d2cs_gameinforeq.seqno); - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_gameinforeply)); - packet_set_type(rpacket,D2CS_CLIENT_GAMEINFOREPLY); - bn_short_set(&rpacket->u.d2cs_client_gameinforeply.seqno,seqno); - bn_int_set(&rpacket->u.d2cs_client_gameinforeply.gameflag,game_get_gameflag(game)); - bn_int_set(&rpacket->u.d2cs_client_gameinforeply.etime,time(NULL)-d2cs_game_get_create_time(game)); - bn_byte_set(&rpacket->u.d2cs_client_gameinforeply.charlevel,game_get_charlevel(game)); - bn_byte_set(&rpacket->u.d2cs_client_gameinforeply.leveldiff,game_get_leveldiff(game)); - bn_byte_set(&rpacket->u.d2cs_client_gameinforeply.maxchar,game_get_maxchar(game)); - bn_byte_set(&rpacket->u.d2cs_client_gameinforeply.u1,0); - - n=0; - BEGIN_LIST_TRAVERSE_DATA_CONST(game_get_charlist(game),info) - { - if (!info->charname) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL charname in game %s char list",gamename); - continue; - } - packet_append_string(rpacket,info->charname); - bn_byte_set(&rpacket->u.d2cs_client_gameinforeply.class[n],info->class); - bn_byte_set(&rpacket->u.d2cs_client_gameinforeply.level[n],info->level); - n++; - } - END_LIST_TRAVERSE_DATA_CONST() - - bn_byte_set(&rpacket->u.d2cs_client_gameinforeply.currchar,n); - if (n!=game_get_currchar(game)) { - eventlog(eventlog_level_error,__FUNCTION__,"game %s character list corrupted",gamename); - } - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - return 0; -} - -static int on_client_charloginreq(t_connection * c, t_packet * packet) -{ - t_packet * bnpacket; - char const * charname; - char const * account; - t_sq * sq; - t_d2charinfo_file data; - - if (!(charname=packet_get_str_const(packet,sizeof(t_client_d2cs_charloginreq),MAX_CHARNAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad character name"); - return -1; - } - if (!(account=d2cs_conn_get_account(c))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing account for connection"); - return -1; - } - if (d2charinfo_load(account,charname,&data)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error loading charinfo for character %s(*%s)",charname,account); - return -1; - } else if (!bnetd_conn()) { - eventlog(eventlog_level_error,__FUNCTION__,"no bnetd connection available,character login rejected"); - return -1; - } - conn_set_charinfo(c,&data.summary); - eventlog(eventlog_level_info,__FUNCTION__,"got character %s(*%s) login request",charname,account); - if ((bnpacket=packet_create(packet_class_d2cs_bnetd))) { - if ((sq=sq_create(d2cs_conn_get_sessionnum(c),packet,0))) { - packet_set_size(bnpacket,sizeof(t_d2cs_bnetd_charloginreq)); - packet_set_type(bnpacket,D2CS_BNETD_CHARLOGINREQ); - bn_int_set(&bnpacket->u.d2cs_bnetd_charloginreq.h.seqno,sq_get_seqno(sq)); - bn_int_set(&bnpacket->u.d2cs_bnetd_charloginreq.sessionnum, - conn_get_bnetd_sessionnum(c)); - packet_append_string(bnpacket,charname); - packet_append_string(bnpacket,(char const *)&data.portrait); - conn_push_outqueue(bnetd_conn(),bnpacket); - } - packet_del_ref(bnpacket); - } - return 0; -} - -static int on_client_deletecharreq(t_connection * c, t_packet * packet) -{ - t_packet * rpacket; - char const * charname; - char const * account; - unsigned int reply; - - if (!(charname=packet_get_str_const(packet,sizeof(t_client_d2cs_deletecharreq),MAX_CHARNAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad character name"); - return -1; - } - if (conn_check_multilogin(c,charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"character %s is already logged in",charname); - return -1; - } - d2cs_conn_set_charname(c,NULL); - account=d2cs_conn_get_account(c); - if (d2char_delete(account,charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to delete character %s(*%s)",charname,account); - reply = D2CS_CLIENT_DELETECHARREPLY_FAILED; - } else { - reply = D2CS_CLIENT_DELETECHARREPLY_SUCCEED; - } - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_deletecharreply)); - packet_set_type(rpacket,D2CS_CLIENT_DELETECHARREPLY); - bn_short_set(&rpacket->u.d2cs_client_deletecharreply.u1,0); - bn_int_set(&rpacket->u.d2cs_client_deletecharreply.reply,reply); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - return 0; -} - -static int on_client_ladderreq(t_connection * c, t_packet * packet) -{ - unsigned char type; - unsigned short start_pos; - - type=bn_byte_get(packet->u.client_d2cs_ladderreq.type); - start_pos=bn_short_get(packet->u.client_d2cs_ladderreq.start_pos); - d2cs_send_client_ladder(c,type,start_pos); - return 0; -} - -static int d2cs_send_client_ladder(t_connection * c, unsigned char type, unsigned short from) -{ - t_packet * rpacket; - t_d2cs_client_ladderinfo const * ladderinfo; - unsigned int curr_len, cont_len, total_len; - t_d2cs_client_ladderheader ladderheader; - t_d2cs_client_ladderinfoheader infoheader; - unsigned int start_pos, count, count_per_packet, npacket; - unsigned int i, n, curr_pos; - - start_pos=from; - count=prefs_get_ladderlist_count(); - if (d2ladder_get_ladder(&start_pos,&count,type,&ladderinfo)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error get ladder for type %d start_pos %d",type,from); - return 0; - } - - count_per_packet=14; - npacket=count/count_per_packet; - if (count % count_per_packet) npacket++; - - curr_len=0; - cont_len=0; - total_len = count * sizeof(*ladderinfo) + sizeof(ladderheader) + sizeof(infoheader) * npacket; - total_len -= 4; - bn_short_set(&ladderheader.start_pos,start_pos); - bn_short_set(&ladderheader.u1,0); - bn_int_set(&ladderheader.count1,count); - - for (i=0; i< npacket; i++) { - curr_len=0; - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_ladderreply)); - packet_set_type(rpacket,D2CS_CLIENT_LADDERREPLY); - bn_byte_set(&rpacket->u.d2cs_client_ladderreply.type, type); - bn_short_set(&rpacket->u.d2cs_client_ladderreply.total_len, total_len); - bn_short_set(&rpacket->u.d2cs_client_ladderreply.cont_len,cont_len); - if (i==0) { - bn_int_set(&infoheader.count2,count); - packet_append_data(rpacket,&ladderheader,sizeof(ladderheader)); - curr_len += sizeof(ladderheader); - } else { - bn_int_set(&infoheader.count2,0); - } - packet_append_data(rpacket,&infoheader,sizeof(infoheader)); - curr_len += sizeof(infoheader); - for (n=0; n< count_per_packet; n++) { - curr_pos = n + i * count_per_packet; - if (curr_pos >= count) break; - packet_append_data(rpacket, ladderinfo+curr_pos, sizeof(*ladderinfo)); - curr_len += sizeof(*ladderinfo); - } - if (i==0) { - packet_set_size(rpacket, packet_get_size(rpacket)-4); - curr_len -= 4; - } - bn_short_set(&rpacket->u.d2cs_client_ladderreply.curr_len,curr_len); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - cont_len += curr_len; - } - return 0; -} - -static int on_client_motdreq(t_connection * c, t_packet * packet) -{ - t_packet * rpacket; - - if (!packet) - return -1; - - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_motdreply)); - packet_set_type(rpacket,D2CS_CLIENT_MOTDREPLY); - bn_byte_set(&rpacket->u.d2cs_client_motdreply.u1,0); - packet_append_string(rpacket,prefs_get_motd()); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - return 0; -} - -static int on_client_cancelcreategame(t_connection * c, t_packet * packet) -{ - t_gq * gq; - t_elem * elem; - - if (!packet) - return -1; - - if (!(gq=conn_get_gamequeue(c))) { - return 0; - } - conn_set_gamequeue(c,NULL); - gq_destroy(gq,&elem); - return 0; -} - -static int on_client_charladderreq(t_connection * c, t_packet * packet) -{ - t_packet * rpacket; - char const * charname; - unsigned int expansion, hardcore, type; - int pos; - - if (!(charname=packet_get_str_const(packet,sizeof(t_client_d2cs_charladderreq),MAX_CHARNAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad character name"); - return -1; - } - expansion=bn_int_get(packet->u.client_d2cs_charladderreq.expansion); - hardcore=bn_int_get(packet->u.client_d2cs_charladderreq.hardcore); - type=0; /* avoid warning */ - if (hardcore && expansion) { - type=D2LADDER_EXP_HC_OVERALL; - } else if (!hardcore && expansion) { - type=D2LADDER_EXP_STD_OVERALL; - } else if (hardcore && !expansion) { - type=D2LADDER_HC_OVERALL; - } else if (!hardcore && !expansion) { - type=D2LADDER_STD_OVERALL; - } - if ((pos=d2ladder_find_character_pos(type,charname))<0) { - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_ladderreply)); - packet_set_type(rpacket,D2CS_CLIENT_LADDERREPLY); - bn_byte_set(&rpacket->u.d2cs_client_ladderreply.type, type); - bn_short_set(&rpacket->u.d2cs_client_ladderreply.total_len,0); - bn_short_set(&rpacket->u.d2cs_client_ladderreply.curr_len,0); - bn_short_set(&rpacket->u.d2cs_client_ladderreply.cont_len,0); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - return 0; - } - pos -= prefs_get_ladderlist_count()/2; - if (pos < 0) pos=0; - d2cs_send_client_ladder(c,type,pos); - return 0; -} - -static int on_client_charlistreq(t_connection * c, t_packet * packet) -{ - t_packet * rpacket; - t_pdir * dir; - char const * account; - char const * charname; - char * path; - t_d2charinfo_file * charinfo; - unsigned int n, maxchar; - t_elist charlist_head; - char const * charlist_sort_order; - - if (!packet) - return -1; - - if (!(account=d2cs_conn_get_account(c))) { - eventlog(eventlog_level_error,__FUNCTION__,"missing account for connection"); - return -1; - } - path=xmalloc(strlen(prefs_get_charinfo_dir())+1+strlen(account)+1); - charlist_sort_order = prefs_get_charlist_sort_order(); - - elist_init(&charlist_head); - - d2char_get_infodir_name(path,account); - if (prefs_allow_newchar()) - maxchar=prefs_get_maxchar(); - else - maxchar=0; - - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_charlistreply)); - packet_set_type(rpacket,D2CS_CLIENT_CHARLISTREPLY); - bn_short_set(&rpacket->u.d2cs_client_charlistreply.u1,0); - n=0; - if (!(dir=p_opendir(path))) { - eventlog(eventlog_level_info,__FUNCTION__,"(*%s) charinfo directory do not exist, building it",account); - p_mkdir(path,S_IRWXU); - } else { - while ((charname=p_readdir(dir))) { - if (charname[0]=='.') continue; - charinfo = xmalloc(sizeof(t_d2charinfo_file)); - if (d2charinfo_load(account,charname,charinfo)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error loading charinfo for %s(*%s)",charname,account); - xfree((void *)charinfo); - continue; - } - eventlog(eventlog_level_debug,__FUNCTION__,"adding char %s (*%s)", charname, account); - d2charlist_add_char(&charlist_head,charinfo,0); - n++; - if (n>=maxchar) break; - } - if (prefs_allow_newchar() && (nu.d2cs_client_charlistreply.maxchar,maxchar); - } else { - bn_short_set(&rpacket->u.d2cs_client_charlistreply.maxchar,0); - } - if (n>=maxchar) - maxchar = 0; - - p_closedir(dir); - if (!strcmp(charlist_sort_order, "ASC")) - { - t_elist * curr, * safe; - t_d2charlist * ccharlist; - - elist_for_each_safe(curr,&charlist_head,safe) - { - ccharlist = elist_entry(curr,t_d2charlist,list); - packet_append_string(rpacket,ccharlist->charinfo->header.charname); - packet_append_string(rpacket,(char *)&ccharlist->charinfo->portrait); - xfree((void *)ccharlist->charinfo); - xfree((void *)ccharlist); - } - } - else - { - t_elist * curr, * safe; - t_d2charlist * ccharlist; - - elist_for_each_safe_rev(curr,&charlist_head,safe) - { - ccharlist = elist_entry(curr,t_d2charlist,list); - packet_append_string(rpacket,ccharlist->charinfo->header.charname); - packet_append_string(rpacket,(char *)&ccharlist->charinfo->portrait); - xfree((void *)ccharlist->charinfo); - xfree((void *)ccharlist); - - } - } - } - bn_short_set(&rpacket->u.d2cs_client_charlistreply.currchar,n); - bn_short_set(&rpacket->u.d2cs_client_charlistreply.currchar2,n); - bn_short_set(&rpacket->u.d2cs_client_charlistreply.maxchar,maxchar); - - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - xfree(path); - return 0; -} - -static int on_client_convertcharreq(t_connection * c, t_packet * packet) -{ - t_packet * rpacket; - char const * charname; - char const * account; - unsigned int reply; - - if (!(charname=packet_get_str_const(packet,sizeof(t_client_d2cs_convertcharreq),MAX_CHARNAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad character name"); - return -1; - } - if (conn_check_multilogin(c,charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"character %s is already logged in",charname); - return -1; - } - account=d2cs_conn_get_account(c); - if (d2char_convert(account,charname)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to convert character %s(*%s)",charname,account); - reply = D2CS_CLIENT_CONVERTCHARREPLY_FAILED; - } else { - reply = D2CS_CLIENT_CONVERTCHARREPLY_SUCCEED; - } - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_convertcharreply)); - packet_set_type(rpacket,D2CS_CLIENT_CONVERTCHARREPLY); - bn_int_set(&rpacket->u.d2cs_client_convertcharreply.reply,reply); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - return 0; -} - -extern int d2cs_send_client_creategamewait(t_connection * c, unsigned int position) -{ - t_packet * packet; - - ASSERT(c,-1); - if ((packet=packet_create(packet_class_d2cs))) { - packet_set_size(packet,sizeof(t_d2cs_client_creategamewait)); - packet_set_type(packet,D2CS_CLIENT_CREATEGAMEWAIT); - bn_int_set(&packet->u.d2cs_client_creategamewait.position,position); - conn_push_outqueue(c,packet); - packet_del_ref(packet); - } - return 0; -} - -extern int d2cs_handle_client_creategame(t_connection * c, t_packet * packet) -{ - return on_client_creategamereq(c,packet); -} - -static unsigned int d2cs_try_joingame(t_connection const * c, t_game const * game, char const * gamepass) -{ - unsigned int reply; - - ASSERT(c,D2CS_CLIENT_JOINGAMEREPLY_NOT_EXIST); - ASSERT(game,D2CS_CLIENT_JOINGAMEREPLY_NOT_EXIST); - if (!game_get_created(game)) { - reply=D2CS_CLIENT_JOINGAMEREPLY_NOT_EXIST; - } else if (!game_get_d2gs(game)) { - reply=D2CS_CLIENT_JOINGAMEREPLY_NOT_EXIST; - } else if (conn_get_charinfo_expansion(c) != game_get_gameflag_expansion(game)) { - reply=D2CS_CLIENT_JOINGAMEREPLY_LEVEL_LIMIT; - } else if (conn_get_charinfo_hardcore(c) != game_get_gameflag_hardcore(game)) { - reply=D2CS_CLIENT_JOINGAMEREPLY_LEVEL_LIMIT; - } else if (conn_get_charinfo_difficulty(c) < game_get_gameflag_difficulty(game)) { - reply=D2CS_CLIENT_JOINGAMEREPLY_LEVEL_LIMIT; - } else if (prefs_allow_gamelimit()) { - if (game_get_maxchar(game) <= game_get_currchar(game)) { - reply=D2CS_CLIENT_JOINGAMEREPLY_GAME_FULL; - } else if (conn_get_charinfo_level(c) > game_get_maxlevel(game)) { - reply=D2CS_CLIENT_JOINGAMEREPLY_LEVEL_LIMIT; - } else if (conn_get_charinfo_level(c) < game_get_minlevel(game)) { - reply=D2CS_CLIENT_JOINGAMEREPLY_LEVEL_LIMIT; - } else if (strcmp(d2cs_game_get_pass(game),gamepass)) { - reply=D2CS_CLIENT_JOINGAMEREPLY_BAD_PASS; - } else { - reply=D2CS_CLIENT_JOINGAMEREPLY_SUCCEED; - } - } else { - if (game_get_currchar(game) >= MAX_CHAR_PER_GAME) { - reply=D2CS_CLIENT_JOINGAMEREPLY_GAME_FULL; - } else { - reply=D2CS_CLIENT_JOINGAMEREPLY_SUCCEED; - } - } - return reply; -} diff --git a/d2pack109/src/d2cs/handle_d2cs.h b/d2pack109/src/d2cs/handle_d2cs.h deleted file mode 100644 index f81ba0f..0000000 --- a/d2pack109/src/d2cs/handle_d2cs.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_HANDLE_D2CS_H -#define INCLUDED_HANDLE_D2CS_H - -#include "connection.h" -#include "common/packet.h" - -extern int d2cs_handle_d2cs_packet(t_connection * c, t_packet * packet); -extern int d2cs_handle_client_creategame(t_connection * c, t_packet * packet); -extern int d2cs_send_client_creategamewait(t_connection * c, unsigned int position); - -#endif diff --git a/d2pack109/src/d2cs/handle_d2gs.c b/d2pack109/src/d2cs/handle_d2gs.c deleted file mode 100644 index fe44580..0000000 --- a/d2pack109/src/d2cs/handle_d2gs.c +++ /dev/null @@ -1,435 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_SYS_TYPES_H -# include /* needed to include netinet/in.h */ -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/socket.h" -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#ifdef HAVE_ARPA_INET_H -# include /* FIXME: probably not needed... do some systems put types in here or something? */ -#endif -#include "compat/psock.h" - -#include "d2gs.h" -#include "handle_d2gs.h" -#include "serverqueue.h" -#include "game.h" -#include "connection.h" -#include "prefs.h" -#include "d2cs_d2gs_protocol.h" -#include "common/trans.h" -#include "common/addr.h" -#include "common/eventlog.h" -#include "common/queue.h" -#include "common/bn_type.h" -#include "common/packet.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -DECLARE_PACKET_HANDLER(on_d2gs_authreply) -DECLARE_PACKET_HANDLER(on_d2gs_setgsinfo) -DECLARE_PACKET_HANDLER(on_d2gs_echoreply) -DECLARE_PACKET_HANDLER(on_d2gs_creategamereply) -DECLARE_PACKET_HANDLER(on_d2gs_joingamereply) -DECLARE_PACKET_HANDLER(on_d2gs_updategameinfo) -DECLARE_PACKET_HANDLER(on_d2gs_closegame) - -static t_packet_handle_table d2gs_packet_handle_table[]={ -/* 0x00 */ { 0, conn_state_none, NULL }, -/* 0x01 */ { 0, conn_state_none, NULL }, -/* 0x02 */ { 0, conn_state_none, NULL }, -/* 0x03 */ { 0, conn_state_none, NULL }, -/* 0x04 */ { 0, conn_state_none, NULL }, -/* 0x05 */ { 0, conn_state_none, NULL }, -/* 0x06 */ { 0, conn_state_none, NULL }, -/* 0x07 */ { 0, conn_state_none, NULL }, -/* 0x08 */ { 0, conn_state_none, NULL }, -/* 0x09 */ { 0, conn_state_none, NULL }, -/* 0x0a */ { 0, conn_state_none, NULL }, -/* 0x0b */ { 0, conn_state_none, NULL }, -/* 0x0c */ { 0, conn_state_none, NULL }, -/* 0x0d */ { 0, conn_state_none, NULL }, -/* 0x0e */ { 0, conn_state_none, NULL }, -/* 0x0f */ { 0, conn_state_none, NULL }, -/* 0x10 */ { 0, conn_state_none, NULL }, -/* FIXME: shouldn't these three be at 0x10-0x12? (But I'm pretty sure I preserved the padding) */ -/* 0x11 */ { sizeof(t_d2gs_d2cs_authreply), conn_state_connected, on_d2gs_authreply }, -/* 0x12 */ { sizeof(t_d2gs_d2cs_setgsinfo), conn_state_authed, on_d2gs_setgsinfo }, -/* 0x13 */ { sizeof(t_d2gs_d2cs_echoreply), conn_state_any, on_d2gs_echoreply }, -/* 0x14 */ { 0, conn_state_none, NULL }, -/* 0x15 */ { 0, conn_state_none, NULL }, -/* 0x16 */ { 0, conn_state_none, NULL }, -/* 0x17 */ { 0, conn_state_none, NULL }, -/* 0x18 */ { 0, conn_state_none, NULL }, -/* 0x19 */ { 0, conn_state_none, NULL }, -/* 0x1a */ { 0, conn_state_none, NULL }, -/* 0x1b */ { 0, conn_state_none, NULL }, -/* 0x1c */ { 0, conn_state_none, NULL }, -/* 0x1d */ { 0, conn_state_none, NULL }, -/* 0x1e */ { 0, conn_state_none, NULL }, -/* 0x1f */ { 0, conn_state_none, NULL }, -/* 0x20 */ { sizeof(t_d2gs_d2cs_creategamereply),conn_state_authed, on_d2gs_creategamereply }, -/* 0x21 */ { sizeof(t_d2gs_d2cs_joingamereply), conn_state_authed, on_d2gs_joingamereply }, -/* 0x22 */ { sizeof(t_d2gs_d2cs_updategameinfo), conn_state_authed, on_d2gs_updategameinfo }, -/* 0x23 */ { sizeof(t_d2gs_d2cs_closegame), conn_state_authed, on_d2gs_closegame }, -}; - - -static int on_d2gs_authreply(t_connection * c, t_packet * packet) -{ - t_d2gs * gs; - t_packet * rpacket; - unsigned int reply; - unsigned int try_checksum, checksum; - unsigned int version; - - if (!(gs=d2gslist_find_gs(conn_get_d2gs_id(c)))) { - eventlog(eventlog_level_error,__FUNCTION__,"game server %d not found",conn_get_d2gs_id(c)); - return -1; - } - - version=bn_int_get(packet->u.d2gs_d2cs_authreply.version); - try_checksum=bn_int_get(packet->u.d2gs_d2cs_authreply.checksum); - checksum=d2gs_calc_checksum(c); - if (prefs_get_d2gs_version() && (version != prefs_get_d2gs_version())) { - eventlog(eventlog_level_error,__FUNCTION__,"game server %d version mismatch 0x%X - 0x%X",conn_get_d2gs_id(c), - version,prefs_get_d2gs_version()); - reply=D2CS_D2GS_AUTHREPLY_BAD_VERSION; - } else if (prefs_get_d2gs_checksum() && try_checksum != checksum) { - eventlog(eventlog_level_error,__FUNCTION__,"game server %d checksum mismach 0x%X - 0x%X",conn_get_d2gs_id(c),try_checksum,checksum); - reply=D2CS_D2GS_AUTHREPLY_BAD_CHECKSUM; - } else { - reply=D2CS_D2GS_AUTHREPLY_SUCCEED; - } - - if (reply==D2CS_D2GS_AUTHREPLY_SUCCEED) { - eventlog(eventlog_level_info,__FUNCTION__,"game server %s authed",addr_num_to_ip_str(d2cs_conn_get_addr(c))); - d2cs_conn_set_state(c,conn_state_authed); - d2gs_active(gs,c); - } else { - eventlog(eventlog_level_error,__FUNCTION__,"game server %s failed to auth",addr_num_to_ip_str(d2cs_conn_get_addr(c))); - /* - d2cs_conn_set_state(c,conn_state_destroy); - */ - } - if ((rpacket=packet_create(packet_class_d2gs))) { - packet_set_size(rpacket,sizeof(t_d2cs_d2gs_authreply)); - packet_set_type(rpacket,D2CS_D2GS_AUTHREPLY); - bn_int_set(&rpacket->u.d2cs_d2gs_authreply.h.seqno,1); - bn_int_set(&rpacket->u.d2cs_d2gs_authreply.reply,reply); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - - // set d2gs version - gs->d2gs_version = version; - - return 0; -} - -static int on_d2gs_setgsinfo(t_connection * c, t_packet * packet) -{ - t_d2gs * gs; - t_packet * rpacket; - unsigned int maxgame, prev_maxgame; - unsigned int currgame, gameflag; - - if (!(gs=d2gslist_find_gs(conn_get_d2gs_id(c)))) { - eventlog(eventlog_level_error,__FUNCTION__,"game server %d not found",conn_get_d2gs_id(c)); - return -1; - } - maxgame=bn_int_get(packet->u.d2gs_d2cs_setgsinfo.maxgame); - prev_maxgame=d2gs_get_maxgame(gs); - currgame = d2gs_get_gamenum(gs); - eventlog(eventlog_level_info, __FUNCTION__, "change game server %s max game from %d to %d (%d current)",addr_num_to_ip_str(d2cs_conn_get_addr(c)),prev_maxgame, maxgame, currgame); - d2gs_set_maxgame(gs,maxgame); - - if(gs->d2gs_version > 0x1090007) - { - gameflag=bn_int_get(packet->u.d2gs_d2cs_setgsinfo.gameflag); - - if ((rpacket=packet_create(packet_class_d2gs))) { - packet_set_size(rpacket,sizeof(t_d2cs_d2gs_setgsinfo)); - packet_set_type(rpacket,D2CS_D2GS_SETGSINFO); - bn_int_set(&rpacket->u.d2cs_d2gs_setgsinfo.h.seqno,1); - bn_int_set(&rpacket->u.d2cs_d2gs_setgsinfo.maxgame,maxgame); - bn_int_set(&rpacket->u.d2cs_d2gs_setgsinfo.gameflag,gameflag); - conn_push_outqueue(c,rpacket); - packet_del_ref(rpacket); - } - } - - gqlist_check_creategame(); - return 0; -} - -static int on_d2gs_echoreply(t_connection * c, t_packet * packet) -{ - if (!c || !packet) - return 0; - return 0; -} - -static int on_d2gs_creategamereply(t_connection * c, t_packet * packet) -{ - t_packet * opacket, * rpacket; - t_sq * sq; - t_connection * client; - t_game * game; - int result; - int reply; - int seqno; - t_elem * curr; - - seqno=bn_int_get(packet->u.d2cs_d2gs.h.seqno); - if (!(sq=sqlist_find_sq(seqno))) { - eventlog(eventlog_level_error,__FUNCTION__,"seqno %d not found",seqno); - return 0; - } - if (!(client=d2cs_connlist_find_connection_by_sessionnum(sq_get_clientid(sq)))) { - eventlog(eventlog_level_error,__FUNCTION__,"client %d not found",sq_get_clientid(sq)); - sq_destroy(sq,&curr); - return 0; - } - if (!(game=gamelist_find_game_by_id(sq_get_gameid(sq)))) { - eventlog(eventlog_level_error,__FUNCTION__,"game %d not found",sq_get_gameid(sq)); - sq_destroy(sq,&curr); - return 0; - } - if (!(opacket=sq_get_packet(sq))) { - eventlog(eventlog_level_error,__FUNCTION__,"previous packet not found (seqno: %d)",seqno); - sq_destroy(sq,&curr); - return 0; - } - - result=bn_int_get(packet->u.d2gs_d2cs_creategamereply.result); - if (result==D2GS_D2CS_CREATEGAME_SUCCEED) { - game_set_d2gs_gameid(game,bn_int_get(packet->u.d2gs_d2cs_creategamereply.gameid)); - game_set_created(game,1); - eventlog(eventlog_level_info,__FUNCTION__,"game %s created on gs %d",d2cs_game_get_name(game),conn_get_d2gs_id(c)); - reply=D2CS_CLIENT_CREATEGAMEREPLY_SUCCEED; - } else if (result==D2GS_D2CS_JOINGAME_GAME_FULL) { - eventlog(eventlog_level_info, __FUNCTION__, "failed to add %s to game %s on gs %d (game full)",d2cs_conn_get_charname(client),d2cs_game_get_name(game),conn_get_d2gs_id(c)); - reply=D2CS_CLIENT_JOINGAMEREPLY_GAME_FULL; - } else { - eventlog(eventlog_level_warn,__FUNCTION__,"failed to create game %s on gs %d",d2cs_game_get_name(game),conn_get_d2gs_id(c)); - game_destroy(game,&curr); - reply=D2CS_CLIENT_CREATEGAMEREPLY_FAILED; - } - - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_creategamereply)); - packet_set_type(rpacket,D2CS_CLIENT_CREATEGAMEREPLY); - bn_short_set(&rpacket->u.d2cs_client_creategamereply.seqno, - bn_short_get(opacket->u.client_d2cs_creategamereq.seqno)); - bn_short_set(&rpacket->u.d2cs_client_creategamereply.gameid,1); - bn_short_set(&rpacket->u.d2cs_client_creategamereply.u1,1); - bn_int_set(&rpacket->u.d2cs_client_creategamereply.reply,reply); - conn_push_outqueue(client,rpacket); - packet_del_ref(rpacket); - } - sq_destroy(sq,&curr); - return 0; -} - -static int on_d2gs_joingamereply(t_connection * c, t_packet * packet) -{ - t_sq * sq; - t_d2gs * gs; - t_connection * client; - t_game * game; - t_packet * opacket, * rpacket; - int result; - int reply; - int seqno; - unsigned int gsaddr; - t_elem * curr; - unsigned short gsport; - - - seqno=bn_int_get(packet->u.d2cs_d2gs.h.seqno); - if (!(sq=sqlist_find_sq(seqno))) { - eventlog(eventlog_level_error,__FUNCTION__,"seqno %d not found",seqno); - return 0; - } - if (!(client=d2cs_connlist_find_connection_by_sessionnum(sq_get_clientid(sq)))) { - eventlog(eventlog_level_error,__FUNCTION__,"client %d not found",sq_get_clientid(sq)); - sq_destroy(sq,&curr); - return 0; - } - if (!(game=gamelist_find_game_by_id(sq_get_gameid(sq)))) { - eventlog(eventlog_level_error,__FUNCTION__,"game %d not found",sq_get_gameid(sq)); - sq_destroy(sq,&curr); - return 0; - } - if (!(gs=game_get_d2gs(game))) { - eventlog(eventlog_level_error,__FUNCTION__,"try join game without game server set"); - sq_destroy(sq,&curr); - return 0; - } - if (!(opacket=sq_get_packet(sq))) { - eventlog(eventlog_level_error,__FUNCTION__,"previous packet not found (seqno: %d)",seqno); - sq_destroy(sq,&curr); - return 0; - } - - result=bn_int_get(packet->u.d2gs_d2cs_joingamereply.result); - if (result==D2GS_D2CS_JOINGAME_SUCCEED) { - eventlog(eventlog_level_info,__FUNCTION__,"added %s to game %s on gs %d",d2cs_conn_get_charname(client), - d2cs_game_get_name(game),conn_get_d2gs_id(c)); - reply=D2CS_CLIENT_JOINGAMEREPLY_SUCCEED; - } else { - eventlog(eventlog_level_info,__FUNCTION__,"failed to add %s to game %s on gs %d",d2cs_conn_get_charname(client), - d2cs_game_get_name(game),conn_get_d2gs_id(c)); - reply=D2CS_CLIENT_JOINGAMEREPLY_FAILED; - } - - if ((rpacket=packet_create(packet_class_d2cs))) { - packet_set_size(rpacket,sizeof(t_d2cs_client_joingamereply)); - packet_set_type(rpacket,D2CS_CLIENT_JOINGAMEREPLY); - bn_short_set(&rpacket->u.d2cs_client_joingamereply.seqno, - bn_short_get(opacket->u.client_d2cs_joingamereq.seqno)); - bn_short_set(&rpacket->u.d2cs_client_joingamereply.gameid,game_get_d2gs_gameid(game)); - bn_short_set(&rpacket->u.d2cs_client_joingamereply.u1,0); - bn_int_set(&rpacket->u.d2cs_client_joingamereply.reply,reply); - if (reply == D2CS_CLIENT_JOINGAMEREPLY_SUCCEED) { - bn_int_set(&rpacket->u.d2cs_client_joingamereply.token,sq_get_gametoken(sq)); - - gsaddr = d2gs_get_ip(gs); - gsport = 4000; - trans_net(d2cs_conn_get_addr(client), &gsaddr, &gsport); - - if(d2gs_get_ip(gs)!=gsaddr) - { - eventlog(eventlog_level_info,__FUNCTION__,"translated gameserver %s -> %s",addr_num_to_ip_str(d2gs_get_ip(gs)),addr_num_to_ip_str(gsaddr)); - } else { - eventlog(eventlog_level_info,__FUNCTION__,"no translation required for gamserver %s",addr_num_to_ip_str(gsaddr)); - } - - bn_int_nset(&rpacket->u.d2cs_client_joingamereply.addr,gsaddr); - - } else { - bn_int_set(&rpacket->u.d2cs_client_joingamereply.token,0); - bn_int_set(&rpacket->u.d2cs_client_joingamereply.addr,0); - } - conn_push_outqueue(client,rpacket); - packet_del_ref(rpacket); - } - sq_destroy(sq,&curr); - return 0; -} - -static int on_d2gs_updategameinfo(t_connection * c, t_packet * packet) -{ - unsigned int flag; - char const * charname; - t_game * game; - unsigned int charclass; - unsigned int charlevel; - unsigned int d2gs_gameid; - unsigned int d2gs_id; - - if (!(charname=packet_get_str_const(packet,sizeof(t_d2gs_d2cs_updategameinfo),MAX_CHARNAME_LEN))) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad charname"); - return 0; - } - d2gs_id=conn_get_d2gs_id(c); - d2gs_gameid=bn_int_get(packet->u.d2gs_d2cs_updategameinfo.gameid); - charclass=bn_int_get(packet->u.d2gs_d2cs_updategameinfo.charclass); - charlevel=bn_int_get(packet->u.d2gs_d2cs_updategameinfo.charlevel); - flag=bn_int_get(packet->u.d2gs_d2cs_updategameinfo.flag); - if (!(game=gamelist_find_game_by_d2gs_and_id(d2gs_id,d2gs_gameid))) { - eventlog(eventlog_level_error,__FUNCTION__,"game %d not found on gs %d",d2gs_gameid,d2gs_id); - return -1; - } - if (flag==D2GS_D2CS_UPDATEGAMEINFO_FLAG_ENTER) { - game_add_character(game,charname,charclass,charlevel); - } else if (flag==D2GS_D2CS_UPDATEGAMEINFO_FLAG_LEAVE) { - game_del_character(game,charname); - } else if (flag==D2GS_D2CS_UPDATEGAMEINFO_FLAG_UPDATE) { - game_add_character(game,charname,charclass,charlevel); - } else { - eventlog(eventlog_level_error,__FUNCTION__,"got bad updategameinfo flag %d",flag); - } - return 0; -} - -static int on_d2gs_closegame(t_connection * c, t_packet * packet) -{ - t_game * game; - t_elem * curr; - - if (!(game=gamelist_find_game_by_d2gs_and_id(conn_get_d2gs_id(c), - bn_int_get(packet->u.d2gs_d2cs_closegame.gameid)))) { - return 0; - } - game_destroy(game, &curr); - return 0; -} - -extern int handle_d2gs_packet(t_connection * c, t_packet * packet) -{ - int type; - t_d2gs * gs; - - type=packet_get_type(packet); - - // ugly d2gs hack, used in backward campability... - if(type == D2GS_D2CS_SETGSINFO) - { - gs=d2gslist_find_gs(conn_get_d2gs_id(c)); - if(gs->d2gs_version <= 0x1090007) - d2gs_packet_handle_table[type].size = sizeof(t_d2gs_d2cs_setgsinfo) - sizeof(bn_int); - } - - conn_process_packet(c,packet,d2gs_packet_handle_table,NELEMS(d2gs_packet_handle_table)); - return 0; -} - -extern int handle_d2gs_init(t_connection * c) -{ - t_packet * packet; - - if ((packet=packet_create(packet_class_d2gs))) { - packet_set_size(packet,sizeof(t_d2cs_d2gs_authreq)); - packet_set_type(packet,D2CS_D2GS_AUTHREQ); - bn_int_set(&packet->u.d2cs_d2gs_authreq.h.seqno,1); - bn_int_set(&packet->u.d2cs_d2gs_authreq.sessionnum,d2cs_conn_get_sessionnum(c)); - packet_append_string(packet,prefs_get_realmname()); - conn_push_outqueue(c,packet); - packet_del_ref(packet); - } - eventlog(eventlog_level_info,__FUNCTION__,"sent init packet to d2gs %d (sessionnum=%d)",conn_get_d2gs_id(c),d2cs_conn_get_sessionnum(c)); - return 0; -} diff --git a/d2pack109/src/d2cs/handle_d2gs.h b/d2pack109/src/d2cs/handle_d2gs.h deleted file mode 100644 index 9b6652b..0000000 --- a/d2pack109/src/d2cs/handle_d2gs.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_HANDLE_D2GS_H -#define INCLUDED_HANDLE_D2GS_H - -#include "connection.h" -#include "common/packet.h" - -/* FIXME: why include the time stuff? */ -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - - -extern int handle_d2gs_packet(t_connection * c, t_packet * packet); -extern int handle_d2gs_init(t_connection * c); - -#endif diff --git a/d2pack109/src/d2cs/handle_init.c b/d2pack109/src/d2cs/handle_init.c deleted file mode 100644 index e3f6dcc..0000000 --- a/d2pack109/src/d2cs/handle_init.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif - -#include "connection.h" -#include "handle_init.h" -#include "handle_d2gs.h" -#include "d2gs.h" -#include "prefs.h" -#include "common/init_protocol.h" -#include "common/addr.h" -#include "common/packet.h" -#include "common/queue.h" -#include "common/eventlog.h" -#include "common/bn_type.h" -#include "common/setup_after.h" - -static int on_d2gs_initconn(t_connection * c); -static int on_d2cs_initconn(t_connection * c); - -extern int d2cs_handle_init_packet(t_connection * c, t_packet * packet) -{ - int class; - int retval; - - ASSERT(c,-1); - ASSERT(packet,-1); - class=bn_byte_get(packet->u.client_initconn.class); - switch (class) { - case CLIENT_INITCONN_CLASS_D2CS: - retval=on_d2cs_initconn(c); - break; - case CLIENT_INITCONN_CLASS_D2GS: - retval=on_d2gs_initconn(c); - break; - default: - eventlog(eventlog_level_error,__FUNCTION__,"got bad connection class %d",class); - retval=-1; - break; - } - return retval; -} - -static int on_d2gs_initconn(t_connection * c) -{ - t_d2gs * gs; - - eventlog(eventlog_level_info,__FUNCTION__,"[%d] client initiated d2gs connection",d2cs_conn_get_socket(c)); - if (!(gs=d2gslist_find_gs_by_ip(d2cs_conn_get_addr(c)))) { - // reload list and see if any dns addy's has changed - if (d2gslist_reload(prefs_get_d2gs_list())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error reloading game server list,exitting"); - return -1; - } - //recheck - if (!(gs=d2gslist_find_gs_by_ip(d2cs_conn_get_addr(c)))) { - eventlog(eventlog_level_error,__FUNCTION__,"d2gs connection from invalid ip address %s",addr_num_to_ip_str(d2cs_conn_get_addr(c))); - return -1; - } - } - d2cs_conn_set_class(c,conn_class_d2gs); - d2cs_conn_set_state(c,conn_state_connected); - conn_set_d2gs_id(c,d2gs_get_id(gs)); - if (handle_d2gs_init(c)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to init d2gs connection"); - return -1; - } - return 0; -} - -static int on_d2cs_initconn(t_connection * c) -{ - eventlog(eventlog_level_info,__FUNCTION__,"[%d] client initiated d2cs connection",d2cs_conn_get_socket(c)); - d2cs_conn_set_class(c,conn_class_d2cs); - d2cs_conn_set_state(c,conn_state_connected); - return 0; -} diff --git a/d2pack109/src/d2cs/handle_init.h b/d2pack109/src/d2cs/handle_init.h deleted file mode 100644 index 535a918..0000000 --- a/d2pack109/src/d2cs/handle_init.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_HANDLE_INIT_H -#define INCLUDED_HANDLE_INIT_H - -#include "connection.h" -#include "common/packet.h" - -extern int d2cs_handle_init_packet(t_connection * c, t_packet * packet); - -#endif diff --git a/d2pack109/src/d2cs/handle_signal.c b/d2pack109/src/d2cs/handle_signal.c deleted file mode 100644 index 170244f..0000000 --- a/d2pack109/src/d2cs/handle_signal.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strdup.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef DO_POSIXSIG -# include -# include "compat/signal.h" -#endif -#ifdef HAVE_FCNTL_H -# include -#else -# ifdef HAVE_SYS_FILE_H -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif - -#include "d2gs.h" -#include "game.h" -#include "prefs.h" -#include "d2ladder.h" -#include "cmdline_parse.h" -#include "handle_signal.h" -#include "common/trans.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static void on_signal(int s); - -static volatile struct -{ - unsigned char do_quit; - unsigned char cancel_quit; - unsigned char reload_config; - unsigned char reload_ladder; - unsigned char restart_d2gs; - unsigned int exit_time; -} signal_data ={ 0, 0, 0, 0, 0, 0 }; - -extern int handle_signal(void) -{ - time_t now; - char const * levels; - char * temp; - char const * tok; - - - if (signal_data.cancel_quit) { - signal_data.cancel_quit=0; - if (!signal_data.exit_time) { - eventlog(eventlog_level_info,__FUNCTION__,"there is no previous shutdown to be canceled"); - } else { - signal_data.exit_time=0; - eventlog(eventlog_level_info,__FUNCTION__,"shutdown was canceled due to signal"); - } - } - if (signal_data.do_quit) { - signal_data.do_quit=0; - now=time(NULL); - if (!signal_data.exit_time) { - signal_data.exit_time=now+d2cs_prefs_get_shutdown_delay(); - } else { - signal_data.exit_time-=d2cs_prefs_get_shutdown_decr(); - } - eventlog(eventlog_level_info,__FUNCTION__,"the server is going to shutdown in %lu minutes",(signal_data.exit_time-now)/60); - } - if (signal_data.exit_time) { - now=time(NULL); - if (now >= (signed)signal_data.exit_time) { - signal_data.exit_time=0; - eventlog(eventlog_level_info,__FUNCTION__,"shutdown server due to signal"); - return -1; - } - } - if (signal_data.reload_config) { - signal_data.reload_config=0; - eventlog(eventlog_level_info,__FUNCTION__,"reloading configuartion file due to signal"); - if (prefs_reload(cmdline_get_prefs_file())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error reload configuration file,exitting"); - return -1; - } - if (d2gslist_reload(prefs_get_d2gs_list())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error reloading game server list,exitting"); - return -1; - } - if (trans_reload(d2cs_prefs_get_transfile(),TRANS_D2CS)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"could not reload trans list"); - } - - eventlog_clear_level(); - if ((levels = d2cs_prefs_get_loglevels())) - { - temp = xstrdup(levels); - tok = strtok(temp,","); /* strtok modifies the string it is passed */ - - while (tok) - { - if (eventlog_add_level(tok)<0) - eventlog(eventlog_level_error,__FUNCTION__,"could not add log level \"%s\"",tok); - tok = strtok(NULL,","); - } - - xfree(temp); - } - - if (!cmdline_get_debugmode()) eventlog_open(d2cs_prefs_get_logfile()); - } - if (signal_data.reload_ladder) { - signal_data.reload_ladder=0; - eventlog(eventlog_level_info,__FUNCTION__,"reloading ladder data due to signal"); - d2ladder_refresh(); - } - - if (signal_data.restart_d2gs) { - signal_data.restart_d2gs=0; - eventlog(eventlog_level_info,__FUNCTION__,"restarting all game servers due to signal"); - d2gs_restart_all_gs(); - } - - return 0; -} - -#ifdef WIN32 -extern void signal_quit_wrapper(void) -{ - signal_data.do_quit=1; -} - -extern void signal_reload_config_wrapper(void) -{ - signal_data.reload_config = 1; -} - -extern void signal_load_ladder_wrapper(void) -{ - signal_data.reload_ladder = 1; -} - -extern void signal_exit_wrapper(void) -{ - signal_data.exit_time = 1; -} - -extern void signal_restart_d2gs_wrapper(void) -{ - signal_data.restart_d2gs = 1; -} -#else -extern int handle_signal_init(void) -{ - signal(SIGINT,on_signal); - signal(SIGTERM,on_signal); - signal(SIGABRT,on_signal); - signal(SIGHUP,on_signal); - signal(SIGUSR1,on_signal); - signal(SIGUSR2,on_signal); - signal(SIGPIPE,on_signal); - return 0; -} - -static void on_signal(int s) -{ - switch (s) { - case SIGINT: - eventlog(eventlog_level_debug,__FUNCTION__,"sigint received"); - signal_data.do_quit=1; - break; - case SIGTERM: - eventlog(eventlog_level_debug,__FUNCTION__,"sigint received"); - signal_data.do_quit=1; - break; - case SIGABRT: - eventlog(eventlog_level_debug,__FUNCTION__,"sigabrt received"); - signal_data.cancel_quit=1; - break; - case SIGHUP: - eventlog(eventlog_level_debug,__FUNCTION__,"sighup received"); - signal_data.reload_config=1; - break; - case SIGUSR1: - eventlog(eventlog_level_debug,__FUNCTION__,"sigusr1 received"); - signal_data.reload_ladder=1; - break; - case SIGUSR2: - eventlog(eventlog_level_debug,__FUNCTION__,"sigusr2 received"); - signal_data.restart_d2gs=1; - break; - case SIGPIPE: - eventlog(eventlog_level_debug,__FUNCTION__,"sigpipe received"); - break; - } - signal(s,on_signal); -} -#endif diff --git a/d2pack109/src/d2cs/handle_signal.h b/d2pack109/src/d2cs/handle_signal.h deleted file mode 100644 index 39b22c9..0000000 --- a/d2pack109/src/d2cs/handle_signal.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_HANDLE_SIGNAL_H -#define INCLUDED_HANDLE_SIGNAL_H - -#ifndef WIN32 -extern int handle_signal_init(void); -#else -extern void signal_quit_wrapper(void); -extern void signal_reload_config_wrapper(void); -extern void signal_load_ladder_wrapper(void); -extern void signal_exit_wrapper(void); -extern void signal_restart_d2gs_wrapper(void); -#endif - -extern int handle_signal(void); - -#endif diff --git a/d2pack109/src/d2cs/main.c b/d2pack109/src/d2cs/main.c deleted file mode 100644 index 4835fae..0000000 --- a/d2pack109/src/d2cs/main.c +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#include -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strdup.h" -#include -#include "compat/strerror.h" -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#include "server.h" -#include "game.h" -#include "connection.h" -#include "serverqueue.h" -#include "d2gs.h" -#include "prefs.h" -#include "cmdline_parse.h" -#include "d2ladder.h" -#include "version.h" -#include "common/trans.h" -#include "common/fdwatch.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#ifdef WIN32 -# include "win32/service.h" -#endif -#ifdef WIN32_GUI -# include "win32/winmain.h" -#endif -#include "common/setup_after.h" - -char serviceLongName[] = "d2cs109 service"; -char serviceName[] = "d2cs109"; -char serviceDescription[] = "Diablo 2 (109) Character Server"; - -int g_ServiceStatus = -1; - -static int init(void); -static int cleanup(void); -static int config_init(int argc, char * * argv); -static int config_cleanup(void); -static int setup_daemon(void); - - -#ifdef DO_DAEMONIZE -static int setup_daemon(void) -{ - int pid; - - if (chdir("/")<0) { - eventlog(eventlog_level_error,__FUNCTION__,"can not change working directory to root directory (chdir: %s)",strerror(errno)); - return -1; - } - close(STDIN_FILENO); - close(STDOUT_FILENO); - if (!cmdline_get_debugmode()) { - close(STDERR_FILENO); - } - switch ((pid = fork())) { - case 0: - break; - case -1: - eventlog(eventlog_level_error,__FUNCTION__,"error create child process (fork: %s)",strerror(errno)); - return -1; - default: - return pid; - } - umask(0); - setsid(); - return 0; -} -#endif - -static int init(void) -{ - d2cs_connlist_create(); - d2cs_gamelist_create(); - sqlist_create(); - d2gslist_create(); - gqlist_create(); - d2ladder_init(); - if(trans_load(d2cs_prefs_get_transfile(),TRANS_D2CS)<0) - eventlog(eventlog_level_error,__FUNCTION__,"could not load trans list"); - fdwatch_init(prefs_get_max_connections()); - return 0; -} - - -static int cleanup(void) -{ - d2ladder_destroy(); - d2cs_connlist_destroy(); - d2cs_gamelist_destroy(); - sqlist_destroy(); - d2gslist_destroy(); - gqlist_destroy(); - trans_unload(); - fdwatch_close(); - return 0; -} - - -static int config_init(int argc, char * * argv) -{ - char const * levels; - char * temp; - char const * tok; - int pid; - - if (cmdline_parse(argc, argv)<0) { - return -1; - } -#ifdef WIN32 - if (cmdline_get_run_as_service()) { - Win32_ServiceRun(); - return 1; - } -#endif - if (cmdline_get_version()) { - cmdline_show_version(); - return -1; - } - if (cmdline_get_help()) { - cmdline_show_help(); - return -1; - } -#ifdef DO_DAEMONIZE - if (!cmdline_get_foreground()) { - if (!((pid = setup_daemon()) == 0)) { - return pid; - } - } -#endif -#ifdef WIN32 - if (cmdline_get_make_service()) { - if (strcmp(cmdline_get_make_service(), "install") == 0) { - fprintf(stderr, "Installing service\n"); - Win32_ServiceInstall(); - return 1; - } - if (strcmp(cmdline_get_make_service(), "uninstall") == 0) { - fprintf(stderr, "Uninstalling service\n"); - Win32_ServiceUninstall(); - return 1; - } - } -#endif - - if (d2cs_prefs_load(cmdline_get_prefs_file())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error loading configuration file %s",cmdline_get_prefs_file()); - return -1; - } - - eventlog_clear_level(); - if ((levels = d2cs_prefs_get_loglevels())) - { - temp = xstrdup(levels); - tok = strtok(temp,","); /* strtok modifies the string it is passed */ - - while (tok) - { - if (eventlog_add_level(tok)<0) - eventlog(eventlog_level_error,__FUNCTION__,"could not add log level \"%s\"",tok); - tok = strtok(NULL,","); - } - - xfree(temp); - } - - if (cmdline_get_debugmode()) { - eventlog_set(stderr); - } else if (cmdline_get_logfile()) { - if (eventlog_open(cmdline_get_logfile())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error open eventlog file %s",cmdline_get_logfile()); - return -1; - } - } else { - if (eventlog_open(d2cs_prefs_get_logfile())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error open eventlog file %s",d2cs_prefs_get_logfile()); - return -1; - } - } - return 0; -} - - -static int config_cleanup(void) -{ - d2cs_prefs_unload(); - cmdline_cleanup(); - return 0; -} - -#ifdef WIN32_GUI -extern int server_main(int argc, char * * argv) -#else -extern int main(int argc, char * * argv) -#endif -{ - int pid; - eventlog_set(stderr); - if (!((pid = config_init(argc, argv)) == 0)) { - return pid; - } - eventlog(eventlog_level_info,__FUNCTION__,D2CS_VERSION); - if (init()<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to init"); - return -1; - } else { - eventlog(eventlog_level_info,__FUNCTION__,"server initialized"); - } - if (d2cs_server_process()<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to run server"); - return -1; - } - cleanup(); - config_cleanup(); - eventlog_close(); - return 0; -} diff --git a/d2pack109/src/d2cs/net.c b/d2pack109/src/d2cs/net.c deleted file mode 100644 index ab92f12..0000000 --- a/d2pack109/src/d2cs/net.c +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include "compat/memset.h" -#include -#include "compat/strerror.h" -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_FCNTL_H -# include -#else -# ifdef HAVE_SYS_FILE_H -# include -# endif -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/socket.h" -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#ifdef HAVE_ARPA_INET_H -# include -#endif -#ifdef HAVE_NETDB_H -# include -#endif -#include "compat/psock.h" - -#include "net.h" -#include "common/eventlog.h" -#include "common/setup_after.h" - - -/* FIXME: use addr.h code to do this and make a separate error - * return path so that 255.255.255.255 isn't an error. - */ -extern unsigned long int net_inet_addr(char const * host) -{ - struct hostent * hp; - - if (isdigit((int)host[0])) { - return inet_addr(host); - } else { - hp=gethostbyname(host); - if (!hp || !(hp->h_addr_list)) { - return ~0UL; - } - return *(unsigned long *)hp->h_addr_list[0]; - } -} - -extern int net_socket(int type) -{ - int sock; - int val; - int ipproto; - - if (type==PSOCK_SOCK_STREAM) { - ipproto = PSOCK_IPPROTO_TCP; - } else { - ipproto = PSOCK_IPPROTO_UDP; - } - if ((sock=psock_socket(PSOCK_PF_INET, type, ipproto))<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error creating socket (psock_socket: %s)", strerror(psock_errno())); - return -1; - } - val=1; - if (psock_setsockopt(sock,PSOCK_SOL_SOCKET, PSOCK_SO_KEEPALIVE, &val, sizeof(val))<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error set socket option KEEPALIVE (psock_setsockopt: %s)",strerror(psock_errno())); - } - if (psock_ctl(sock,PSOCK_NONBLOCK)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error set socket mode to non-block (psock_ctl: %s)",strerror(psock_errno())); - psock_close(sock); - return -1; - } - return sock; -} - -extern int net_check_connected(int sock) -{ - int err; - psock_t_socklen errlen; - - err = 0; - errlen = sizeof(err); - if (psock_getsockopt(sock,PSOCK_SOL_SOCKET, PSOCK_SO_ERROR, &err, &errlen)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error get socket option SO_ERROR (psock_getsockopt: %s)",strerror(psock_errno())); - return -1; - } - if (errlen && err) - return -1; - return 0; -} - - -extern int net_listen(unsigned int ip, unsigned int port, int type) -{ - int sock; - int val; - struct sockaddr_in addr; - int ipproto; - - if (type==PSOCK_SOCK_STREAM) { - ipproto = PSOCK_IPPROTO_TCP; - } else { - ipproto = PSOCK_IPPROTO_UDP; - } - if ((sock=psock_socket(PSOCK_PF_INET, type, ipproto))<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error create listen socket"); - return -1; - } - val=1; - if (psock_setsockopt(sock,PSOCK_SOL_SOCKET,PSOCK_SO_REUSEADDR,&val,sizeof(int))<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error set socket option SO_REUSEADDR"); - } - memset(&addr,0,sizeof(addr)); - addr.sin_family=PSOCK_AF_INET; - addr.sin_port=htons(port); - addr.sin_addr.s_addr=htonl(ip); - if (psock_bind(sock,(struct sockaddr *)&addr, sizeof(addr))<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error bind listen socket"); - psock_close(sock); - return -1; - } - if (psock_listen(sock,LISTEN_QUEUE)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error listen socket"); - psock_close(sock); - return -1; - } - return sock; -} - -extern int net_send_data(int sock, char * buff, int buffsize, int * pos, int * currsize) -{ - int nsend; - - ASSERT(buff,-1); - ASSERT(pos,-1); - if (*pos>buffsize) { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] send buffer overflow pos=%d buffsize=%d",sock,*pos,buffsize); - return -1; - } - if (*currsize>*pos) { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] send buffer error currsize=%d pos=%d",sock,*currsize,*pos); - return -1; - } - nsend=psock_send(sock,buff+*pos-*currsize,*currsize,0); - if (nsend==0) { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] no data sent (close connection)",sock); - return -1; - } - if (nsend<0) { - if ( -#ifdef PSOCK_EINTR - psock_errno()==PSOCK_EINTR || -#endif -#ifdef PSOCK_EAGAIN - psock_errno()==PSOCK_EAGAIN || -#endif -#ifdef PSOCK_EWOULDBLOCK - psock_errno()==PSOCK_EWOULDBLOCK || -#endif -#ifdef PSOCK_NOBUFS - psock_errno()==PSOCK_ENOBUFS || -#endif -#ifdef PSOCK_ENOMEM - psock_errno()==ENOMEM || -#endif - 0) - return 0; - - eventlog(eventlog_level_error,__FUNCTION__,"[%d] error sent data (closing connection) (psock_send: %s)",sock,strerror(psock_errno())); - return -1; - } - *currsize -= nsend; - return 1; -} - -extern int net_recv_data(int sock, char * buff, int buffsize, int * pos, int * currsize) -{ - int nrecv; - - ASSERT(buff,-1); - ASSERT(pos,-1); - if (*pos>buffsize) { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] recv buffer overflow pos=%d buffsize=%d",sock,*pos,buffsize); - return -1; - } - if (*currsize>*pos) { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] recv buffer error currsize=%d pos=%d",sock,*currsize,*pos); - return -1; - } - if (*pos==buffsize) { - memmove(buff,buff+*pos,*currsize); - *pos=0; - } - nrecv=psock_recv(sock,buff+*pos,buffsize-*pos,0); - if (nrecv==0) { - eventlog(eventlog_level_info,__FUNCTION__,"[%d] remote host closed connection",sock); - return -1; - } - if (nrecv<0) { - if ( -#ifdef PSOCK_EINTR - psock_errno()==PSOCK_EINTR || -#endif -#ifdef PSOCK_EAGAIN - psock_errno()==PSOCK_EAGAIN || -#endif -#ifdef PSOCK_EWOULDBLOCK - psock_errno()==PSOCK_EWOULDBLOCK || -#endif -#ifdef PSOCK_ENOMEM - psock_errno()==ENOMEM || -#endif - 0) - return 0; - - if ( -#ifdef PSOCK_ENOTCONN - psock_errno()==PSOCK_ENOTCONN || -#endif -#ifdef PSOCK_ECONNRESET - psock_errno()==PSOCK_ECONNRESET || -#endif - 0) { - eventlog(eventlog_level_error,__FUNCTION__,"[%d] remote host closed connection (psock_recv: %s)",sock,strerror(psock_errno())); - return -1; - } - eventlog(eventlog_level_error,__FUNCTION__,"[%d] recv error (closing connection) (psock_recv: %s)",sock,strerror(psock_errno())); - return -1; - } - * currsize += nrecv; - return 1; -} diff --git a/d2pack109/src/d2cs/net.h b/d2pack109/src/d2cs/net.h deleted file mode 100644 index a6b3cca..0000000 --- a/d2pack109/src/d2cs/net.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_NET_H -#define INCLUDED_NET_H - -extern int net_socket(int type); -extern unsigned long int net_inet_addr(char const * host); -extern int net_check_connected(int sock); -extern int net_listen(unsigned int ip, unsigned int port, int type); -extern int net_send_data(int sock, char * buff, int buffsize, int * pos, int * currsize); -extern int net_recv_data(int sock, char * buff, int buffsize, int * pos, int * currsize); - -#endif diff --git a/d2pack109/src/d2cs/prefs.c b/d2pack109/src/d2cs/prefs.c deleted file mode 100644 index e58c61f..0000000 --- a/d2pack109/src/d2cs/prefs.c +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/memset.h" - -#include "conf.h" -#include "prefs.h" -#include "common/eventlog.h" -#include "common/setup_after.h" - -static t_conf_table prefs_conf_table[]={ - { "logfile", offsetof(t_prefs,logfile), conf_type_str, 0, DEFAULT_LOG_FILE }, - { "loglevels", offsetof(t_prefs,loglevels), conf_type_str, 0, DEFAULT_LOG_LEVELS }, - { "servaddrs", offsetof(t_prefs,servaddrs), conf_type_str, 0, D2CS_SERVER_ADDRS }, - { "gameservlist", offsetof(t_prefs,gameservlist), conf_type_str, 0, D2GS_SERVER_LIST }, - { "bnetdaddr", offsetof(t_prefs,bnetdaddr), conf_type_str, 0, BNETD_SERVER_LIST }, - { "charsavedir", offsetof(t_prefs,charsavedir), conf_type_str, 0, D2CS_CHARSAVE_DIR }, - { "charinfodir", offsetof(t_prefs,charinfodir), conf_type_str, 0, D2CS_CHARINFO_DIR }, - { "bak_charsavedir", offsetof(t_prefs,bak_charsavedir), conf_type_str, 0, D2CS_BAK_CHARSAVE_DIR }, - { "bak_charinfodir", offsetof(t_prefs,bak_charinfodir), conf_type_str, 0, D2CS_BAK_CHARINFO_DIR }, - { "ladderdir", offsetof(t_prefs,ladderdir), conf_type_str, 0, D2CS_LADDER_DIR }, - { "ladder_refresh_interval",offsetof(t_prefs,ladder_refresh_interval),conf_type_int,3600, NULL }, - { "newbiefile", offsetof(t_prefs,newbiefile), conf_type_str, 0, D2CS_CHARSAVE_NEWBIE }, - { "transfile", offsetof(t_prefs,transfile), conf_type_str, 0, D2CS_TRANS_FILE }, - { "motd", offsetof(t_prefs,motd), conf_type_hexstr, 0, D2CS_MOTD }, - { "realmname", offsetof(t_prefs,realmname), conf_type_str, 0, DEFAULT_REALM_NAME }, - { "maxchar", offsetof(t_prefs,maxchar), conf_type_int, MAX_CHAR_PER_ACCT, NULL }, - { "listpurgeinterval", offsetof(t_prefs,listpurgeinterval), conf_type_int, LIST_PURGE_INTERVAL, NULL }, - { "gqcheckinterval", offsetof(t_prefs,gqcheckinterval), conf_type_int, GAMEQUEUE_CHECK_INTERVAL, NULL }, - { "maxgamelist", offsetof(t_prefs,maxgamelist), conf_type_int, MAX_GAME_LIST, NULL }, - { "max_game_idletime", offsetof(t_prefs,max_game_idletime), conf_type_int, MAX_GAME_IDLE_TIME, NULL }, - { "gamelist_showall", offsetof(t_prefs,gamelist_showall), conf_type_bool, 0, NULL }, - { "game_maxlifetime", offsetof(t_prefs,game_maxlifetime), conf_type_int, 0, NULL }, - { "allow_gamelimit", offsetof(t_prefs,allow_gamelimit), conf_type_bool, 1, NULL }, - { "allow_newchar", offsetof(t_prefs,allow_newchar), conf_type_bool, 1, NULL }, - { "idletime", offsetof(t_prefs,idletime), conf_type_int, MAX_CLIENT_IDLETIME, NULL }, - { "shutdown_delay", offsetof(t_prefs,shutdown_delay), conf_type_int, DEFAULT_SHUTDOWN_DELAY, NULL }, - { "shutdown_decr", offsetof(t_prefs,shutdown_decr), conf_type_int, DEFAULT_SHUTDOWN_DECR, NULL }, - { "s2s_retryinterval", offsetof(t_prefs,s2s_retryinterval), conf_type_int, DEFAULT_S2S_RETRYINTERVAL, NULL }, - { "s2s_timeout", offsetof(t_prefs,s2s_timeout), conf_type_int, DEFAULT_S2S_TIMEOUT, NULL }, - { "sq_checkinterval", offsetof(t_prefs,sq_checkinterval), conf_type_int, DEFAULT_SQ_CHECKINTERVAL, NULL }, - { "sq_timeout", offsetof(t_prefs,sq_timeout), conf_type_int, DEFAULT_SQ_TIMEOUT, NULL }, - { "d2gs_checksum", offsetof(t_prefs,d2gs_checksum), conf_type_int, 0, NULL }, - { "d2gs_version", offsetof(t_prefs,d2gs_version), conf_type_int, 0, NULL }, - { "d2gs_password", offsetof(t_prefs,d2gs_password), conf_type_str, 0, "" }, - { "check_multilogin", offsetof(t_prefs,check_multilogin), conf_type_int, 1, NULL }, - { "s2s_idletime", offsetof(t_prefs,s2s_idletime), conf_type_int, DEFAULT_S2S_IDLETIME, NULL }, - { "s2s_keepalive_interval", offsetof(t_prefs,s2s_keepalive_interval),conf_type_int,DEFAULT_S2S_KEEPALIVE_INTERVAL, NULL}, - { "timeout_checkinterval", offsetof(t_prefs,timeout_checkinterval), conf_type_int,DEFAULT_TIMEOUT_CHECKINTERVAL, NULL}, - { "lod_realm", offsetof(t_prefs,lod_realm), conf_type_int, 2, NULL }, - { "allow_convert", offsetof(t_prefs,allow_convert), conf_type_int, 0, NULL }, - { "account_allowed_symbols",offsetof(t_prefs,account_allowed_symbols),conf_type_str,0, DEFAULT_ACC_ALLOWED_SYMBOLS}, - { "d2gs_restart_delay", offsetof(t_prefs,d2gs_restart_delay),conf_type_int, DEFAULT_D2GS_RESTART_DELAY, NULL }, - { "charlist_sort", offsetof(t_prefs,charlist_sort), conf_type_str, 0, "none" }, - { "charlist_sort_order", offsetof(t_prefs,charlist_sort_order), conf_type_str, 0, "ASC" }, - { "max_connections", offsetof(t_prefs,max_connections), conf_type_int, BNETD_MAX_SOCKETS, NULL }, - { NULL, 0, conf_type_none, 0, NULL } -}; - -static t_prefs prefs_conf; - -extern int d2cs_prefs_load(char const * filename) -{ - memset(&prefs_conf,0,sizeof(prefs_conf)); - if (conf_load_file(filename,prefs_conf_table,&prefs_conf,sizeof(prefs_conf))<0) { - return -1; - } - return 0; -} - -extern int prefs_reload(char const * filename) -{ - d2cs_prefs_unload(); - if (d2cs_prefs_load(filename)<0) return -1; - return 0; -} - -extern int d2cs_prefs_unload(void) -{ - return conf_cleanup(prefs_conf_table, &prefs_conf, sizeof(prefs_conf)); -} - -extern char const * prefs_get_servaddrs(void) -{ - return prefs_conf.servaddrs; -} - -extern char const * prefs_get_charsave_dir(void) -{ - return prefs_conf.charsavedir; -} - -extern char const * prefs_get_charinfo_dir(void) -{ - return prefs_conf.charinfodir; -} - -extern char const * prefs_get_bak_charsave_dir(void) -{ - return prefs_conf.bak_charsavedir; -} - -extern char const * prefs_get_bak_charinfo_dir(void) -{ - return prefs_conf.bak_charinfodir; -} - -extern char const * prefs_get_charsave_newbie(void) -{ - return prefs_conf.newbiefile; -} - -extern char const * prefs_get_motd(void) -{ - return prefs_conf.motd; -} - -extern char const * prefs_get_d2gs_list(void) -{ - return prefs_conf.gameservlist; -} - -extern unsigned int prefs_get_maxchar(void) -{ - return (prefs_conf.maxchar>MAX_MAX_CHAR_PER_ACCT)?MAX_MAX_CHAR_PER_ACCT:prefs_conf.maxchar; -} - -extern unsigned int prefs_get_list_purgeinterval(void) -{ - return prefs_conf.listpurgeinterval; -} - -extern unsigned int prefs_get_gamequeue_checkinterval(void) -{ - return prefs_conf.gqcheckinterval; -} - -extern unsigned int prefs_get_maxgamelist(void) -{ - return prefs_conf.maxgamelist; -} - -extern unsigned int prefs_allow_newchar(void) -{ - return prefs_conf.allow_newchar; -} - -extern unsigned int prefs_get_idletime(void) -{ - return prefs_conf.idletime; -} - -extern char const * d2cs_prefs_get_logfile(void) -{ - return prefs_conf.logfile; -} - -extern unsigned int d2cs_prefs_get_shutdown_delay(void) -{ - return prefs_conf.shutdown_delay; -} - -extern unsigned int d2cs_prefs_get_shutdown_decr(void) -{ - return prefs_conf.shutdown_decr; -} - -extern char const * prefs_get_bnetdaddr(void) -{ - return prefs_conf.bnetdaddr; -} - -extern char const * prefs_get_realmname(void) -{ - return prefs_conf.realmname; -} - -extern unsigned int prefs_get_s2s_retryinterval(void) -{ - return prefs_conf.s2s_retryinterval; -} - -extern unsigned int prefs_get_s2s_timeout(void) -{ - return prefs_conf.s2s_timeout; -} - -extern unsigned int prefs_get_sq_timeout(void) -{ - return prefs_conf.sq_timeout; -} - -extern unsigned int prefs_get_sq_checkinterval(void) -{ - return prefs_conf.sq_checkinterval; -} - -extern unsigned int prefs_get_d2gs_checksum(void) -{ - return prefs_conf.d2gs_checksum; -} - -extern unsigned int prefs_get_d2gs_version(void) -{ - return prefs_conf.d2gs_version; -} - -extern unsigned int prefs_get_ladderlist_count(void) -{ - return 0x10; -} - -extern unsigned int prefs_get_d2ladder_refresh_interval(void) -{ - return prefs_conf.ladder_refresh_interval; -} - -extern unsigned int prefs_get_game_maxlifetime(void) -{ - return prefs_conf.game_maxlifetime; -} - -extern char const * prefs_get_ladder_dir(void) -{ - return prefs_conf.ladderdir; -} - -extern char const * d2cs_prefs_get_loglevels(void) -{ - return prefs_conf.loglevels; -} - -extern unsigned int prefs_allow_gamelist_showall(void) -{ - return prefs_conf.gamelist_showall; -} - -extern unsigned int prefs_allow_gamelimit(void) -{ - return prefs_conf.allow_gamelimit; -} - -extern unsigned int prefs_check_multilogin(void) -{ - return prefs_conf.check_multilogin; -} - -extern char const * prefs_get_d2gs_password(void) -{ - return prefs_conf.d2gs_password; -} - -extern unsigned int prefs_get_s2s_idletime(void) -{ - return prefs_conf.s2s_idletime; -} - -extern unsigned int prefs_get_s2s_keepalive_interval(void) -{ - return prefs_conf.s2s_keepalive_interval; -} - -extern unsigned int prefs_get_timeout_checkinterval(void) -{ - return prefs_conf.timeout_checkinterval; -} - -extern unsigned int prefs_get_max_game_idletime(void) -{ - return prefs_conf.max_game_idletime; -} - -extern unsigned int prefs_get_lod_realm(void) -{ - return prefs_conf.lod_realm; -} - -extern unsigned int prefs_get_allow_convert(void) -{ - return prefs_conf.allow_convert; -} - -extern char const * d2cs_prefs_get_transfile(void) -{ - return prefs_conf.transfile; -} - -extern char const * prefs_get_d2cs_account_allowed_symbols(void) -{ - return prefs_conf.account_allowed_symbols; -} - -extern unsigned int prefs_get_d2gs_restart_delay(void) -{ - return prefs_conf.d2gs_restart_delay; -} - -extern char const * prefs_get_charlist_sort(void) -{ - return prefs_conf.charlist_sort; -} - -extern char const * prefs_get_charlist_sort_order(void) -{ - return prefs_conf.charlist_sort_order; -} - -extern unsigned int prefs_get_max_connections(void) -{ - return prefs_conf.max_connections; -} diff --git a/d2pack109/src/d2cs/prefs.h b/d2pack109/src/d2cs/prefs.h deleted file mode 100644 index bb98e85..0000000 --- a/d2pack109/src/d2cs/prefs.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_PREFS_H -#define INCLUDED_PREFS_H - -typedef struct -{ - char const * logfile; - char const * loglevels; - char const * servaddrs; - char const * gameservlist; - char const * bnetdaddr; - char const * charsavedir; - char const * charinfodir; - char const * bak_charsavedir; - char const * bak_charinfodir; - char const * ladderdir; - char const * newbiefile; - char const * motd; - char const * realmname; - char const * d2gs_password; - char const * transfile; - char const * account_allowed_symbols; - unsigned int ladder_refresh_interval; - unsigned int maxchar; - unsigned int listpurgeinterval; - unsigned int gqcheckinterval; - unsigned int s2s_retryinterval; - unsigned int s2s_timeout; - unsigned int s2s_idletime; - unsigned int sq_checkinterval; - unsigned int sq_timeout; - unsigned int maxgamelist; - unsigned int max_game_idletime; - unsigned int gamelist_showall; - unsigned int game_maxlifetime; - unsigned int allow_gamelimit; - unsigned int allow_newchar; - unsigned int idletime; - unsigned int shutdown_delay; - unsigned int shutdown_decr; - unsigned int d2gs_checksum; - unsigned int d2gs_version; - unsigned int check_multilogin; - unsigned int timeout_checkinterval; - unsigned int s2s_keepalive_interval; - unsigned int lod_realm; - unsigned int allow_convert; - unsigned int d2gs_restart_delay; - char const * charlist_sort; - char const * charlist_sort_order; - unsigned int max_connections; -} t_prefs; - -extern int d2cs_prefs_load(char const * filename); -extern int prefs_reload(char const * filename); -extern int d2cs_prefs_unload(void); - -extern char const * d2cs_prefs_get_transfile(void); -extern char const * d2cs_prefs_get_logfile(void); -extern char const * prefs_get_servaddrs(void); -extern char const * prefs_get_charsave_dir(void); -extern char const * prefs_get_charinfo_dir(void); -extern char const * prefs_get_bak_charsave_dir(void); -extern char const * prefs_get_bak_charinfo_dir(void); -extern char const * prefs_get_charsave_newbie(void); -extern char const * prefs_get_motd(void); -extern char const * prefs_get_realmname(void); -extern char const * prefs_get_d2gs_list(void); -extern unsigned int prefs_get_maxchar(void); -extern unsigned int prefs_get_list_purgeinterval(void); -extern unsigned int prefs_get_maxgamelist(void); -extern unsigned int prefs_allow_newchar(void); -extern unsigned int prefs_get_gamequeue_checkinterval(void); -extern unsigned int prefs_get_idletime(void); -extern unsigned int d2cs_prefs_get_shutdown_delay(void); -extern unsigned int d2cs_prefs_get_shutdown_decr(void); -extern char const * prefs_get_bnetdaddr(void); -extern unsigned int prefs_get_s2s_retryinterval(void); -extern unsigned int prefs_get_s2s_timeout(void); -extern unsigned int prefs_get_sq_timeout(void); -extern unsigned int prefs_get_sq_checkinterval(void); -extern unsigned int prefs_get_d2gs_checksum(void); -extern unsigned int prefs_get_d2gs_version(void); -extern unsigned int prefs_get_ladderlist_count(void); -extern unsigned int prefs_get_d2ladder_refresh_interval(void); -extern unsigned int prefs_get_game_maxlifetime(void); -extern char const * prefs_get_ladder_dir(void); -extern char const * d2cs_prefs_get_loglevels(void); -extern unsigned int prefs_allow_gamelist_showall(void); -extern unsigned int prefs_allow_gamelimit(void); -extern unsigned int prefs_check_multilogin(void); -extern char const * prefs_get_d2gs_password(void); -extern unsigned int prefs_get_s2s_idletime(void); -extern unsigned int prefs_get_s2s_keepalive_interval(void); -extern unsigned int prefs_get_timeout_checkinterval(void); -extern unsigned int prefs_get_max_game_idletime(void); -extern unsigned int prefs_get_lod_realm(void); -extern unsigned int prefs_get_allow_convert(void); -extern char const * prefs_get_d2cs_account_allowed_symbols(void); -extern unsigned int prefs_get_d2gs_restart_delay(void); -extern char const * prefs_get_charlist_sort(void); -extern char const * prefs_get_charlist_sort_order(void); -extern unsigned int prefs_get_max_connections(void); - -#endif diff --git a/d2pack109/src/d2cs/s2s.c b/d2pack109/src/d2cs/s2s.c deleted file mode 100644 index ccc60cf..0000000 --- a/d2pack109/src/d2cs/s2s.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/memset.h" -#include "compat/strdup.h" -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include -#include "compat/strerror.h" -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/psock.h" -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#include - -#include "compat/psock.h" -#include "compat/strtoul.h" -#include "connection.h" -#include "bnetd.h" -#include "net.h" -#include "s2s.h" -#include "common/fdwatch.h" -#include "server.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -extern int s2s_check(void) -{ - bnetd_check(); - return 0; -} - -extern int s2s_init(void) -{ - bnetd_init(); - return 0; -} - -extern t_connection * s2s_create(char const * server, unsigned short def_port, t_conn_class class) -{ - struct sockaddr_in addr, laddr; - psock_t_socklen laddr_len; - unsigned int ip; - unsigned short port; - int sock, connected; - t_connection * c; - char * p, * tserver; - - ASSERT(server,NULL); - tserver=xstrdup(server); - p=strchr(tserver,':'); - if (p) { - port=(unsigned short)strtoul(p+1,NULL,10); - *p='\0'; - } else { - port=def_port; - } - - if ((sock=net_socket(PSOCK_SOCK_STREAM))<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error creating s2s socket"); - xfree(tserver); - return NULL; - } - - memset(&addr,0,sizeof(addr)); - addr.sin_family = PSOCK_AF_INET; - addr.sin_port = htons(port); - addr.sin_addr.s_addr= net_inet_addr(tserver); - xfree(tserver); - - eventlog(eventlog_level_info,__FUNCTION__,"try make s2s connection to %s",server); - if (psock_connect(sock,(struct sockaddr *)&addr,sizeof(addr))<0) { - if (psock_errno()!=PSOCK_EWOULDBLOCK && psock_errno() != PSOCK_EINPROGRESS) { - eventlog(eventlog_level_error,__FUNCTION__,"error connecting to %s (psock_connect: %s)",server,strerror(psock_errno())); - psock_close(sock); - return NULL; - } - connected=0; - eventlog(eventlog_level_info,__FUNCTION__,"connection to s2s server %s is in progress",server); - } else { - connected=1; - eventlog(eventlog_level_info,__FUNCTION__,"connected to s2s server %s",server); - } - laddr_len=sizeof(laddr); - memset(&laddr,0,sizeof(laddr)); - ip=port=0; - if (psock_getsockname(sock,(struct sockaddr *)&laddr,&laddr_len)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"unable to get local socket info"); - } else { - if (laddr.sin_family != PSOCK_AF_INET) { - eventlog(eventlog_level_error,__FUNCTION__,"got bad socket family %d",laddr.sin_family); - } else { - ip=ntohl(laddr.sin_addr.s_addr); - port=ntohs(laddr.sin_port); - } - } - if (!(c=d2cs_conn_create(sock,ip,port, ntohl(addr.sin_addr.s_addr), ntohs(addr.sin_port)))) { - eventlog(eventlog_level_error,__FUNCTION__,"error create s2s connection"); - psock_close(sock); - return NULL; - } - if (connected) { - if (conn_add_fd(c,fdwatch_type_read, d2cs_server_handle_tcp)<0) { - eventlog(eventlog_level_error, __FUNCTION__, "error adding socket %d to fdwatch pool (max sockets?)",sock); - d2cs_conn_set_state(c,conn_state_destroy); - return NULL; - } - d2cs_conn_set_state(c,conn_state_init); - } else { - if (conn_add_fd(c, fdwatch_type_write, d2cs_server_handle_tcp)<0) { - eventlog(eventlog_level_error, __FUNCTION__, "error adding socket %d to fdwatch pool (max sockets?)",sock); - d2cs_conn_set_state(c,conn_state_destroy); - return NULL; - } - d2cs_conn_set_state(c,conn_state_connecting); - } - d2cs_conn_set_class(c,class); - return c; -} - -extern int s2s_destroy(t_connection * c) -{ - ASSERT(c,-1); - switch (d2cs_conn_get_class(c)) { - case conn_class_bnetd: - bnetd_destroy(c); - break; - default: - eventlog(eventlog_level_error,__FUNCTION__,"got bad s2s connection class %d",d2cs_conn_get_class(c)); - return -1; - } - return 0; -} diff --git a/d2pack109/src/d2cs/s2s.h b/d2pack109/src/d2cs/s2s.h deleted file mode 100644 index 9c87ba2..0000000 --- a/d2pack109/src/d2cs/s2s.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_S2S_H -#define INCLUDED_S2S_H - -#include "connection.h" - -extern int s2s_init(void); -extern int s2s_check(void); -extern t_connection * s2s_create(char const * server, unsigned short def_port, t_conn_class class); -extern int s2s_destroy(t_connection * s2s); - -#endif diff --git a/d2pack109/src/d2cs/server.c b/d2pack109/src/d2cs/server.c deleted file mode 100644 index 0483a9a..0000000 --- a/d2pack109/src/d2cs/server.c +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include "compat/memset.h" -#include -#include "compat/strerror.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_FCNTL_H -# include -#else -# ifdef HAVE_SYS_FILE_H -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/psock.h" -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#ifdef HAVE_ARPA_INET_H -# include -#endif -#include "compat/inet_ntoa.h" -#include "compat/psock.h" - -#include "d2gs.h" -#include "net.h" -#include "s2s.h" -#include "gamequeue.h" -#include "game.h" -#include "connection.h" -#include "serverqueue.h" -#include "common/fdwatch.h" -#include "server.h" -#include "prefs.h" -#include "d2ladder.h" -#include "handle_signal.h" -#include "common/addr.h" -#include "common/list.h" -#include "common/hashtable.h" -#include "common/eventlog.h" -#ifdef WIN32 -# include /* for kbhit() and getch() */ -#endif -#include "common/setup_after.h" - -static int server_listen(void); -static int server_accept(int sock); -static int server_handle_timed_event(void); -static int server_handle_socket(void); -static int server_loop(void); -static int server_cleanup(void); - -t_addrlist * server_listen_addrs; - -extern int g_ServiceStatus; - -static int server_listen(void) -{ - t_addr * curr_laddr; - t_addr_data laddr_data; - int sock; - - if (!(server_listen_addrs=addrlist_create(prefs_get_servaddrs(),INADDR_ANY,D2CS_SERVER_PORT))) { - eventlog(eventlog_level_error,__FUNCTION__,"error create listening address list"); - return -1; - } - BEGIN_LIST_TRAVERSE_DATA(server_listen_addrs,curr_laddr) - { - sock=net_listen(addr_get_ip(curr_laddr),addr_get_port(curr_laddr),PSOCK_SOCK_STREAM); - if (sock<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error listen socket"); - return -1; - } - - if (psock_ctl(sock,PSOCK_NONBLOCK)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error set listen socket in non-blocking mode"); - } - - laddr_data.i = sock; - addr_set_data(curr_laddr,laddr_data); - - if (fdwatch_add_fd(sock, fdwatch_type_read, d2cs_server_handle_accept, curr_laddr)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error adding socket %d to fdwatch pool (max sockets?)",sock); - psock_close(sock); - return -1; - } - - eventlog(eventlog_level_info,__FUNCTION__,"listen on %s", addr_num_to_addr_str(addr_get_ip(curr_laddr),addr_get_port(curr_laddr))); - } - END_LIST_TRAVERSE_DATA() - return 0; -} - -static int server_accept(int sock) -{ - int csock; - struct sockaddr_in caddr, raddr; - psock_t_socklen caddr_len, raddr_len; - int val; - unsigned int ip; - unsigned short port; - t_connection *cc; - - caddr_len=sizeof(caddr); - memset(&caddr,0,sizeof(caddr)); - csock=psock_accept(sock,(struct sockaddr *)&caddr,&caddr_len); - if (csock<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error accept new connection"); - return -1; - } else eventlog(eventlog_level_info,__FUNCTION__,"accept connection from %s",inet_ntoa(caddr.sin_addr)); - - val=1; - if (psock_setsockopt(csock, PSOCK_SOL_SOCKET, PSOCK_SO_KEEPALIVE, &val,sizeof(val))<0) { - eventlog(eventlog_level_warn,__FUNCTION__,"error set sock option keep alive"); - } - if (psock_ctl(csock, PSOCK_NONBLOCK)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error set socket to non-blocking mode"); - psock_close(csock); - return -1; - } - - raddr_len=sizeof(raddr); - memset(&raddr,0,sizeof(raddr)); - ip=port=0; - if (psock_getsockname(csock,(struct sockaddr *)&raddr,&raddr_len)<0) { - eventlog(eventlog_level_warn,__FUNCTION__,"unable to get local socket info"); - } else { - if (raddr.sin_family!=PSOCK_AF_INET) { - eventlog(eventlog_level_warn,__FUNCTION__,"got bad socket family %d",raddr.sin_family); - } else { - ip=ntohl(raddr.sin_addr.s_addr); - port=ntohs(raddr.sin_port); - } - } - if (!(cc = d2cs_conn_create(csock,ip,port,ntohl(caddr.sin_addr.s_addr),ntohs(caddr.sin_port)))) { - eventlog(eventlog_level_error,__FUNCTION__,"error create new connection"); - psock_close(csock); - return -1; - } - if (conn_add_fd(cc, fdwatch_type_read, d2cs_server_handle_tcp)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error adding socket %d to fdwatch pool (max sockets?)",csock); - d2cs_conn_set_state(cc,conn_state_destroy); - return -1; - } - - return 0; -} - -static int server_handle_timed_event(void) -{ - static time_t prev_list_purgetime=0; - static time_t prev_gamequeue_checktime=0; - static time_t prev_s2s_checktime=0; - static time_t prev_sq_checktime=0; - static time_t prev_d2ladder_refresh_time=0; - static time_t prev_s2s_keepalive_time=0; - static time_t prev_timeout_checktime; - time_t now; - - now=time(NULL); - if (now-prev_list_purgetime>(signed)prefs_get_list_purgeinterval()) { - hashtable_purge(d2cs_connlist()); - d2cs_gamelist_check_voidgame(); - prev_list_purgetime=now; - } - if (now-prev_gamequeue_checktime>(signed)prefs_get_gamequeue_checkinterval()) { - gqlist_update_all_clients(); - prev_gamequeue_checktime=now; - } - if (now-prev_s2s_checktime>(signed)prefs_get_s2s_retryinterval()) { - s2s_check(); - prev_s2s_checktime=now; - } - if (now-prev_sq_checktime>(signed)prefs_get_sq_checkinterval()) { - sqlist_check_timeout(); - prev_sq_checktime=now; - } - if (now-prev_d2ladder_refresh_time>(signed)prefs_get_d2ladder_refresh_interval()) { - d2ladder_refresh(); - prev_d2ladder_refresh_time=now; - } - if (now-prev_s2s_keepalive_time>(signed)prefs_get_s2s_keepalive_interval()) { - d2gs_keepalive(); - prev_s2s_keepalive_time=now; - } - if (now-prev_timeout_checktime>(signed)prefs_get_timeout_checkinterval()) { - connlist_check_timeout(); - prev_timeout_checktime=now; - } - return 0; -} - -extern int d2cs_server_handle_accept(void *data, t_fdwatch_type rw) -{ - int sock; - - sock = addr_get_data((t_addr *)data).i; - server_accept(sock); - return 0; -} - -extern int d2cs_server_handle_tcp(void *data, t_fdwatch_type rw) -{ - t_connection *c = (t_connection *)data; - - if (rw & fdwatch_type_read) conn_add_socket_flag(c,SOCKET_FLAG_READ); - if (rw & fdwatch_type_write) conn_add_socket_flag(c,SOCKET_FLAG_WRITE); - if (conn_handle_socket(c)<0) - d2cs_conn_set_state(c, conn_state_destroy); - - return 0; -} - -static int server_handle_socket(void) -{ - switch (fdwatch(BNETD_POLL_INTERVAL)) { - case -1: - if ( -#ifdef PSOCK_EINTR - psock_errno()!=PSOCK_EINTR && -#endif - 1) { - eventlog(eventlog_level_error,__FUNCTION__,"select failed (select: %s)",strerror(psock_errno())); - return -1; - } - /* fall through */ - case 0: - return 0; - default: - break; - } - - fdwatch_handle(); - - return 0; -} - -static int server_loop(void) -{ - unsigned int count; - - count=0; - while (1) { -#ifdef WIN32 - if (g_ServiceStatus<0 && kbhit() && getch()=='q') - signal_quit_wrapper(); - - if (g_ServiceStatus == 0) signal_quit_wrapper(); - - while (g_ServiceStatus == 2) Sleep(1000); -#endif - - if (handle_signal()<0) break; - if (++count>=(1000/BNETD_POLL_INTERVAL)) { - server_handle_timed_event(); - count=0; - } - server_handle_socket(); - d2cs_connlist_reap(); - } - return 0; -} - -static int server_cleanup(void) -{ - t_addr * curr_laddr; - int sock; - - BEGIN_LIST_TRAVERSE_DATA(server_listen_addrs,curr_laddr) - { - sock=addr_get_data(curr_laddr).i; - psock_close(sock); - } - END_LIST_TRAVERSE_DATA() - addrlist_destroy(server_listen_addrs); - return 0; -} - -extern int d2cs_server_process(void) -{ -#ifndef WIN32 - handle_signal_init(); -#endif - if (psock_init()<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to init network"); - return -1; - } - eventlog(eventlog_level_info,__FUNCTION__,"network initialized"); - if (s2s_init()<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to init s2s connection"); - return -1; - } - if (server_listen()<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to setup listen socket"); - return -1; - } - eventlog(eventlog_level_info,__FUNCTION__,"entering server loop"); - server_loop(); - eventlog(eventlog_level_info,__FUNCTION__,"exit from server loop,cleanup"); - server_cleanup(); - return 0; -} diff --git a/d2pack109/src/d2cs/server.h b/d2pack109/src/d2cs/server.h deleted file mode 100644 index 42a0be2..0000000 --- a/d2pack109/src/d2cs/server.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_SERVER_H -#define INCLUDED_SERVER_H - -#include "common/fdwatch.h" - -extern int d2cs_server_process(void); -extern int d2cs_server_handle_tcp(void*,t_fdwatch_type); -extern int d2cs_server_handle_accept(void*,t_fdwatch_type); - -#endif diff --git a/d2pack109/src/d2cs/serverqueue.c b/d2pack109/src/d2cs/serverqueue.c deleted file mode 100644 index d459032..0000000 --- a/d2pack109/src/d2cs/serverqueue.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#include "prefs.h" -#include "serverqueue.h" -#include "common/packet.h" -#include "common/list.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static t_list * sqlist_head=NULL; -static unsigned int sqlist_seqno=0; - -extern t_list * sqlist(void) -{ - return sqlist_head; -} - -extern int sqlist_create(void) -{ - sqlist_head=list_create(); - return 0; -} - -extern int sqlist_destroy(void) -{ - t_sq * sq; - - BEGIN_LIST_TRAVERSE_DATA_CONST(sqlist_head,sq) - { - sq_destroy(sq,(t_elem **)curr_elem_); - } - END_LIST_TRAVERSE_DATA_CONST() - - if (list_destroy(sqlist_head)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error destroy server queue list"); - return -1; - } - sqlist_head=NULL; - return 0; -} - -extern int sqlist_check_timeout(void) -{ - t_sq * sq; - time_t now; - - now=time(NULL); - BEGIN_LIST_TRAVERSE_DATA(sqlist_head, sq) - { - if (now - sq->ctime > prefs_get_sq_timeout()) { - eventlog(eventlog_level_info,__FUNCTION__,"destroying expired server queue %d",sq->seqno); - sq_destroy(sq,&curr_elem_); - } - } - END_LIST_TRAVERSE_DATA() - return 0; -} - -extern t_sq * sqlist_find_sq(unsigned int seqno) -{ - t_sq * sq; - - BEGIN_LIST_TRAVERSE_DATA_CONST(sqlist_head,sq) - { - if (sq->seqno==seqno) return sq; - } - END_LIST_TRAVERSE_DATA_CONST() - return NULL; -} - -extern t_sq * sq_create(unsigned int clientid, t_packet * packet,unsigned int gameid ) -{ - t_sq * sq; - - sq=xmalloc(sizeof(t_sq)); - sq->seqno=++sqlist_seqno; - sq->ctime=time(NULL); - sq->clientid=clientid; - sq->gameid=gameid; - sq->packet=packet; - sq->gametoken=0; - if (packet) packet_add_ref(packet); - list_append_data(sqlist_head,sq); - return sq; -} - -extern int sq_destroy(t_sq * sq,t_elem ** curr) -{ - ASSERT(sq,-1); - if (list_remove_data(sqlist_head,sq,curr)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error remove server queue from list"); - return -1; - } - if (sq->packet) packet_del_ref(sq->packet); - xfree(sq); - return 0; -} - -extern unsigned int sq_get_clientid(t_sq const * sq) -{ - ASSERT(sq,0); - return sq->clientid; -} - -extern t_packet * sq_get_packet(t_sq const * sq) -{ - ASSERT(sq,NULL); - return sq->packet; -} - -extern unsigned int sq_get_gameid(t_sq const * sq) -{ - ASSERT(sq,0); - return sq->gameid; -} - -extern unsigned int sq_get_seqno(t_sq const * sq) -{ - ASSERT(sq,0); - return sq->seqno; -} - -extern int sq_set_gametoken(t_sq * sq, unsigned int gametoken) -{ - ASSERT(sq,-1); - sq->gametoken=gametoken; - return 0; -} - -extern unsigned int sq_get_gametoken(t_sq const * sq) -{ - ASSERT(sq,0); - return sq->gametoken; -} - diff --git a/d2pack109/src/d2cs/serverqueue.h b/d2pack109/src/d2cs/serverqueue.h deleted file mode 100644 index af036ca..0000000 --- a/d2pack109/src/d2cs/serverqueue.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_SERVERQUEUE_H -#define INCLUDED_SERVERQUEUE_H - -#include "common/list.h" -#include "common/packet.h" - - -typedef struct serverqueue -{ - unsigned int seqno; - unsigned int ctime; - unsigned int clientid; - t_packet * packet; - unsigned int gameid; - unsigned int gametoken; -} t_sq; - -extern t_list * sqlist(void); -extern int sqlist_create(void); -extern int sqlist_destroy(void); - -extern int sq_destroy(t_sq * sq,t_elem ** curr); -extern int sqlist_check_timeout(void); -extern t_sq * sqlist_find_sq(unsigned int seqno); -extern t_sq * sq_create(unsigned int clientid, t_packet * packet,unsigned int gameid); - -extern unsigned int sq_get_clientid(t_sq const * sq); -extern unsigned int sq_get_gameid(t_sq const * sq); -extern unsigned int sq_get_seqno(t_sq const * sq); -extern int sq_set_gametoken(t_sq * sq, unsigned int gametoken); -extern unsigned int sq_get_gametoken(t_sq const * sq); -extern t_packet * sq_get_packet(t_sq const * sq); - -#endif diff --git a/d2pack109/src/d2cs/setup.h b/d2pack109/src/d2cs/setup.h deleted file mode 100644 index 780e870..0000000 --- a/d2pack109/src/d2cs/setup.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2CS_SETUP_H -#define INCLUDED_D2CS_SETUP_H - -/* FIXME: what is this for? */ -#ifndef D2CS -# define D2CS -#endif - - -#ifndef min -# define min(a,b) (((a)>(b))?(b):(a)) -#endif -#ifndef max -# define max(a,b) (((a)>(b))?(a):(b)) -#endif - -#define tf(a) ((a)?1:0) - -#define strcmp_charname strcasecmp -#define strncmp_charname strncasencmp - -#define BEGIN_LIST_TRAVERSE_DATA(list,data) \ -{\ - t_elem * curr_elem_;\ - for (curr_elem_=list_get_first(list); curr_elem_ && (data=elem_get_data(curr_elem_)); \ - curr_elem_=elem_get_next(list,curr_elem_)) - -#define END_LIST_TRAVERSE_DATA() \ -} - -#define BEGIN_LIST_TRAVERSE_DATA_CONST(list,data)\ -{\ - t_elem const * curr_elem_;\ - for (curr_elem_=list_get_first_const(list); curr_elem_ && (data=elem_get_data(curr_elem_)); \ - curr_elem_=elem_get_next_const(list,curr_elem_)) - -#define END_LIST_TRAVERSE_DATA_CONST() \ -} - -#define BEGIN_HASHTABLE_TRAVERSE_DATA(hashtable,data)\ -{\ - t_entry * curr_entry_;\ - for (curr_entry_=hashtable_get_first(hashtable); curr_entry_ && (data=entry_get_data(curr_entry_));\ - curr_entry_=entry_get_next(curr_entry_)) - -#define END_HASHTABLE_TRAVERSE_DATA() \ -} - -#define BEGIN_HASHTABLE_TRAVERSE_MATCHING_DATA(hashtable,data,hash)\ -{\ - t_entry * curr_entry_;\ - for (curr_entry_=hashtable_get_first_matching(hashtable,hash); \ - curr_entry_ && (data=entry_get_data(curr_entry_)); \ - curr_entry_ = entry_get_next_matching(curr_entry_)) - -#define END_HASHTABLE_TRAVERSE_DATA() \ -} - -#define CASE(condition,func) case condition:\ - func;\ - break;\ - -#define ASSERT(var,retval) if (!var) { eventlog(eventlog_level_error,__FUNCTION__,"got NULL " #var); return retval; } -#define DECLARE_PACKET_HANDLER(handler) static int handler(t_connection *, t_packet *); -#define NELEMS(s) sizeof(s)/sizeof(s[0]) - -#define MAX_SAVEFILE_SIZE 32 * 1024 -#define MAX_CHARNAME_LEN 16 -#define MAX_GAMENAME_LEN 16 -#define MAX_GAMEPASS_LEN 16 -#define MAX_GAMEDESC_LEN 32 -#define MAX_ACCTNAME_LEN 16 -#define MAX_REALMNAME_LEN 32 -#define MIN_NAME_LEN 2 -#define MAX_CHAR_PER_GAME 8 -#define D2CS_SERVER_PORT 6113 -#define MAX_GAME_IDLE_TIME 0 -#define DEFAULT_S2S_RETRYINTERVAL 60 -#define DEFAULT_S2S_TIMEOUT 60 -#define DEFAULT_SQ_CHECKINTERVAL 300 -#define DEFAULT_SQ_TIMEOUT 300 -#define DEFAULT_REALM_NAME "D2CS" -#define DEFAULT_SHUTDOWN_DELAY 300 -#define DEFAULT_SHUTDOWN_DECR 60 -#define DEFAULT_S2S_IDLETIME 300 -#define DEFAULT_S2S_KEEPALIVE_INTERVAL 60 -#define DEFAULT_TIMEOUT_CHECKINTERVAL 60 -#define DEFAULT_ACC_ALLOWED_SYMBOLS "-_[]" -#define DEFAULT_D2GS_RESTART_DELAY 300 - -#ifndef D2CS_DEFAULT_CONF_FILE -# define D2CS_DEFAULT_CONF_FILE "conf/d2cs.conf" -#endif - -#define DEFAULT_LOG_FILE "/usr/local/var/d2cs.log" -#define DEFAULT_LOG_LEVELS "info,warn,error" -#define DEFAULT_MEMLOG_FILE "/tmp/d2cs-mem.log" - -#define D2CS_SERVER_ADDRS "0.0.0.0" -#define D2GS_SERVER_LIST "192.168.0.1" -#define BNETD_SERVER_LIST "192.168.0.1" -#define MAX_D2GAME_NUMBER 30 -#define MAX_CHAR_PER_ACCT 8 -// MAX_MAX_CHAR_PER_ACCT is needed cause D2 client can only handle 21 character -#define MAX_MAX_CHAR_PER_ACCT 21 -#define MAX_CLIENT_IDLETIME 30 * 60 - -#define D2CS_CHARINFO_DIR "/usr/local/var/charinfo" -#define D2CS_CHARSAVE_DIR "/usr/local/var/charsave" -#define D2CS_BAK_CHARINFO_DIR "/usr/local/var/bak/charinfo" -#define D2CS_BAK_CHARSAVE_DIR "/usr/local/var/bak/charsave" -#define D2CS_CHARSAVE_NEWBIE "/usr/local/var/files/newbie.save" -#define D2CS_TRANS_FILE "/usr/local/etc/address_translation.conf" -#define D2CS_LADDER_DIR "/usr/local/var/ladders" - -#define D2CS_MOTD "No MOTD yet" - -#define LIST_PURGE_INTERVAL 300 -#define GAMEQUEUE_CHECK_INTERVAL 60 - -#define MAX_GAME_LIST 20 - -#endif diff --git a/d2pack109/src/d2cs/version.h b/d2pack109/src/d2cs/version.h deleted file mode 100644 index c34fa80..0000000 --- a/d2pack109/src/d2cs/version.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_VERSION_H -#define INCLUDED_VERSION_H - -#define D2CS_VERSION_NUMBER 0x00010004 -#define D2CS_VERSION_STRING "0.1.0b4" -#define D2CS_VERSION "D2CS Version " D2CS_VERSION_STRING " Built " __DATE__ - -#endif diff --git a/d2pack109/src/d2cs/xstring.c b/d2pack109/src/d2cs/xstring.c deleted file mode 100644 index 3e0c576..0000000 --- a/d2pack109/src/d2cs/xstring.c +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#include -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include "compat/memcpy.h" -#include "compat/memmove.h" -#include "compat/strdup.h" - -#include "common/xalloc.h" -#include "xstring.h" -#include "common/setup_after.h" - -extern char * strtolower(char * str) -{ - unsigned int i; - unsigned char ch; - - if (!str) return NULL; - for (i=0; (ch=str[i]); i++) { - if ((isupper(ch))) str[i]=ch+('a'-'A'); - } - return str; -} - -extern unsigned char xtoi(unsigned char ch) -{ - unsigned char retval; - - if (isalpha(ch)) retval=tolower(ch); - else retval=ch; - if (retval < 'A') retval -= ('0'-0); - else retval -= ('a' - 0xa); - return retval; -} - -extern char * str_strip_affix(char * str, char const * affix) -{ - unsigned int i, j, n; - int match; - - if (!str) return NULL; - if (!affix) return str; - for (i=0; str[i]; i++) { - match=0; - for (n=0; affix[n]; n++) { - if (str[i]==affix[n]) { - match=1; - break; - } - } - if (!match) break; - } - for (j=strlen(str)-1; j>=i; j--) { - match=0; - for (n=0; affix[n]; n++) { - if (str[j]==affix[n]) { - match=1; - break; - } - } - if (!match) break; - } - if (i>j) { - str[0]='\0'; - } else { - memmove(str,str+i,j-i+1); - str[j-i+1]='\0'; - } - return str; -} - -extern char * hexstrdup(unsigned char const * src) -{ - char * dest; - int len; - - if (!src) return NULL; - dest=xstrdup(src); - len=hexstrtoraw(src,dest,strlen(dest)+1); - dest[len]='\0'; - return dest; -} - -extern unsigned int hexstrtoraw(unsigned char const * src, char * data, unsigned int datalen) -{ - unsigned char ch; - unsigned int i, j; - - for (i=0, j=0; j=n ) { - n += SPLIT_STRING_INCREASEMENT; - pindex=(int *)xrealloc(pindex,n * sizeof(int)); - } - pindex[*count]=j; - (*count)++; - if (str[i]=='"') { - i++; - while (str[i]) { - if (str[i]=='\\') { - i++; - if (!str[i]) break; - } else if (str[i]=='"') { - i++; - break; - } - temp[j++]=str[i++]; - } - } else { - while (str[i] && str[i] != ' ' && str[i] != '\t') { - temp[j++]=str[i++]; - } - } - temp[j++]='\0'; - } - index_size= *count * sizeof(char *); - if (!index_size) { - xfree(temp); - xfree(pindex); - return NULL; - } - result=xmalloc(j+index_size); - memcpy(result+index_size,temp,j); - - ptrindex=xmalloc(*count * sizeof (char*)); - for (i=0; i< *count; i++) { - ptrindex[i] = result + index_size + pindex[i]; - } - memcpy(result,ptrindex,index_size); - xfree(temp); - xfree(pindex); - xfree(ptrindex); - return (char * *)result; -} - -#define COMBINE_STRING_INIT_LEN 1024 -#define COMBINE_STRING_INCREASEMENT 1024 -extern char * arraytostr(char * * array, char const * delim, int count) -{ - int i; - unsigned int n; - char * result; - int need_delim; - - if (!delim || !array) return NULL; - - n=COMBINE_STRING_INIT_LEN; - result=xmalloc(n); - result[0]='\0'; - - need_delim=0; - for (i=0; i=n) { - n+=COMBINE_STRING_INCREASEMENT; - result=xrealloc(result,n); - } - if (need_delim) { - strcat(result,delim); - } - strcat(result,array[i]); - need_delim=1; - } - result=xrealloc(result,strlen(result)+1); - return result; -} - diff --git a/d2pack109/src/d2cs/xstring.h b/d2pack109/src/d2cs/xstring.h deleted file mode 100644 index 54f4018..0000000 --- a/d2pack109/src/d2cs/xstring.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_XSTRING_H -#define INCLUDED_XSTRING_H - -extern char * strtolower(char * str); -extern char * hexstrdup(unsigned char const * src); -extern unsigned int hexstrtoraw(unsigned char const * src, char * data, unsigned int datalen); -extern unsigned char xtoi(unsigned char ch); -extern char * * strtoargv(char const * str, unsigned int * count); -extern char * arraytostr(char * * array, char const * delim, int count); -extern char * str_strip_affix(char * str, char const * affix); - -#endif diff --git a/d2pack109/src/d2dbs/charlock.c b/d2pack109/src/d2dbs/charlock.c deleted file mode 100644 index cadbf5e..0000000 --- a/d2pack109/src/d2dbs/charlock.c +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (C) 2001 faster (lqx@cic.tsinghua.edu.cn) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#include -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strcasecmp.h" -#include -#ifdef HAVE_LIMITS_H -# include -#endif - -#include "charlock.h" -#include "common/introtate.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -/* FIXME: for simplification, no multiple realm support now */ - -/* local functions */ -static int cl_insert_to_gsq_list(unsigned int gsid, t_charlockinfo *pcl); -static int cl_delete_from_gsq_list(t_charlockinfo *pcl); -static unsigned int string_hash(char const *string); - - -/* variables */ -static unsigned int clitbl_len = 0; -static unsigned int gsqtbl_len = 0; -static t_charlockinfo * * clitbl = NULL; -static t_charlockinfo * * gsqtbl = NULL; - - -int cl_init(unsigned int tbllen, unsigned int maxgs) -{ - if (!tbllen || !maxgs) return -1; - cl_destroy(); - - clitbl = (t_charlockinfo**)xmalloc(tbllen*sizeof(t_charlockinfo**)); - gsqtbl = (t_charlockinfo**)xmalloc(maxgs*sizeof(t_charlockinfo**)); - memset(clitbl, 0, tbllen*sizeof(t_charlockinfo**)); - memset(gsqtbl, 0, maxgs*sizeof(t_charlockinfo**)); - clitbl_len = tbllen; - gsqtbl_len = maxgs; - return 0; -} - - -int cl_destroy(void) -{ - unsigned int i; - t_charlockinfo * ptl, * ptmp; - - if (clitbl) { - for (i=0; inext; - xfree(ptmp); - } - } - xfree(clitbl); - } - if (gsqtbl) xfree(gsqtbl); - clitbl = gsqtbl = NULL; - clitbl_len = gsqtbl_len = 0; - return 0; -} - - -int cl_query_charlock_status(unsigned char *charname, - unsigned char *realmname, unsigned int *gsid) -{ - t_charlockinfo *pcl; - unsigned int hashval; - - if (!charname || !realmname) return -1; - if (!clitbl_len || !gsqtbl) return -1; - if (strlen(charname)>=MAX_CHARNAME_LEN) return -1; - - hashval = string_hash(charname) % clitbl_len; - pcl = clitbl[hashval]; - while(pcl) - { - if (strcasecmp(pcl->charname, charname) == 0) { - *gsid = pcl->gsid; - return 1; /* found the char, it is locked */ - } - pcl = pcl->next; - } - return 0; /* not found, it is unlocked */ -} - - -int cl_lock_char(unsigned char *charname, - unsigned char *realmname, unsigned int gsid) -{ - t_charlockinfo *pcl, *ptmp; - unsigned int hashval; - - if (!charname || !realmname) return -1; - if (!clitbl_len || !gsqtbl) return -1; - if (strlen(charname)>=MAX_CHARNAME_LEN) return -1; - - hashval = string_hash(charname) % clitbl_len; - pcl = clitbl[hashval]; - ptmp = NULL; - while(pcl) - { - if (strcasecmp(pcl->charname, charname) == 0) - return 0; /* found the char is already locked */ - ptmp = pcl; - pcl = pcl->next; - } - - /* not found, locked it */ - pcl = (t_charlockinfo*)xmalloc(sizeof(t_charlockinfo)); - memset(pcl, 0, sizeof(t_charlockinfo)); - strncpy(pcl->charname, charname, MAX_CHARNAME_LEN-1); - strncpy(pcl->realmname, realmname, MAX_REALMNAME_LEN-1); - pcl->gsid = gsid; - - /* add to hash table link list */ - if (ptmp) ptmp->next = pcl; - else clitbl[hashval] = pcl; - /* add to gs specified link list */ - cl_insert_to_gsq_list(gsid, pcl); - - return 0; -} - - -int cl_unlock_char(unsigned char *charname, unsigned char *realmname) -{ - t_charlockinfo *pcl, *ptmp; - unsigned int hashval; - - if (!charname || !realmname) return -1; - if (!clitbl_len || !gsqtbl) return 0; - if (strlen(charname)>=MAX_CHARNAME_LEN) return -1; - - hashval = string_hash(charname) % clitbl_len; - pcl = clitbl[hashval]; - ptmp = NULL; - while(pcl) - { - if (strcasecmp(pcl->charname, charname) == 0) { - cl_delete_from_gsq_list(pcl); - if (ptmp) ptmp->next = pcl->next; - else clitbl[hashval] = pcl->next; - xfree(pcl); - return 0; - } - ptmp = pcl; - pcl = pcl->next; - } - return 0; -} - - -int cl_unlock_all_char_by_gsid(unsigned int gsid) -{ - unsigned int index_pos; - t_charlockinfo *pcl, *pnext; - - index_pos = gsid % gsqtbl_len; - pcl = gsqtbl[index_pos]; - while(pcl) - { - pnext = pcl->gsqnext; - cl_unlock_char(pcl->charname, pcl->realmname); - pcl = pnext; - } - return 0; -} - - -static int cl_insert_to_gsq_list(unsigned int gsid, t_charlockinfo *pcl) -{ - unsigned int index_pos; - t_charlockinfo *ptmp; - - if (!pcl) return -1; - - index_pos = gsid % gsqtbl_len; - ptmp = gsqtbl[index_pos]; - gsqtbl[index_pos] = pcl; - if (ptmp) { - pcl->gsqnext = ptmp; - ptmp->gsqprev = pcl; - } - return 0; -} - - -static int cl_delete_from_gsq_list(t_charlockinfo *pcl) -{ - unsigned int index_pos; - t_charlockinfo *pprev, *pnext; - - if (!pcl) return -1; - - index_pos = (pcl->gsid) % gsqtbl_len; - pprev = pcl->gsqprev; - pnext = pcl->gsqnext; - if (pprev) pprev->gsqnext = pnext; - else gsqtbl[index_pos] = pnext; - if (pnext) pnext->gsqprev = pprev; - - return 0; -} - - -static unsigned int string_hash(char const *string) -{ - unsigned int i; - unsigned int pos; - unsigned int hash; - unsigned int ch; - - if (!string) return 0; - - for (hash=0,pos=0,i=0; i -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif - -#include "version.h" -#include "cmdline_parse.h" -#include "d2cs/conf.h" -#include "common/eventlog.h" -#include "common/setup_after.h" - -static t_conf_table param_conf_table[]={ - { "-c", offsetof(t_param,prefs_file), conf_type_str, 0, D2DBS_DEFAULT_CONF_FILE}, - { "-l", offsetof(t_param,logfile), conf_type_str, 0, NULL }, - { "-h", offsetof(t_param,help), conf_type_bool,0, NULL }, - { "--help", offsetof(t_param,help), conf_type_bool,0, NULL }, - { "-v", offsetof(t_param,version), conf_type_bool,0, NULL }, - { "--version", offsetof(t_param,version), conf_type_bool,0, NULL }, - { "-f", offsetof(t_param,foreground), conf_type_bool,0, NULL }, - { "--foreground",offsetof(t_param,foreground), conf_type_bool,0, NULL }, - { "-D", offsetof(t_param,debugmode), conf_type_bool,0, NULL }, - { "--debug", offsetof(t_param,debugmode), conf_type_bool,0, NULL }, -#ifdef WIN32 - { "--service", offsetof(t_param,run_as_service),conf_type_bool,0, NULL }, - { "-s", offsetof(t_param,make_service), conf_type_str, 0, NULL }, -#endif - { NULL, 0, conf_type_none,0, NULL } -}; - -static t_param cmdline_param; - -static char help_message[]="Usage: d2dbs []\n" -" -m : set memory debug logging file to FILE\n" -" -c : set configuration file to FILE\n" -" -l : set log to FILE\n" -" -h, --help: show this help message and exit\n" -" -v, --version: show version information and exit\n" -" -f, --foreground: start in foreground mode (don`t daemonize)\n" -" -D, --debug: run in debug mode (run in foreground and log to stdout)\n" -#ifdef WIN32 -" Running as service functions:\n" -" --service run as service\n" -" -s install install service\n" -" -s uninstall uninstall service\n" -#endif -"\n" -"Notes:\n" -" 1.You should always use absolute path here for all FILE names\n\n"; - -extern void d2dbs_cmdline_show_help(void) -{ - fprintf(stderr,help_message); - return; -} - -extern void d2dbs_cmdline_show_version(void) -{ - fprintf(stderr,D2DBS_VERSION); - fprintf(stderr,"\n\n"); - return; -} - -extern int d2dbs_cmdline_parse(int argc, char ** argv) -{ - memset(&cmdline_param,0, sizeof(cmdline_param)); - if (conf_parse_param(argc, argv, param_conf_table, &cmdline_param, sizeof(cmdline_param))<0) { - return -1; - } - return 0; -} - -extern int d2dbs_cmdline_cleanup(void) -{ - return conf_cleanup(param_conf_table, &cmdline_param, sizeof(cmdline_param)); -} - -extern char const * d2dbs_cmdline_get_prefs_file(void) -{ - return cmdline_param.prefs_file; -} - -extern unsigned int d2dbs_cmdline_get_help(void) -{ - return cmdline_param.help; -} - -extern unsigned int d2dbs_cmdline_get_version(void) -{ - return cmdline_param.version; -} - -extern unsigned int d2dbs_cmdline_get_foreground(void) -{ - return cmdline_param.foreground; -} - -extern char const * d2dbs_cmdline_get_logfile(void) -{ - return cmdline_param.logfile; -} - -extern unsigned int d2dbs_cmdline_get_debugmode(void) -{ - return cmdline_param.debugmode; -} - -#ifdef WIN32 -extern unsigned int d2dbs_cmdline_get_run_as_service(void) -{ - return cmdline_param.run_as_service; -} - -extern char const * d2dbs_cmdline_get_make_service(void) -{ - return cmdline_param.make_service; -} - -#endif diff --git a/d2pack109/src/d2dbs/cmdline_parse.h b/d2pack109/src/d2dbs/cmdline_parse.h deleted file mode 100644 index a445d25..0000000 --- a/d2pack109/src/d2dbs/cmdline_parse.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_CMDLINE_PARSE_H -#define INCLUDED_CMDLINE_PARSE_H - -typedef struct -{ - char const * prefs_file; - char const * logfile; - unsigned int foreground; - unsigned int help; - unsigned int version; - unsigned int debugmode; - unsigned int run_as_service; - char const * make_service; -} t_param; - -extern int d2dbs_cmdline_parse(int argc, char ** argv); -extern int d2dbs_cmdline_cleanup(void); -extern void d2dbs_cmdline_show_help(void); -extern void d2dbs_cmdline_show_version(void); -extern char const * d2dbs_cmdline_get_prefs_file(void); -extern char const * d2dbs_cmdline_get_logfile(void); -extern unsigned int d2dbs_cmdline_get_version(void); -extern unsigned int d2dbs_cmdline_get_help(void); -extern unsigned int d2dbs_cmdline_get_foreground(void); -extern unsigned int d2dbs_cmdline_get_debugmode(void); -#ifdef WIN32 -extern unsigned int d2dbs_cmdline_get_run_as_service(void); -extern char const * d2dbs_cmdline_get_make_service(void); -#endif - -#endif diff --git a/d2pack109/src/d2dbs/d2ladder.c b/d2pack109/src/d2dbs/d2ladder.c deleted file mode 100644 index d30fc5c..0000000 --- a/d2pack109/src/d2dbs/d2ladder.c +++ /dev/null @@ -1,965 +0,0 @@ -/* - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_SYS_FILE_H -#include -#endif -#ifdef HAVE_FCNTL_H -# include -#else -# ifdef HAVE_SYS_FILE_H -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#include "compat/rename.h" -#include "d2ladder.h" -#include "prefs.h" -#include "common/tag.h" -#include "common/list.h" -#include "common/eventlog.h" -#include "compat/strncasecmp.h" -#include "d2cs/d2charfile.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -char * d2ladder_ladder_file = NULL; -char * d2ladder_backup_file = NULL; - -t_d2ladderlist * d2ladder_list = NULL; -unsigned long d2ladder_maxtype; -int d2ladder_change_count=0; -int d2ladder_need_rebuild = 0; -char * XMLname = "d2ladder.xml"; - - -int d2ladderlist_init(void); -int d2ladderlist_destroy(void); -int d2ladder_empty(void); -int d2ladder_initladderfile(void); - -t_d2ladder * d2ladderlist_find_type(unsigned int type); - -int d2ladder_check(void); -int d2ladder_readladder(void); - -int d2ladder_insert(t_d2ladder * d2ladder,t_d2ladder_info * pcharladderinfo); -int d2ladder_find_char_all(t_d2ladder * d2ladder, t_d2ladder_info * info); -int d2ladder_find_pos(t_d2ladder * d2ladder, t_d2ladder_info * info); -int d2ladder_update_info_and_pos(t_d2ladder * d2ladder, t_d2ladder_info * info, int oldpos, int newpos); -int d2ladder_checksum(unsigned char const * data, unsigned int len,unsigned int offset); -int d2ladder_checksum_set(void); -int d2ladder_checksum_check(void); - - -extern int d2ladder_update(t_d2ladder_info * pcharladderinfo) -{ - t_d2ladder * d2ladder; - unsigned short hardcore,expansion,status; - unsigned char class; - unsigned int ladder_overall_type,ladder_class_type; - - if (!pcharladderinfo->charname[0]) return 0; - class=pcharladderinfo->class; - status=pcharladderinfo->status; - - hardcore=charstatus_get_hardcore(status); - expansion=charstatus_get_expansion(status); - ladder_overall_type=0; - if (!expansion && class> D2CHAR_CLASS_MAX ) return -1; - if (expansion && class> D2CHAR_EXP_CLASS_MAX ) return -1; - if (hardcore && expansion) { - ladder_overall_type=D2LADDER_EXP_HC_OVERALL; - } else if (!hardcore && expansion) { - ladder_overall_type=D2LADDER_EXP_STD_OVERALL; - } else if (hardcore && !expansion) { - ladder_overall_type=D2LADDER_HC_OVERALL; - } else if (!hardcore && !expansion) { - ladder_overall_type=D2LADDER_STD_OVERALL; - } - - ladder_class_type=ladder_overall_type + class+1; - - d2ladder=d2ladderlist_find_type(ladder_overall_type); - if(d2ladder_insert(d2ladder,pcharladderinfo)==1) { - d2ladder_change_count++; - } - - d2ladder=d2ladderlist_find_type(ladder_class_type); - if(d2ladder_insert(d2ladder,pcharladderinfo)==1) { - d2ladder_change_count++; - } - return 0; -} - -int d2ladder_initladderfile(void) -{ - FILE * fdladder; - t_d2ladderfile_ladderindex lhead[D2LADDER_MAXTYPE]; - t_d2ladderfile_header fileheader; - int start; - unsigned long maxtype; - t_d2ladderfile_ladderinfo emptydata; - unsigned int i,j, number; - - maxtype=D2LADDER_MAXTYPE; - start=sizeof(t_d2ladderfile_header)+sizeof(lhead); - for(i=0;iD2LADDER_HC_OVERALL && i<=D2LADDER_HC_OVERALL+D2CHAR_CLASS_MAX +1) || - (i>D2LADDER_STD_OVERALL && i<=D2LADDER_STD_OVERALL+D2CHAR_CLASS_MAX +1) || - (i>D2LADDER_EXP_HC_OVERALL && i<=D2LADDER_EXP_HC_OVERALL+D2CHAR_EXP_CLASS_MAX +1) || - (i>D2LADDER_EXP_STD_OVERALL && i<=D2LADDER_EXP_STD_OVERALL+D2CHAR_EXP_CLASS_MAX +1)) { - number=D2LADDER_MAXNUM; - } else { - number=0; - } - bn_int_set(&lhead[i].number,number); - start += number*sizeof(emptydata); - } - memset(&emptydata,0,sizeof(emptydata)); - if (!d2ladder_ladder_file) return -1; - fdladder=fopen(d2ladder_ladder_file,"wb"); - if(fdladder) { - bn_int_set(&fileheader.maxtype,maxtype); - bn_int_set(&fileheader.checksum,0); - fwrite(&fileheader,1,sizeof(fileheader),fdladder); - fwrite(lhead,1,sizeof(lhead),fdladder); - for(i=0;iexperience < prefs_get_ladderupdate_threshold()) return -1; - - i=d2ladder->len; - while (i--) { - if (d2ladder->info[i].experience > info->experience) { - if (strncasecmp(d2ladder->info[i].charname,info->charname, MAX_CHARNAME_LEN)) { - i++; - } - break; - } - if (i<=0) break; - } - return i; -} - - -int d2ladder_insert(t_d2ladder * d2ladder,t_d2ladder_info * info) -{ - int oldpos, newpos; - - newpos=d2ladder_find_pos(d2ladder,info); - /* we currectly do nothing when character is being kick out of ladder for simple */ - /* - if (newpos<0 || newpos >= d2ladder->len) return 0; - */ - oldpos=d2ladder_find_char_all(d2ladder,info); - return d2ladder_update_info_and_pos(d2ladder,info,oldpos,newpos); -} - -int d2ladder_find_char_all(t_d2ladder * d2ladder, t_d2ladder_info * info) -{ - int i; - t_d2ladder_info * ladderdata; - - if (!d2ladder || !info) return -1; - ladderdata=d2ladder->info; - if (!ladderdata) return -1; - i=d2ladder->len; - while (i--) { - if (!strncmp(ladderdata[i].charname,info->charname,MAX_CHARNAME_LEN)) return i; - } - return -1; -} - -int d2ladder_update_info_and_pos(t_d2ladder * d2ladder, t_d2ladder_info * info, int oldpos, int newpos) -{ - int i; - int direction; - int outflag; - t_d2ladder_info * ladderdata; - - if (!d2ladder || !info) return -1; - ladderdata=d2ladder->info; - if (!ladderdata) return -1; - - /* character not in ladder before */ - outflag=0; - if (oldpos < 0 || oldpos >= (signed)d2ladder->len) { - oldpos = d2ladder->len-1; - } - if (newpos < 0 || newpos >= (signed)d2ladder->len) { - newpos = d2ladder->len-1; - outflag = 1; - } - if ((oldpos == (signed)d2ladder->len -1) && outflag) { - return 0; - } - if (newpos > oldpos && !outflag ) newpos--; - direction = (newpos > oldpos)? 1: -1; - for (i=oldpos; i!=newpos; i+=direction) { - ladderdata[i] = ladderdata[i+direction]; - } - ladderdata[i]=*info; - return 1; -} - - -extern int d2ladder_rebuild(void) -{ - d2ladder_empty(); - d2ladder_need_rebuild = 0; - return 0; -} - -int d2ladder_check(void) -{ - if (!d2ladder_ladder_file) return -1; - if (!d2ladder_backup_file) return -1; - if(d2ladder_checksum_check()!=1) { - eventlog(eventlog_level_error,__FUNCTION__,"ladder file checksum error,try to use backup file"); - if (p_rename(d2ladder_backup_file,d2ladder_ladder_file)==-1) { - eventlog(eventlog_level_error,__FUNCTION__,"error rename %s to %s", d2ladder_backup_file,d2ladder_ladder_file); - } - if(d2ladder_checksum_check()!=1) { - eventlog(eventlog_level_error,__FUNCTION__,"ladder backup file checksum error,rebuild ladder"); - if (d2ladder_initladderfile()<0) return -1; - else { - d2ladder_need_rebuild=1; - return 0; - } - } - } - return 1; -} - - -t_d2ladder * d2ladderlist_find_type(unsigned int type) -{ - t_d2ladder * d2ladder; - t_elem const * elem; - - if (!d2ladder_list) { - eventlog(eventlog_level_error,__FUNCTION__,"got NULL d2ladder_list"); - return NULL; - } - - LIST_TRAVERSE_CONST(d2ladder_list,elem) - { - if (!(d2ladder=elem_get_data(elem))) continue; - if (d2ladder->type==type) return d2ladder; - } - eventlog(eventlog_level_error,__FUNCTION__,"could not find type %d in d2ladder_list",type); - return NULL; -} - -extern int d2dbs_d2ladder_init(void) -{ - d2ladder_change_count=0; - d2ladder_maxtype=0; - d2ladder_ladder_file=xmalloc(strlen(d2dbs_prefs_get_ladder_dir())+1+\ - strlen(LADDER_FILE_PREFIX)+1+strlen(CLIENTTAG_DIABLO2DV)+1+10); - d2ladder_backup_file=xmalloc(strlen(d2dbs_prefs_get_ladder_dir())+1+\ - strlen(LADDER_BACKUP_PREFIX)+1+strlen(CLIENTTAG_DIABLO2DV)+1+10); - if (!d2ladder_ladder_file) return -1; - if (!d2ladder_backup_file) return -1; - sprintf(d2ladder_ladder_file,"%s/%s.%s",d2dbs_prefs_get_ladder_dir(),\ - LADDER_FILE_PREFIX,CLIENTTAG_DIABLO2DV); - - sprintf(d2ladder_backup_file,"%s/%s.%s",d2dbs_prefs_get_ladder_dir(),\ - LADDER_BACKUP_PREFIX,CLIENTTAG_DIABLO2DV); - - if (d2ladderlist_init()<0) { - return -1; - } - if(d2ladder_check()<0) { - eventlog(eventlog_level_error,__FUNCTION__,"ladder file checking error"); - return -1; - } - if (d2ladder_readladder()<0) { - return -1; - } - if (d2ladder_need_rebuild) d2ladder_rebuild(); - d2ladder_saveladder(); - return 0; -} - -int d2ladderlist_init(void) -{ - t_d2ladder * d2ladder; - unsigned int i; - - - if (!d2ladder_ladder_file) return -1; - d2ladder_list=list_create(); - d2ladder_maxtype=D2LADDER_MAXTYPE; - for (i=0;itype=i; - d2ladder->info=NULL; - d2ladder->len=0; - list_append_data(d2ladder_list,d2ladder); - } - return 0; -} - -int d2ladder_readladder(void) -{ - t_d2ladder * d2ladder; - t_d2ladderfile_header fileheader; - FILE * fdladder; - t_d2ladderfile_ladderindex * lhead; - t_d2ladderfile_ladderinfo * ldata; - t_d2ladder_info * info; - t_d2ladder_info temp; - long leftsize,blocksize; - unsigned int laddertype; - unsigned int tempmaxtype; - int readlen; - unsigned int i, number; - - if (!d2ladder_ladder_file) return -1; - fdladder=fopen(d2ladder_ladder_file,"rb"); - if(!fdladder) { - eventlog(eventlog_level_error,__FUNCTION__,"canot open ladder file"); - return -1; - } - - fseek(fdladder,0,SEEK_END); - leftsize=ftell(fdladder); - rewind(fdladder); - - blocksize=sizeof(fileheader) ; - if (leftsizeD2LADDER_MAXTYPE) { - eventlog(eventlog_level_error,__FUNCTION__,"ladder type > D2LADDER_MAXTYPE error"); - fclose(fdladder); - return -1; - } - d2ladder_maxtype=tempmaxtype; - - blocksize=d2ladder_maxtype*sizeof(*lhead); - if (leftsize < blocksize ) { - eventlog(eventlog_level_error,__FUNCTION__,"file size error"); - fclose(fdladder); - return -1; - } - - if (!(lhead=xmalloc(blocksize))) { - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for lhead"); - fclose(fdladder); - return -1; - } - readlen=fread(lhead,1,d2ladder_maxtype*sizeof(*lhead),fdladder); - if (readlen<=0) { - eventlog(eventlog_level_error,__FUNCTION__,"file %s read error(read:%s)",d2ladder_ladder_file,strerror(errno)); - xfree(lhead); - fclose(fdladder); - return -1; - } - leftsize-=blocksize; - - blocksize=0; - for(i=0;iinfo=info; - d2ladder->len=number; - for (i=0; i< number; i++) { - if (!ldata[i].charname[0]) continue; - temp.experience=bn_int_get(ldata[i].experience); - temp.status=bn_short_get(ldata[i].status); - temp.level=bn_byte_get(ldata[i].level); - temp.class=bn_byte_get(ldata[i].class); - strncpy(temp.charname,ldata[i].charname,sizeof(info[i].charname)); - if (d2ladder_update_info_and_pos(d2ladder,&temp, - d2ladder_find_char_all(d2ladder,&temp), - d2ladder_find_pos(d2ladder,&temp))==1) { - d2ladder_change_count++; - } - } - xfree(ldata); - } - leftsize-=blocksize; - - xfree(lhead); - fclose(fdladder); - return 0; -} - -extern int d2dbs_d2ladder_destroy(void) -{ - unsigned int i; - t_d2ladder * d2ladder; - - d2ladder_saveladder(); - for (i=0;iinfo) - xfree(d2ladder->info); - d2ladder->info=NULL; - d2ladder->len=0; - } - } - d2ladderlist_destroy(); - if (d2ladder_ladder_file) { - xfree(d2ladder_ladder_file); - d2ladder_ladder_file=NULL; - } - if (d2ladder_backup_file) { - xfree(d2ladder_backup_file); - d2ladder_backup_file=NULL; - } - return 0; -} - -int d2ladderlist_destroy(void) -{ - t_d2ladder * d2ladder; - t_elem * elem; - - if (!d2ladder_list) return -1; - LIST_TRAVERSE(d2ladder_list,elem) - { - if (!(d2ladder=elem_get_data(elem))) continue; - xfree(d2ladder); - list_remove_elem(d2ladder_list,&elem); - } - list_destroy(d2ladder_list); - return 0; -} - -int d2ladder_empty(void) -{ - unsigned int i; - t_d2ladder * d2ladder; - - for (i=0;iinfo,0,d2ladder->len * sizeof(*d2ladder->info)); - } - } - return 0; -} - -const char * get_prefix(int type, int status, int class) -{ - int difficulty; - static char prefix [4][4][2][16] = - {{{"",""},{"",""},{"",""},{"",""}}, - - {{"Count" ,"Countess"} , {"Sir","Dame"}, - {"Destroyer","Destroyer"} , {"Slayer","Slayer"}}, - - {{"Duke" ,"Duchess"} , {"Lord","Lady"}, - {"Conqueror","Conqueror"} , {"Champion","Champion"}}, - - {{"King" ,"Queen"} , {"Baron","Baroness"}, - {"Guardian","Guardian"} , {"Patriarch","Matriarch"}}}; - - static int sex[11] = {0,1,1,0,0,0,0,1,0,0,0}; - - difficulty = ((status >> 0x08) & 0x0f) / 5; - - - return prefix[difficulty][type][sex[class]]; -} - -int d2ladder_print_XML(FILE *ladderstrm) -{ - // modified version of d2ladder_print - changes done by jfro with a little help of aaron - t_d2ladder * d2ladder; - t_d2ladder_info * ldata; - int overalltype,classtype; - unsigned int i,type; - char laddermode[4][20]={"Hardcore", "Standard","Expansion HC","Expansion" }; - char charclass[11][12]={"OverAll", "Amazon", "Sorceress", "Necromancer", "Paladin",\ - "Barbarian", "Druid", "Assassin", "","",""} ; - - fprintf(ladderstrm,"\n\n"); - for(type=0; type len<=0) - continue; - ldata=d2ladder->info; - - overalltype=0; - classtype=0; - - if(type<= D2LADDER_HC_OVERALL+D2CHAR_CLASS_MAX +1) - { - overalltype=0 ; - classtype=type-D2LADDER_HC_OVERALL; - } - else if(type >= D2LADDER_STD_OVERALL && type<= D2LADDER_STD_OVERALL+D2CHAR_CLASS_MAX +1) - { - overalltype=1; - classtype=type-D2LADDER_STD_OVERALL; - } - else if(type >= D2LADDER_EXP_HC_OVERALL && type<= D2LADDER_EXP_HC_OVERALL+D2CHAR_EXP_CLASS_MAX +1) - { - overalltype=2; - classtype=type-D2LADDER_EXP_HC_OVERALL; - } - else if(type >= D2LADDER_EXP_STD_OVERALL && type<= D2LADDER_EXP_STD_OVERALL+D2CHAR_EXP_CLASS_MAX +1) - { - overalltype=3; - classtype=type-D2LADDER_EXP_STD_OVERALL ; - } - - fprintf(ladderstrm,"\n\t%d\n\t%s\n\t%s\n", - type,laddermode[overalltype],charclass[classtype]); - for(i=0; ilen; i++) - { - if ((ldata[i].charname != NULL) && (ldata[i].charname[0] != '\0')) - { - fprintf(ladderstrm,"\t\n\t\t%2d\n\t\t%s\n\t\t%2d\n", - i+1,ldata[i].charname,ldata[i].level); - fprintf(ladderstrm,"\t\t%d\n\t\t%s\n", - ldata[i].experience,charclass[ldata[i].class+1]); - fprintf(ladderstrm,"\t\t%s\n", - get_prefix(overalltype,ldata[i].status,ldata[i].class+1)); - if (((ldata[i].status) & (D2CHARINFO_STATUS_FLAG_DEAD | D2CHARINFO_STATUS_FLAG_HARDCORE)) == - (D2CHARINFO_STATUS_FLAG_DEAD | D2CHARINFO_STATUS_FLAG_HARDCORE)) - fprintf(ladderstrm,"\t\tdead\n\t\n"); - else - fprintf(ladderstrm,"\t\talive\n\t\n"); - } - } - fprintf(ladderstrm,"\n"); - fflush(ladderstrm); - } - fprintf(ladderstrm,"\n"); - return 0; -} - -extern int d2ladder_saveladder(void) -{ - t_d2ladderfile_ladderindex lhead[D2LADDER_MAXTYPE]; - t_d2ladderfile_header fileheader; - FILE * fdladder; - int start; - unsigned int i,j, number; - t_d2ladder * d2ladder; - t_d2ladderfile_ladderinfo * ldata; - char * XMLfilename; - FILE * XMLfile; - -/* - if(!d2ladder_change_count) { - eventlog(eventlog_level_debug,__FUNCTION__,"ladder data unchanged, skip saving"); - return 0; - } -*/ - start=sizeof(fileheader)+sizeof(lhead); - - for(i=0;itype); - bn_int_set(&lhead[i].offset,start); - bn_int_set(&lhead[i].number,d2ladder->len); - start+=d2ladder->len*sizeof(*ldata); - } - - if (!d2ladder_ladder_file) return -1; - if (!d2ladder_backup_file) return -1; - - if(d2ladder_checksum_check()==1) { - eventlog(eventlog_level_info,__FUNCTION__,"backup ladder file"); - if (p_rename(d2ladder_ladder_file,d2ladder_backup_file)==-1) { - eventlog(eventlog_level_warn,__FUNCTION__,"error rename %s to %s", d2ladder_ladder_file, d2ladder_backup_file); - } - } - - fdladder=fopen(d2ladder_ladder_file,"wb"); - if(!fdladder) { - eventlog(eventlog_level_error,__FUNCTION__,"error open ladder file %s",d2ladder_ladder_file); - return -1; - } - - // aaron: add extra output for XML ladder here ---> - if (d2dbs_prefs_get_XML_output_ladder()) - { - XMLfilename = xmalloc(strlen(d2dbs_prefs_get_ladder_dir())+1+strlen(XMLname)+1); - if (!XMLfilename) - { - eventlog(eventlog_level_error,__FUNCTION__,"could not alloc mem for XML ladder filename"); - } - else - { - sprintf(XMLfilename,"%s/%s",d2dbs_prefs_get_ladder_dir(),XMLname); - if (!(XMLfile = fopen(XMLfilename,"w"))) - { - eventlog(eventlog_level_error,__FUNCTION__,"could not open XML ladder file for output"); - } - else - { - d2ladder_print_XML(XMLfile); - fclose(XMLfile); - xfree(XMLfilename); - } - } - } - - // <--- - - bn_int_set(&fileheader.maxtype,d2ladder_maxtype); - bn_int_set(&fileheader.checksum,0); - fwrite(&fileheader,1,sizeof(fileheader),fdladder); - fwrite(lhead,1,sizeof(lhead),fdladder); - for(i=0;iinfo[j].experience); - bn_short_set(&ldata[j].status, d2ladder->info[j].status); - bn_byte_set(&ldata[j].level, d2ladder->info[j].level); - bn_byte_set(&ldata[j].class, d2ladder->info[j].class); - strncpy(ldata[j].charname,d2ladder->info[j].charname,sizeof(ldata[j].charname)); - } - fwrite(ldata,1,number*sizeof(*ldata),fdladder); - xfree(ldata); - } - fclose(fdladder); - d2ladder_checksum_set(); - eventlog(eventlog_level_info,__FUNCTION__,"ladder file saved (%d changes)",d2ladder_change_count); - d2ladder_change_count=0; - return 0; -} - -int d2ladder_print(FILE *ladderstrm) -{ - t_d2ladder * d2ladder; - t_d2ladder_info * ldata; - unsigned int i,type; - int overalltype,classtype; - char laddermode[4][20]={"Hardcore", "Standard","Expansion HC","Expansion" }; - char charclass[11][12]={"OverAll", "Amazon", "Sorceress", "Necromancer", "Paladin",\ - "Barbarian", "Druid", "Assassin", "","",""} ; - - for(type=0; type len<=0) - continue; - ldata=d2ladder->info; - - overalltype=0; - classtype=0; - - if(type<= D2LADDER_HC_OVERALL+D2CHAR_CLASS_MAX +1) - { - overalltype=0 ; - classtype=type-D2LADDER_HC_OVERALL; - } - else if (type >= D2LADDER_STD_OVERALL && type<= D2LADDER_STD_OVERALL+D2CHAR_CLASS_MAX +1) - { - overalltype=1; - classtype=type-D2LADDER_STD_OVERALL; - } - else if (type >= D2LADDER_EXP_HC_OVERALL && type<= D2LADDER_EXP_HC_OVERALL+D2CHAR_EXP_CLASS_MAX +1) - { - overalltype=2; - classtype=type-D2LADDER_EXP_HC_OVERALL; - } - else if (type >= D2LADDER_EXP_STD_OVERALL && type<= D2LADDER_EXP_STD_OVERALL+D2CHAR_EXP_CLASS_MAX +1) - { - overalltype=3; - classtype=type- D2LADDER_EXP_STD_OVERALL ; - } - - fprintf(ladderstrm,"ladder type %d %s %s\n",type,laddermode[overalltype],charclass[classtype]); - fprintf(ladderstrm,"************************************************************************\n"); - fprintf(ladderstrm,"No character name level exp status title class \n"); - for(i=0; ilen; i++) - { - fprintf(ladderstrm,"NO.%2d %-16s %2d %10d %2X %1X %s\n", - i+1, - ldata[i].charname, - ldata[i].level, - ldata[i].experience, - ldata[i].status, - 1, - charclass[ldata[i].class+1]); - } - fprintf(ladderstrm,"************************************************************************\n"); - fflush(ladderstrm); - } - return 0; -} - -int d2ladder_checksum(unsigned char const * data, unsigned int len,unsigned int offset) -{ - int checksum; - unsigned int i; - unsigned int ch; - - if (!data) return 0; - checksum=0; - for (i=0; i=offset && i 2000) - len = 2000; - else - len = filesize-curlen; - readlen=fread(buffer+curlen,1,len,fdladder); - if (readlen<=0) { - xfree(buffer); - fclose(fdladder); - eventlog(eventlog_level_error,__FUNCTION__,"got bad save file or read error(read:%s)",strerror(errno)); - return -1; - } - curlen+=readlen; - } - - bn_int_set(&checksum,d2ladder_checksum(buffer,filesize,LADDERFILE_CHECKSUM_OFFSET)); - fseek(fdladder,LADDERFILE_CHECKSUM_OFFSET,SEEK_SET); - fwrite(&checksum,1,sizeof(checksum),fdladder); - xfree(buffer); - fclose(fdladder); - return 0; -} - -int d2ladder_checksum_check(void) -{ - FILE * fdladder; - off_t filesize; - int curlen,readlen,len; - unsigned char * buffer; - int checksum,oldchecksum; - t_d2ladderfile_header * header; - - if (!d2ladder_ladder_file) return -1; - fdladder=fopen(d2ladder_ladder_file,"rb"); - if(!fdladder) { - eventlog(eventlog_level_error,__FUNCTION__,"error open ladder file %s",d2ladder_ladder_file); - return -1; - } - fseek(fdladder,0,SEEK_END); - filesize=ftell(fdladder); - rewind(fdladder); - if(filesize==(off_t)-1) { - eventlog(eventlog_level_error,__FUNCTION__,"lseek() error in ladder file %s",d2ladder_ladder_file); - fclose(fdladder); - return -1; - } - if(filesize<(signed)sizeof(t_d2ladderfile_header)) { - eventlog(eventlog_level_error,__FUNCTION__,"ladder file size error :%s",d2ladder_ladder_file); - fclose(fdladder); - return -1; - } - if (!(buffer=xmalloc(filesize))) { - fclose(fdladder); - eventlog(eventlog_level_error,__FUNCTION__,"could not allocate memory for buffer"); - return -1; - } - header=(t_d2ladderfile_header *)buffer; - curlen=0; - while(curlen 2000) - len = 2000; - else - len = filesize-curlen; - readlen=fread(buffer+curlen,1,len,fdladder); - if (readlen<=0) { - xfree(buffer); - fclose(fdladder); - eventlog(eventlog_level_error,__FUNCTION__,"got bad save file or read error(read:%s)",strerror(errno)); - return -1; - } - curlen+=readlen; - } - fclose(fdladder); - - oldchecksum=bn_int_get(header->checksum); - checksum=d2ladder_checksum(buffer,filesize,LADDERFILE_CHECKSUM_OFFSET); - xfree(buffer); - - if(oldchecksum==checksum) { - eventlog(eventlog_level_info,__FUNCTION__,"ladder file check pass (checksum=0x%X)",checksum); - return 1; - } else { - eventlog(eventlog_level_debug,__FUNCTION__,"ladder file checksum mismatch 0x%X - 0x%X",oldchecksum, checksum); - return 0; - } -} diff --git a/d2pack109/src/d2dbs/d2ladder.h b/d2pack109/src/d2dbs/d2ladder.h deleted file mode 100644 index 26c9bf2..0000000 --- a/d2pack109/src/d2dbs/d2ladder.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_D2LADDER_H -#define INCLUDED_D2LADDER_H - -#include -#include "common/list.h" -#include "d2cs/d2cs_d2dbs_ladder.h" -#define JUST_NEED_TYPES -#include "d2cs/d2charfile.h" -#undef JUST_NEED_TYPES - -#define LADDER_BACKUP_PREFIX "ladderbk" -#define DEFAULT_LADDER_DIR "var/ladders" -#define LADDERFILE_CHECKSUM_OFFSET offsetof(t_d2ladderfile_header,checksum) - -typedef struct -{ - unsigned int experience; - unsigned short status; - unsigned char level; - unsigned char class; - char charname[MAX_CHARNAME_LEN]; -} t_d2ladder_info; - -typedef struct -{ - unsigned int type; - t_d2ladder_info * info; - unsigned int len; -} t_d2ladder; - -typedef t_list t_d2ladderlist; - -#define D2LADDER_MAXNUM 200 -#define D2LADDER_OVERALL_MAXNUM 1000 -#define D2LADDER_MAXTYPE 35 - -extern int d2dbs_d2ladder_init(void); -extern int d2dbs_d2ladder_destroy(void); -extern int d2ladder_rebuild(void); -extern int d2ladder_update(t_d2ladder_info * pcharladderinfo); -extern int d2ladder_print(FILE * ladderstrm); -extern int d2ladder_saveladder(void); - -#endif diff --git a/d2pack109/src/d2dbs/dbsdupecheck.c b/d2pack109/src/d2dbs/dbsdupecheck.c deleted file mode 100644 index ee51bb9..0000000 --- a/d2pack109/src/d2dbs/dbsdupecheck.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2001 faster (lqx@cic.tsinghua.edu.cn) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#include -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strcasecmp.h" -#include -#ifdef HAVE_LIMITS_H -# include -#endif -#include "dbsdupecheck.h" -#include "common/setup_after.h" -#include "common/bn_type.h" -#include "common/eventlog.h" - -const char * delimiter = "JM"; - -int is_delimit(char * data) -{ - if ((data[0]==delimiter[0]) && (data[1]==delimiter[1])) return 1; - else return 0; -} - -void * find_delimiter(char * data, unsigned int datalen) -{ - char * datap = data; - unsigned int count; - for (count=1; count -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_FCNTL_H -# include -#else -# ifdef HAVE_SYS_FILE_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/memset.h" -#include -#include "compat/strerror.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/socket.h" -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#ifdef HAVE_ARPA_INET_H -# include -#endif -#include "compat/inet_ntoa.h" -#include "compat/psock.h" - -#include "dbserver.h" -#include "charlock.h" -#include "d2ladder.h" -#include "dbspacket.h" -#include "prefs.h" -#include "handle_signal.h" -#include "common/list.h" -#include "common/eventlog.h" -#include "common/addr.h" -#include "common/xalloc.h" -#ifdef WIN32 -# include /* for kbhit() and getch() */ -#endif -#include "common/setup_after.h" - - -static int dbs_packet_gs_id = 0; -static t_preset_d2gsid *preset_d2gsid_head = NULL; -t_list * dbs_server_connection_list = NULL; -int dbs_server_listen_socket=-1; - -extern int g_ServiceStatus; - -/* dbs_server_main - * The module's driver function -- we just call other functions and - * interpret their results. - */ - -static int dbs_handle_timed_events(void); -static void dbs_on_exit(void); - -int dbs_server_init(void); -void dbs_server_loop(int ListeningSocket); -int dbs_server_setup_fdsets(fd_set * pReadFDs, fd_set * pWriteFDs, - fd_set * pExceptFDs, int ListeningSocket ) ; -BOOL dbs_server_read_data(t_d2dbs_connection* conn) ; -BOOL dbs_server_write_data(t_d2dbs_connection* conn) ; -int dbs_server_list_add_socket(int sd, unsigned int ipaddr); -static int setsockopt_keepalive(int sock); -static unsigned int get_preset_d2gsid(unsigned int ipaddr); - - -int dbs_server_main(void) -{ - eventlog(eventlog_level_info,__FUNCTION__,"establishing the listener..."); - dbs_server_listen_socket = dbs_server_init(); - if (dbs_server_listen_socket<0) { - eventlog(eventlog_level_error,__FUNCTION__,"dbs_server_init error "); - return 3; - } - eventlog(eventlog_level_info,__FUNCTION__,"waiting for connections..."); - dbs_server_loop(dbs_server_listen_socket); - dbs_on_exit(); - return 0; -} - -/* dbs_server_init - * Sets up a listener on the given interface and port, returning the - * listening socket if successful; if not, returns -1. - */ -/* FIXME: No it doesn't! pcAddress is not ever referenced in this - * function. - * CreepLord: Fixed much better way (will accept dns hostnames) - */ -int dbs_server_init(void) -{ - int sd; - struct sockaddr_in sinInterface; - int val; - t_addr * servaddr; - - dbs_server_connection_list=list_create(); - - if (d2dbs_d2ladder_init()==-1) - { - eventlog(eventlog_level_error,__FUNCTION__,"d2ladder_init() failed"); - return -1; - } - - if (cl_init(DEFAULT_HASHTBL_LEN, DEFAULT_GS_MAX)==-1) - { - eventlog(eventlog_level_error,__FUNCTION__,"cl_init() failed"); - return -1; - } - - if (psock_init()<0) - { - eventlog(eventlog_level_error,__FUNCTION__,"psock_init() failed"); - return -1; - } - - sd = psock_socket(PSOCK_PF_INET, PSOCK_SOCK_STREAM, PSOCK_IPPROTO_TCP); - if (sd==-1) - { - eventlog(eventlog_level_error,__FUNCTION__,"psock_socket() failed : %s",strerror(psock_errno())); - return -1; - } - - val = 1; - if (psock_setsockopt(sd, PSOCK_SOL_SOCKET, PSOCK_SO_REUSEADDR, &val, sizeof(val)) < 0) - { - eventlog(eventlog_level_error,__FUNCTION__,"psock_setsockopt() failed : %s",strerror(psock_errno())); - } - - if (!(servaddr=addr_create_str(d2dbs_prefs_get_servaddrs(),INADDR_ANY,DEFAULT_LISTEN_PORT))) - { - eventlog(eventlog_level_error,__FUNCTION__,"could not get servaddr"); - return -1; - } - - sinInterface.sin_family = PSOCK_AF_INET; - sinInterface.sin_addr.s_addr = htonl(addr_get_ip(servaddr)); - sinInterface.sin_port = htons(addr_get_port(servaddr)); - if (psock_bind(sd, (struct sockaddr*)&sinInterface, (psock_t_socklen)sizeof(struct sockaddr_in)) < 0) - { - eventlog(eventlog_level_error,__FUNCTION__,"psock_bind() failed : %s",strerror(psock_errno())); - return -1; - } - if (psock_listen(sd, LISTEN_QUEUE) < 0) - { - eventlog(eventlog_level_error,__FUNCTION__,"psock_listen() failed : %s",strerror(psock_errno())); - return -1; - } - addr_destroy(servaddr); - return sd; -} - - -/* dbs_server_setup_fdsets - * Set up the three FD sets used with select() with the sockets in the - * connection list. Also add one for the listener socket, if we have - * one. - */ - -int dbs_server_setup_fdsets(t_psock_fd_set * pReadFDs, t_psock_fd_set * pWriteFDs, t_psock_fd_set * pExceptFDs, int lsocket) -{ - t_elem const * elem; - t_d2dbs_connection* it; - int highest_fd; - - PSOCK_FD_ZERO(pReadFDs); - PSOCK_FD_ZERO(pWriteFDs); - PSOCK_FD_ZERO(pExceptFDs); /* FIXME: don't check these... remove this code */ - /* Add the listener socket to the read and except FD sets, if there is one. */ - if (lsocket >= 0) { - PSOCK_FD_SET(lsocket, pReadFDs); - PSOCK_FD_SET(lsocket, pExceptFDs); - } - highest_fd=lsocket; - - LIST_TRAVERSE_CONST(dbs_server_connection_list,elem) - { - if (!(it=elem_get_data(elem))) continue; - if (it->nCharsInReadBuffer < (kBufferSize-kMaxPacketLength)) { - /* There's space in the read buffer, so pay attention to incoming data. */ - PSOCK_FD_SET(it->sd, pReadFDs); - } - if (it->nCharsInWriteBuffer > 0) { - PSOCK_FD_SET(it->sd, pWriteFDs); - } - PSOCK_FD_SET(it->sd, pExceptFDs); - if (highest_fd < it->sd) highest_fd=it->sd; - } - return highest_fd; -} - -/* dbs_server_read_data - * Data came in on a client socket, so read it into the buffer. Returns - * false on failure, or when the client closes its half of the - * connection. (EAGAIN doesn't count as a failure.) - */ -BOOL dbs_server_read_data(t_d2dbs_connection* conn) -{ - int nBytes; - - nBytes = psock_recv(conn->sd, - conn->ReadBuf + conn->nCharsInReadBuffer, - kBufferSize - conn->nCharsInReadBuffer, 0); - if (nBytes == 0) { - eventlog(eventlog_level_info,__FUNCTION__,"Socket %d was closed by the client. Shutting down.",conn->sd); - return FALSE; - } else if (nBytes < 0) { - int err; - psock_t_socklen errlen; - - err = 0; - errlen = sizeof(err); - if (psock_getsockopt(conn->sd, PSOCK_SOL_SOCKET, PSOCK_SO_ERROR, &err, &errlen)<0) - return TRUE; - if (errlen==0 || err==PSOCK_EAGAIN) { - return TRUE; - } else { - eventlog(eventlog_level_error,__FUNCTION__,"psock_recv() failed : %s",strerror(err)); - return FALSE; - } - } - conn->nCharsInReadBuffer += nBytes; - return TRUE; -} - - -/* dbs_server_write_data - * The connection is writable, so send any pending data. Returns - * false on failure. (EAGAIN doesn't count as a failure.) - */ -BOOL dbs_server_write_data(t_d2dbs_connection* conn) -{ - unsigned int sendlen; - int nBytes ; - - if (conn->nCharsInWriteBuffer>kMaxPacketLength) sendlen=kMaxPacketLength; - else sendlen=conn->nCharsInWriteBuffer; - nBytes = psock_send(conn->sd, conn->WriteBuf, sendlen, 0); - if (nBytes < 0) { - int err; - psock_t_socklen errlen; - - err = 0; - errlen = sizeof(err); - if (psock_getsockopt(conn->sd, PSOCK_SOL_SOCKET, PSOCK_SO_ERROR, &err, &errlen)<0) - return TRUE; - if (errlen==0 || err==PSOCK_EAGAIN) { - return TRUE; - } else { - eventlog(eventlog_level_error,__FUNCTION__,"psock_send() failed : %s",strerror(err)); - return FALSE; - } - } - if (nBytes == conn->nCharsInWriteBuffer) { - conn->nCharsInWriteBuffer = 0; - } else { - conn->nCharsInWriteBuffer -= nBytes; - memmove(conn->WriteBuf, conn->WriteBuf + nBytes, conn->nCharsInWriteBuffer); - } - return TRUE; -} - -int dbs_server_list_add_socket(int sd, unsigned int ipaddr) -{ - t_d2dbs_connection *it; - struct in_addr in; - - it=xmalloc(sizeof(t_d2dbs_connection)); - memset(it, 0, sizeof(t_d2dbs_connection)); - it->sd=sd; - it->ipaddr=ipaddr; - it->major=0; - it->minor=0; - it->type=0; - it->stats=0; - it->verified=0; - it->serverid=get_preset_d2gsid(ipaddr); - it->last_active=time(NULL); - it->nCharsInReadBuffer=0; - it->nCharsInWriteBuffer=0; - list_append_data(dbs_server_connection_list,it); - in.s_addr = htonl(ipaddr); - strncpy(it->serverip, inet_ntoa(in), sizeof(it->serverip)-1); - - return 1; -} - -static int dbs_handle_timed_events(void) -{ - static time_t prev_ladder_save_time=0; - static time_t prev_keepalive_save_time=0; - static time_t prev_timeout_checktime=0; - time_t now; - - now=time(NULL); - if (now-prev_ladder_save_time>(signed)prefs_get_laddersave_interval()) { - d2ladder_saveladder(); - prev_ladder_save_time=now; - } - if (now-prev_keepalive_save_time>(signed)prefs_get_keepalive_interval()) { - dbs_keepalive(); - prev_keepalive_save_time=now; - } - if (now-prev_timeout_checktime>(signed)d2dbs_prefs_get_timeout_checkinterval()) { - dbs_check_timeout(); - prev_timeout_checktime=now; - } - return 0; -} - -void dbs_server_loop(int lsocket) -{ - struct sockaddr_in sinRemote; - int sd ; - fd_set ReadFDs, WriteFDs, ExceptFDs; - t_elem * elem; - t_d2dbs_connection* it; - BOOL bOK ; - const char* pcErrorType ; - struct timeval tv; - int highest_fd; - psock_t_socklen nAddrSize = sizeof(sinRemote); - - while (1) { -#ifdef WIN32 - if (g_ServiceStatus<0 && kbhit() && getch()=='q') - d2dbs_signal_quit_wrapper(); - - if (g_ServiceStatus == 0) d2dbs_signal_quit_wrapper(); - - while (g_ServiceStatus == 2) Sleep(1000); -#endif - if (d2dbs_handle_signal()<0) break; - dbs_handle_timed_events(); - highest_fd=dbs_server_setup_fdsets(&ReadFDs, &WriteFDs, &ExceptFDs, lsocket); - - tv.tv_sec = 0; - tv.tv_usec = SELECT_TIME_OUT; - switch (psock_select(highest_fd+1, &ReadFDs, &WriteFDs, &ExceptFDs, &tv) ) { - case -1: - eventlog(eventlog_level_error,__FUNCTION__,"psock_select() failed : %s",strerror(psock_errno())); - continue; - case 0: - continue; - default: - break; - } - - if (PSOCK_FD_ISSET(lsocket, &ReadFDs)) { - sd = psock_accept(lsocket, (struct sockaddr*)&sinRemote, &nAddrSize); - if (sd == -1) { - eventlog(eventlog_level_error,__FUNCTION__,"psock_accept() failed : %s",strerror(psock_errno())); - return; - } - - eventlog(eventlog_level_info,__FUNCTION__,"accepted connection from %s:%d , socket %d .", - inet_ntoa(sinRemote.sin_addr) , ntohs(sinRemote.sin_port), sd); - eventlog_step(prefs_get_logfile_gs(),eventlog_level_info,__FUNCTION__,"accepted connection from %s:%d , socket %d .", - inet_ntoa(sinRemote.sin_addr) , ntohs(sinRemote.sin_port), sd); - setsockopt_keepalive(sd); - dbs_server_list_add_socket(sd, ntohl(sinRemote.sin_addr.s_addr)); - if (psock_ctl(sd,PSOCK_NONBLOCK)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"could not set TCP socket [%d] to non-blocking mode (closing connection) (psock_ctl: %s)", sd,strerror(psock_errno())); - psock_close(sd); - } - } else if (PSOCK_FD_ISSET(lsocket, &ExceptFDs)) { - eventlog(eventlog_level_error,__FUNCTION__,"exception on listening socket"); - /* FIXME: exceptions are not errors with TCP, they are out-of-band data */ - return; - } - - LIST_TRAVERSE(dbs_server_connection_list,elem) - { - bOK = TRUE; - pcErrorType = 0; - - if (!(it=elem_get_data(elem))) continue; - if (PSOCK_FD_ISSET(it->sd, &ExceptFDs)) { - bOK = FALSE; - pcErrorType = "General socket error"; /* FIXME: no no no no no */ - PSOCK_FD_CLR(it->sd, &ExceptFDs); - } else { - - if (PSOCK_FD_ISSET(it->sd, &ReadFDs)) { - bOK = dbs_server_read_data(it); - pcErrorType = "Read error"; - PSOCK_FD_CLR(it->sd, &ReadFDs); - } - - if (PSOCK_FD_ISSET(it->sd, &WriteFDs)) { - bOK = dbs_server_write_data(it); - pcErrorType = "Write error"; - PSOCK_FD_CLR(it->sd, &WriteFDs); - } - } - - if (!bOK) { - int err; - psock_t_socklen errlen; - - err = 0; - errlen = sizeof(err); - if (psock_getsockopt(it->sd, PSOCK_SOL_SOCKET, PSOCK_SO_ERROR, &err, &errlen)==0) { - if (errlen && err!=0) { - eventlog(eventlog_level_error,__FUNCTION__,"data socket error : %s",strerror(err)); - } - } - dbs_server_shutdown_connection(it); - list_remove_elem(dbs_server_connection_list,&elem); - } else { - if (dbs_packet_handle(it)==-1) { - eventlog(eventlog_level_error,__FUNCTION__,"dbs_packet_handle() failed"); - dbs_server_shutdown_connection(it); - list_remove_elem(dbs_server_connection_list,&elem); - } - } - } - } -} - -static void dbs_on_exit(void) -{ - t_elem * elem; - t_d2dbs_connection * it; - - if (dbs_server_listen_socket>=0) - psock_close(dbs_server_listen_socket); - dbs_server_listen_socket=-1; - - LIST_TRAVERSE(dbs_server_connection_list,elem) - { - if (!(it=elem_get_data(elem))) continue; - dbs_server_shutdown_connection(it); - list_remove_elem(dbs_server_connection_list,&elem); - } - cl_destroy(); - d2dbs_d2ladder_destroy(); - list_destroy(dbs_server_connection_list); - if (preset_d2gsid_head) - { - t_preset_d2gsid * curr; - t_preset_d2gsid * next; - - for (curr=preset_d2gsid_head; curr; curr=next) - { - next = curr->next; - xfree(curr); - } - } - eventlog(eventlog_level_info,__FUNCTION__,"dbserver stopped"); -} - -int dbs_server_shutdown_connection(t_d2dbs_connection* conn) -{ - psock_shutdown(conn->sd, PSOCK_SHUT_RDWR) ; - psock_close(conn->sd); - if (conn->verified && conn->type==CONNECT_CLASS_D2GS_TO_D2DBS) { - eventlog(eventlog_level_info,__FUNCTION__,"unlock all characters on gs %s(%d)",conn->serverip,conn->serverid); - eventlog_step(prefs_get_logfile_gs(),eventlog_level_info,__FUNCTION__,"unlock all characters on gs %s(%d)",conn->serverip,conn->serverid); - eventlog_step(prefs_get_logfile_gs(),eventlog_level_info,__FUNCTION__,"close connection to gs on socket %d", conn->sd); - cl_unlock_all_char_by_gsid(conn->serverid); - } - xfree(conn); - return 1; -} - -static int setsockopt_keepalive(int sock) -{ - int optval; - psock_t_socklen optlen; - - optval = 1; - optlen = sizeof(optval); - if (psock_setsockopt(sock, PSOCK_SOL_SOCKET, PSOCK_SO_KEEPALIVE, &optval, optlen)) { - eventlog(eventlog_level_info,__FUNCTION__,"failed set KEEPALIVE for socket %d, errno=%d", sock, psock_errno()); - return -1; - } else { - eventlog(eventlog_level_info,__FUNCTION__,"set KEEPALIVE option for socket %d", sock); - return 0; - } -} - -static unsigned int get_preset_d2gsid(unsigned int ipaddr) -{ - t_preset_d2gsid *pgsid; - - pgsid = preset_d2gsid_head; - while (pgsid) - { - if (pgsid->ipaddr == ipaddr) - return pgsid->d2gsid; - pgsid = pgsid->next; - } - /* not found, build a new item */ - pgsid = xmalloc(sizeof(t_preset_d2gsid)); - pgsid->ipaddr = ipaddr; - pgsid->d2gsid = ++dbs_packet_gs_id; - /* add to list */ - pgsid->next = preset_d2gsid_head; - preset_d2gsid_head = pgsid; - return preset_d2gsid_head->d2gsid; -} diff --git a/d2pack109/src/d2dbs/dbserver.h b/d2pack109/src/d2dbs/dbserver.h deleted file mode 100644 index 1bb7aff..0000000 --- a/d2pack109/src/d2dbs/dbserver.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_DBSERVER_H -#define INCLUDED_DBSERVER_H - -#include "common/list.h" - -typedef struct { - int sd; - unsigned int ipaddr; - unsigned char major; - unsigned char minor; - unsigned char type; - unsigned char stats; - unsigned int serverid; - unsigned int verified; - unsigned char serverip[16]; - int last_active; - int nCharsInReadBuffer; - int nCharsInWriteBuffer; - char ReadBuf[kBufferSize]; - char WriteBuf[kBufferSize]; -} t_d2dbs_connection; - -typedef struct raw_preset_d2gsid { - unsigned int ipaddr; - unsigned int d2gsid; - struct raw_preset_d2gsid *next; -} t_preset_d2gsid; - -int dbs_server_main(void); -int dbs_server_shutdown_connection(t_d2dbs_connection* conn); - -extern t_list * dbs_server_connection_list; - -#endif diff --git a/d2pack109/src/d2dbs/dbspacket.c b/d2pack109/src/d2dbs/dbspacket.c deleted file mode 100644 index 81f64d0..0000000 --- a/d2pack109/src/d2dbs/dbspacket.c +++ /dev/null @@ -1,865 +0,0 @@ -/* - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#include -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_FCNTL_H -# include -#else -# ifdef HAVE_SYS_FILE_H -# include -# endif -#endif -#include "compat/statmacros.h" -#include "compat/mkdir.h" -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/memcpy.h" -#include "compat/memmove.h" -#include "compat/strdup.h" -#include "compat/strsep.h" -#include -#include "compat/strerror.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#include "compat/socket.h" -#ifdef HAVE_SYS_PARAM_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include -#endif -#include "compat/netinet_in.h" -#ifdef HAVE_ARPA_INET_H -# include -#endif -#include "compat/inet_ntoa.h" -#include "compat/psock.h" -#include "compat/access.h" -#include "compat/rename.h" -#include "dbserver.h" -#include "dbspacket.h" -#include "d2ladder.h" -#include "charlock.h" -#include "prefs.h" -#include "d2cs/xstring.h" -#include "d2cs/d2cs_d2gs_character.h" -#include "common/bn_type.h" -#include "common/list.h" -#include "common/eventlog.h" -#include "common/addr.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static unsigned int dbs_packet_savedata_charsave(t_d2dbs_connection* conn,char * AccountName,char * CharName,char * data,unsigned int datalen); -static unsigned int dbs_packet_savedata_charinfo(t_d2dbs_connection* conn,char * AccountName,char * CharName,char * data,unsigned int datalen); -static unsigned int dbs_packet_getdata_charsave(t_d2dbs_connection* conn,char * AccountName,char * CharName,char * data,unsigned int bufsize); -static unsigned int dbs_packet_getdata_charinfo(t_d2dbs_connection* conn,char * AccountName,char * CharName,char * data,unsigned int bufsize); -static unsigned int dbs_packet_echoreply(t_d2dbs_connection* conn); -static unsigned int dbs_packet_getdata(t_d2dbs_connection* conn); -static unsigned int dbs_packet_savedata(t_d2dbs_connection* conn); -static unsigned int dbs_packet_charlock(t_d2dbs_connection* conn); -static unsigned int dbs_packet_updateladder(t_d2dbs_connection* conn); -static int dbs_verify_ipaddr(char const * addrlist,t_d2dbs_connection * c); - -static int dbs_packet_fix_charinfo(t_d2dbs_connection * conn,char * AccountName,char * CharName,char * charsave); -static void dbs_packet_set_charinfo_level(char * CharName,char * charinfo); - -static unsigned int dbs_packet_savedata_charsave(t_d2dbs_connection* conn, char * AccountName,char * CharName,char * data,unsigned int datalen) -{ - char filename[MAX_PATH]; - char savefile[MAX_PATH]; - char bakfile[MAX_PATH]; - unsigned short curlen,readlen,leftlen,writelen; - FILE * fd; - - strtolower(AccountName); - strtolower(CharName); - - sprintf(filename,"%s/.%s.tmp",d2dbs_prefs_get_charsave_dir(),CharName); - fd = fopen(filename, "wb"); - if (!fd) { - eventlog(eventlog_level_error,__FUNCTION__,"open() failed : %s",filename); - return 0; - } - curlen=0; - leftlen=datalen; - while(curlen2000) writelen=2000; - else writelen=leftlen; - readlen=fwrite(data+curlen,1,writelen,fd); - if (readlen<=0) { - fclose(fd); - eventlog(eventlog_level_error,__FUNCTION__,"write() failed error : %s",strerror(errno)); - return 0; - } - curlen+=readlen; - leftlen-=readlen; - } - fclose(fd); - - sprintf(bakfile,"%s/%s",prefs_get_charsave_bak_dir(),CharName); - sprintf(savefile,"%s/%s",d2dbs_prefs_get_charsave_dir(),CharName); - if (p_rename(savefile, bakfile)==-1) { - eventlog(eventlog_level_warn,__FUNCTION__,"error rename %s to %s", savefile, bakfile); - } - if (p_rename(filename, savefile)==-1) { - eventlog(eventlog_level_error,__FUNCTION__,"error rename %s to %s", filename, savefile); - return 0; - } - eventlog(eventlog_level_info,__FUNCTION__,"saved charsave %s(*%s) for gs %s(%d)", CharName, AccountName, conn->serverip, conn->serverid); - return datalen; -} - -static unsigned int dbs_packet_savedata_charinfo(t_d2dbs_connection* conn,char * AccountName,char * CharName,char * data,unsigned int datalen) -{ - char savefile[MAX_PATH]; - char bakfile[MAX_PATH]; - char filepath[MAX_PATH]; - char filename[MAX_PATH]; - FILE * fd; - unsigned short curlen,readlen,leftlen,writelen; - struct stat statbuf; - - strtolower(AccountName); - strtolower(CharName); - - sprintf(filepath,"%s/%s",prefs_get_charinfo_bak_dir(),AccountName); - if (stat(filepath,&statbuf)==-1) { - p_mkdir(filepath,S_IRWXU|S_IRWXG|S_IRWXO ); - eventlog(eventlog_level_info,__FUNCTION__,"created charinfo directory: %s",filepath); - } - - sprintf(filename,"%s/%s/.%s.tmp",d2dbs_prefs_get_charinfo_dir(),AccountName,CharName); - fd = fopen(filename, "wb"); - if (!fd) { - eventlog(eventlog_level_error,__FUNCTION__,"open() failed : %s",filename); - return 0; - } - - curlen=0; - leftlen=datalen; - while(curlen2000) writelen=2000; - else writelen=leftlen; - readlen=fwrite(data+curlen,1,writelen,fd); - if (readlen<=0) { - fclose(fd); - eventlog(eventlog_level_error,__FUNCTION__,"write() failed error : %s",strerror(errno)); - return 0; - } - curlen+=readlen; - leftlen-=readlen; - } - fclose(fd); - - sprintf(bakfile,"%s/%s/%s",prefs_get_charinfo_bak_dir(),AccountName,CharName); - sprintf(savefile,"%s/%s/%s",d2dbs_prefs_get_charinfo_dir(),AccountName,CharName); - if (p_rename(savefile, bakfile)==-1) { - eventlog(eventlog_level_info,__FUNCTION__,"error rename %s to %s", savefile, bakfile); - } - if (p_rename(filename, savefile)==-1) { - eventlog(eventlog_level_error,__FUNCTION__,"error rename %s to %s", filename, savefile); - return 0; - } - eventlog(eventlog_level_info,__FUNCTION__,"saved charinfo %s(*%s) for gs %s(%d)", CharName, AccountName, conn->serverip, conn->serverid); - return datalen; -} - -static unsigned int dbs_packet_getdata_charsave(t_d2dbs_connection* conn,char * AccountName,char * CharName,char * data,unsigned int bufsize) -{ - char filename[MAX_PATH]; - char filename_d2closed[MAX_PATH]; - FILE * fd; - unsigned short curlen,readlen,leftlen,writelen; - long filesize; - - strtolower(AccountName); - strtolower(CharName); - - sprintf(filename,"%s/%s",d2dbs_prefs_get_charsave_dir(),CharName); - sprintf(filename_d2closed,"%s/%s.d2s",d2dbs_prefs_get_charsave_dir(),CharName); - if ((access(filename, F_OK) < 0) && (access(filename_d2closed, F_OK) == 0)) - { - p_rename(filename_d2closed, filename); - } - fd = fopen(filename, "rb"); - if (!fd) { - eventlog(eventlog_level_error,__FUNCTION__,"open() failed : %s",filename); - return 0; - } - fseek(fd,0,SEEK_END); - filesize=ftell(fd); - rewind(fd); - if (filesize==-1) { - fclose(fd); - eventlog(eventlog_level_error,__FUNCTION__,"lseek() failed"); - return 0; - } - if ((signed)bufsize < filesize) { - fclose(fd); - eventlog(eventlog_level_error,__FUNCTION__,"not enough buffer"); - return 0; - } - - curlen=0; - leftlen=filesize; - while(curlen < filesize) { - if (leftlen>2000) writelen=2000; - else writelen=leftlen; - readlen=fread(data+curlen,1,writelen,fd); - if (readlen<=0) { - fclose(fd); - eventlog(eventlog_level_error,__FUNCTION__,"read() failed error : %s",strerror(errno)); - return 0; - } - leftlen-=readlen; - curlen+=readlen; - } - fclose(fd); - eventlog(eventlog_level_info,__FUNCTION__,"loaded charsave %s(*%s) for gs %s(%d)", CharName, AccountName, conn->serverip, conn->serverid); - return filesize; -} - -static unsigned int dbs_packet_getdata_charinfo(t_d2dbs_connection* conn,char * AccountName,char * CharName,char * data,unsigned int bufsize) -{ - char filename[MAX_PATH]; - FILE * fd; - unsigned short curlen,readlen,leftlen,writelen; - long filesize; - - strtolower(AccountName); - strtolower(CharName); - - sprintf(filename,"%s/%s/%s",d2dbs_prefs_get_charinfo_dir(),AccountName,CharName); - fd = fopen(filename, "rb"); - if (!fd) { - eventlog(eventlog_level_error,__FUNCTION__,"open() failed : %s",filename); - return 0; - } - fseek(fd,0,SEEK_END); - filesize=ftell(fd); - rewind(fd); - if (filesize==-1) { - fclose(fd); - eventlog(eventlog_level_error,__FUNCTION__,"lseek() failed"); - return 0; - } - if ((signed)bufsize < filesize) { - fclose(fd); - eventlog(eventlog_level_error,__FUNCTION__,"not enough buffer"); - return 0; - } - - curlen=0; - leftlen=filesize; - while(curlen < filesize) { - if (leftlen>2000) - writelen=2000; - else - writelen=leftlen; - readlen=fread(data+curlen,1,writelen,fd); - if (readlen<=0) - { - fclose(fd); - eventlog(eventlog_level_error,__FUNCTION__,"read() failed error : %s",strerror(errno)); - return 0; - } - leftlen-=readlen; - curlen+=readlen; - } - fclose(fd); - eventlog(eventlog_level_info,__FUNCTION__,"loaded charinfo %s(*%s) for gs %s(%d)", CharName, AccountName, conn->serverip, conn->serverid); - return filesize; -} - -static unsigned int dbs_packet_savedata(t_d2dbs_connection * conn) -{ - unsigned short writelen; - unsigned short datatype; - unsigned short datalen; - unsigned int result; - char AccountName[MAX_NAME_LEN+16]; - char CharName[MAX_NAME_LEN+16]; - char RealmName[MAX_NAME_LEN+16]; - t_d2gs_d2dbs_save_data_request * savecom; - t_d2dbs_d2gs_save_data_reply * saveret; - char * readpos; - unsigned char * writepos; - - readpos=conn->ReadBuf; - savecom=(t_d2gs_d2dbs_save_data_request *)readpos; - datatype=bn_short_get(savecom->datatype); - datalen=bn_short_get(savecom->datalen); - - readpos+=sizeof(*savecom); - strncpy(AccountName,readpos,MAX_NAME_LEN); - AccountName[MAX_NAME_LEN]=0; - readpos+=strlen(AccountName)+1; - strncpy(CharName,readpos,MAX_NAME_LEN); - CharName[MAX_NAME_LEN]=0; - readpos+=strlen(CharName)+1; - strncpy(RealmName,readpos,MAX_NAME_LEN); - RealmName[MAX_NAME_LEN]=0; - readpos+=strlen(RealmName)+1; - - if (readpos+datalen!=conn->ReadBuf+bn_short_get(savecom->h.size)) { - eventlog(eventlog_level_error,__FUNCTION__,"request packet size error"); - return -1; - } - - if (datatype==D2GS_DATA_CHARSAVE) { - if (dbs_packet_savedata_charsave(conn,AccountName,CharName,readpos,datalen)>0 && - dbs_packet_fix_charinfo(conn,AccountName,CharName,readpos)) { - result=D2DBS_SAVE_DATA_SUCCESS; - } else { - datalen=0; - result=D2DBS_SAVE_DATA_FAILED ; - } - } else if (datatype==D2GS_DATA_PORTRAIT) { - /* if level is > 255 , sets level to 255 */ - dbs_packet_set_charinfo_level(CharName,readpos); - if (dbs_packet_savedata_charinfo(conn,AccountName,CharName,readpos,datalen)>0) { - result=D2DBS_SAVE_DATA_SUCCESS; - } else { - datalen=0; - result=D2DBS_SAVE_DATA_FAILED; - } - } else { - eventlog(eventlog_level_error,__FUNCTION__,"unknown data type %d",datatype); - return -1; - } - writelen=sizeof(*saveret)+strlen(CharName)+1; - if (writelen > kBufferSize-conn->nCharsInWriteBuffer) return 0; - writepos=conn->WriteBuf+conn->nCharsInWriteBuffer; - saveret=(t_d2dbs_d2gs_save_data_reply *)writepos; - bn_short_set(&saveret->h.type, D2DBS_D2GS_SAVE_DATA_REPLY); - bn_short_set(&saveret->h.size,writelen); - bn_int_set(&saveret->h.seqno,bn_int_get(savecom->h.seqno)); - bn_short_set(&saveret->datatype,bn_short_get(savecom->datatype)); - bn_int_set(&saveret->result,result); - writepos+=sizeof(*saveret); - strncpy(writepos,CharName,MAX_NAME_LEN); - conn->nCharsInWriteBuffer += writelen; - return 1; -} - -static unsigned int dbs_packet_echoreply(t_d2dbs_connection * conn) -{ - conn->last_active=time(NULL); - return 1; -} - -static unsigned int dbs_packet_getdata(t_d2dbs_connection * conn) -{ - unsigned short writelen; - unsigned short datatype; - unsigned short datalen; - unsigned int result; - char AccountName[MAX_NAME_LEN+16]; - char CharName[MAX_NAME_LEN+16]; - char RealmName[MAX_NAME_LEN+16]; - t_d2gs_d2dbs_get_data_request * getcom; - t_d2dbs_d2gs_get_data_reply * getret; - char * readpos; - char * writepos; - char databuf[kBufferSize ]; - t_d2charinfo_file charinfo; - unsigned short charinfolen; - unsigned int gsid; - - readpos=conn->ReadBuf; - getcom=(t_d2gs_d2dbs_get_data_request *)readpos; - datatype=bn_short_get(getcom->datatype); - - readpos+=sizeof(*getcom); - strncpy(AccountName,readpos,MAX_NAME_LEN); - AccountName[MAX_NAME_LEN]=0; - readpos+=strlen(AccountName)+1; - strncpy(CharName,readpos,MAX_NAME_LEN); - CharName[MAX_NAME_LEN]=0; - readpos+=strlen(CharName)+1; - strncpy(RealmName,readpos,MAX_NAME_LEN); - RealmName[MAX_NAME_LEN]=0; - readpos+=strlen(RealmName)+1; - - if (readpos != conn->ReadBuf+bn_short_get(getcom->h.size)) { - eventlog(eventlog_level_error,__FUNCTION__,"request packet size error"); - return -1; - } - writepos=conn->WriteBuf+conn->nCharsInWriteBuffer; - getret=(t_d2dbs_d2gs_get_data_reply *)writepos; - datalen=0; - if (datatype==D2GS_DATA_CHARSAVE) { - if (cl_query_charlock_status(CharName,RealmName,&gsid)!=0) { - eventlog(eventlog_level_warn,__FUNCTION__,"char %s(*%s)@%s is already locked on gs %u",CharName,AccountName,RealmName,gsid); - result=D2DBS_GET_DATA_CHARLOCKED; - } else if (cl_lock_char(CharName,RealmName,conn->serverid) != 0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to lock char %s(*%s)@%s for gs %s(%d)",CharName,AccountName,RealmName,conn->serverip,conn->serverid); - result=D2DBS_GET_DATA_CHARLOCKED; - } else { - eventlog(eventlog_level_info,__FUNCTION__,"lock char %s(*%s)@%s for gs %s(%d)",CharName,AccountName,RealmName,conn->serverip,conn->serverid); - datalen=dbs_packet_getdata_charsave(conn,AccountName,CharName,databuf,kBufferSize ); - if (datalen>0) { - result=D2DBS_GET_DATA_SUCCESS; - charinfolen=dbs_packet_getdata_charinfo(conn,AccountName,CharName,(char *)&charinfo,sizeof(charinfo)); - if (charinfolen>0) { - result=D2DBS_GET_DATA_SUCCESS; - } else { - result=D2DBS_GET_DATA_FAILED; - if (cl_unlock_char(CharName,RealmName)!=0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to unlock char %s(*%s)@%s for gs %s(%d)",CharName,\ - AccountName,RealmName,conn->serverip,conn->serverid); - } else { - eventlog(eventlog_level_info,__FUNCTION__,"unlock char %s(*%s)@%s for gs %s(%d)",CharName,\ - AccountName,RealmName,conn->serverip,conn->serverid); - } - } - } else { - datalen=0; - result=D2DBS_GET_DATA_FAILED; - if (cl_unlock_char(CharName,RealmName)!=0) { - eventlog(eventlog_level_error,__FUNCTION__,"faled to unlock char %s(*%s)@%s for gs %s(%d)",CharName,\ - AccountName,RealmName,conn->serverip,conn->serverid); - } else { - eventlog(eventlog_level_info,__FUNCTION__,"unlock char %s(*%s)@%s for gs %s(%d)",CharName,\ - AccountName,RealmName,conn->serverip,conn->serverid); - } - - } - } - if (result==D2DBS_GET_DATA_SUCCESS) { - bn_int_set(&getret->charcreatetime,bn_int_get(charinfo.header.create_time)); - /* FIXME: this should be rewritten to support string formatted time */ - if (bn_int_get(charinfo.header.create_time)>=prefs_get_ladderinit_time()) { - bn_int_set(&getret->allowladder,1); - } else { - bn_int_set(&getret->allowladder,0); - } - } else { - bn_int_set(&getret->charcreatetime,0); - bn_int_set(&getret->allowladder,0); - } - } else if (datatype==D2GS_DATA_PORTRAIT) { - datalen=dbs_packet_getdata_charinfo(conn,AccountName,CharName,databuf,kBufferSize ); - if (datalen>0) result=D2DBS_GET_DATA_SUCCESS ; - else { - datalen=0; - result=D2DBS_GET_DATA_FAILED ; - } - } else { - eventlog(eventlog_level_error,__FUNCTION__,"unknown data type %d",datatype); - return -1; - } - writelen=datalen+sizeof(*getret)+strlen(CharName)+1; - if (writelen > kBufferSize-conn->nCharsInWriteBuffer) return 0; - bn_short_set(&getret->h.type,D2DBS_D2GS_GET_DATA_REPLY); - bn_short_set(&getret->h.size,writelen); - bn_int_set(&getret->h.seqno,bn_int_get(getcom->h.seqno)); - bn_short_set(&getret->datatype,bn_short_get(getcom->datatype)); - bn_int_set(&getret->result,result); - bn_short_set(&getret->datalen,datalen); - writepos+=sizeof(*getret); - strncpy(writepos,CharName,MAX_NAME_LEN); - writepos+=strlen(CharName)+1; - if (datalen) memcpy(writepos,databuf,datalen); - conn->nCharsInWriteBuffer += writelen; - return 1; -} - -static unsigned int dbs_packet_updateladder(t_d2dbs_connection * conn) -{ - char CharName[MAX_NAME_LEN+16]; - char RealmName[MAX_NAME_LEN+16]; - t_d2gs_d2dbs_update_ladder * updateladder; - char * readpos; - t_d2ladder_info charladderinfo; - - readpos=conn->ReadBuf; - updateladder=(t_d2gs_d2dbs_update_ladder *)readpos; - - readpos+=sizeof(*updateladder); - strncpy(CharName,readpos,MAX_NAME_LEN); - CharName[MAX_NAME_LEN]=0; - readpos+=strlen(CharName)+1; - strncpy(RealmName,readpos,MAX_NAME_LEN); - RealmName[MAX_NAME_LEN]=0; - readpos+=strlen(RealmName)+1; - if (readpos != conn->ReadBuf+bn_short_get(updateladder->h.size)) { - eventlog(eventlog_level_error,__FUNCTION__,"request packet size error"); - return -1; - } - - strcpy(charladderinfo.charname,CharName); - charladderinfo.experience=bn_int_get(updateladder->charexplow); - charladderinfo.level=bn_int_get(updateladder->charlevel); - charladderinfo.status=bn_short_get(updateladder->charstatus); - charladderinfo.class=bn_short_get(updateladder->charclass); - eventlog(eventlog_level_info,__FUNCTION__,"update ladder for %s@%s for gs %s(%d)",CharName,RealmName,conn->serverip,conn->serverid); - d2ladder_update(&charladderinfo); - return 1; -} - -static unsigned int dbs_packet_charlock(t_d2dbs_connection * conn) -{ - char CharName[MAX_NAME_LEN+16]; - char AccountName[MAX_NAME_LEN+16]; - char RealmName[MAX_NAME_LEN+16]; - t_d2gs_d2dbs_char_lock * charlock; - char * readpos; - - readpos=conn->ReadBuf; - charlock=(t_d2gs_d2dbs_char_lock*)readpos; - - readpos+=sizeof(*charlock); - strncpy(AccountName,readpos,MAX_NAME_LEN); - AccountName[MAX_NAME_LEN]=0; - readpos+=strlen(AccountName)+1; - strncpy(CharName,readpos,MAX_NAME_LEN); - CharName[MAX_NAME_LEN]=0; - readpos+=strlen(CharName)+1; - strncpy(RealmName,readpos,MAX_NAME_LEN); - RealmName[MAX_NAME_LEN]=0; - readpos+=strlen(RealmName)+1; - - if (readpos != conn->ReadBuf+ bn_short_get(charlock->h.size)) { - eventlog(eventlog_level_error,__FUNCTION__,"request packet size error"); - return -1; - } - - if (bn_int_get(charlock->lockstatus)) { - if (cl_lock_char(CharName,RealmName,conn->serverid)!=0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to lock character %s(*%s)@%s for gs %s(%d)",CharName,AccountName,RealmName,conn->serverip,conn->serverid); - } else { - eventlog(eventlog_level_info,__FUNCTION__,"lock character %s(*%s)@%s for gs %s(%d)",CharName,AccountName,RealmName,conn->serverip,conn->serverid); - } - } else { - if (cl_unlock_char(CharName,RealmName) != 0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to unlock character %s(*%s)@%s for gs %s(%d)",CharName,AccountName,RealmName,conn->serverip,conn->serverid); - } else { - eventlog(eventlog_level_info,__FUNCTION__,"unlock character %s(*%s)@%s for gs %s(%d)",CharName,AccountName,RealmName,conn->serverip,conn->serverid); - } - } - return 1; -} - -/* - return value: - 1 : process one or more packet - 0 : not get a whole packet,do nothing - -1 : error -*/ -extern int dbs_packet_handle(t_d2dbs_connection* conn) -{ - unsigned short readlen,writelen; - t_d2dbs_d2gs_header * readhead; - unsigned short retval; - - if (conn->stats==0) { - if (conn->nCharsInReadBuffer<(signed)sizeof(t_d2gs_d2dbs_connect)) { - return 0; - } - conn->stats=1; - conn->type=conn->ReadBuf[0]; - - if (conn->type==CONNECT_CLASS_D2GS_TO_D2DBS) { - if (dbs_verify_ipaddr(d2dbs_prefs_get_d2gs_list(),conn)<0) { - eventlog(eventlog_level_error,__FUNCTION__,"d2gs connection from unknown ip address"); - return -1; - } - readlen=1; - writelen=0; - eventlog(eventlog_level_info,__FUNCTION__,"set connection type for gs %s(%d) on socket %d", conn->serverip, conn->serverid, conn->sd); - eventlog_step(prefs_get_logfile_gs(),eventlog_level_info,"set connection type for gs %s(%d) on socket %d", conn->serverip, conn->serverid, conn->sd); - } else { - eventlog(eventlog_level_error,__FUNCTION__,"unknown connection type"); - return -1; - } - conn->nCharsInReadBuffer -= readlen; - memmove(conn->ReadBuf,conn->ReadBuf+readlen,conn->nCharsInReadBuffer); - } else if (conn->stats==1) { - if (conn->type==CONNECT_CLASS_D2GS_TO_D2DBS) { - while (conn->nCharsInReadBuffer >= (signed)sizeof(*readhead)) { - readhead=(t_d2dbs_d2gs_header *)conn->ReadBuf; - readlen=bn_short_get(readhead->size); - if (conn->nCharsInReadBuffer < readlen) break; - switch(bn_short_get(readhead->type)) { - case D2GS_D2DBS_SAVE_DATA_REQUEST: - retval=dbs_packet_savedata(conn); - break; - case D2GS_D2DBS_GET_DATA_REQUEST: - retval=dbs_packet_getdata(conn); - break; - case D2GS_D2DBS_UPDATE_LADDER: - retval=dbs_packet_updateladder(conn); - break; - case D2GS_D2DBS_CHAR_LOCK: - retval=dbs_packet_charlock(conn); - break; - case D2GS_D2DBS_ECHOREPLY: - retval=dbs_packet_echoreply(conn); - break; - default: - eventlog(eventlog_level_error,__FUNCTION__,"unknown request type %d",\ - bn_short_get(readhead->type)); - retval=-1; - } - if (retval!=1) return retval; - conn->nCharsInReadBuffer -= readlen; - memmove(conn->ReadBuf,conn->ReadBuf+readlen,conn->nCharsInReadBuffer); - } - } else { - eventlog(eventlog_level_error,__FUNCTION__,"unknown connection type %d",conn->type); - return -1; - } - } else { - eventlog(eventlog_level_error,__FUNCTION__,"unknown connection stats"); - return -1; - } - return 1; -} - -/* FIXME: we should save client ipaddr into c->ipaddr after accept */ -static int dbs_verify_ipaddr(char const * addrlist,t_d2dbs_connection * c) -{ - struct in_addr in; - char * adlist; - char const * ipaddr; - char * s, * temp; - t_elem * elem; - t_d2dbs_connection * tempc; - unsigned int valid; - unsigned int resolveipaddr; - - in.s_addr=htonl(c->ipaddr); - ipaddr=inet_ntoa(in); - adlist = xstrdup(addrlist); - temp=adlist; - valid=0; - while ((s=strsep(&temp, ","))) { - host_lookup(s, &resolveipaddr); - if(resolveipaddr == 0) continue; - - if (!strcmp(ipaddr, (const char *)addr_num_to_ip_str(resolveipaddr))) { - valid=1; - break; - } - } - xfree(adlist); - if (valid) { - eventlog(eventlog_level_info,__FUNCTION__,"ip address %s is valid",ipaddr); - LIST_TRAVERSE(dbs_server_connection_list,elem) - { - if (!(tempc=elem_get_data(elem))) continue; - if (tempc !=c && tempc->ipaddr==c->ipaddr) { - eventlog(eventlog_level_info,__FUNCTION__,"destroying previous connection %d",tempc->serverid); - dbs_server_shutdown_connection(tempc); - list_remove_elem(dbs_server_connection_list,&elem); - } - } - c->verified = 1; - return 0; - } else { - eventlog(eventlog_level_info,__FUNCTION__,"ip address %s is invalid",ipaddr); - } - return -1; -} - -int dbs_check_timeout(void) -{ - t_elem *elem; - t_d2dbs_connection *tempc; - time_t now; - int timeout; - - now=time(NULL); - timeout=d2dbs_prefs_get_idletime(); - LIST_TRAVERSE(dbs_server_connection_list,elem) - { - if (!(tempc=elem_get_data(elem))) continue; - if (now-tempc->last_active>timeout) { - eventlog(eventlog_level_debug,__FUNCTION__,"connection %d timed out",tempc->serverid); - dbs_server_shutdown_connection(tempc); - list_remove_elem(dbs_server_connection_list,&elem); - continue; - } - } - return 0; -} - -int dbs_keepalive(void) -{ - t_elem *elem; - t_d2dbs_connection *tempc; - t_d2dbs_d2gs_echorequest *echoreq; - unsigned short writelen; - unsigned char *writepos; - time_t now; - - writelen = sizeof(t_d2dbs_d2gs_echorequest); - now=time(NULL); - LIST_TRAVERSE(dbs_server_connection_list,elem) - { - if (!(tempc=elem_get_data(elem))) continue; - if (writelen > kBufferSize - tempc->nCharsInWriteBuffer) continue; - writepos = tempc->WriteBuf + tempc->nCharsInWriteBuffer; - echoreq = (t_d2dbs_d2gs_echorequest*)writepos; - bn_short_set(&echoreq->h.type, D2DBS_D2GS_ECHOREQUEST); - bn_short_set(&echoreq->h.size, writelen); - /* FIXME: sequence number not set */ - bn_int_set(&echoreq->h.seqno, 0); - tempc->nCharsInWriteBuffer += writelen; - } - return 0; -} - -/*************************************************************************************/ -#define CHARINFO_SIZE 0xC0 -#define CHARINFO_PORTRAIT_LEVEL_OFFSET 0x89 -#define CHARINFO_PORTRAIT_STATUS_OFFSET 0x8A -#define CHARINFO_SUMMARY_LEVEL_OFFSET 0xB8 -#define CHARINFO_SUMMARY_STATUS_OFFSET 0xB4 -#define CHARINFO_PORTRAIT_GFX_OFFSET 0x72 -#define CHARINFO_PORTRAIT_COLOR_OFFSET 0x7E - -#define CHARSAVE_LEVEL_OFFSET 0x2B -#define CHARSAVE_STATUS_OFFSET 0x24 -#define CHARSAVE_GFX_OFFSET 0x88 -#define CHARSAVE_COLOR_OFFSET 0x98 - -#define charstatus_to_portstatus(status) ((((status & 0xFF00) << 1) | (status & 0x00FF)) | 0x8080) -#define portstatus_to_charstatus(status) (((status & 0x7F00) >> 1) | (status & 0x007F)) - -static void dbs_packet_set_charinfo_level(char * CharName,char * charinfo) -{ - if (prefs_get_difficulty_hack()) { /* difficulty hack enabled */ - unsigned int level = bn_int_get(&charinfo[CHARINFO_SUMMARY_LEVEL_OFFSET]); - unsigned int plevel = bn_byte_get(&charinfo[CHARINFO_PORTRAIT_LEVEL_OFFSET]); - - /* levels 257 thru 355 */ - if (level != plevel) { - eventlog(eventlog_level_info,__FUNCTION__,"level mis-match for %s ( %u != %u ) setting to 255",CharName,level,plevel); - bn_byte_set((bn_byte *)&charinfo[CHARINFO_PORTRAIT_LEVEL_OFFSET],255); - bn_int_set((bn_int *)&charinfo[CHARINFO_SUMMARY_LEVEL_OFFSET],255); - } - } -} - -static int dbs_packet_fix_charinfo(t_d2dbs_connection * conn,char * AccountName,char * CharName,char * charsave) -{ - if (prefs_get_difficulty_hack()) { - unsigned char charinfo[CHARINFO_SIZE]; - unsigned int level = bn_byte_get(&charsave[CHARSAVE_LEVEL_OFFSET]); - unsigned short status = bn_short_get(&charsave[CHARSAVE_STATUS_OFFSET]); - unsigned short pstatus = charstatus_to_portstatus(status); - int i; - - /* - * charinfo is only updated from level 1 to 99 (d2gs issue) - * from 100 to 256 d2gs does not send it - * when value rolls over (level 256 = 0) - * and charactar reaches level 257 (rolled over to level 1) - * d2gs starts sending it agian until level 356 (rolled over to 100) - * is reached agian. etc. etc. etc. - */ - if (level == 0) /* level 256, 512, 768, etc */ - level = 255; - - if (level < 100) - return 1; /* d2gs will send charinfo - level will be set to 255 at that time if needed */ - - eventlog(eventlog_level_info,__FUNCTION__,"level %u > 99 for %s",level,CharName); - - if(!(dbs_packet_getdata_charinfo(conn,AccountName,CharName,charinfo,CHARINFO_SIZE))) { - eventlog(eventlog_level_error,__FUNCTION__,"unable to get charinfo for %s",CharName); - return 0; - } - - /* if level in charinfo file is already set to 255, - * then is must have been set when d2gs sent the charinfo - * and got a level mis-match (levels 257 - 355) - * or level is actually 255. In eather case we set to 255 - * this should work for any level mod - */ - if (bn_byte_get(&charinfo[CHARINFO_PORTRAIT_LEVEL_OFFSET]) == 255) - level = 255; - - eventlog(eventlog_level_info,__FUNCTION__,"updating charinfo for %s -> level = %u , status = 0x%04X , pstatus = 0x%04X",CharName,level,status,pstatus); - bn_byte_set((bn_byte *)&charinfo[CHARINFO_PORTRAIT_LEVEL_OFFSET],level); - bn_int_set((bn_int *)&charinfo[CHARINFO_SUMMARY_LEVEL_OFFSET],level); - bn_short_set((bn_short *)&charinfo[CHARINFO_PORTRAIT_STATUS_OFFSET],pstatus); - bn_int_set((bn_int *)&charinfo[CHARINFO_SUMMARY_STATUS_OFFSET],status); - - for (i=0;i<11;i++) { - bn_byte_set((bn_byte *)&charinfo[CHARINFO_PORTRAIT_GFX_OFFSET+i],bn_byte_get(&charsave[CHARSAVE_GFX_OFFSET+i])); - bn_byte_set((bn_byte *)&charinfo[CHARINFO_PORTRAIT_COLOR_OFFSET+i],bn_byte_get(&charsave[CHARSAVE_GFX_OFFSET+i])); - } - - if (!(dbs_packet_savedata_charinfo(conn,AccountName,CharName,charinfo,CHARINFO_SIZE))) { - eventlog(eventlog_level_error,__FUNCTION__,"unable to save charinfo for %s",CharName); - return 0; - } - - return 1; /* charinfo updated */ - } - - return 1; /* difficulty hack not enabled */ -} diff --git a/d2pack109/src/d2dbs/dbspacket.h b/d2pack109/src/d2dbs/dbspacket.h deleted file mode 100644 index 81da50b..0000000 --- a/d2pack109/src/d2dbs/dbspacket.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2001 faster (lqx@cic.tsinghua.edu.cn) - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_DBSPACKET_H -#define INCLUDED_DBSPACKET_H - -#include "dbserver.h" -#include "common/bn_type.h" - -#pragma pack(1) - -typedef struct { - bn_short size; - bn_short type; - bn_int seqno; -} t_d2dbs_d2gs_header; - -typedef struct { - bn_byte class; -} t_d2gs_d2dbs_connect; -#define CONNECT_CLASS_D2GS_TO_D2DBS 0x65 - -#define D2GS_D2DBS_SAVE_DATA_REQUEST 0x30 -typedef struct { - t_d2dbs_d2gs_header h; - bn_short datatype; - bn_short datalen; - /* AccountName */ - /* CharName */ - /* data */ -} t_d2gs_d2dbs_save_data_request; -#define D2GS_DATA_CHARSAVE 0x01 -#define D2GS_DATA_PORTRAIT 0x02 - -#define D2DBS_D2GS_SAVE_DATA_REPLY 0x30 -typedef struct { - t_d2dbs_d2gs_header h; - bn_int result; - bn_short datatype; - /* CharName */ -} t_d2dbs_d2gs_save_data_reply; -#define D2DBS_SAVE_DATA_SUCCESS 0 -#define D2DBS_SAVE_DATA_FAILED 1 - -#define D2GS_D2DBS_GET_DATA_REQUEST 0x31 -typedef struct { - t_d2dbs_d2gs_header h; - bn_short datatype; - /* AccountName */ - /* CharName */ -} t_d2gs_d2dbs_get_data_request; - -#define D2DBS_D2GS_GET_DATA_REPLY 0x31 -typedef struct { - t_d2dbs_d2gs_header h; - bn_int result; - bn_int charcreatetime; - bn_int allowladder; - bn_short datatype; - bn_short datalen; - /* CharName */ - /* data */ -} t_d2dbs_d2gs_get_data_reply; - -#define D2DBS_GET_DATA_SUCCESS 0 -#define D2DBS_GET_DATA_FAILED 1 -#define D2DBS_GET_DATA_CHARLOCKED 2 - -#define D2GS_D2DBS_UPDATE_LADDER 0x32 -typedef struct { - t_d2dbs_d2gs_header h; - bn_int charlevel; - bn_int charexplow; - bn_int charexphigh; - bn_short charclass; - bn_short charstatus; - /* CharName */ - /* RealmName */ -} t_d2gs_d2dbs_update_ladder; - -#define D2GS_D2DBS_CHAR_LOCK 0x33 -typedef struct { - t_d2dbs_d2gs_header h; - bn_int lockstatus; - /* CharName */ - /* RealmName */ -} t_d2gs_d2dbs_char_lock; - -#define D2DBS_D2GS_ECHOREQUEST 0x34 -typedef struct { - t_d2dbs_d2gs_header h; -} t_d2dbs_d2gs_echorequest; - -#define D2GS_D2DBS_ECHOREPLY 0x34 -typedef struct { - t_d2dbs_d2gs_header h; -} t_d2gs_d2dbs_echoreply; - - -#endif - -extern int dbs_packet_handle(t_d2dbs_connection * conn); -extern int dbs_keepalive(void); -extern int dbs_check_timeout(void); - diff --git a/d2pack109/src/d2dbs/handle_signal.c b/d2pack109/src/d2dbs/handle_signal.c deleted file mode 100644 index 33a03a0..0000000 --- a/d2pack109/src/d2dbs/handle_signal.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strdup.h" -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif -#ifdef DO_POSIXSIG -# include -# include "compat/signal.h" -#endif -#ifdef HAVE_FCNTL_H -# include -#else -# ifdef HAVE_SYS_FILE_H -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif - -#include "dbserver.h" -#include "prefs.h" -#include "d2ladder.h" -#include "cmdline_parse.h" -#include "handle_signal.h" -#include "common/eventlog.h" -#include "common/xalloc.h" -#include "common/setup_after.h" - -static void on_signal(int s); - -static volatile struct -{ - unsigned char do_quit; - unsigned char cancel_quit; - unsigned char reload_config; - unsigned char save_ladder; - unsigned int exit_time; -} signal_data ={ 0, 0, 0, 0, 0 }; - -extern int d2dbs_handle_signal(void) -{ - time_t now; - char const * levels; - char * temp; - char const * tok; - - - if (signal_data.cancel_quit) { - signal_data.cancel_quit=0; - if (!signal_data.exit_time) { - eventlog(eventlog_level_info,__FUNCTION__,"there is no previous shutdown to be canceled"); - } else { - signal_data.exit_time=0; - eventlog(eventlog_level_info,__FUNCTION__,"shutdown was canceled due to signal"); - } - } - if (signal_data.do_quit) { - signal_data.do_quit=0; - now=time(NULL); - if (!signal_data.exit_time) { - signal_data.exit_time=now+d2dbs_prefs_get_shutdown_delay(); - } else { - signal_data.exit_time-=d2dbs_prefs_get_shutdown_decr(); - } - eventlog(eventlog_level_info,__FUNCTION__,"the server is going to shutdown in %lu minutes",(signal_data.exit_time-now)/60); - } - if (signal_data.exit_time) { - now=time(NULL); - if (now >= (signed)signal_data.exit_time) { - signal_data.exit_time=0; - eventlog(eventlog_level_info,__FUNCTION__,"shutdown server due to signal"); - return -1; - } - } - if (signal_data.reload_config) { - signal_data.reload_config=0; - eventlog(eventlog_level_info,__FUNCTION__,"reloading configuartion file due to signal"); - if (d2dbs_prefs_reload(d2dbs_cmdline_get_prefs_file())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error reload configuration file,exitting"); - return -1; - } - eventlog_clear_level(); - if ((levels = d2dbs_prefs_get_loglevels())) - { - temp = xstrdup(levels); - tok = strtok(temp,","); /* strtok modifies the string it is passed */ - - while (tok) - { - if (eventlog_add_level(tok)<0) - eventlog(eventlog_level_error,__FUNCTION__,"could not add log level \"%s\"",tok); - tok = strtok(NULL,","); - } - xfree(temp); - } - - if (!d2dbs_cmdline_get_debugmode()) eventlog_open(d2dbs_prefs_get_logfile()); - } - if (signal_data.save_ladder) { - signal_data.save_ladder=0; - eventlog(eventlog_level_info,__FUNCTION__,"save ladder data due to signal"); - d2ladder_saveladder(); - } - return 0; -} - -#ifdef WIN32 -extern void d2dbs_signal_quit_wrapper(void) -{ - signal_data.do_quit=1; -} - -extern void d2dbs_signal_reload_config_wrapper(void) -{ - signal_data.reload_config = 1; -} - -extern void d2dbs_signal_save_ladder_wrapper(void) -{ - signal_data.save_ladder = 1; -} - -extern void d2dbs_signal_exit_wrapper(void) -{ - signal_data.exit_time = 1; -} -#else -extern int d2dbs_handle_signal_init(void) -{ - signal(SIGINT,on_signal); - signal(SIGTERM,on_signal); - signal(SIGABRT,on_signal); - signal(SIGHUP,on_signal); - signal(SIGUSR1,on_signal); - signal(SIGPIPE,on_signal); - return 0; -} - -static void on_signal(int s) -{ - switch (s) { - case SIGINT: - eventlog(eventlog_level_debug,__FUNCTION__,"sigint received"); - signal_data.do_quit=1; - break; - case SIGTERM: - eventlog(eventlog_level_debug,__FUNCTION__,"sigint received"); - signal_data.do_quit=1; - break; - case SIGABRT: - eventlog(eventlog_level_debug,__FUNCTION__,"sigabrt received"); - signal_data.cancel_quit=1; - break; - case SIGHUP: - eventlog(eventlog_level_debug,__FUNCTION__,"sighup received"); - signal_data.reload_config=1; - break; - case SIGUSR1: - eventlog(eventlog_level_debug,__FUNCTION__,"sigusr1 received"); - signal_data.save_ladder=1; - break; - case SIGPIPE: - eventlog(eventlog_level_debug,__FUNCTION__,"sigpipe received"); - break; - } - signal(s,on_signal); -} -#endif diff --git a/d2pack109/src/d2dbs/handle_signal.h b/d2pack109/src/d2dbs/handle_signal.h deleted file mode 100644 index 2fde910..0000000 --- a/d2pack109/src/d2dbs/handle_signal.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_HANDLE_SIGNAL_H -#define INCLUDED_HANDLE_SIGNAL_H - -#ifndef WIN32 -extern int d2dbs_handle_signal_init(void); -#else -extern void d2dbs_signal_quit_wrapper(void); -extern void d2dbs_signal_reload_config_wrapper(void); -extern void d2dbs_signal_save_ladder_wrapper(void); -extern void d2dbs_signal_exit_wrapper(void); -#endif - -extern int d2dbs_handle_signal(void); - -#endif diff --git a/d2pack109/src/d2dbs/main.c b/d2pack109/src/d2dbs/main.c deleted file mode 100644 index 4083bba..0000000 --- a/d2pack109/src/d2dbs/main.c +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#include -#ifdef STDC_HEADERS -# include -#else -# ifdef HAVE_MALLOC_H -# include -# endif -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#include -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif -#include "compat/strdup.h" -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#include "prefs.h" -#include "cmdline_parse.h" -#include "version.h" -#include "common/eventlog.h" -#include "handle_signal.h" -#include "dbserver.h" -#include "common/xalloc.h" -#ifdef WIN32 -# include "win32/service.h" -#endif -#ifdef WIN32_GUI -# include "win32/winmain.h" -#endif -#include "common/setup_after.h" - -static FILE * eventlog_fp; - -char serviceLongName[] = "d2dbs109 service"; -char serviceName[] = "d2dbs109"; -char serviceDescription[] = "Diablo 2 (109) DataBase Server"; - -int g_ServiceStatus = -1; - -static int init(void); -static int cleanup(void); -static int config_init(int argc, char * * argv); -static int config_cleanup(void); -static int setup_daemon(void); - -#ifdef DO_DAEMONIZE -static int setup_daemon(void) -{ - int pid; - - if (chdir("/")<0) { - eventlog(eventlog_level_error,__FUNCTION__,"can not change working directory to root directory (chdir: %s)",strerror(errno)); - return -1; - } - - close(STDIN_FILENO); - close(STDOUT_FILENO); - if (!d2dbs_cmdline_get_debugmode()) { - close(STDERR_FILENO); - } - - switch ((pid=fork())) { - case 0: - break; - case -1: - eventlog(eventlog_level_error,__FUNCTION__,"error create child process (fork: %s)",strerror(errno)); - return -1; - default: - return pid; - } - umask(0); - setsid(); - return 0; -} -#endif - -static int init(void) -{ - return 0; -} - -static int cleanup(void) -{ - return 0; -} - -static int config_init(int argc, char * * argv) -{ - char const * levels; - char * temp; - char const * tok; - int pid; - - if (d2dbs_cmdline_parse(argc, argv)<0) { - return -1; - } -#ifdef WIN32 - if (d2dbs_cmdline_get_run_as_service()) { - Win32_ServiceRun(); - return 1; - } -#endif - if (d2dbs_cmdline_get_version()) { - d2dbs_cmdline_show_version(); - return -1; - } - if (d2dbs_cmdline_get_help()) { - d2dbs_cmdline_show_help(); - return -1; - } -#ifdef DO_DAEMONIZE - if (!d2dbs_cmdline_get_foreground()) { - if (!((pid = setup_daemon()) == 0)) { - return pid; - } - } -#endif -#ifdef WIN32 - if (d2dbs_cmdline_get_make_service()) - { - if (strcmp(d2dbs_cmdline_get_make_service(), "install") == 0) { - fprintf(stderr, "Installing service\n"); - Win32_ServiceInstall(); - return 1; - } - if (strcmp(d2dbs_cmdline_get_make_service(), "uninstall") == 0) { - fprintf(stderr, "Uninstalling service\n"); - Win32_ServiceUninstall(); - return 1; - } - } -#endif - if (d2dbs_prefs_load(d2dbs_cmdline_get_prefs_file())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error loading configuration file %s",d2dbs_cmdline_get_prefs_file()); - return -1; - } - - eventlog_clear_level(); - if ((levels = d2dbs_prefs_get_loglevels())) - { - temp = xstrdup(levels); - tok = strtok(temp,","); /* strtok modifies the string it is passed */ - - while (tok) - { - if (eventlog_add_level(tok)<0) - eventlog(eventlog_level_error,__FUNCTION__,"could not add log level \"%s\"",tok); - tok = strtok(NULL,","); - } - - xfree(temp); - } - - - if (d2dbs_cmdline_get_debugmode()) { - eventlog_set(stderr); - } else if (d2dbs_cmdline_get_logfile()) { - if (eventlog_open(d2dbs_cmdline_get_logfile())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error open eventlog file %s",d2dbs_cmdline_get_logfile()); - return -1; - } - } else { - if (eventlog_open(d2dbs_prefs_get_logfile())<0) { - eventlog(eventlog_level_error,__FUNCTION__,"error open eventlog file %s",d2dbs_prefs_get_logfile()); - return -1; - } - } - return 0; -} - -static int config_cleanup(void) -{ - d2dbs_prefs_unload(); - d2dbs_cmdline_cleanup(); - eventlog_close(); - if (eventlog_fp) fclose(eventlog_fp); - return 0; -} - -#ifdef WIN32_GUI -extern int server_main(int argc, char * * argv) -#else -extern int main(int argc, char * * argv) -#endif -{ - int pid; - - eventlog_set(stderr); - pid = config_init(argc, argv); - if (!(pid == 0)) { - return pid; - } - eventlog(eventlog_level_info,__FUNCTION__,D2DBS_VERSION); - if (init()<0) { - eventlog(eventlog_level_error,__FUNCTION__,"failed to init"); - return -1; - } else { - eventlog(eventlog_level_info,__FUNCTION__,"server initialized"); - } -#ifndef WIN32 - d2dbs_handle_signal_init(); -#endif - dbs_server_main(); - cleanup(); - config_cleanup(); - return 0; -} diff --git a/d2pack109/src/d2dbs/prefs.c b/d2pack109/src/d2dbs/prefs.c deleted file mode 100644 index c494c82..0000000 --- a/d2pack109/src/d2dbs/prefs.c +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#include "common/setup_before.h" -#include "setup.h" - -#ifdef HAVE_STDDEF_H -# include -#else -# ifndef NULL -# define NULL ((void *)0) -# endif -#endif -#ifdef HAVE_STRING_H -# include -#else -# ifdef HAVE_STRINGS_H -# include -# endif -# ifdef HAVE_MEMORY_H -# include -# endif -#endif - -#include "prefs.h" -#include "d2cs/conf.h" -#include "common/eventlog.h" -#include "common/setup_after.h" - -static t_conf_table prefs_conf_table[]={ - { "logfile", offsetof(t_prefs,logfile), conf_type_str, 0, DEFAULT_LOG_FILE }, - { "logfile-gs", offsetof(t_prefs,logfile_gs), conf_type_str, 0, DEFAULT_LOG_FILE_GS }, - { "loglevels", offsetof(t_prefs,loglevels), conf_type_str, 0, DEFAULT_LOG_LEVELS }, - { "servaddrs", offsetof(t_prefs,servaddrs), conf_type_str, 0, D2DBS_SERVER_ADDRS }, - { "gameservlist", offsetof(t_prefs,gameservlist), conf_type_str, 0, D2GS_SERVER_LIST }, - { "charsavedir", offsetof(t_prefs,charsavedir), conf_type_str, 0, D2DBS_CHARSAVE_DIR }, - { "charinfodir", offsetof(t_prefs,charinfodir), conf_type_str, 0, D2DBS_CHARINFO_DIR }, - { "bak_charsavedir", offsetof(t_prefs,charsavebakdir), conf_type_str, 0, D2DBS_CHARSAVEBAK_DIR }, - { "bak_charinfodir", offsetof(t_prefs,charinfobakdir), conf_type_str, 0, D2DBS_CHARINFOBAK_DIR }, - { "ladderdir", offsetof(t_prefs,ladderdir), conf_type_str, 0, D2DBS_LADDER_DIR }, - { "laddersave_interval", offsetof(t_prefs,laddersave_interval), conf_type_int, 3600, NULL }, - { "ladderinit_time", offsetof(t_prefs,ladderinit_time), conf_type_int, 0, NULL }, - { "shutdown_delay", offsetof(t_prefs,shutdown_delay), conf_type_int, DEFAULT_SHUTDOWN_DELAY, NULL }, - { "shutdown_decr", offsetof(t_prefs,shutdown_decr), conf_type_int, DEFAULT_SHUTDOWN_DECR, NULL }, - { "idletime", offsetof(t_prefs,idletime), conf_type_int, DEFAULT_IDLETIME, NULL }, - { "keepalive_interval", offsetof(t_prefs,keepalive_interval), conf_type_int, DEFAULT_KEEPALIVE_INTERVAL, NULL }, - { "timeout_checkinterval",offsetof(t_prefs,timeout_checkinterval),conf_type_int, DEFAULT_TIMEOUT_CHECKINTERVAL, NULL}, - { "XML_ladder_output" ,offsetof(t_prefs,XML_ladder_output), conf_type_int, 0, NULL }, - { "ladderupdate_threshold",offsetof(t_prefs,ladderupdate_threshold),conf_type_int,DEFAULT_LADDERUPDATE_THRESHOLD, NULL}, - { "difficulty_hack", offsetof(t_prefs,difficulty_hack), conf_type_int, 0, NULL }, - { NULL, 0, conf_type_none, 0, NULL } -}; - -static t_prefs prefs_conf; - -extern int d2dbs_prefs_load(char const * filename) -{ - memset(&prefs_conf,0,sizeof(prefs_conf)); - if (conf_load_file(filename,prefs_conf_table,&prefs_conf,sizeof(prefs_conf))<0) { - return -1; - } - return 0; -} - -extern int d2dbs_prefs_reload(char const * filename) -{ - d2dbs_prefs_unload(); - if (d2dbs_prefs_load(filename)<0) return -1; - return 0; -} - -extern int d2dbs_prefs_unload(void) -{ - return conf_cleanup(prefs_conf_table, &prefs_conf, sizeof(prefs_conf)); -} - -extern char const * d2dbs_prefs_get_servaddrs(void) -{ - return prefs_conf.servaddrs; -} - -extern char const * d2dbs_prefs_get_charsave_dir(void) -{ - return prefs_conf.charsavedir; -} - -extern char const * d2dbs_prefs_get_charinfo_dir(void) -{ - return prefs_conf.charinfodir; -} - -extern char const * d2dbs_prefs_get_d2gs_list(void) -{ - return prefs_conf.gameservlist; -} - -extern char const * d2dbs_prefs_get_ladder_dir(void) -{ - return prefs_conf.ladderdir; -} - -extern char const * d2dbs_prefs_get_logfile(void) -{ - return prefs_conf.logfile; -} - -extern char const * prefs_get_logfile_gs(void) -{ - return prefs_conf.logfile_gs; -} - -extern char const * prefs_get_charsave_bak_dir(void) -{ - return prefs_conf.charsavebakdir; -} - -extern char const * prefs_get_charinfo_bak_dir(void) -{ - return prefs_conf.charinfobakdir; -} - -extern unsigned int prefs_get_laddersave_interval(void) -{ - return prefs_conf.laddersave_interval; -} - -extern unsigned int prefs_get_ladderinit_time(void) -{ - return prefs_conf.ladderinit_time; -} - -extern char const * d2dbs_prefs_get_loglevels(void) -{ - return prefs_conf.loglevels; -} - -extern unsigned int d2dbs_prefs_get_shutdown_delay(void) -{ - return prefs_conf.shutdown_delay; -} - -extern unsigned int d2dbs_prefs_get_shutdown_decr(void) -{ - return prefs_conf.shutdown_decr; -} - -extern unsigned int prefs_get_keepalive_interval(void) -{ - return prefs_conf.keepalive_interval; -} - -extern unsigned int d2dbs_prefs_get_idletime(void) -{ - return prefs_conf.idletime; -} - -extern unsigned int d2dbs_prefs_get_timeout_checkinterval(void) -{ - return prefs_conf.timeout_checkinterval; -} - -extern unsigned int d2dbs_prefs_get_XML_output_ladder(void) -{ - return prefs_conf.XML_ladder_output; -} - -extern unsigned int prefs_get_ladderupdate_threshold(void) -{ - return prefs_conf.ladderupdate_threshold; -} - -extern unsigned int prefs_get_difficulty_hack(void) -{ - return prefs_conf.difficulty_hack; -} diff --git a/d2pack109/src/d2dbs/prefs.h b/d2pack109/src/d2dbs/prefs.h deleted file mode 100644 index 936edf8..0000000 --- a/d2pack109/src/d2dbs/prefs.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_PREFS_H -#define INCLUDED_PREFS_H - -typedef struct -{ - char const * logfile; - char const * logfile_gs; - char const * loglevels; - char const * servaddrs; - char const * gameservlist; - char const * charsavedir; - char const * charsavebakdir; - char const * charinfodir; - char const * charinfobakdir; - char const * ladderdir; - unsigned int laddersave_interval; - unsigned int ladderinit_time; - unsigned int shutdown_delay; - unsigned int shutdown_decr; - unsigned int idletime; - unsigned int keepalive_interval; - unsigned int timeout_checkinterval; - unsigned int XML_ladder_output; - unsigned int ladderupdate_threshold; - unsigned int difficulty_hack; -} t_prefs; - -extern int d2dbs_prefs_load(char const * filename); -extern int d2dbs_prefs_reload(char const * filename); -extern int d2dbs_prefs_unload(void); - -extern char const * d2dbs_prefs_get_logfile(void); -extern char const * prefs_get_logfile_gs(void); -extern char const * d2dbs_prefs_get_servaddrs(void); -extern char const * d2dbs_prefs_get_charsave_dir(void); -extern char const * d2dbs_prefs_get_charinfo_dir(void); -extern char const * prefs_get_charsave_bak_dir(void); -extern char const * prefs_get_charinfo_bak_dir(void); -extern char const * d2dbs_prefs_get_ladder_dir(void); -extern char const * d2dbs_prefs_get_d2gs_list(void); -extern unsigned int prefs_get_laddersave_interval(void); -extern unsigned int prefs_get_ladderinit_time(void); -extern char const * d2dbs_prefs_get_loglevels(void); -extern unsigned int d2dbs_prefs_get_shutdown_delay(void); -extern unsigned int d2dbs_prefs_get_shutdown_decr(void); -extern unsigned int d2dbs_prefs_get_idletime(void); -extern unsigned int prefs_get_keepalive_interval(void); -extern unsigned int d2dbs_prefs_get_timeout_checkinterval(void); -extern unsigned int d2dbs_prefs_get_XML_output_ladder(void); -extern unsigned int prefs_get_ladderupdate_threshold(void); -extern unsigned int prefs_get_difficulty_hack(void); - -#endif diff --git a/d2pack109/src/d2dbs/setup.h b/d2pack109/src/d2dbs/setup.h deleted file mode 100644 index 4e19a3c..0000000 --- a/d2pack109/src/d2dbs/setup.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INLCUDED_D2DBS_SETUP_H -#define INLCUDED_D2DBS_SETUP_H - -#if !defined(MAX_PATH) && !defined(WIN32) -# define MAX_PATH 1024 -#endif - -#ifndef WIN32 -typedef unsigned int BOOL; -#endif - -#define TRUE 1 -#define FALSE 0 -#define tf(a) ((a)?1:0) -#define SELECT_TIME_OUT 20000 -#define kBufferSize (1024*20) -#define kMaxPacketLength (1024*5) -#define MAX_GAMEPASS_LEN 16 -#define MAX_GAMEDESC_LEN 32 - -#define MAX_NAME_LEN 16 -#define MAX_CHARNAME_LEN 16 -#define MAX_ACCTNAME_LEN 16 -#define MAX_GAMENAME_LEN 16 -#define MAX_REALMNAME_LEN 32 - -#define DEFAULT_LOG_FILE "/usr/local/var/d2dbs.log" -#define DEFAULT_LOG_FILE_GS "/usr/local/var/d2dbs-gs.log" -#define DEFAULT_LOG_LEVELS "info,warn,error" -#define D2DBS_CHARSAVE_DIR "/usr/local/var/charsave" -#define D2DBS_CHARINFO_DIR "/usr/local/var/charinfo" -#define D2DBS_CHARSAVEBAK_DIR "/usr/local/var/bak/charsave" -#define D2DBS_CHARINFOBAK_DIR "/usr/local/var/bak/charinfo" -#define D2DBS_LADDER_DIR "/usr/local/var/ladders" -#ifndef D2DBS_DEFAULT_CONF_FILE -# define D2DBS_DEFAULT_CONF_FILE "conf/d2dbs.conf" -#endif -#define DEFAULT_MEMLOG_FILE "/tmp/d2dbs-mem.log" -#define DEFAULT_LISTEN_PORT 6114 -#define D2DBS_SERVER_ADDRS "0.0.0.0" -#define D2GS_SERVER_LIST "192.168.0.1" -#define LOG_LEVEL LOG_MSG -#define DEFAULT_GS_MAX 256 -#define DEFAULT_SHUTDOWN_DELAY 300 -#define DEFAULT_SHUTDOWN_DECR 60 -#define DEFAULT_IDLETIME 300 -#define DEFAULT_KEEPALIVE_INTERVAL 60 -#define DEFAULT_TIMEOUT_CHECKINTERVAL 60 -#define DEFAULT_LADDERUPDATE_THRESHOLD 0 - -#endif diff --git a/d2pack109/src/d2dbs/version.h b/d2pack109/src/d2dbs/version.h deleted file mode 100644 index 9666e0b..0000000 --- a/d2pack109/src/d2dbs/version.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2001 sousou (liupeng.cs@263.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_VERSION_H -#define INCLUDED_VERSION_H - -#define D2DBS_VERSION_NUMBER "0.1.0b4" -#define D2DBS_VERSION "D2DBS Version " D2DBS_VERSION_NUMBER " Built " __DATE__ - -#endif diff --git a/d2pack109/src/win32/configwin.h b/d2pack109/src/win32/configwin.h deleted file mode 100644 index 7e3d733..0000000 --- a/d2pack109/src/win32/configwin.h +++ /dev/null @@ -1,394 +0,0 @@ -/* ../include/config.h.win32 Generated by hand from ../include/config.h.in. */ -/* ../include/config.h.in. Generated automatically from configure.in by autoheader. */ - -#ifdef __BORLANDC__ -# define __FUNCTION__ __FUNC__ -#endif - -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -/* #undef _ALL_SOURCE */ -#endif - -/* Define if the closedir function returns void instead of int. */ -/* #undef CLOSEDIR_VOID */ - -/* Define to empty if the keyword does not work. */ -/* #undef const */ - -/* Define if you don't have vprintf but do have _doprnt. */ -/* #undef HAVE_DOPRNT */ - -/* Define if you have the strftime function. */ -#define HAVE_STRFTIME 1 - -/* Define if you have the vprintf function. */ -#define HAVE_VPRINTF 1 - -/* Define if you have the _vsnprintf function. */ -#define HAVE__VSNPRINTF 1 - -/* Define if you have the _snprintf function. */ -#define HAVE__SNPRINTF 1 - -/* Define if on MINIX. */ -/* #undef _MINIX */ - -/* Define to `long' if doesn't define. */ -/* #undef off_t */ - -/* Define to `int' if doesn't define. */ -/* #undef pid_t */ - -/* Define if the system does not provide POSIX.1 features except - with this defined. */ -/* #undef _POSIX_1_SOURCE */ - -/* Define if you need to in order for stat and other things to work. */ -/* #undef _POSIX_SOURCE */ - -/* Define as the return type of signal handlers (int or void). */ -#define RETSIGTYPE void - -/* Define if the `setpgrp' function takes no argument. */ -/* #undef SETPGRP_VOID */ - -/* Define to `unsigned' if doesn't define. */ -/* #undef size_t */ - -/* Define if the `S_IS*' macros in do not work properly. */ -/* #undef STAT_MACROS_BROKEN */ - -/* Define if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define if you can safely include both and . */ -/* #undef TIME_WITH_SYS_TIME */ - -/* Define if your declares struct tm. */ -/* #undef TM_IN_SYS_TIME */ - -/* The number of bytes in a unsigned char. */ -#define SIZEOF_UNSIGNED_CHAR 1 - -/* The number of bytes in a unsigned int. */ -#define SIZEOF_UNSIGNED_INT 4 - -/* The number of bytes in a unsigned long. */ -#define SIZEOF_UNSIGNED_LONG 4 - -/* The number of bytes in a unsigned long long. */ -/* Borland doesn't do ull, but VC++ does */ -#ifdef __BORLANDC__ -# define SIZEOF_UNSIGNED_LONG_LONG 0 -#else -# define SIZEOF_UNSIGNED_LONG_LONG 8 -#endif - -/* The number of bytes in a unsigned short. */ -#define SIZEOF_UNSIGNED_SHORT 2 - -/* Define if you have the _mkdir function. */ -#define HAVE__MKDIR 1 - -/* Define if you have the bcopy function. */ -/* #undef HAVE_BCOPY */ - -/* Define if you have the chdir function. */ -/* #undef HAVE_CHDIR */ - -/* Define if you have the difftime function. */ -#define HAVE_DIFFTIME 1 - -/* Define if you have the fork function. */ -/* #undef HAVE_FORK */ - -/* Define if you have the ftime function. */ -#define HAVE_FTIME 1 - -/* Define if you have the getenv function. */ -#define HAVE_GETENV 1 - -/* Define if you have the getgid function. */ -/* #undef HAVE_GETGID */ - -/* Define if you have the getgrnam function. */ -/* #undef HAVE_GETGRNAM */ - -/* Define if you have the gethostbyname function. */ -#define HAVE_GETHOSTBYNAME 1 - -/* Define if you have the gethostname function. */ -#define HAVE_GETHOSTNAME 1 - -/* Define if you have the getlogin function. */ -/* #undef HAVE_GETLOGIN */ - -/* Define if you have the getpid function. */ -/* #undef HAVE_GETPID */ - -/* Define if you have the getpwnam function. */ -/* #undef HAVE_GETPWNAM */ - -/* Define if you have the getservbyname function. */ -#define HAVE_GETSERVBYNAME 1 - -/* Define if you have the gettimeofday function. */ -/* #undef HAVE_GETTIMEOFDAY */ - -/* Define if you have the getuid function. */ -/* #undef HAVE_GETUID */ - -/* Define if you have the index function. */ -/* #undef HAVE_INDEX */ - -/* Define if you have the inet_aton function. */ -/* #undef HAVE_INET_ATON */ - -/* Define if you have the inet_ntoa function. */ -#define HAVE_INET_NTOA 1 - -/* Define if you have the ioctl function. */ -/* #undef HAVE_IOCTL */ - -/* Define if you have the memcpy function. */ -#define HAVE_MEMCPY 1 - -/* Define if you have the memmove function. */ -#define HAVE_MEMMOVE 1 - -/* Define if you have the memset function. */ -#define HAVE_MEMSET 1 - -/* Define if you have the mkdir function. */ -#define HAVE_MKDIR - -/* Define if you have the mktime function. */ -#define HAVE_MKTIME 1 - -/* Define if you have the pipe function. */ -/* #undef HAVE_PIPE */ - -/* Define if you have the poll function. */ -/* #undef HAVE_POLL */ - -/* Define if you have the pow function. */ -#define HAVE_POW - -/* Define if you have the recv function. */ -#define HAVE_RECV 1 - -/* Define if you have the recvfrom function. */ -#define HAVE_RECVFROM 1 - -/* Define if you have the rindex function. */ -/* #undef HAVE_RINDEX */ - -/* Define if you have the select function. */ -#define HAVE_SELECT 1 - -/* Define if you have the send function. */ -#define HAVE_SEND 1 - -/* Define if you have the sendto function. */ -#define HAVE_SENDTO 1 - -/* Define if you have the setgid function. */ -/* #undef HAVE_SETGID */ - -/* Define if you have the setpgid function. */ -/* #undef HAVE_SETPGID */ - -/* Define if you have the setpgrp function. */ -/* #undef HAVE_SETPGRP */ - -/* Define if you have the setsid function. */ -/* #undef HAVE_SETSID */ - -/* Define if you have the setuid function. */ -/* #undef HAVE_SETUID */ - -/* Define if you have the sigaction function. */ -/* #undef HAVE_SIGACTION */ - -/* Define if you have the sigaddset function. */ -/* #undef HAVE_SIGADDSET */ - -/* Define if you have the sigprocmask function. */ -/* #undef HAVE_SIGPROCMASK */ - -/* Define if you have the socket function. */ -#define HAVE_SOCKET 1 - -/* Define if you have the strcasecmp function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define if you have the strchr function. */ -#define HAVE_STRCHR 1 - -/* Define if you have the strsep function. */ -/* #undef HAVE_STRSEP */ - -/* Define if you have the strdup function. */ -#define HAVE_STRDUP 1 - -/* Define if you have the strerror function. */ -#define HAVE_STRERROR 1 - -/* Define if you have the stricmp function. */ -#define HAVE_STRICMP 1 - -/* Define if you have the strncasecmp function. */ -/* #undef HAVE_STRNCASECMP */ - -/* Define if you have the strnicmp function. */ -#define HAVE_STRNICMP 1 - -/* Define if you have the strrchr function. */ -#define HAVE_STRRCHR 1 - -/* Define if you have the strtoul function. */ -#define HAVE_STRTOUL 1 - -/* Define if you have the uname function. */ -/* #undef HAVE_UNAME */ - -/* Define if you have the wait function. */ -/* #undef HAVE_WAIT */ - -/* Define if you have the waitpid function. */ -/* #undef HAVE_WAITPID */ - -/* Define if you have the header file. */ -/* #undef HAVE_ARPA_INET_H */ - -#ifdef __BORLANDC__ -/* Define if you have the header file. */ -# define HAVE_DIR_H -#else -/* Define if you have the header file. */ -#define HAVE_DIRECT_H 1 -#endif - -/* Define if you have the header file. */ -/* #undef HAVE_DIRENT_H */ - -/* Define if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_GRP_H */ - -/* Define if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define if you have the header file. */ -#define HAVE_MALLOC_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_MEMORY_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_NDIR_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_NETDB_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_NETINET_IN_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_POLL_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_PWD_H */ - -/* Define if you have the header file. */ -#define HAVE_STDARG_H 1 - -/* Define if you have the header file. */ -#define HAVE_STDDEF_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_STROPTS_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_DIR_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_FILE_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_IOCTL_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_NDIR_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_PARAM_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_POLL_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_SELECT_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_SOCKET_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_STROPTS_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_TIME_H */ - -/* Define if you have the header file. */ -#define HAVE_SYS_TIMEB_H 1 - -/* Define if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_UTSNAME_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_SYS_WAIT_H */ - -/* Define if you have the header file. */ -/* #undef HAVE_TERMIOS_H */ - -/* Define if mkdir takes only one argument. */ -#define MKDIR_TAKES_ONE_ARG 1 - -/* Define if you have the header file. */ -#define HAVE_VARARGS_H 1 - -/* Define if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define if you support inline */ -#define inline __inline - -/* Define if you support assertions */ -#define HAVE_ASSERT_H 1 - -/* Define if you have the memmove function. */ -#define HAVE_MEMMOVE 1 - -/* Define if you have the header file. */ -#define HAVE_TIME_H 1 - diff --git a/d2pack109/src/win32/d2cs_winmain.c b/d2pack109/src/win32/d2cs_winmain.c deleted file mode 100644 index 1778f92..0000000 --- a/d2pack109/src/win32/d2cs_winmain.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifdef WIN32_GUI - -#include "common/setup_before.h" -#include -#include -#include -#include -#include "d2cs_resource.h" -#include "common/eventlog.h" -#include "d2cs/version.h" -#include "d2cs/handle_signal.h" -#include "service.h" -#include "winmain.h" -#include "common/setup_after.h" - -#define WM_SHELLNOTIFY (WM_USER+1) - -extern int server_main(int argc, char *argv[]); /* d2cs main function in d2cs/main.c */ - -static void d2cs(void * dummy); /* thread function for d2cs */ - -static void guiAddText(const char *str, COLORREF clr); -static void KillTrayIcon(HWND hwnd); -static int OnShellNotify(HWND hwnd, int uID, int uMessage); -static void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify); -static BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct); -static void OnClose(HWND hwnd); -static void OnSize(HWND hwnd, UINT state, int cx, int cy); - -LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK DlgProcAbout(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - -HWND ghwndConsole; /* hwnd for eventlog output */ - -static int gui_run = TRUE; /* default state: run gui */ -static int d2cs_run = TRUE; /* default state: run d2cs */ -static int d2cs_running = FALSE; /* currect state: not running */ - -int fprintf(FILE *stream, const char *format, ...) -{ - va_list args; - va_start(args, format); - if(stream == stderr || stream == stdout) - return gui_lvprintf(eventlog_level_error, format, args); - else - return vfprintf(stream, format, args); -} - -static void KillTrayIcon(HWND hwnd) -{ - NOTIFYICONDATA dta; - - dta.cbSize = sizeof(NOTIFYICONDATA); - dta.hWnd = hwnd; - dta.uID = ID_TRAY; - dta.uFlags = 0; - Shell_NotifyIcon(NIM_DELETE, &dta); -} - -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpszCmdLine, int nCmdShow) -{ - WNDCLASSEX wc; - HWND hwnd; - MSG msg; - - /* if running as a service skip starting the GUI and go straight to starting d2cs */ - if (__argc==2 && strcmp(__argv[1],"--service")==0) - { - Win32_ServiceRun(); - return 1; - } - - LoadLibrary("RichEd20.dll"); - - wc.cbSize = sizeof(WNDCLASSEX); - wc.style = 0; - wc.lpfnWndProc = WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = sizeof(LPVOID); - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(ID_ICON1)); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)COLOR_WINDOW; - wc.lpszMenuName = MAKEINTRESOURCE(ID_MENU); - wc.lpszClassName = "BnetWndClass"; - - if(!RegisterClassEx( &wc )) - RegisterClass((LPWNDCLASS)&wc.style); - - hwnd = CreateWindow(TEXT("BnetWndClass"),"Diablo II Character Server", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, CW_USEDEFAULT, - NULL, - LoadMenu(hInstance, MAKEINTRESOURCE(ID_MENU)), - hInstance,NULL); - - if(hwnd) { - ShowWindow(hwnd, nCmdShow); - UpdateWindow(hwnd); - } - - while(GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage( &msg ); - DispatchMessage( &msg ); - - if(!d2cs_running && d2cs_run && gui_run) { - d2cs_running = TRUE; - _beginthread(d2cs, 0, NULL); - } - - if(!gui_run && !d2cs_running) { - KillTrayIcon(hwnd); - exit(0); - } - } - return ((int) msg.wParam); -} - -LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch(uMsg) { - HANDLE_MSG(hwnd, WM_CREATE, OnCreate); - HANDLE_MSG(hwnd, WM_SIZE, OnSize); - HANDLE_MSG(hwnd, WM_COMMAND, OnCommand); - HANDLE_MSG(hwnd, WM_CLOSE, OnClose); - case WM_SHELLNOTIFY: - return OnShellNotify(hwnd, wParam, lParam); - } - return DefWindowProc(hwnd, uMsg, wParam, lParam); -} - -static BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct) -{ - ghwndConsole = CreateWindowEx(WS_EX_CLIENTEDGE, RICHEDIT_CLASS, NULL, - WS_CHILD|WS_VISIBLE|ES_READONLY|ES_MULTILINE| - WS_VSCROLL|WS_HSCROLL|ES_NOHIDESEL, - 0, 0, - 0, 0, hwnd, 0, - 0, NULL); - - if(!ghwndConsole) - return FALSE; - - return TRUE; -} - -static void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) -{ - switch (id) { - case ID_RESTORE: - OnShellNotify(hwnd, ID_TRAY, WM_LBUTTONDBLCLK); - break; - case ID_START_D2CS: - fprintf(stderr,"Sending Start Signal to d2cs\n"); - d2cs_run = TRUE; - break; - case ID_SHUTDOWN_D2CS: - fprintf(stderr,"Sending Shutdown Signal to d2cs\n"); - d2cs_run = FALSE; - signal_quit_wrapper(); - break; - case ID_RESTART_D2CS: - fprintf(stderr,"Sending Restart Signal To d2cs\n"); - d2cs_run = TRUE; - signal_quit_wrapper(); - break; - case ID_EDITCONFIG_D2CS: - ShellExecute(NULL, "open", "notepad.exe", "conf\\d2cs.conf", NULL, SW_SHOW ); - break; - case ID_LOADCONFIG_D2CS: - fprintf(stderr,"Sending Reload Config Signal To d2cs\n"); - signal_reload_config_wrapper(); - break; - case ID_LADDER_LOAD: - fprintf(stderr,"Sending Reload Ladder Signal To d2cs\n"); - signal_load_ladder_wrapper(); - break; - case ID_RESTART_D2GS: - fprintf(stderr,"Sending Restart d2gs Signal To d2cs\n"); - signal_restart_d2gs_wrapper(); - break; - case ID_EXIT: - OnClose(hwnd); - break; - case ID_CLEAR: - SendMessage(ghwndConsole, WM_SETTEXT, 0, 0); - break; - case ID_ABOUT: - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(ID_ABOUT_BOX), hwnd, (DLGPROC)DlgProcAbout); - break; - } -} - -static int OnShellNotify(HWND hwnd, int uID, int uMessage) -{ - if(uID == ID_TRAY) { - if(uMessage == WM_LBUTTONDBLCLK) { - if(!IsWindowVisible(hwnd)) - ShowWindow(hwnd, SW_RESTORE); - - SetForegroundWindow(hwnd); - } - } - return 0; -} - -static void OnClose(HWND hwnd) -{ - fprintf(stderr,"Sending Exit Signal To d2cs\n"); - gui_run = FALSE; - d2cs_run = FALSE; - signal_exit_wrapper(); -} - -static void OnSize(HWND hwnd, UINT state, int cx, int cy) -{ - NOTIFYICONDATA dta; - - if( state == SIZE_MINIMIZED ) { - dta.cbSize = sizeof(NOTIFYICONDATA); - dta.hWnd = hwnd; - dta.uID = ID_TRAY; - dta.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP; - dta.uCallbackMessage = WM_SHELLNOTIFY; - dta.hIcon = LoadIcon(GetWindowInstance(hwnd), MAKEINTRESOURCE(ID_ICON1)); - strcpy(dta.szTip, "D2CS Version"); - strcat(dta.szTip, " "); - strcat(dta.szTip, D2CS_VERSION_STRING); - - Shell_NotifyIcon(NIM_ADD, &dta); - ShowWindow(hwnd, SW_HIDE); - return; - } - - MoveWindow(ghwndConsole, 0, 0, cx, cy, TRUE); -} - -BOOL CALLBACK DlgProcAbout(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) { - case WM_CLOSE: - EndDialog(hwnd, TRUE); - return TRUE; - case WM_INITDIALOG: - return TRUE; - case WM_COMMAND: - switch ((int)wParam) { - case IDOK: - EndDialog(hwnd, TRUE); - return TRUE; - } - } - return FALSE; -} - -extern int gui_lprintf(t_eventlog_level l, const char *format, ...) -{ - va_list arglist; - va_start(arglist, format); - - return gui_lvprintf(l, format, arglist); -} - -extern int gui_lvprintf(t_eventlog_level l, const char *format, va_list arglist) -{ - char buff[4096]; - int result; - COLORREF clr; - - result = vsprintf(buff, format, arglist); - - switch(l) - { - case eventlog_level_none: - clr = RGB(0, 0, 0); - break; - case eventlog_level_trace: - clr = RGB(255, 0, 255); - break; - case eventlog_level_debug: - clr = RGB(0, 0, 255); - break; - case eventlog_level_info: - clr = RGB(0, 0, 0); - break; - case eventlog_level_warn: - clr = RGB(255, 128, 64); - break; - case eventlog_level_error: - clr = RGB(255, 0, 0); - break; - case eventlog_level_fatal: - clr = RGB(255, 0, 0); - break; - default: - clr = RGB(0, 0, 0); - } - guiAddText(buff, clr); - return result; -} - -static void guiAddText(const char *str, COLORREF clr) -{ - int start_lines, text_length, end_lines; - CHARRANGE cr; - CHARRANGE ds; - CHARFORMAT fmt; - - text_length = SendMessage(ghwndConsole, WM_GETTEXTLENGTH, 0, 0); - - if (text_length > 30000) - { - ds.cpMin = 0; - ds.cpMax = text_length - 30000; - SendMessage(ghwndConsole, EM_EXSETSEL, 0, (LPARAM)&ds); - SendMessage(ghwndConsole, EM_REPLACESEL, FALSE, 0); - } - - cr.cpMin = text_length; - cr.cpMax = text_length; - SendMessage(ghwndConsole, EM_EXSETSEL, 0, (LPARAM)&cr); - - fmt.cbSize = sizeof(CHARFORMAT); - fmt.dwMask = CFM_COLOR|CFM_FACE|CFM_SIZE|CFM_BOLD|CFM_ITALIC|CFM_STRIKEOUT|CFM_UNDERLINE; - fmt.yHeight = 160; - fmt.dwEffects = 0; - fmt.crTextColor = clr; - strcpy(fmt.szFaceName,"Courier New"); - - SendMessage(ghwndConsole, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&fmt); - SendMessage(ghwndConsole, EM_REPLACESEL, FALSE, (LPARAM)str); -} - -#define EXIT_ERROR -1 -#define EXIT_OK 0 -#define EXIT_SERVICE 1 - -static void d2cs(void * dummy) -{ - switch (server_main(__argc, __argv)) - { - case EXIT_SERVICE: - gui_run = FALSE; /* close gui */ - case EXIT_ERROR: - d2cs_run = FALSE; /* don't restart */ - case EXIT_OK: - ; /* do nothing */ - } - - fprintf(stderr,"Server Stopped\n"); - d2cs_running = FALSE; -} - -#endif diff --git a/d2pack109/src/win32/d2dbs_winmain.c b/d2pack109/src/win32/d2dbs_winmain.c deleted file mode 100644 index 7d7ee83..0000000 --- a/d2pack109/src/win32/d2dbs_winmain.c +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifdef WIN32_GUI - -#include "common/setup_before.h" -#include -#include -#include -#include -#include "d2dbs_resource.h" -#include "common/eventlog.h" -#include "d2dbs/version.h" -#include "d2dbs/handle_signal.h" -#include "service.h" -#include "winmain.h" -#include "common/setup_after.h" - -#define WM_SHELLNOTIFY (WM_USER+1) - -extern int server_main(int argc, char *argv[]); /* d2dbs main function in d2dbs/main.c */ - -static void d2dbs(void * dummy); /* thread function for d2dbs */ - -static void guiAddText(const char *str, COLORREF clr); -static void KillTrayIcon(HWND hwnd); -static int OnShellNotify(HWND hwnd, int uID, int uMessage); -static void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify); -static BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct); -static void OnClose(HWND hwnd); -static void OnSize(HWND hwnd, UINT state, int cx, int cy); - -LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); -BOOL CALLBACK DlgProcAbout(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - -HWND ghwndConsole; /* hwnd for eventlog output */ - -static int gui_run = TRUE; /* default state: run gui */ -static int d2dbs_run = TRUE; /* default state: run d2dbs */ -static int d2dbs_running = FALSE; /* currect state: not running */ - -int fprintf(FILE *stream, const char *format, ...) -{ - va_list args; - va_start(args, format); - if(stream == stderr || stream == stdout) - return gui_lvprintf(eventlog_level_error, format, args); - else - return vfprintf(stream, format, args); -} - -static void KillTrayIcon(HWND hwnd) -{ - NOTIFYICONDATA dta; - - dta.cbSize = sizeof(NOTIFYICONDATA); - dta.hWnd = hwnd; - dta.uID = ID_TRAY; - dta.uFlags = 0; - Shell_NotifyIcon(NIM_DELETE, &dta); -} - -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPSTR lpszCmdLine, int nCmdShow) -{ - WNDCLASSEX wc; - HWND hwnd; - MSG msg; - - /* if running as a service skip starting the GUI and go straight to starting d2dbs */ - if (__argc==2 && strcmp(__argv[1],"--service")==0) - { - Win32_ServiceRun(); - return 1; - } - - LoadLibrary("RichEd20.dll"); - - wc.cbSize = sizeof(WNDCLASSEX); - wc.style = 0; - wc.lpfnWndProc = WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = sizeof(LPVOID); - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(ID_ICON1)); - wc.hCursor = LoadCursor(NULL, IDC_ARROW); - wc.hbrBackground = (HBRUSH)COLOR_WINDOW; - wc.lpszMenuName = MAKEINTRESOURCE(ID_MENU); - wc.lpszClassName = "BnetWndClass"; - - if(!RegisterClassEx( &wc )) - RegisterClass((LPWNDCLASS)&wc.style); - - hwnd = CreateWindow(TEXT("BnetWndClass"),"Diablo II DataBase Server", - WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT,CW_USEDEFAULT, - CW_USEDEFAULT,CW_USEDEFAULT, - NULL, - LoadMenu(hInstance, MAKEINTRESOURCE(ID_MENU)), - hInstance,NULL); - - if(hwnd) { - ShowWindow(hwnd, nCmdShow); - UpdateWindow(hwnd); - } - - while(GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage( &msg ); - DispatchMessage( &msg ); - - if(!d2dbs_running && d2dbs_run && gui_run) { - d2dbs_running = TRUE; - _beginthread(d2dbs, 0, NULL); - } - - if(!gui_run && !d2dbs_running) { - KillTrayIcon(hwnd); - exit(0); - } - } - return ((int) msg.wParam); -} - -LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch(uMsg) { - HANDLE_MSG(hwnd, WM_CREATE, OnCreate); - HANDLE_MSG(hwnd, WM_SIZE, OnSize); - HANDLE_MSG(hwnd, WM_COMMAND, OnCommand); - HANDLE_MSG(hwnd, WM_CLOSE, OnClose); - case WM_SHELLNOTIFY: - return OnShellNotify(hwnd, wParam, lParam); - } - return DefWindowProc(hwnd, uMsg, wParam, lParam); -} - -static BOOL OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct) -{ - ghwndConsole = CreateWindowEx(WS_EX_CLIENTEDGE, RICHEDIT_CLASS, NULL, - WS_CHILD|WS_VISIBLE|ES_READONLY|ES_MULTILINE| - WS_VSCROLL|WS_HSCROLL|ES_NOHIDESEL, - 0, 0, - 0, 0, hwnd, 0, - 0, NULL); - - if(!ghwndConsole) - return FALSE; - - return TRUE; -} - -static void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) -{ - switch (id) { - case ID_RESTORE: - OnShellNotify(hwnd, ID_TRAY, WM_LBUTTONDBLCLK); - break; - case ID_START_D2DBS: - fprintf(stderr,"Sending Start Signal to d2dbs\n"); - d2dbs_run = TRUE; - break; - case ID_SHUTDOWN_D2DBS: - fprintf(stderr,"Sending Shutdown Signal to d2dbs\n"); - d2dbs_run = FALSE; - d2dbs_signal_quit_wrapper(); - break; - case ID_RESTART_D2DBS: - fprintf(stderr,"Sending Restart Signal To d2dbs\n"); - d2dbs_run = TRUE; - d2dbs_signal_quit_wrapper(); - break; - case ID_EDITCONFIG_D2DBS: - ShellExecute(NULL, "open", "notepad.exe", "conf\\d2dbs.conf", NULL, SW_SHOW ); - break; - case ID_LOADCONFIG_D2DBS: - fprintf(stderr,"Sending Reload Config Signal To d2dbs\n"); - d2dbs_signal_reload_config_wrapper(); - break; - case ID_LADDER_SAVE: - fprintf(stderr,"Sending Save Ladder Signal To d2dbs\n"); - d2dbs_signal_save_ladder_wrapper(); - break; - case ID_EXIT: - OnClose(hwnd); - break; - case ID_CLEAR: - SendMessage(ghwndConsole, WM_SETTEXT, 0, 0); - break; - case ID_ABOUT: - DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(ID_ABOUT_BOX), hwnd, (DLGPROC)DlgProcAbout); - break; - } -} - -static int OnShellNotify(HWND hwnd, int uID, int uMessage) -{ - if(uID == ID_TRAY) { - if(uMessage == WM_LBUTTONDBLCLK) { - if(!IsWindowVisible(hwnd)) - ShowWindow(hwnd, SW_RESTORE); - - SetForegroundWindow(hwnd); - } - } - return 0; -} - -static void OnClose(HWND hwnd) -{ - fprintf(stderr,"Sending Exit Signal To d2dbs\n"); - gui_run = FALSE; - d2dbs_run = FALSE; - d2dbs_signal_exit_wrapper(); -} - -static void OnSize(HWND hwnd, UINT state, int cx, int cy) -{ - NOTIFYICONDATA dta; - - if( state == SIZE_MINIMIZED ) { - dta.cbSize = sizeof(NOTIFYICONDATA); - dta.hWnd = hwnd; - dta.uID = ID_TRAY; - dta.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP; - dta.uCallbackMessage = WM_SHELLNOTIFY; - dta.hIcon = LoadIcon(GetWindowInstance(hwnd), MAKEINTRESOURCE(ID_ICON1)); - strcpy(dta.szTip, "D2DBS Version"); - strcat(dta.szTip, " "); - strcat(dta.szTip, D2DBS_VERSION_NUMBER); - - Shell_NotifyIcon(NIM_ADD, &dta); - ShowWindow(hwnd, SW_HIDE); - return; - } - - MoveWindow(ghwndConsole, 0, 0, cx, cy, TRUE); -} - -BOOL CALLBACK DlgProcAbout(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) { - case WM_CLOSE: - EndDialog(hwnd, TRUE); - return TRUE; - case WM_INITDIALOG: - return TRUE; - case WM_COMMAND: - switch ((int)wParam) { - case IDOK: - EndDialog(hwnd, TRUE); - return TRUE; - } - } - return FALSE; -} - -extern int gui_lprintf(t_eventlog_level l, const char *format, ...) -{ - va_list arglist; - va_start(arglist, format); - - return gui_lvprintf(l, format, arglist); -} - -extern int gui_lvprintf(t_eventlog_level l, const char *format, va_list arglist) -{ - char buff[4096]; - int result; - COLORREF clr; - - result = vsprintf(buff, format, arglist); - - switch(l) - { - case eventlog_level_none: - clr = RGB(0, 0, 0); - break; - case eventlog_level_trace: - clr = RGB(255, 0, 255); - break; - case eventlog_level_debug: - clr = RGB(0, 0, 255); - break; - case eventlog_level_info: - clr = RGB(0, 0, 0); - break; - case eventlog_level_warn: - clr = RGB(255, 128, 64); - break; - case eventlog_level_error: - clr = RGB(255, 0, 0); - break; - case eventlog_level_fatal: - clr = RGB(255, 0, 0); - break; - default: - clr = RGB(0, 0, 0); - } - guiAddText(buff, clr); - return result; -} - -static void guiAddText(const char *str, COLORREF clr) -{ - int start_lines, text_length, end_lines; - CHARRANGE cr; - CHARRANGE ds; - CHARFORMAT fmt; - - text_length = SendMessage(ghwndConsole, WM_GETTEXTLENGTH, 0, 0); - - if (text_length > 30000) - { - ds.cpMin = 0; - ds.cpMax = text_length - 30000; - SendMessage(ghwndConsole, EM_EXSETSEL, 0, (LPARAM)&ds); - SendMessage(ghwndConsole, EM_REPLACESEL, FALSE, 0); - } - - cr.cpMin = text_length; - cr.cpMax = text_length; - SendMessage(ghwndConsole, EM_EXSETSEL, 0, (LPARAM)&cr); - - fmt.cbSize = sizeof(CHARFORMAT); - fmt.dwMask = CFM_COLOR|CFM_FACE|CFM_SIZE|CFM_BOLD|CFM_ITALIC|CFM_STRIKEOUT|CFM_UNDERLINE; - fmt.yHeight = 160; - fmt.dwEffects = 0; - fmt.crTextColor = clr; - strcpy(fmt.szFaceName,"Courier New"); - - SendMessage(ghwndConsole, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&fmt); - SendMessage(ghwndConsole, EM_REPLACESEL, FALSE, (LPARAM)str); -} - -#define EXIT_ERROR -1 -#define EXIT_OK 0 -#define EXIT_SERVICE 1 - -static void d2dbs(void * dummy) -{ - switch (server_main(__argc, __argv)) - { - case EXIT_SERVICE: - gui_run = FALSE; /* close gui */ - case EXIT_ERROR: - d2dbs_run = FALSE; /* don't restart */ - case EXIT_OK: - ; /* do nothing */ - } - - fprintf(stderr,"Server Stopped\n"); - d2dbs_running = FALSE; -} - -#endif diff --git a/d2pack109/src/win32/service.c b/d2pack109/src/win32/service.c deleted file mode 100644 index 59eba87..0000000 --- a/d2pack109/src/win32/service.c +++ /dev/null @@ -1,236 +0,0 @@ - /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include - -#if !defined(WINADVAPI) -#if !defined(_ADVAPI32_) -#define WINADVAPI DECLSPEC_IMPORT -#else -#define WINADVAPI -#endif -#endif - -extern char serviceLongName[]; -extern char serviceName[]; -extern char serviceDescription[]; - -extern int g_ServiceStatus; - -#ifdef WIN32_GUI -extern int server_main(int argc, char *argv[]); -#else -extern int main(int argc, char *argv[]); -#endif - -SERVICE_STATUS serviceStatus; -SERVICE_STATUS_HANDLE serviceStatusHandle = 0; - -typedef WINADVAPI BOOL (WINAPI *CSD_T)(SC_HANDLE, DWORD, LPCVOID); - -void Win32_ServiceInstall() -{ - SERVICE_DESCRIPTION sdBuf; - CSD_T ChangeServiceDescription; - HANDLE advapi32; - SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE); - - if (serviceControlManager) - { - char path[_MAX_PATH + 10]; - if (GetModuleFileName( 0, path, sizeof(path)/sizeof(path[0]) ) > 0) - { - SC_HANDLE service; - strcat(path, " --service"); - service = CreateService(serviceControlManager, - serviceName, serviceLongName, - SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, - SERVICE_AUTO_START, SERVICE_ERROR_IGNORE, path, - 0, 0, 0, 0, 0); - if (service) - { - sdBuf.lpDescription = serviceDescription; - - if (!(advapi32 = GetModuleHandle("ADVAPI32.DLL"))) - { - CloseServiceHandle(service); - CloseServiceHandle(serviceControlManager); - return; - } - - ; - if (!(ChangeServiceDescription = (CSD_T) GetProcAddress(advapi32, "ChangeServiceConfig2A"))) - { - CloseServiceHandle(service); - CloseServiceHandle(serviceControlManager); - return; - } - - ChangeServiceDescription( - service, // handle to service - SERVICE_CONFIG_DESCRIPTION, // change: description - &sdBuf); - CloseServiceHandle(service); - } - } - CloseServiceHandle(serviceControlManager); - } -} - -void Win32_ServiceUninstall() -{ - SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CONNECT); - - if (serviceControlManager) - { - SC_HANDLE service = OpenService(serviceControlManager, - serviceName, SERVICE_QUERY_STATUS | DELETE); - if (service) - { - SERVICE_STATUS serviceStatus; - if (QueryServiceStatus(service, &serviceStatus)) - { - if (serviceStatus.dwCurrentState == SERVICE_STOPPED) - DeleteService(service); - } - //DeleteService(service); - - CloseServiceHandle(service); - } - - CloseServiceHandle(serviceControlManager); - } - -} - -void WINAPI ServiceControlHandler(DWORD controlCode) -{ - switch (controlCode) - { - case SERVICE_CONTROL_INTERROGATE: - break; - - case SERVICE_CONTROL_SHUTDOWN: - case SERVICE_CONTROL_STOP: - serviceStatus.dwCurrentState = SERVICE_STOP_PENDING; - SetServiceStatus(serviceStatusHandle, &serviceStatus); - - g_ServiceStatus = 0; - return; - - case SERVICE_CONTROL_PAUSE: - g_ServiceStatus = 2; - serviceStatus.dwCurrentState = SERVICE_PAUSED; - SetServiceStatus(serviceStatusHandle, &serviceStatus); - break; - - case SERVICE_CONTROL_CONTINUE: - serviceStatus.dwCurrentState = SERVICE_RUNNING; - SetServiceStatus(serviceStatusHandle, &serviceStatus); - g_ServiceStatus = 1; - break; - - default: - if ( controlCode >= 128 && controlCode <= 255 ) - // user defined control code - break; - else - // unrecognized control code - break; - } - - SetServiceStatus(serviceStatusHandle, &serviceStatus); -} - -void WINAPI ServiceMain(DWORD argc, char *argv[]) -{ - // initialise service status - serviceStatus.dwServiceType = SERVICE_WIN32; - serviceStatus.dwCurrentState = SERVICE_START_PENDING; - serviceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | - SERVICE_ACCEPT_PAUSE_CONTINUE; - serviceStatus.dwWin32ExitCode = NO_ERROR; - serviceStatus.dwServiceSpecificExitCode = NO_ERROR; - serviceStatus.dwCheckPoint = 0; - serviceStatus.dwWaitHint = 0; - - serviceStatusHandle = RegisterServiceCtrlHandler(serviceName, ServiceControlHandler); - - if ( serviceStatusHandle ) - { - char path[_MAX_PATH + 1]; - int i, last_slash = 0; - - GetModuleFileName(0, path, sizeof(path)/sizeof(path[0])); - - for (i = 0; i < strlen(path); i++) { - if (path[i] == '\\') last_slash = i; - } - - path[last_slash] = 0; - - // service is starting - serviceStatus.dwCurrentState = SERVICE_START_PENDING; - SetServiceStatus(serviceStatusHandle, &serviceStatus); - - // do initialisation here - SetCurrentDirectory(path); - - // running - serviceStatus.dwControlsAccepted |= (SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN); - serviceStatus.dwCurrentState = SERVICE_RUNNING; - SetServiceStatus( serviceStatusHandle, &serviceStatus ); - - //////////////////////// - // service main cycle // - //////////////////////// - - g_ServiceStatus = 1; - argc = 1; - -#ifdef WIN32_GUI - server_main(argc, argv); -#else - main(argc, argv); -#endif - - // service was stopped - serviceStatus.dwCurrentState = SERVICE_STOP_PENDING; - SetServiceStatus(serviceStatusHandle, &serviceStatus); - - // do cleanup here - - // service is now stopped - serviceStatus.dwControlsAccepted &= ~(SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN); - serviceStatus.dwCurrentState = SERVICE_STOPPED; - SetServiceStatus(serviceStatusHandle, &serviceStatus); - } -} - -void Win32_ServiceRun() -{ - SERVICE_TABLE_ENTRY serviceTable[] = - { - { serviceName, ServiceMain }, - { 0, 0 } - }; - - if (!StartServiceCtrlDispatcher(serviceTable)) - { - } -} diff --git a/d2pack109/src/win32/service.h b/d2pack109/src/win32/service.h deleted file mode 100644 index 7150978..0000000 --- a/d2pack109/src/win32/service.h +++ /dev/null @@ -1,19 +0,0 @@ - /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -void Win32_ServiceInstall(void); -void Win32_ServiceUninstall(void); -void Win32_ServiceRun(void); diff --git a/d2pack109/src/win32/u2d.c b/d2pack109/src/win32/u2d.c deleted file mode 100644 index c93b013..0000000 --- a/d2pack109/src/win32/u2d.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include - -int u2d(char * file) -{ - FILE * orig_file; - FILE * new_file; - char temp_file[256]; - int ch; - int prev_ch = 0; - - sprintf(temp_file, "%s.tmp", file); - orig_file = fopen(file, "rb"); - new_file = fopen(temp_file, "wb"); - - while ((ch = getc(orig_file)) != EOF) - { - if ((ch == 0x0A) && (prev_ch != 0x0D)) - putc(0x0D, new_file); - - putc(ch, new_file); - prev_ch = ch; - } - - fclose(orig_file); - fclose(new_file); - remove(file); - rename(temp_file,file); - remove(temp_file); - return 0; -} - -int main (int argc, char **argv) -{ - int i; - - for (i = 1; i < argc; i++) - u2d(argv[i]); - - return 0; -} - diff --git a/d2pack109/src/win32/winmain.h b/d2pack109/src/win32/winmain.h deleted file mode 100644 index eebfe7f..0000000 --- a/d2pack109/src/win32/winmain.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2001 Erik Latoshek [forester] (laterk@inbox.lv) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef __WINMAIN_H__ -#define __WINMAIN_H__ - -#include -#include "common/eventlog.h" - -extern int gui_printf(const char *format, ...); -extern void guiOnUpdateUserList(void); - -extern int gui_lvprintf(t_eventlog_level l, const char *format, va_list arglist); -extern int gui_lprintf(t_eventlog_level l, const char *format, ...); - -#endif diff --git a/pvpgn/docs/Compile.Instructions.Win32.Dev-C++.txt b/docs/Compile.Instructions.Win32.Dev-C++.txt similarity index 98% rename from pvpgn/docs/Compile.Instructions.Win32.Dev-C++.txt rename to docs/Compile.Instructions.Win32.Dev-C++.txt index 382be50..9e80307 100644 --- a/pvpgn/docs/Compile.Instructions.Win32.Dev-C++.txt +++ b/docs/Compile.Instructions.Win32.Dev-C++.txt @@ -1,32 +1,32 @@ -PvPGN Win32 Dev-C++ Compile Instructions -This file explains how to compile PvPGN for Win32 using Dev-C++ ( 5.0 beta 9 (4.9.9.0) ) - -1) Download Dev-C++ 5.0 beta 9 (4.9.9.0) with Mingw/GCC 3.3.1 from the folling sites: -http://prdownloads.sourceforge.net/dev-cpp/devcpp4990setup.exe - -2) Install Dev-C++ in a folder without any spaces in the path - -3) From within Dev-C++ install the zlib-DevPak from the DevPacks.org community server (Tools->Check for Updates/Packages) - -4) Go into the Win32-Projects folder of the PvPGN sources -Simply double-click on any of the *.dev files to fire up Dev-C++ and use Execute->Compile to build the binary - -5) The resulting exe file will be in the bin directory and you can use it with the other files from the latest PvPGN release. - -Notes for MYSQL/PGSQL/SQLITE3/ODBC Support: - support with Dev-C++ still unsupported/untested - - -Common problems and Solutions: -============================== - -Fatal: 'all-before' does not exist - don't know how to make it: ----------------------------------------------------------------- -That happens when the wrong make.exe is invoked, usually the Borland one. It will usually leave a copyright notice in your compile log. -How to fix it? add the bin folder of your Dev-C++ (or MinGW) installation to the PATH environment variable, before any Borland path that might be there -For more details check: http://www14.brinkster.com/aditsu/dev-cpp-faq.html#allbefore - -Complains about not being able to create Makefile or 'no rule to make target all': ------------------------------------------------------------------------------------ -Check size of pvpgn\src\win32\Makefile.win +PvPGN Win32 Dev-C++ Compile Instructions +This file explains how to compile PvPGN for Win32 using Dev-C++ ( 5.0 beta 9 (4.9.9.0) ) + +1) Download Dev-C++ 5.0 beta 9 (4.9.9.0) with Mingw/GCC 3.3.1 from the folling sites: +http://prdownloads.sourceforge.net/dev-cpp/devcpp4990setup.exe + +2) Install Dev-C++ in a folder without any spaces in the path + +3) From within Dev-C++ install the zlib-DevPak from the DevPacks.org community server (Tools->Check for Updates/Packages) + +4) Go into the Win32-Projects folder of the PvPGN sources +Simply double-click on any of the *.dev files to fire up Dev-C++ and use Execute->Compile to build the binary + +5) The resulting exe file will be in the bin directory and you can use it with the other files from the latest PvPGN release. + +Notes for MYSQL/PGSQL/SQLITE3/ODBC Support: + support with Dev-C++ still unsupported/untested + + +Common problems and Solutions: +============================== + +Fatal: 'all-before' does not exist - don't know how to make it: +---------------------------------------------------------------- +That happens when the wrong make.exe is invoked, usually the Borland one. It will usually leave a copyright notice in your compile log. +How to fix it? add the bin folder of your Dev-C++ (or MinGW) installation to the PATH environment variable, before any Borland path that might be there +For more details check: http://www14.brinkster.com/aditsu/dev-cpp-faq.html#allbefore + +Complains about not being able to create Makefile or 'no rule to make target all': +----------------------------------------------------------------------------------- +Check size of pvpgn\src\win32\Makefile.win If it's 0 bytes quit Dev-C++, delete the file and try to compile again \ No newline at end of file diff --git a/pvpgn/docs/Compile.Instructions.Win32.VS.Net2005.txt b/docs/Compile.Instructions.Win32.VS.Net2005.txt similarity index 98% rename from pvpgn/docs/Compile.Instructions.Win32.VS.Net2005.txt rename to docs/Compile.Instructions.Win32.VS.Net2005.txt index d5a4c04..87934ae 100644 --- a/pvpgn/docs/Compile.Instructions.Win32.VS.Net2005.txt +++ b/docs/Compile.Instructions.Win32.VS.Net2005.txt @@ -1,56 +1,56 @@ -A step-by-step guide for building the SVN version of PvPGN using Visual Studio Professional -=========================================================================================== - -Requirements: - - CMake 2.4.7 ( http://www.cmake.org/files/v2.4/cmake-2.4.7-win32-x86.exe ) - - Visual Studio 2005 Professional - (you can also use Visual C++ Express - but this will need additional - tweaking that is beyond the scope of this guide.) - - zlib ( http://www.winimage.com/zLibDll/zlib123dll.zip AND http://www.winimage.com/zLibDll/zlib123.zip ) - - latest PvPGN sources from SVN (in this example I have them extracted under D:/svn/pvpgn/ ) - - Optional: - - MySQL ( http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.45-win32.zip/from/pick#mirrors ) - (using the installer version will make thinks alot easier for you - trust me on this) - - PostgreSQL ( http://wwwmaster.postgresql.org/download/mirrors-ftp?file=%2Fbinary%2Fv8.2.5%2Fwin32%2Fpostgresql-8.2.5-1.zip ) - (same applies here - using this installer will make things alot easier for you) - - SQLite ( http://www.sqlite.org/sqlitedll-3_4_2.zip ) - (needs some extra tweaking - but we'll leave that for later) - -Step-by-step guide: - - install Visual Studio Professional (obviously not required when allread done) - - install CMake (same applies here) - - extract PvPGN sources from zip/tarball or get them via SVN - - create a folder called "zlib" inside you PvPGN base folder ( i.e. D:/svn/pvpgn/zlib/ ) - - extract the following files from zlib123.zip into the "zlib" folder: - zconf.h, zlib.h - - extract the following file from zlib123dll.zip (from with dll32 folder) into the "zlib" folder: - zlibwapi.lib - - install MySQL if you intend to use it as a storage backend - - install PostgreSQL if you intend to use it as a storage backend - - SQLite stub - need some extra tweaking to be explained later (in version 2.0 of this guide) - - create a folder called "build" inside you PvPGN base folder ( i.e. D:/svn/pvpgn/build/ ) - - fire up CMake (I'll use the GUI version for this guide - so you should use it, too) - - Where is the source code: D:\svn\pvpgn - - Where to build the binaries: D:\svn\pvpgn\build - - Now press the "Configure" button, select "Visual Studio 2005" as the build environment and wait a few seconds - - all the components should be found without any problems - - now enable optinal components if required ( WITH_MYSQL, WITH_PGSQL, WITH_SQLITE3 ) and "Configure" again - - again all the components should be found without any problems - - Press "OK" - - double-click on D:/svn/pvpgn/build/pvpgn.sln to fire up Visual Studio 2005 - - build the "ALL_BUILD" target - - build the "INSTALL" target - - now you should find all the stuff (almost) ready under c:/Program Files/pvpgn/ - - extract the following files from zlib123dll.zip (from with dll32 folder) into the "sbin" folder: - zlibwapi.lib - - optionally get the following files from C:\Program Files\MySQL\MySQL Server 5.0\lib\opt\ and copy them into the "sbin" folder - libmysql.dll - - optionally get the following files from C:\Program Files\PostgreSQL\8.2\bin\ and copy them into the "sbin" folder - libpq.dll, libintl-2.dll, libiconv-2.dll, krb5_32.dll, comerr32.dll - - optionally extract the following files from sqlitedll-3_4_2.zip into the "sbin" folder: - sqlite3.dll - - drink a beer and congratulate yourself for what you accomplished today - - - +A step-by-step guide for building the SVN version of PvPGN using Visual Studio Professional +=========================================================================================== + +Requirements: + - CMake 2.4.7 ( http://www.cmake.org/files/v2.4/cmake-2.4.7-win32-x86.exe ) + - Visual Studio 2005 Professional + (you can also use Visual C++ Express - but this will need additional + tweaking that is beyond the scope of this guide.) + - zlib ( http://www.winimage.com/zLibDll/zlib123dll.zip AND http://www.winimage.com/zLibDll/zlib123.zip ) + - latest PvPGN sources from SVN (in this example I have them extracted under D:/svn/pvpgn/ ) + + Optional: + - MySQL ( http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.45-win32.zip/from/pick#mirrors ) + (using the installer version will make thinks alot easier for you - trust me on this) + - PostgreSQL ( http://wwwmaster.postgresql.org/download/mirrors-ftp?file=%2Fbinary%2Fv8.2.5%2Fwin32%2Fpostgresql-8.2.5-1.zip ) + (same applies here - using this installer will make things alot easier for you) + - SQLite ( http://www.sqlite.org/sqlitedll-3_4_2.zip ) + (needs some extra tweaking - but we'll leave that for later) + +Step-by-step guide: + - install Visual Studio Professional (obviously not required when allread done) + - install CMake (same applies here) + - extract PvPGN sources from zip/tarball or get them via SVN + - create a folder called "zlib" inside you PvPGN base folder ( i.e. D:/svn/pvpgn/zlib/ ) + - extract the following files from zlib123.zip into the "zlib" folder: + zconf.h, zlib.h + - extract the following file from zlib123dll.zip (from with dll32 folder) into the "zlib" folder: + zlibwapi.lib + - install MySQL if you intend to use it as a storage backend + - install PostgreSQL if you intend to use it as a storage backend + - SQLite stub - need some extra tweaking to be explained later (in version 2.0 of this guide) + - create a folder called "build" inside you PvPGN base folder ( i.e. D:/svn/pvpgn/build/ ) + - fire up CMake (I'll use the GUI version for this guide - so you should use it, too) + - Where is the source code: D:\svn\pvpgn + - Where to build the binaries: D:\svn\pvpgn\build + - Now press the "Configure" button, select "Visual Studio 2005" as the build environment and wait a few seconds + - all the components should be found without any problems + - now enable optinal components if required ( WITH_MYSQL, WITH_PGSQL, WITH_SQLITE3 ) and "Configure" again + - again all the components should be found without any problems + - Press "OK" + - double-click on D:/svn/pvpgn/build/pvpgn.sln to fire up Visual Studio 2005 + - build the "ALL_BUILD" target + - build the "INSTALL" target + - now you should find all the stuff (almost) ready under c:/Program Files/pvpgn/ + - extract the following files from zlib123dll.zip (from with dll32 folder) into the "sbin" folder: + zlibwapi.lib + - optionally get the following files from C:\Program Files\MySQL\MySQL Server 5.0\lib\opt\ and copy them into the "sbin" folder + libmysql.dll + - optionally get the following files from C:\Program Files\PostgreSQL\8.2\bin\ and copy them into the "sbin" folder + libpq.dll, libintl-2.dll, libiconv-2.dll, krb5_32.dll, comerr32.dll + - optionally extract the following files from sqlitedll-3_4_2.zip into the "sbin" folder: + sqlite3.dll + - drink a beer and congratulate yourself for what you accomplished today + + + diff --git a/pvpgn/docs/INDEX b/docs/INDEX similarity index 100% rename from pvpgn/docs/INDEX rename to docs/INDEX diff --git a/pvpgn/docs/INSTALL.unix b/docs/INSTALL.unix similarity index 100% rename from pvpgn/docs/INSTALL.unix rename to docs/INSTALL.unix diff --git a/pvpgn/docs/Makefile.am b/docs/Makefile.am similarity index 100% rename from pvpgn/docs/Makefile.am rename to docs/Makefile.am diff --git a/pvpgn/docs/PORTS b/docs/PORTS similarity index 100% rename from pvpgn/docs/PORTS rename to docs/PORTS diff --git a/pvpgn/docs/README.fdwatch b/docs/README.fdwatch similarity index 100% rename from pvpgn/docs/README.fdwatch rename to docs/README.fdwatch diff --git a/pvpgn/docs/README.storage b/docs/README.storage similarity index 100% rename from pvpgn/docs/README.storage rename to docs/README.storage diff --git a/pvpgn/docs/bnmotd.txt b/docs/bnmotd.txt similarity index 100% rename from pvpgn/docs/bnmotd.txt rename to docs/bnmotd.txt diff --git a/pvpgn/files/CMakeLists.txt b/files/CMakeLists.txt similarity index 100% rename from pvpgn/files/CMakeLists.txt rename to files/CMakeLists.txt diff --git a/pvpgn/files/IX86ver1.mpq b/files/IX86ver1.mpq similarity index 100% rename from pvpgn/files/IX86ver1.mpq rename to files/IX86ver1.mpq diff --git a/pvpgn/files/Makefile.am b/files/Makefile.am similarity index 100% rename from pvpgn/files/Makefile.am rename to files/Makefile.am diff --git a/pvpgn/files/PMACver1.mpq b/files/PMACver1.mpq similarity index 100% rename from pvpgn/files/PMACver1.mpq rename to files/PMACver1.mpq diff --git a/pvpgn/files/XMACver1.mpq b/files/XMACver1.mpq similarity index 100% rename from pvpgn/files/XMACver1.mpq rename to files/XMACver1.mpq diff --git a/pvpgn/files/ad000001.mng b/files/ad000001.mng similarity index 100% rename from pvpgn/files/ad000001.mng rename to files/ad000001.mng diff --git a/pvpgn/files/ad000001.smk b/files/ad000001.smk similarity index 100% rename from pvpgn/files/ad000001.smk rename to files/ad000001.smk diff --git a/pvpgn/files/ad000002.mng b/files/ad000002.mng similarity index 100% rename from pvpgn/files/ad000002.mng rename to files/ad000002.mng diff --git a/pvpgn/files/ad000003.mng b/files/ad000003.mng similarity index 100% rename from pvpgn/files/ad000003.mng rename to files/ad000003.mng diff --git a/pvpgn/files/ad000004.mng b/files/ad000004.mng similarity index 100% rename from pvpgn/files/ad000004.mng rename to files/ad000004.mng diff --git a/pvpgn/files/ad000075.mng b/files/ad000075.mng similarity index 100% rename from pvpgn/files/ad000075.mng rename to files/ad000075.mng diff --git a/pvpgn/files/bnserver-D2DV.ini b/files/bnserver-D2DV.ini similarity index 100% rename from pvpgn/files/bnserver-D2DV.ini rename to files/bnserver-D2DV.ini diff --git a/pvpgn/files/bnserver-D2XP.ini b/files/bnserver-D2XP.ini similarity index 100% rename from pvpgn/files/bnserver-D2XP.ini rename to files/bnserver-D2XP.ini diff --git a/pvpgn/files/bnserver-WAR3.ini b/files/bnserver-WAR3.ini similarity index 100% rename from pvpgn/files/bnserver-WAR3.ini rename to files/bnserver-WAR3.ini diff --git a/pvpgn/files/bnserver.ini b/files/bnserver.ini similarity index 100% rename from pvpgn/files/bnserver.ini rename to files/bnserver.ini diff --git a/pvpgn/files/chathelp-war3-default.txt b/files/chathelp-war3-default.txt similarity index 100% rename from pvpgn/files/chathelp-war3-default.txt rename to files/chathelp-war3-default.txt diff --git a/pvpgn/files/chathelp-war3-enUS.txt b/files/chathelp-war3-enUS.txt similarity index 100% rename from pvpgn/files/chathelp-war3-enUS.txt rename to files/chathelp-war3-enUS.txt diff --git a/pvpgn/files/chathelp-war3-frFR.txt b/files/chathelp-war3-frFR.txt similarity index 100% rename from pvpgn/files/chathelp-war3-frFR.txt rename to files/chathelp-war3-frFR.txt diff --git a/pvpgn/files/chathelp-war3-ruRU.txt b/files/chathelp-war3-ruRU.txt similarity index 100% rename from pvpgn/files/chathelp-war3-ruRU.txt rename to files/chathelp-war3-ruRU.txt diff --git a/pvpgn/files/chathelp-war3-zhCN.txt b/files/chathelp-war3-zhCN.txt similarity index 96% rename from pvpgn/files/chathelp-war3-zhCN.txt rename to files/chathelp-war3-zhCN.txt index 43c4fe4..197ddc0 100644 --- a/pvpgn/files/chathelp-war3-zhCN.txt +++ b/files/chathelp-war3-zhCN.txt @@ -1,15 +1,15 @@ -PvPGN模拟战网èŠå¤©å‘½ä»¤å¸®åŠ© - -新命令: - -使用 /f help 显示朋å‹å‘½ä»¤å¸®åŠ© -使用 /users 显示在线玩家数 -使用 /w 或者 /msg <玩家å称> å‘é€æ¶ˆæ¯ç»™çŽ©å®¶ -使用 /join <频é“> åŠ å…¥æŒ‡å®šçš„é¢‘é“ - -频é“管ç†å‘˜ï¼š - -使用 /ban <玩家å称> 把玩家从该频é“中踢出,并ç¦æ­¢çŽ©å®¶å†æ¬¡è¿›å…¥æ­¤é¢‘é“ -使用 /kick <玩家å称> 把玩家从该频é“中踢出 - -更多的帮助:输入/help +PvPGN模拟战网èŠå¤©å‘½ä»¤å¸®åŠ© + +新命令: + +使用 /f help 显示朋å‹å‘½ä»¤å¸®åŠ© +使用 /users 显示在线玩家数 +使用 /w 或者 /msg <玩家å称> å‘é€æ¶ˆæ¯ç»™çŽ©å®¶ +使用 /join <频é“> åŠ å…¥æŒ‡å®šçš„é¢‘é“ + +频é“管ç†å‘˜ï¼š + +使用 /ban <玩家å称> 把玩家从该频é“中踢出,并ç¦æ­¢çŽ©å®¶å†æ¬¡è¿›å…¥æ­¤é¢‘é“ +使用 /kick <玩家å称> 把玩家从该频é“中踢出 + +更多的帮助:输入/help diff --git a/pvpgn/files/icons-WAR3.bni b/files/icons-WAR3.bni similarity index 100% rename from pvpgn/files/icons-WAR3.bni rename to files/icons-WAR3.bni diff --git a/pvpgn/files/icons.bni b/files/icons.bni similarity index 100% rename from pvpgn/files/icons.bni rename to files/icons.bni diff --git a/pvpgn/files/icons_STAR.bni b/files/icons_STAR.bni similarity index 100% rename from pvpgn/files/icons_STAR.bni rename to files/icons_STAR.bni diff --git a/pvpgn/files/newaccount-default.txt b/files/newaccount-default.txt similarity index 100% rename from pvpgn/files/newaccount-default.txt rename to files/newaccount-default.txt diff --git a/pvpgn/files/newaccount-enUS.txt b/files/newaccount-enUS.txt similarity index 100% rename from pvpgn/files/newaccount-enUS.txt rename to files/newaccount-enUS.txt diff --git a/d2pack109/files/newbie.save b/files/newbie.save similarity index 100% rename from d2pack109/files/newbie.save rename to files/newbie.save diff --git a/pvpgn/files/termsofservice-default.txt b/files/termsofservice-default.txt similarity index 100% rename from pvpgn/files/termsofservice-default.txt rename to files/termsofservice-default.txt diff --git a/pvpgn/files/termsofservice-enUS.txt b/files/termsofservice-enUS.txt similarity index 100% rename from pvpgn/files/termsofservice-enUS.txt rename to files/termsofservice-enUS.txt diff --git a/pvpgn/files/tos-unicode_default.txt b/files/tos-unicode_default.txt similarity index 98% rename from pvpgn/files/tos-unicode_default.txt rename to files/tos-unicode_default.txt index 011a1b6..d457818 100644 --- a/pvpgn/files/tos-unicode_default.txt +++ b/files/tos-unicode_default.txt @@ -1,21 +1,21 @@ -You are currently connected to a PvPGN Server (Player -vs- Player Gaming Network) - -PvPGN TERMS OF USE: - -PvPGN is a Battle.net(R) emulation server and in no way affiliated with bnetd, warforge, or Blizzard Entertainment(R). -PvPGN is provided "as is" without warrenties of any kind. -We do not support the idea of Pirated software and urge you to purchase a legit copy of any games that you play on our servers. - -1. Information found on PvPGN. -PvPGN does not endorse or stand behind the accuracy, truthfulness or reliability of any information (including statements of opinion or advice) provided on or by means of PvPGN. Any and all statements made in forums, chat or during game play reflect only the views of their author. - -2. Disclaimer of Warrenty. -PvPGN is provided to you "as is" without warrenty of any kind. PvPGN does not warrent that their programm will be uninterrupted or error free. - -3. Limitations of Liability -PvPGN is in no way liable for loss or damage of any kind resulting from the use of PvPGN, including but not limited to, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other damages or losses, commercial or otherwise. - -Battle.net(R) and Blizzard Entertainment(R) are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries. - -Besides all this... Happy gaming.. -PvPGN Project Page: http://pvpgn.berlios.de/ +You are currently connected to a PvPGN Server (Player -vs- Player Gaming Network) + +PvPGN TERMS OF USE: + +PvPGN is a Battle.net(R) emulation server and in no way affiliated with bnetd, warforge, or Blizzard Entertainment(R). +PvPGN is provided "as is" without warrenties of any kind. +We do not support the idea of Pirated software and urge you to purchase a legit copy of any games that you play on our servers. + +1. Information found on PvPGN. +PvPGN does not endorse or stand behind the accuracy, truthfulness or reliability of any information (including statements of opinion or advice) provided on or by means of PvPGN. Any and all statements made in forums, chat or during game play reflect only the views of their author. + +2. Disclaimer of Warrenty. +PvPGN is provided to you "as is" without warrenty of any kind. PvPGN does not warrent that their programm will be uninterrupted or error free. + +3. Limitations of Liability +PvPGN is in no way liable for loss or damage of any kind resulting from the use of PvPGN, including but not limited to, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other damages or losses, commercial or otherwise. + +Battle.net(R) and Blizzard Entertainment(R) are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries. + +Besides all this... Happy gaming.. +PvPGN Project Page: http://pvpgn.berlios.de/ diff --git a/pvpgn/files/tos.txt b/files/tos.txt similarity index 98% rename from pvpgn/files/tos.txt rename to files/tos.txt index 011a1b6..d457818 100644 --- a/pvpgn/files/tos.txt +++ b/files/tos.txt @@ -1,21 +1,21 @@ -You are currently connected to a PvPGN Server (Player -vs- Player Gaming Network) - -PvPGN TERMS OF USE: - -PvPGN is a Battle.net(R) emulation server and in no way affiliated with bnetd, warforge, or Blizzard Entertainment(R). -PvPGN is provided "as is" without warrenties of any kind. -We do not support the idea of Pirated software and urge you to purchase a legit copy of any games that you play on our servers. - -1. Information found on PvPGN. -PvPGN does not endorse or stand behind the accuracy, truthfulness or reliability of any information (including statements of opinion or advice) provided on or by means of PvPGN. Any and all statements made in forums, chat or during game play reflect only the views of their author. - -2. Disclaimer of Warrenty. -PvPGN is provided to you "as is" without warrenty of any kind. PvPGN does not warrent that their programm will be uninterrupted or error free. - -3. Limitations of Liability -PvPGN is in no way liable for loss or damage of any kind resulting from the use of PvPGN, including but not limited to, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other damages or losses, commercial or otherwise. - -Battle.net(R) and Blizzard Entertainment(R) are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries. - -Besides all this... Happy gaming.. -PvPGN Project Page: http://pvpgn.berlios.de/ +You are currently connected to a PvPGN Server (Player -vs- Player Gaming Network) + +PvPGN TERMS OF USE: + +PvPGN is a Battle.net(R) emulation server and in no way affiliated with bnetd, warforge, or Blizzard Entertainment(R). +PvPGN is provided "as is" without warrenties of any kind. +We do not support the idea of Pirated software and urge you to purchase a legit copy of any games that you play on our servers. + +1. Information found on PvPGN. +PvPGN does not endorse or stand behind the accuracy, truthfulness or reliability of any information (including statements of opinion or advice) provided on or by means of PvPGN. Any and all statements made in forums, chat or during game play reflect only the views of their author. + +2. Disclaimer of Warrenty. +PvPGN is provided to you "as is" without warrenty of any kind. PvPGN does not warrent that their programm will be uninterrupted or error free. + +3. Limitations of Liability +PvPGN is in no way liable for loss or damage of any kind resulting from the use of PvPGN, including but not limited to, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other damages or losses, commercial or otherwise. + +Battle.net(R) and Blizzard Entertainment(R) are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries. + +Besides all this... Happy gaming.. +PvPGN Project Page: http://pvpgn.berlios.de/ diff --git a/pvpgn/files/tos_default.txt b/files/tos_default.txt similarity index 98% rename from pvpgn/files/tos_default.txt rename to files/tos_default.txt index 011a1b6..d457818 100644 --- a/pvpgn/files/tos_default.txt +++ b/files/tos_default.txt @@ -1,21 +1,21 @@ -You are currently connected to a PvPGN Server (Player -vs- Player Gaming Network) - -PvPGN TERMS OF USE: - -PvPGN is a Battle.net(R) emulation server and in no way affiliated with bnetd, warforge, or Blizzard Entertainment(R). -PvPGN is provided "as is" without warrenties of any kind. -We do not support the idea of Pirated software and urge you to purchase a legit copy of any games that you play on our servers. - -1. Information found on PvPGN. -PvPGN does not endorse or stand behind the accuracy, truthfulness or reliability of any information (including statements of opinion or advice) provided on or by means of PvPGN. Any and all statements made in forums, chat or during game play reflect only the views of their author. - -2. Disclaimer of Warrenty. -PvPGN is provided to you "as is" without warrenty of any kind. PvPGN does not warrent that their programm will be uninterrupted or error free. - -3. Limitations of Liability -PvPGN is in no way liable for loss or damage of any kind resulting from the use of PvPGN, including but not limited to, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other damages or losses, commercial or otherwise. - -Battle.net(R) and Blizzard Entertainment(R) are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries. - -Besides all this... Happy gaming.. -PvPGN Project Page: http://pvpgn.berlios.de/ +You are currently connected to a PvPGN Server (Player -vs- Player Gaming Network) + +PvPGN TERMS OF USE: + +PvPGN is a Battle.net(R) emulation server and in no way affiliated with bnetd, warforge, or Blizzard Entertainment(R). +PvPGN is provided "as is" without warrenties of any kind. +We do not support the idea of Pirated software and urge you to purchase a legit copy of any games that you play on our servers. + +1. Information found on PvPGN. +PvPGN does not endorse or stand behind the accuracy, truthfulness or reliability of any information (including statements of opinion or advice) provided on or by means of PvPGN. Any and all statements made in forums, chat or during game play reflect only the views of their author. + +2. Disclaimer of Warrenty. +PvPGN is provided to you "as is" without warrenty of any kind. PvPGN does not warrent that their programm will be uninterrupted or error free. + +3. Limitations of Liability +PvPGN is in no way liable for loss or damage of any kind resulting from the use of PvPGN, including but not limited to, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other damages or losses, commercial or otherwise. + +Battle.net(R) and Blizzard Entertainment(R) are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries. + +Besides all this... Happy gaming.. +PvPGN Project Page: http://pvpgn.berlios.de/ diff --git a/pvpgn/files/ver-ix86-1.mpq b/files/ver-ix86-1.mpq similarity index 100% rename from pvpgn/files/ver-ix86-1.mpq rename to files/ver-ix86-1.mpq diff --git a/pvpgn/man/CMakeLists.txt b/man/CMakeLists.txt similarity index 100% rename from pvpgn/man/CMakeLists.txt rename to man/CMakeLists.txt diff --git a/pvpgn/man/Makefile.am b/man/Makefile.am similarity index 100% rename from pvpgn/man/Makefile.am rename to man/Makefile.am diff --git a/pvpgn/man/bnbot.1 b/man/bnbot.1 similarity index 100% rename from pvpgn/man/bnbot.1 rename to man/bnbot.1 diff --git a/pvpgn/man/bnchat.1 b/man/bnchat.1 similarity index 100% rename from pvpgn/man/bnchat.1 rename to man/bnchat.1 diff --git a/pvpgn/man/bnetd.1 b/man/bnetd.1 similarity index 100% rename from pvpgn/man/bnetd.1 rename to man/bnetd.1 diff --git a/pvpgn/man/bnetd.conf.5 b/man/bnetd.conf.5 similarity index 100% rename from pvpgn/man/bnetd.conf.5 rename to man/bnetd.conf.5 diff --git a/pvpgn/man/bnftp.1 b/man/bnftp.1 similarity index 100% rename from pvpgn/man/bnftp.1 rename to man/bnftp.1 diff --git a/pvpgn/man/bni2tga.1 b/man/bni2tga.1 similarity index 100% rename from pvpgn/man/bni2tga.1 rename to man/bni2tga.1 diff --git a/pvpgn/man/bnibuild.1 b/man/bnibuild.1 similarity index 100% rename from pvpgn/man/bnibuild.1 rename to man/bnibuild.1 diff --git a/pvpgn/man/bniextract.1 b/man/bniextract.1 similarity index 100% rename from pvpgn/man/bniextract.1 rename to man/bniextract.1 diff --git a/pvpgn/man/bnilist.1 b/man/bnilist.1 similarity index 100% rename from pvpgn/man/bnilist.1 rename to man/bnilist.1 diff --git a/pvpgn/man/bnpass.1 b/man/bnpass.1 similarity index 100% rename from pvpgn/man/bnpass.1 rename to man/bnpass.1 diff --git a/pvpgn/man/bnpcap.1 b/man/bnpcap.1 similarity index 100% rename from pvpgn/man/bnpcap.1 rename to man/bnpcap.1 diff --git a/pvpgn/man/bnproxy.1 b/man/bnproxy.1 similarity index 100% rename from pvpgn/man/bnproxy.1 rename to man/bnproxy.1 diff --git a/pvpgn/man/bnstat.1 b/man/bnstat.1 similarity index 100% rename from pvpgn/man/bnstat.1 rename to man/bnstat.1 diff --git a/pvpgn/man/bntext.5 b/man/bntext.5 similarity index 100% rename from pvpgn/man/bntext.5 rename to man/bntext.5 diff --git a/pvpgn/man/bntrackd.1 b/man/bntrackd.1 similarity index 100% rename from pvpgn/man/bntrackd.1 rename to man/bntrackd.1 diff --git a/pvpgn/man/tgainfo.1 b/man/tgainfo.1 similarity index 100% rename from pvpgn/man/tgainfo.1 rename to man/tgainfo.1 diff --git a/pvpgn/COPYING b/pvpgn/COPYING deleted file mode 100644 index d60c31a..0000000 --- a/pvpgn/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/pvpgn/README b/pvpgn/README deleted file mode 100644 index 0c1a0d8..0000000 --- a/pvpgn/README +++ /dev/null @@ -1,12 +0,0 @@ - -CONGRATULATIONS!!!! - -WHY ?? BECAUSE YOU ARE ONE OF THE VERY VERY VERY FEW WHO READ THE README FILE!! - -But because the other, huge percentage do NOT, we moved the actual contents -of this file into IGNOREME file because the chances for most of the people to -read IGNOREME are at least the chances to read README (more than that, we -believe they are really much higher). - -So now, go read IGNOREME with the actual contents what you would have -expected here. diff --git a/pvpgn/files/newbie.save b/pvpgn/files/newbie.save deleted file mode 100644 index e839a52f01c06a036a7922de7eca4214d24f4a3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 hcmWGt6}l>t0Xwi~6kuoqN-;7pg1~>=0K0zTL;*%t9u)up diff --git a/pvpgn/src/autoconf/install-sh b/pvpgn/src/autoconf/install-sh deleted file mode 100644 index ebc6691..0000000 --- a/pvpgn/src/autoconf/install-sh +++ /dev/null @@ -1,250 +0,0 @@ -#! /bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/pvpgn/src/autoconf/mkdir-p b/pvpgn/src/autoconf/mkdir-p deleted file mode 100644 index dc973c3..0000000 --- a/pvpgn/src/autoconf/mkdir-p +++ /dev/null @@ -1,101 +0,0 @@ -#! /bin/sh -# $XConsortium: mkdirhier.sh,v 1.7 94/03/24 15:46:34 gildea Exp $ -# Courtesy of Paul Eggert - -# -# Modified by QingLong for portability. 24-02-97. -# - - -newline=' -' -IFS=$newline - -# -# WARNING! Some ancient shells do not understand `:=' and `:-' expansion. -# Use just `=' instead of `:=' if you have lame one. -#: ${MKDIR:=mkdir} ${TR:=tr} -# - -if test -z "${MKDIR-}" ; - then - MKDIR=mkdir -fi - -if test -z "${TR-}" ; - then - TR=tr -fi - - -case ${1--} in - -*) echo >&2 "mkdir-p: usage: mkdir-p directory ..." - exit 1 -esac - -status="" - -for directory - do - case $directory in - '') - echo >&2 "mkdir-p: empty directory name" - status="1" - continue - ;; - *"$newline"*) - echo >&2 "mkdir-p: directory name contains a newline: \`\`$directory''" - status="1" - continue - ;; - ///*) prefix="/" # See POSIX 2.3 "path". - ;; - //*) prefix="//" - ;; - /*) prefix="/" - ;; - -*) prefix="./" - ;; - *) prefix="" - esac - # - IFS=/ - set x $directory - # - case $2 in - */*) - # IFS parsing is broken - IFS=' ' - set x `echo $directory | ${TR} / ' '` - ;; - esac - # - IFS=$newline - shift - # - for filename - do - path="$prefix$filename" - prefix="$path/" - shift - # - test -d "$path" || \ - { - paths=$path - for filename - do - if test "$filename" != "." ; - then - path="$path/$filename" - paths="$paths$newline$path" - fi - done - # - ${MKDIR} $paths || status=$? - # - break - } - done -done - -exit $status diff --git a/pvpgn/src/autoconf/mkdir.m4 b/pvpgn/src/autoconf/mkdir.m4 deleted file mode 100644 index c3d8ca3..0000000 --- a/pvpgn/src/autoconf/mkdir.m4 +++ /dev/null @@ -1,35 +0,0 @@ -dnl AC_FUNC_MKDIR -dnl Check mkdir arguments. -dnl Defines MKDIR_TAKES_ONE_ARG. -dnl -dnl Based on code written by Alexandre Duret-Lutz . - -AC_DEFUN([AC_FUNC_MKDIR_ARGS], -[AC_CHECK_FUNCS([mkdir _mkdir]) -AC_CACHE_CHECK([whether mkdir takes one argument], - [ac_cv_mkdir_takes_one_arg], -[AC_TRY_COMPILE([ -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_DIR_H -# include -#endif -#ifdef HAVE_DIRECT_H -# include -#endif -#ifndef HAVE_MKDIR -# ifdef HAVE__MKDIR -# define mkdir _mkdir -# endif -#endif -],[mkdir(".");], -[ac_cv_mkdir_takes_one_arg=yes],[ac_cv_mkdir_takes_one_arg=no])]) -if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then - AC_DEFINE([MKDIR_TAKES_ONE_ARG],1, - [Define if mkdir takes only one argument.]) -fi -]) diff --git a/pvpgn/src/common/introtate.h b/pvpgn/src/common/introtate.h deleted file mode 100644 index 1e01a96..0000000 --- a/pvpgn/src/common/introtate.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - - -/*****/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_INTROTATE_PROTOS -#define INCLUDED_INTROTATE_PROTOS - -/* - * ROTL(x,n,w) rotates "w" bit wide value "x" by "n" bits to the left - * - * The expression passed in as x must have a type at least as wide as w. - * The type should probably be unsigned for this to be guaranteed to work - * properly. If n or w is signed and larger than x remember that the - * promotion rules would promote x to be of the same (signed) type. - * - * Unfortunately C doesn't have rotate operations and they can be difficult - * to implement when handling rotates by zero, negative numbers, or numbers - * greater or equal to the bit width of the number. This is because ANSI/ISO - * C makes weak guarantees about the left and right shift operators. We - * would like to not depend on word size, endianness, or how negative - * integers are represented. Unfortunately only some of those goals may be - * achieved. As for optimization, a really good compiler might be able to - * recognize what we are doing and turn it into a single machine instruction. - */ - -/* valid for 00 */ -/*#define ROTL(x,n,w) (((x)<<(n)) | ((x)>>((w)-(n))))*/ - -/* valid for 0<=n0 */ -/*#define ROTL(x,n,w) (((x)<<(n)) | ((x)>>(((-(n))&(w-1)))))*/ - -/* valid for 0<=n and w>0 , depends on 2's complement */ -#define ROTL(x,n,w) (((x)<<((n)&(w-1))) | ((x)>>(((-(n))&(w-1))))) - -/* valid for 0<=n and w>0 , uses three mods and an ugly conditional */ -/* FIXME: and also a bug because it doesn't work on PPC */ -/*#define ROTL(x,n,w) (((n)%(w)) ? (((x)<<((n)%(w))) | ((x)>>((w)-((n)%(w))))) : (x))*/ - -#define ROTL32(x,n) ROTL(x,n,32) -#define ROTL16(x,n) ROTL(x,n,16) - -#endif -#endif diff --git a/pvpgn/src/common/setup_after.h b/pvpgn/src/common/setup_after.h deleted file mode 100644 index e8f6147..0000000 --- a/pvpgn/src/common/setup_after.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_SETUP_BEFORE_H -# error "This file must be included after all other header files" -#endif -#ifndef INCLUDED_SETUP_AFTER_H -#define INCLUDED_SETUP_AFTER_H - -#endif diff --git a/pvpgn/src/compat/netinet_in.h b/pvpgn/src/compat/netinet_in.h deleted file mode 100644 index 7388384..0000000 --- a/pvpgn/src/compat/netinet_in.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_NETINET_IN_PROTOS -#define INCLUDED_NETINET_IN_PROTOS - -#ifndef INADDR_LOOPBACK -#define INADDR_LOOPBACK 0x7f000001 -#endif - -#ifndef INADDR_ANY -#define INADDR_ANY 0x00000000 -#endif - -#endif diff --git a/pvpgn/src/compat/read.h b/pvpgn/src/compat/read.h deleted file mode 100644 index 6be118a..0000000 --- a/pvpgn/src/compat/read.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_READ_PROTOS -#define INCLUDED_READ_PROTOS - -/* Unix puts this in unistd.h */ -#ifdef WIN32 -# include -#endif - -#endif diff --git a/pvpgn/src/compat/statmacros.h b/pvpgn/src/compat/statmacros.h deleted file mode 100644 index 6bb5f67..0000000 --- a/pvpgn/src/compat/statmacros.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#ifndef INCLUDED_STATMACROS_PROTOS -#define INCLUDED_STATMACROS_PROTOS - -#ifdef STAT_MACROS_BROKEN -# ifdef S_ISREG -# undef S_ISREG -# endif -# ifdef S_ISDIR -# undef S_ISDIR -# endif -# ifdef S_ISCHR -# undef S_ISCHR -# endif -# ifdef S_ISBLK -# undef S_ISBLK -# endif -# ifdef S_ISFIFO -# undef S_ISFIFO -# endif -# ifdef S_ISSOCK -# undef S_ISSOCK -# endif -# ifdef S_ISLNK -# undef S_ISLNK -# endif -#endif - -#ifndef S_IFMT -# define S_IFMT 0170000 -#endif - -#ifndef S_ISREG -# ifdef S_IFREG -# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -# endif -#endif -#ifndef S_ISDIR -# ifdef S_IFDIR -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -# endif -#endif -#ifndef S_ISCHR -# ifdef S_IFCHR -# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -# endif -#endif -#ifndef S_ISBLK -# ifdef S_IFBLK -# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -# endif -#endif -#ifndef S_ISFIFO -# ifdef S_IFIFO -# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) -# endif -#endif -#ifndef S_ISLNK -# ifdef S_IFLNK -# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -# endif -#endif -#ifndef S_ISSOCK -# ifdef S_IFSOCK -# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) -# endif -#endif -#ifndef S_ISCDF -# ifdef S_CDF -# define S_ISCDF(m) (S_ISDIR(m) && ((m) & S_CDF)) -# endif -#endif -#ifndef S_ISMPB -# ifdef S_IFMPB /* V7 */ -# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) -# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) -# endif -#endif -#ifndef S_ISNWK -# ifdef S_IFNWK /* HP/UX */ -# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) -# endif -#endif - -#ifndef S_ISUID -# define S_ISUID 01000 /* set user ID */ -#endif -#ifndef S_ISGID -# define S_ISGID 01000 /* set group ID */ -#endif -#ifndef S_ISVTX -# define S_ISVTX 01000 /* sticky bit */ -#endif - -#ifndef S_IRUSR -# ifdef S_IREAD -# define S_IRUSR S_IREAD -# else -# define S_IRUSR 00400 -# endif -#endif -#ifndef S_IWUSR -# ifdef S_IWRITE -# define S_IWUSR S_IWRITE -# else -# define S_IWUSR 00200 -# endif -#endif -#ifndef S_IXUSR -# ifdef S_IEXEC -# define S_IXUSR S_IEXEC -# else -# define S_IXUSR 00100 -# endif -#endif -#ifndef S_IRWXU -# define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) -#endif -#ifndef S_IRGRP -# define S_IRGRP (S_IRUSR >> 3) -#endif -#ifndef S_IWGRP -# define S_IWGRP (S_IWUSR >> 3) -#endif -#ifndef S_IXGRP -# define S_IXGRP (S_IXUSR >> 3) -#endif -#ifndef S_IRWXG -# define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) -#endif - -#ifndef S_IROTH -# define S_IROTH (S_IRGRP >> 3) -#endif -#ifndef S_IWOTH -# define S_IWOTH (S_IWGRP >> 3) -#endif -#ifndef S_IXOTH -# define S_IXOTH (S_IXGRP >> 3) -#endif -#ifndef S_IRWXO -# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) -#endif - -#endif diff --git a/pvpgn/src/win32/console_resource.h b/pvpgn/src/win32/console_resource.h deleted file mode 100644 index 765ffcb..0000000 --- a/pvpgn/src/win32/console_resource.h +++ /dev/null @@ -1,2 +0,0 @@ -#define IDI_ICON1 101 - diff --git a/pvpgn/src/win32/console_resource.rc b/pvpgn/src/win32/console_resource.rc deleted file mode 100644 index 7e362ea..0000000 --- a/pvpgn/src/win32/console_resource.rc +++ /dev/null @@ -1,10 +0,0 @@ -#include "console_resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -#ifndef __BORLANDC__ -#include "afxres.h" -#endif - -/* Icon */ -ID_ICON1 ICON DISCARDABLE "win32/logo01.ico" - diff --git a/pvpgn/src/win32/d2cs_resource.h b/pvpgn/src/win32/d2cs_resource.h deleted file mode 100644 index 7d07f53..0000000 --- a/pvpgn/src/win32/d2cs_resource.h +++ /dev/null @@ -1,17 +0,0 @@ -#define ID_TRAY 4 -#define ID_RESTORE 5 -#define ID_EXIT 6 - -#define ID_ABOUT_BOX 101 -#define ID_ICON1 102 -#define ID_MENU 103 - -#define ID_START_D2CS 40001 -#define ID_SHUTDOWN_D2CS 40002 -#define ID_RESTART_D2CS 40003 -#define ID_EDITCONFIG_D2CS 40004 -#define ID_LOADCONFIG_D2CS 40005 -#define ID_LADDER_LOAD 40006 -#define ID_RESTART_D2GS 40007 -#define ID_CLEAR 40008 -#define ID_ABOUT 40009 diff --git a/pvpgn/src/win32/d2cs_resource.rc b/pvpgn/src/win32/d2cs_resource.rc deleted file mode 100644 index d65326f..0000000 --- a/pvpgn/src/win32/d2cs_resource.rc +++ /dev/null @@ -1,44 +0,0 @@ -#include "d2cs_resource.h" -#include "d2cs/version.h" - -#define APSTUDIO_READONLY_SYMBOLS -#ifndef __BORLANDC__ -#include "afxres.h" -#endif - -/* Menu */ -ID_MENU MENU DISCARDABLE -BEGIN - MENUITEM "&Exit", ID_EXIT - MENUITEM "&Start", ID_START_D2CS - MENUITEM "Shut&down", ID_SHUTDOWN_D2CS - MENUITEM "&Restart", ID_RESTART_D2CS - MENUITEM "&Edit Configuration", ID_EDITCONFIG_D2CS - MENUITEM "Reload &Configuration", ID_LOADCONFIG_D2CS - MENUITEM "Reload &Ladder", ID_LADDER_LOAD - MENUITEM "Restart d2gs", ID_RESTART_D2GS - MENUITEM "&Clear Window", ID_CLEAR - MENUITEM "&About", ID_ABOUT -END - -/* About Dialog Box */ -ID_ABOUT_BOX DIALOGEX 120, 150, 240, 150 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About This Server" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "",IDC_STATIC,5,5,230,140 - CTEXT "D2CS Version",IDC_STATIC,15,15,210,15 - CTEXT D2CS_VERSION_STRING,IDC_STATIC,15,25,210,15 - CTEXT "coded by the PvPGN Team",IDC_STATIC,15,40,210,15 - CTEXT "- - - - - - - - - - - - - - -",IDC_STATIC,15,55,210,15 - CTEXT "visit us @ www.pvpgn.org or",IDC_STATIC,15,70,210,15 - CTEXT "irc.pvpgn.org #pvpgn",IDC_STATIC,15,80,210,15 - CTEXT "©2002 ©2003 ©2004 PvPGN Is a Open Source Project",IDC_STATIC,15,100,210,15 - CTEXT "As specified by the GPL",IDC_STATIC,15,110,210,15 - DEFPUSHBUTTON "&OK",IDOK,95,125,50,14 -END - -/* Icon */ -ID_ICON1 ICON DISCARDABLE "win32/logo01.ico" - diff --git a/pvpgn/src/win32/d2dbs_resource.h b/pvpgn/src/win32/d2dbs_resource.h deleted file mode 100644 index 113d277..0000000 --- a/pvpgn/src/win32/d2dbs_resource.h +++ /dev/null @@ -1,16 +0,0 @@ -#define ID_TRAY 4 -#define ID_RESTORE 5 -#define ID_EXIT 6 - -#define ID_ABOUT_BOX 101 -#define ID_ICON1 102 -#define ID_MENU 103 - -#define ID_START_D2DBS 40001 -#define ID_SHUTDOWN_D2DBS 40002 -#define ID_RESTART_D2DBS 40003 -#define ID_EDITCONFIG_D2DBS 40004 -#define ID_LOADCONFIG_D2DBS 40005 -#define ID_LADDER_SAVE 40006 -#define ID_CLEAR 40007 -#define ID_ABOUT 40008 diff --git a/pvpgn/src/win32/d2dbs_resource.rc b/pvpgn/src/win32/d2dbs_resource.rc deleted file mode 100644 index 1b3b8b5..0000000 --- a/pvpgn/src/win32/d2dbs_resource.rc +++ /dev/null @@ -1,43 +0,0 @@ -#include "d2dbs_resource.h" -#include "d2dbs/version.h" - -#define APSTUDIO_READONLY_SYMBOLS -#ifndef __BORLANDC__ -#include "afxres.h" -#endif - -/* Menu */ -ID_MENU MENU DISCARDABLE -BEGIN - MENUITEM "&Exit", ID_EXIT - MENUITEM "&Start", ID_START_D2DBS - MENUITEM "Shut&down", ID_SHUTDOWN_D2DBS - MENUITEM "&Restart", ID_RESTART_D2DBS - MENUITEM "&Edit Configuration", ID_EDITCONFIG_D2DBS - MENUITEM "Reload &Configuration", ID_LOADCONFIG_D2DBS - MENUITEM "Save &Ladder", ID_LADDER_SAVE - MENUITEM "&Clear Window", ID_CLEAR - MENUITEM "&About", ID_ABOUT -END - -/* About Dialog Box */ -ID_ABOUT_BOX DIALOGEX 120, 150, 240, 150 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "About This Server" -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX "",IDC_STATIC,5,5,230,140 - CTEXT "D2DBS Version",IDC_STATIC,15,15,210,15 - CTEXT D2DBS_VERSION_NUMBER,IDC_STATIC,15,25,210,15 - CTEXT "coded by the PvPGN Team",IDC_STATIC,15,40,210,15 - CTEXT "- - - - - - - - - - - - - - -",IDC_STATIC,15,55,210,15 - CTEXT "visit us @ www.pvpgn.org or",IDC_STATIC,15,70,210,15 - CTEXT "irc.pvpgn.org #pvpgn",IDC_STATIC,15,80,210,15 - CTEXT "©2002 ©2003 ©2004 PvPGN Is a Open Source Project",IDC_STATIC,15,100,210,15 - CTEXT "As specified by the GPL",IDC_STATIC,15,110,210,15 - DEFPUSHBUTTON "&OK",IDOK,95,125,50,14 -END - -/* Icon */ -ID_ICON1 ICON DISCARDABLE "win32/logo01.ico" - diff --git a/pvpgn/src/win32/logo01.ico b/pvpgn/src/win32/logo01.ico deleted file mode 100644 index 9bb64a93d63c2987c1ebbb66ebb7b62ba36097eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14758 zcmeIZ2T)W?_b=MVV;~I-lXGH*oJDdDl9PZaK{A3M0-{6#0Z~9DtEhmAiX@2=BudUX zBZ!!fVivR9jd(bIzWW_t-KtylUe&*A_wMe!e!b^6t5^5*T6+%we}MG>4hMhy0oZ`Y z1^~7K0BE$;_BA#Du0z)(C4aQJ0oV>@s15bQfomiHzCl?K>H}Zt2j!LftR(e6z8C*- z!pQjoqVW~L@7@DYTA6^R<_j!B@kqK+KJ4pjZ72Y%UxJM<$oQ_eUa; zfSsKk;8nu`!QdK@4ekR50Ve=M*$qfq#{ui3t>9Gs0th(Y2|}_vz}~?nu%oaa#0`7| zA|fJykB<+a75xB8IR+S>90mtZR|6Htc%Z&37-(2~0#R)baJXO^gq&{%+l~|gyTWb| z-*69TXlQ^98#Vx}!ajgii3EJk9pGH+9MB0W0qOPk!KKbcpzo6e{8LK7`HltPQvU>O zDeMHP!=C^T4-df7gaKAP7T^qufq;8G(Aj$qgk0(a7doE+t3x>;{6Z^edh!|U>wO8# zs_uYOV;=ydZop!(02&Pk7>S*Lpm!b+t=a+A@-om1E(7OV9|KW6ZxEDT1Y%n5f?dsv zz`F4%h#md%UGu!WyZ}QWL1W4ZC{|T~Y<3;sjjsb~rz^nFBMN9cgaF0u2SCB}2S7`o z06PcXfyhV8Kte(S5Q#*9LL&f*PZ@9!6#<+q3~-yBpzpy4j1J}lxQIPK$?XLWvAMt? zdj@FdOab5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ezN0y2hzGP^>vx>t_#eUVw6K{?&NMH8;ob7q}O z);(`*2H%?$^&96lyOwr1my8_!JN~n#nY9YU4dR1Rj>f7T#b}>__z;bYMBTasya%M* zOX-%)Oxp@RmXw6Lt;~*Na?W|mo~3~o2QzQZo~xhEsG5$;9}PR#ACTDz@d?iC3d!s` zbfN3;mA=6ILEnm5$D4Qbs~>xGKJy-4QoBB~Bfs6_db?-s{iMl%o9}pKf0RNPRymSs ze4f6okYsXAVAm}%k3qrR13ZdHP-ZO*y+pjAyo9y~#iU--Da~qszQNwg*ek=axqYG8 z9jixpc6)SA@3Ct`#|lOcmrNfhoA#-`=UB6#TlPS|?zvFyJGtC3tNiv|#l0?dPt&LV zBR;lj#%t$|1O=Q*D0C3DkF(4!6HP9&TnEXn<3y(sg4PkDWjog57M>|j)`}r+YZ29S zBb(Q_ove(^Y!AECdI&n_bVOh3NG=}EuAR$iT*$7wd#3U3@y3Ud^$(mX7t{+MidDR& z-CR<*I%ZeUv%Pe{w&r2l?SJAeYc&3&vi5xP@8^|~tK$E8PWc->{7z3zzwiIQ0QQ1% Axc~qF diff --git a/pvpgn/scripts/S98bnetd b/scripts/S98bnetd similarity index 100% rename from pvpgn/scripts/S98bnetd rename to scripts/S98bnetd diff --git a/pvpgn/scripts/announce.sh b/scripts/announce.sh similarity index 100% rename from pvpgn/scripts/announce.sh rename to scripts/announce.sh diff --git a/pvpgn/scripts/bnetd.init b/scripts/bnetd.init similarity index 100% rename from pvpgn/scripts/bnetd.init rename to scripts/bnetd.init diff --git a/pvpgn/scripts/bnetd.logrotate b/scripts/bnetd.logrotate similarity index 100% rename from pvpgn/scripts/bnetd.logrotate rename to scripts/bnetd.logrotate diff --git a/pvpgn/scripts/bnetmasq.sh b/scripts/bnetmasq.sh similarity index 100% rename from pvpgn/scripts/bnetmasq.sh rename to scripts/bnetmasq.sh diff --git a/pvpgn/scripts/convert_w3.pl b/scripts/convert_w3.pl similarity index 100% rename from pvpgn/scripts/convert_w3.pl rename to scripts/convert_w3.pl diff --git a/pvpgn/scripts/cvs2cl.pl b/scripts/cvs2cl.pl similarity index 100% rename from pvpgn/scripts/cvs2cl.pl rename to scripts/cvs2cl.pl diff --git a/pvpgn/scripts/flat2cdb.pl b/scripts/flat2cdb.pl similarity index 100% rename from pvpgn/scripts/flat2cdb.pl rename to scripts/flat2cdb.pl diff --git a/pvpgn/scripts/fsgs2bnetd.pl b/scripts/fsgs2bnetd.pl similarity index 100% rename from pvpgn/scripts/fsgs2bnetd.pl rename to scripts/fsgs2bnetd.pl diff --git a/pvpgn/scripts/ladder.py b/scripts/ladder.py similarity index 100% rename from pvpgn/scripts/ladder.py rename to scripts/ladder.py diff --git a/pvpgn/scripts/lastlogin.pl b/scripts/lastlogin.pl similarity index 100% rename from pvpgn/scripts/lastlogin.pl rename to scripts/lastlogin.pl diff --git a/pvpgn/scripts/login_testusers.sh b/scripts/login_testusers.sh similarity index 100% rename from pvpgn/scripts/login_testusers.sh rename to scripts/login_testusers.sh diff --git a/pvpgn/scripts/make_testusers.sh b/scripts/make_testusers.sh similarity index 100% rename from pvpgn/scripts/make_testusers.sh rename to scripts/make_testusers.sh diff --git a/pvpgn/scripts/process.pl b/scripts/process.pl similarity index 100% rename from pvpgn/scripts/process.pl rename to scripts/process.pl diff --git a/pvpgn/scripts/pvpgn_hash.inc.php b/scripts/pvpgn_hash.inc.php similarity index 96% rename from pvpgn/scripts/pvpgn_hash.inc.php rename to scripts/pvpgn_hash.inc.php index 153a915..f088027 100644 --- a/pvpgn/scripts/pvpgn_hash.inc.php +++ b/scripts/pvpgn_hash.inc.php @@ -1,126 +1,126 @@ -> 6) + 1; - - for($i=0; $i < $nblk * 16; $i++) $blks[$i] = 0; - for($i=0; $i < strlen($str); $i++) { - $blks[$i >> 2] |= ord(substr($str, $i, 1)) << ( ($i % 4) * 8); - } - return $blks; -} -function safe_add($x, $y) { - $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); - $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16); - return ($msw << 16) | ($lsw & 0xFFFF); -} - -function safe_not( $num ) { - $lsw = (~($num & 0xFFFF)) & 0xFFFF; - $msw = (~($num >> 16)) & 0xFFFF; - return ($msw << 16) | $lsw; -} - -function safe_rol( $num, $amt ) { - $leftmask = 0xffff | (0xffff << 16); - $leftmask <<= 32 - $amt; - $rightmask = 0xffff | (0xffff << 16); - $rightmask <<= $amt; - $rightmask = safe_not($rightmask); - - $remains = $num & $leftmask; - $remains >>= 32 - $amt; - $remains &= $rightmask; - - $res = ($num << $amt) | $remains; - - return $res; -} - -function ft($t, $b, $c, $d) { - if($t < 20) return ($b & $c) | ((safe_not($b)) & $d); - if($t < 40) return $d ^ $c ^ $b; - if($t < 60) return ($c & $b) | ($d & $c) | ($d & $b); - return $d ^ $c ^ $b; -} - -function kt($t) { - if ($t < 20) { - return 0x5a82 << 16 | 0x7999; - } else if ($t < 40) { - return 0x6ed9 << 16 | 0xeba1; - } else if ($t < 60) { - return 0x8f1b << 16 | 0xbcdc; - } else { - return 0xca62 << 16 | 0xc1d6; - } -} -function pvpgn_hash($str) { - $x = str2blks_pvpgn($str); - - $a = 0x6745 << 16 | 0x2301; - $b = 0xefcd << 16 | 0xab89; - $c = 0x98ba << 16 | 0xdcfe; - $d = 0x1032 << 16 | 0x5476; - $e = 0xc3d2 << 16 | 0xe1f0; - - for($i = 0; $i < sizeof($x); $i += 16) { - $olda = $a; - $oldb = $b; - $oldc = $c; - $oldd = $d; - $olde = $e; - - for($j = 0; $j < 16; $j++) { - $w[$j] = $x[$i+$j]; - } - - for($j = 0; $j < 64; $j++) { - $ww = $w[$j] ^ $w[$j+8] ^ $w[$j+2] ^ $w[$j+13]; - $w[$j+16] = 1 << ($ww%32); - } - - for($j = 0; $j < 80; $j++) { - if ($j<20) - { - $t = safe_add(safe_add(safe_rol($a, 5), ft($j, $b, $c, $d)), safe_add(safe_add($e, $w[$j]), kt($j))); - } - else - { - $t = safe_add(safe_add(safe_rol($t, 5), ft($j, $b, $c, $d)), safe_add(safe_add($e, $w[$j]), kt($j))); - } - $e = $d; - $d = $c; - $c = safe_rol($b, 30); - $b = $a; - $a = $t; - } - $a = safe_add($t, $olda); - $b = safe_add($b, $oldb); - $c = safe_add($c, $oldc); - $d = safe_add($d, $oldd); - $e = safe_add($e, $olde); - } - return sprintf("%08x%08x%08x%08x%08x",$a,$b,$c,$d,$e); -} - +> 6) + 1; + + for($i=0; $i < $nblk * 16; $i++) $blks[$i] = 0; + for($i=0; $i < strlen($str); $i++) { + $blks[$i >> 2] |= ord(substr($str, $i, 1)) << ( ($i % 4) * 8); + } + return $blks; +} +function safe_add($x, $y) { + $lsw = ($x & 0xFFFF) + ($y & 0xFFFF); + $msw = ($x >> 16) + ($y >> 16) + ($lsw >> 16); + return ($msw << 16) | ($lsw & 0xFFFF); +} + +function safe_not( $num ) { + $lsw = (~($num & 0xFFFF)) & 0xFFFF; + $msw = (~($num >> 16)) & 0xFFFF; + return ($msw << 16) | $lsw; +} + +function safe_rol( $num, $amt ) { + $leftmask = 0xffff | (0xffff << 16); + $leftmask <<= 32 - $amt; + $rightmask = 0xffff | (0xffff << 16); + $rightmask <<= $amt; + $rightmask = safe_not($rightmask); + + $remains = $num & $leftmask; + $remains >>= 32 - $amt; + $remains &= $rightmask; + + $res = ($num << $amt) | $remains; + + return $res; +} + +function ft($t, $b, $c, $d) { + if($t < 20) return ($b & $c) | ((safe_not($b)) & $d); + if($t < 40) return $d ^ $c ^ $b; + if($t < 60) return ($c & $b) | ($d & $c) | ($d & $b); + return $d ^ $c ^ $b; +} + +function kt($t) { + if ($t < 20) { + return 0x5a82 << 16 | 0x7999; + } else if ($t < 40) { + return 0x6ed9 << 16 | 0xeba1; + } else if ($t < 60) { + return 0x8f1b << 16 | 0xbcdc; + } else { + return 0xca62 << 16 | 0xc1d6; + } +} +function pvpgn_hash($str) { + $x = str2blks_pvpgn($str); + + $a = 0x6745 << 16 | 0x2301; + $b = 0xefcd << 16 | 0xab89; + $c = 0x98ba << 16 | 0xdcfe; + $d = 0x1032 << 16 | 0x5476; + $e = 0xc3d2 << 16 | 0xe1f0; + + for($i = 0; $i < sizeof($x); $i += 16) { + $olda = $a; + $oldb = $b; + $oldc = $c; + $oldd = $d; + $olde = $e; + + for($j = 0; $j < 16; $j++) { + $w[$j] = $x[$i+$j]; + } + + for($j = 0; $j < 64; $j++) { + $ww = $w[$j] ^ $w[$j+8] ^ $w[$j+2] ^ $w[$j+13]; + $w[$j+16] = 1 << ($ww%32); + } + + for($j = 0; $j < 80; $j++) { + if ($j<20) + { + $t = safe_add(safe_add(safe_rol($a, 5), ft($j, $b, $c, $d)), safe_add(safe_add($e, $w[$j]), kt($j))); + } + else + { + $t = safe_add(safe_add(safe_rol($t, 5), ft($j, $b, $c, $d)), safe_add(safe_add($e, $w[$j]), kt($j))); + } + $e = $d; + $d = $c; + $c = safe_rol($b, 30); + $b = $a; + $a = $t; + } + $a = safe_add($t, $olda); + $b = safe_add($b, $oldb); + $c = safe_add($c, $oldc); + $d = safe_add($d, $oldd); + $e = safe_add($e, $olde); + } + return sprintf("%08x%08x%08x%08x%08x",$a,$b,$c,$d,$e); +} + ?> \ No newline at end of file diff --git a/pvpgn/scripts/pvpgn_wol_hash.inc.php b/scripts/pvpgn_wol_hash.inc.php similarity index 95% rename from pvpgn/scripts/pvpgn_wol_hash.inc.php rename to scripts/pvpgn_wol_hash.inc.php index 838b578..5cd0445 100644 --- a/pvpgn/scripts/pvpgn_wol_hash.inc.php +++ b/scripts/pvpgn_wol_hash.inc.php @@ -1,58 +1,58 @@ -8) - { - return false; - } - $pwd1=$pass; - $esi=8; - $pwd2=array(null,null,null,null,null,null,null,null); - $p1=0; - $p2=0; - $edx=""; - for($i=0;$i<8;$i++) - { - if(ord($pwd1[$p1]) & 1) - { - $edx = ord($pwd1[$p1]) << 1; - $edx &= ord($pwd1[$esi]); - } - else - { - $edx = ord($pwd1[$p1]) ^ ord($pwd1[$esi]); - } - $pwd2[$p2] = $edx; - $p2++; - $esi--; - $p1++; - } - - - $WOL_HASH_CHAR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; - $p1 = 0; - $p2 = 0; - for($i=0;$i<8;$i++) - { - $edx = $pwd2[$p2] & 0x3f; - $p2++; - $pwd1[$p1] = $WOL_HASH_CHAR[$edx]; - $p1++; - } - return $pwd1; -} - +8) + { + return false; + } + $pwd1=$pass; + $esi=8; + $pwd2=array(null,null,null,null,null,null,null,null); + $p1=0; + $p2=0; + $edx=""; + for($i=0;$i<8;$i++) + { + if(ord($pwd1[$p1]) & 1) + { + $edx = ord($pwd1[$p1]) << 1; + $edx &= ord($pwd1[$esi]); + } + else + { + $edx = ord($pwd1[$p1]) ^ ord($pwd1[$esi]); + } + $pwd2[$p2] = $edx; + $p2++; + $esi--; + $p1++; + } + + + $WOL_HASH_CHAR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; + $p1 = 0; + $p2 = 0; + for($i=0;$i<8;$i++) + { + $edx = $pwd2[$p2] & 0x3f; + $p2++; + $pwd1[$p1] = $WOL_HASH_CHAR[$edx]; + $p1++; + } + return $pwd1; +} + ?> \ No newline at end of file diff --git a/pvpgn/scripts/rc.bnetd b/scripts/rc.bnetd similarity index 100% rename from pvpgn/scripts/rc.bnetd rename to scripts/rc.bnetd diff --git a/pvpgn/scripts/reform.awk b/scripts/reform.awk similarity index 100% rename from pvpgn/scripts/reform.awk rename to scripts/reform.awk diff --git a/pvpgn/scripts/sql/repairlevels.pl b/scripts/sql/repairlevels.pl similarity index 100% rename from pvpgn/scripts/sql/repairlevels.pl rename to scripts/sql/repairlevels.pl diff --git a/pvpgn/scripts/storage/cdb2sql.pl b/scripts/storage/cdb2sql.pl similarity index 100% rename from pvpgn/scripts/storage/cdb2sql.pl rename to scripts/storage/cdb2sql.pl diff --git a/pvpgn/scripts/storage/plain2sql.pl b/scripts/storage/plain2sql.pl similarity index 100% rename from pvpgn/scripts/storage/plain2sql.pl rename to scripts/storage/plain2sql.pl diff --git a/pvpgn/scripts/tos.bat b/scripts/tos.bat similarity index 96% rename from pvpgn/scripts/tos.bat rename to scripts/tos.bat index 8a26ef0..0a1824e 100644 --- a/pvpgn/scripts/tos.bat +++ b/scripts/tos.bat @@ -1,36 +1,36 @@ -@echo off -cd ../files - -copy tos.txt tos_RUS.txt -copy tos.txt tos_POL.txt -copy tos.txt tos_CHI.txt -copy tos.txt tos_SIN.txt -copy tos.txt tos_HAN.txt -copy tos.txt tos_KOR.txt -copy tos.txt tos_JPN.txt -copy tos.txt tos_ITA.txt -copy tos.txt tos_BRA.txt -copy tos.txt tos_POR.txt -copy tos.txt tos_FRA.txt -copy tos.txt tos_DEU.txt -copy tos.txt tos_ESP.txt -copy tos.txt tos_USA.txt -copy tos.txt tos_ENU.txt - -copy tos.txt tos-unicode_RUS.txt -copy tos.txt tos-unicode_POL.txt -copy tos.txt tos-unicode_CHI.txt -copy tos.txt tos-unicode_SIN.txt -copy tos.txt tos-unicode_HAN.txt -copy tos.txt tos-unicode_KOR.txt -copy tos.txt tos-unicode_JPN.txt -copy tos.txt tos-unicode_ITA.txt -copy tos.txt tos-unicode_BRA.txt -copy tos.txt tos-unicode_POR.txt -copy tos.txt tos-unicode_FRA.txt -copy tos.txt tos-unicode_DEU.txt -copy tos.txt tos-unicode_ESP.txt -copy tos.txt tos-unicode_USA.txt -copy tos.txt tos-unicode_ENU.txt - +@echo off +cd ../files + +copy tos.txt tos_RUS.txt +copy tos.txt tos_POL.txt +copy tos.txt tos_CHI.txt +copy tos.txt tos_SIN.txt +copy tos.txt tos_HAN.txt +copy tos.txt tos_KOR.txt +copy tos.txt tos_JPN.txt +copy tos.txt tos_ITA.txt +copy tos.txt tos_BRA.txt +copy tos.txt tos_POR.txt +copy tos.txt tos_FRA.txt +copy tos.txt tos_DEU.txt +copy tos.txt tos_ESP.txt +copy tos.txt tos_USA.txt +copy tos.txt tos_ENU.txt + +copy tos.txt tos-unicode_RUS.txt +copy tos.txt tos-unicode_POL.txt +copy tos.txt tos-unicode_CHI.txt +copy tos.txt tos-unicode_SIN.txt +copy tos.txt tos-unicode_HAN.txt +copy tos.txt tos-unicode_KOR.txt +copy tos.txt tos-unicode_JPN.txt +copy tos.txt tos-unicode_ITA.txt +copy tos.txt tos-unicode_BRA.txt +copy tos.txt tos-unicode_POR.txt +copy tos.txt tos-unicode_FRA.txt +copy tos.txt tos-unicode_DEU.txt +copy tos.txt tos-unicode_ESP.txt +copy tos.txt tos-unicode_USA.txt +copy tos.txt tos-unicode_ENU.txt + cd ../scripts \ No newline at end of file diff --git a/pvpgn/scripts/tos.sh b/scripts/tos.sh similarity index 100% rename from pvpgn/scripts/tos.sh rename to scripts/tos.sh diff --git a/pvpgn/src/CMakeLists.txt b/src/CMakeLists.txt similarity index 100% rename from pvpgn/src/CMakeLists.txt rename to src/CMakeLists.txt diff --git a/pvpgn/src/Makefile.am b/src/Makefile.am similarity index 100% rename from pvpgn/src/Makefile.am rename to src/Makefile.am diff --git a/pvpgn/src/autoconf/Makefile.am b/src/autoconf/Makefile.am similarity index 100% rename from pvpgn/src/autoconf/Makefile.am rename to src/autoconf/Makefile.am diff --git a/pvpgn/src/autoconf/ansi2knr.c b/src/autoconf/ansi2knr.c similarity index 100% rename from pvpgn/src/autoconf/ansi2knr.c rename to src/autoconf/ansi2knr.c diff --git a/pvpgn/src/autoconf/ccstdc.m4 b/src/autoconf/ccstdc.m4 similarity index 100% rename from pvpgn/src/autoconf/ccstdc.m4 rename to src/autoconf/ccstdc.m4 diff --git a/pvpgn/src/autoconf/config.guess b/src/autoconf/config.guess similarity index 100% rename from pvpgn/src/autoconf/config.guess rename to src/autoconf/config.guess diff --git a/pvpgn/src/autoconf/config.sub b/src/autoconf/config.sub similarity index 100% rename from pvpgn/src/autoconf/config.sub rename to src/autoconf/config.sub diff --git a/d2pack109/src/autoconf/install-sh b/src/autoconf/install-sh similarity index 100% rename from d2pack109/src/autoconf/install-sh rename to src/autoconf/install-sh diff --git a/d2pack109/src/autoconf/mkdir-p b/src/autoconf/mkdir-p similarity index 100% rename from d2pack109/src/autoconf/mkdir-p rename to src/autoconf/mkdir-p diff --git a/d2pack109/src/autoconf/mkdir.m4 b/src/autoconf/mkdir.m4 similarity index 100% rename from d2pack109/src/autoconf/mkdir.m4 rename to src/autoconf/mkdir.m4 diff --git a/pvpgn/src/autoconf/termios.m4 b/src/autoconf/termios.m4 similarity index 100% rename from pvpgn/src/autoconf/termios.m4 rename to src/autoconf/termios.m4 diff --git a/pvpgn/src/autoconf/winsz.m4 b/src/autoconf/winsz.m4 similarity index 100% rename from pvpgn/src/autoconf/winsz.m4 rename to src/autoconf/winsz.m4 diff --git a/pvpgn/src/bnetd/CMakeLists.txt b/src/bnetd/CMakeLists.txt similarity index 100% rename from pvpgn/src/bnetd/CMakeLists.txt rename to src/bnetd/CMakeLists.txt diff --git a/pvpgn/src/bnetd/Makefile.am b/src/bnetd/Makefile.am similarity index 100% rename from pvpgn/src/bnetd/Makefile.am rename to src/bnetd/Makefile.am diff --git a/pvpgn/src/bnetd/account.cpp b/src/bnetd/account.cpp similarity index 100% rename from pvpgn/src/bnetd/account.cpp rename to src/bnetd/account.cpp diff --git a/pvpgn/src/bnetd/account.h b/src/bnetd/account.h similarity index 100% rename from pvpgn/src/bnetd/account.h rename to src/bnetd/account.h diff --git a/pvpgn/src/bnetd/account_wrap.cpp b/src/bnetd/account_wrap.cpp similarity index 100% rename from pvpgn/src/bnetd/account_wrap.cpp rename to src/bnetd/account_wrap.cpp diff --git a/pvpgn/src/bnetd/account_wrap.h b/src/bnetd/account_wrap.h similarity index 100% rename from pvpgn/src/bnetd/account_wrap.h rename to src/bnetd/account_wrap.h diff --git a/pvpgn/src/bnetd/adbanner.cpp b/src/bnetd/adbanner.cpp similarity index 100% rename from pvpgn/src/bnetd/adbanner.cpp rename to src/bnetd/adbanner.cpp diff --git a/pvpgn/src/bnetd/adbanner.h b/src/bnetd/adbanner.h similarity index 100% rename from pvpgn/src/bnetd/adbanner.h rename to src/bnetd/adbanner.h diff --git a/pvpgn/src/bnetd/alias_command.cpp b/src/bnetd/alias_command.cpp similarity index 100% rename from pvpgn/src/bnetd/alias_command.cpp rename to src/bnetd/alias_command.cpp diff --git a/pvpgn/src/bnetd/alias_command.h b/src/bnetd/alias_command.h similarity index 100% rename from pvpgn/src/bnetd/alias_command.h rename to src/bnetd/alias_command.h diff --git a/pvpgn/src/bnetd/anongame.cpp b/src/bnetd/anongame.cpp similarity index 100% rename from pvpgn/src/bnetd/anongame.cpp rename to src/bnetd/anongame.cpp diff --git a/pvpgn/src/bnetd/anongame.h b/src/bnetd/anongame.h similarity index 100% rename from pvpgn/src/bnetd/anongame.h rename to src/bnetd/anongame.h diff --git a/pvpgn/src/bnetd/anongame_gameresult.cpp b/src/bnetd/anongame_gameresult.cpp similarity index 100% rename from pvpgn/src/bnetd/anongame_gameresult.cpp rename to src/bnetd/anongame_gameresult.cpp diff --git a/pvpgn/src/bnetd/anongame_gameresult.h b/src/bnetd/anongame_gameresult.h similarity index 100% rename from pvpgn/src/bnetd/anongame_gameresult.h rename to src/bnetd/anongame_gameresult.h diff --git a/pvpgn/src/bnetd/anongame_infos.cpp b/src/bnetd/anongame_infos.cpp similarity index 100% rename from pvpgn/src/bnetd/anongame_infos.cpp rename to src/bnetd/anongame_infos.cpp diff --git a/pvpgn/src/bnetd/anongame_infos.h b/src/bnetd/anongame_infos.h similarity index 100% rename from pvpgn/src/bnetd/anongame_infos.h rename to src/bnetd/anongame_infos.h diff --git a/pvpgn/src/bnetd/anongame_maplists.cpp b/src/bnetd/anongame_maplists.cpp similarity index 100% rename from pvpgn/src/bnetd/anongame_maplists.cpp rename to src/bnetd/anongame_maplists.cpp diff --git a/pvpgn/src/bnetd/anongame_maplists.h b/src/bnetd/anongame_maplists.h similarity index 100% rename from pvpgn/src/bnetd/anongame_maplists.h rename to src/bnetd/anongame_maplists.h diff --git a/pvpgn/src/bnetd/anongame_wol.cpp b/src/bnetd/anongame_wol.cpp similarity index 96% rename from pvpgn/src/bnetd/anongame_wol.cpp rename to src/bnetd/anongame_wol.cpp index 5d3fd1e..bb3351a 100644 --- a/pvpgn/src/bnetd/anongame_wol.cpp +++ b/src/bnetd/anongame_wol.cpp @@ -1,624 +1,624 @@ -/* - * Copyright (C) 2008 Pelish (pelish@gmail.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#define ANONGAME_WOL_INTERNAL_ACCESS -#include "common/setup_before.h" -#include "anongame_wol.h" - -#include -#include -#include - -#include "compat/snprintf.h" -#include "compat/strcasecmp.h" - -#include "common/irc_protocol.h" -#include "common/packet.h" -#include "common/eventlog.h" -#include "common/tag.h" -#include "common/list.h" -#include "common/anongame_protocol.h" - -#include "irc.h" -#include "handle_wol.h" -#include "connection.h" -#include "channel.h" -#include "anongame.h" -#include "common/setup_after.h" - -namespace pvpgn -{ - - namespace bnetd - { - - typedef int(*t_anong_tag)(t_anongame_wol_player * player, char * param); - - typedef struct { - const char * wol_anong_tag_string; - t_anong_tag wol_anong_tag_handler; - } t_wol_anongame_tag_table_row; - - static t_list * anongame_wol_matchlist_head = NULL; - - static int _handle_address_tag(t_anongame_wol_player * player, char * param); - static int _handle_port_tag(t_anongame_wol_player * player, char * param); - static int _handle_country_tag(t_anongame_wol_player * player, char * param); - static int _handle_colour_tag(t_anongame_wol_player * player, char * param); - - static const t_wol_anongame_tag_table_row t_wol_anongame_tag_table[] = - { - { MATCHTAG_ADDRESS, _handle_address_tag }, - { MATCHTAG_PORT, _handle_port_tag }, - { MATCHTAG_COUNTRY, _handle_country_tag }, - { MATCHTAG_COLOUR, _handle_colour_tag }, - - { NULL, NULL } - }; - - static int anongame_wol_set_playersetting(t_anongame_wol_player * player, char const * tag, char * param) - { - t_wol_anongame_tag_table_row const *p; - - for (p = t_wol_anongame_tag_table; p->wol_anong_tag_string != NULL; p++) { - if (strcasecmp(tag, p->wol_anong_tag_string) == 0) { - if (p->wol_anong_tag_handler != NULL) - return ((p->wol_anong_tag_handler)(player, param)); - } - } - return -1; - } - - /* anongame_wol player functions: */ - - static t_anongame_wol_player * anongame_wol_player_create(t_connection * conn) - { - t_anongame_wol_player * player; - - player = (t_anongame_wol_player*)xmalloc(sizeof(t_anongame_wol_player)); - - player->conn = conn; - - /* Used only in Red Alert 2 and Yuri's Revenge */ - player->address = 0; - player->port = 0; - player->country = -2; /* Default values are form packet dumps - not prefered country */ - player->colour = -2; /* Default values are form packet dumps - not prefered colour */ - - conn_wol_set_anongame_player(conn, player); - - list_append_data(anongame_wol_matchlist_head, player); - - DEBUG1("[** WOL **] annongame player created: %s", conn_get_chatname(conn)); - - return player; - } - - static int anongame_wol_player_destroy(t_anongame_wol_player * player, t_elem ** curr) - { - if (list_remove_data(anongame_wol_matchlist_head, player, curr) < 0){ - ERROR0("could not remove item from list"); - return -1; - } - - DEBUG0("[** WOL **] destroying annongame player"); - - xfree(player); - - return 0; - } - - static t_connection * anongame_wol_player_get_conn(t_anongame_wol_player const * player) - { - if (!player) { - ERROR0("got NULL player"); - return NULL; - } - - return player->conn; - } - - - static int anongame_wol_player_get_address(t_anongame_wol_player const * player) - { - if (!player) { - ERROR0("got NULL player"); - return -1; - } - - return player->address; - } - - static int _handle_address_tag(t_anongame_wol_player * player, char * param) - { - if (!player) { - ERROR0("got NULL player"); - return -1; - } - - if (param) - player->address = std::atoi(param); - - return 0; - } - - static int anongame_wol_player_get_port(t_anongame_wol_player const * player) - { - if (!player) { - ERROR0("got NULL player"); - return -1; - } - - return player->port; - } - - static int _handle_port_tag(t_anongame_wol_player * player, char * param) - { - if (!player) { - ERROR0("got NULL player"); - return -1; - } - - if (param) - player->port = std::atoi(param); - - return 0; - } - - static int anongame_wol_player_get_country(t_anongame_wol_player const * player) - { - if (!player) { - ERROR0("got NULL player"); - return -1; - } - - return player->country; - } - - static int _handle_country_tag(t_anongame_wol_player * player, char * param) - { - if (!player) { - ERROR0("got NULL player"); - return -1; - } - - if (param) - player->country = std::atoi(param); - - return 0; - } - - static int anongame_wol_player_get_colour(t_anongame_wol_player const * player) - { - if (!player) { - ERROR0("got NULL player"); - return -1; - } - - return player->colour; - } - - static int _handle_colour_tag(t_anongame_wol_player * player, char * param) - { - if (!player) { - ERROR0("got NULL player"); - return -1; - } - - if (param) - player->colour = std::atoi(param); - - return 0; - } - - /* Matchlist functions:*/ - - extern int anongame_wol_matchlist_create(void) - { - anongame_wol_matchlist_head = list_create(); - - return 0; - } - - extern int anongame_wol_matchlist_destroy(void) - { - t_anongame_wol_player * player; - t_elem * curr; - - if (anongame_wol_matchlist_head) { - LIST_TRAVERSE(anongame_wol_matchlist_head, curr) { - if (!(player = (t_anongame_wol_player*)elem_get_data(curr))) { /* should not happen */ - ERROR0("wol_matchlist contains NULL item"); - continue; - } - anongame_wol_player_destroy(player, &curr); - } - - if (list_destroy(anongame_wol_matchlist_head) < 0) - return -1; - anongame_wol_matchlist_head = NULL; - } - - return 0; - } - - extern t_list * anongame_wol_matchlist(void) - { - return anongame_wol_matchlist_head; - } - - static t_anongame_wol_player * anongame_wol_matchlist_find_player_by_conn(t_connection * conn) - { - t_anongame_wol_player * player; - t_elem * curr; - - if (!conn) { - ERROR0("got NULL conn"); - return NULL; - } - - LIST_TRAVERSE(anongame_wol_matchlist(), curr) { - t_anongame_wol_player * player = (t_anongame_wol_player *)elem_get_data(curr); - if (conn == anongame_wol_player_get_conn(player)) { - return player; - } - } - - return NULL; - } - - static int anongame_wol_matchlist_get_length(void) - { - return list_get_length(anongame_wol_matchlist_head); - } - - /* support functions */ - - static int _send_msg(t_connection * conn, char const * command, char const * text) - { - t_packet * p; - char data[MAX_IRC_MESSAGE_LEN + 1]; - unsigned len; - char const * nick; - - if (!conn) { - eventlog(eventlog_level_error, __FUNCTION__, "got NULL connection"); - return -1; - } - if (!command) { - eventlog(eventlog_level_error, __FUNCTION__, "got NULL command"); - return -1; - } - if (!text) { - eventlog(eventlog_level_error, __FUNCTION__, "got NULL text"); - return -1; - } - if (!(p = packet_create(packet_class_raw))) { - eventlog(eventlog_level_error, __FUNCTION__, "could not create packet"); - return -1; - } - - nick = conn_get_loggeduser(conn); - if (!nick) - nick = "UserName"; - - /* snprintf isn't portable -> check message length first */ - len = 1 + 12 + 1 + std::strlen(command) + 1 + std::strlen(nick) + 1 + std::strlen(text) + 2; - if (len > MAX_IRC_MESSAGE_LEN) { - eventlog(eventlog_level_error, __FUNCTION__, "message to send is too large (%u bytes)", len); - return -1; - } - else - std::sprintf(data, ":matchbot!u@h %s %s %s", command, nick, text); - - DEBUG2("[%d] sent \"%s\"", conn_get_socket(conn), data); - std::strcat(data, "\r\n"); - packet_set_size(p, 0); - packet_append_data(p, data, len); - conn_push_outqueue(conn, p); - packet_del_ref(p); - return 0; - } - - static int _get_pair(int * i, int * j, int max, bool different) - { - max++; /* We want to use just real maximum number - no metter what function do */ - - if (*i == -2) - *i = (max * rand() / (RAND_MAX + 1)); - - if (*j == -2) - *j = (max * rand() / (RAND_MAX + 1)); - - if ((different) && (*i == *j)) { - do { - *j = (max * rand() / (RAND_MAX + 1)); - } while (*i == *j); - } - return 0; - } - - - static int anongame_wol_trystart(t_anongame_wol_player const * player1) - { - t_elem * curr; - char temp[MAX_IRC_MESSAGE_LEN]; - char _temp[MAX_IRC_MESSAGE_LEN]; - int random; - - t_anongame_wol_player * player2; - t_connection * conn_pl1; - t_connection * conn_pl2; - char const * channelname; - const char * mapname; - t_clienttag ctag; - - std::memset(temp, 0, sizeof(temp)); - std::memset(_temp, 0, sizeof(_temp)); - - /** - * Expected start message is - * - * Red Alert 2: - * :Start [rand_num],0,0,[credits],0,1,[super_weapon],1,1,0,1,x,2,1,[mapsize_kilobytes],[mapname],1: - * [nick1_name],[nick1_country],[nick1_colour],[nick1_addr_hex],[nick1_nat],[nick1_prt_hex], - * [nick2_name],[nick2_country],[nick2_colour],[nick2_addr_hex],[nick2_nat],[nick2_prt_hex] - * - * Yuris Revenge Quick game: - * - * Yuris Revenge Quick Coop: - * - */ - - if (!player1) { - ERROR0("got NULL player"); - return -1; - } - - conn_pl1 = anongame_wol_player_get_conn(player1); - ctag = conn_get_clienttag(conn_pl1); - channelname = channel_get_name(conn_get_channel(conn_pl1)); - - LIST_TRAVERSE(anongame_wol_matchlist(), curr) { - player2 = (t_anongame_wol_player *)elem_get_data(curr); - conn_pl2 = anongame_wol_player_get_conn(player2); - - if ((player1 != player2) && ((conn_get_channel(conn_pl1)) == (conn_get_channel(conn_pl2)))) { - switch (ctag) { - case CLIENTTAG_REDALERT2_UINT: { - random = rand(); - - if (std::strcmp(channelname, RAL2_CHANNEL_FFA) == 0) { - int pl1_colour = anongame_wol_player_get_colour(player1); - int pl1_country = anongame_wol_player_get_country(player1); - int pl2_colour = anongame_wol_player_get_colour(player2); - int pl2_country = anongame_wol_player_get_country(player2); - - DEBUG0("Generating SOLO game for Red Alert 2"); - - _get_pair(&pl1_colour, &pl2_colour, 7, true); - _get_pair(&pl1_country, &pl2_country, 8, false); - mapname = anongame_get_map_from_prefs(ANONGAME_TYPE_1V1, ctag); - - /* We have madatory of game */ - snprintf(_temp, sizeof(_temp), ":Start %u,0,0,10000,0,1,0,1,1,0,1,x,2,1,165368,%s,1:", random, mapname); - std::strcat(temp, _temp); - - /* GameHost informations */ - snprintf(_temp, sizeof(_temp), "%s,%d,%d,%x,1,%x,", conn_get_chatname(conn_pl1), pl1_country, pl1_colour, anongame_wol_player_get_address(player1), anongame_wol_player_get_port(player1)); - std::strcat(temp, _temp); - - /* GameJoinie informations */ - snprintf(_temp, sizeof(_temp), "%s,%d,%d,%x,1,%x", conn_get_chatname(conn_pl2), pl2_country, pl2_colour, anongame_wol_player_get_address(player2), anongame_wol_player_get_port(player2)); - std::strcat(temp, _temp); - - _send_msg(conn_pl1, "PRIVMSG", temp); - _send_msg(conn_pl2, "PRIVMSG", temp); - } - else - ERROR1("undefined channel type for %s channel", channelname); - } - return 0; - case CLIENTTAG_YURISREV_UINT: { - random = rand(); - - if (std::strcmp(channelname, YURI_CHANNEL_FFA) == 0) { - int pl1_colour = anongame_wol_player_get_colour(player1); - int pl1_country = anongame_wol_player_get_country(player1); - int pl2_colour = anongame_wol_player_get_colour(player2); - int pl2_country = anongame_wol_player_get_country(player2); - - DEBUG0("Generating SOLO game for Yuri's Revenge"); - - _get_pair(&pl1_colour, &pl2_colour, 7, true); - _get_pair(&pl1_country, &pl2_country, 9, false); - mapname = anongame_get_map_from_prefs(ANONGAME_TYPE_1V1, ctag); - - /* We have madatory of game */ - snprintf(_temp, sizeof(_temp), ":Start %u,0,0,10000,0,0,1,1,1,0,3,0,x,2,1,163770,%s,1:", random, mapname); - std::strcat(temp, _temp); - - /* GameHost informations */ - snprintf(_temp, sizeof(_temp), "%s,%d,%d,-2,-2,", conn_get_chatname(conn_pl1), pl1_country, pl1_colour); - std::strcat(temp, _temp); - snprintf(_temp, sizeof(_temp), "%x,1,%x,", anongame_wol_player_get_address(player1), anongame_wol_player_get_port(player1)); - std::strcat(temp, _temp); - - /* GameJoinie informations */ - snprintf(_temp, sizeof(_temp), "%s,%d,%d,-2,-2,", conn_get_chatname(conn_pl2), pl2_country, pl2_colour); - std::strcat(temp, _temp); - snprintf(_temp, sizeof(_temp), "%x,1,%x", anongame_wol_player_get_address(player2), anongame_wol_player_get_port(player2)); - std::strcat(temp, _temp); - - _send_msg(conn_pl1, "PRIVMSG", temp); - _send_msg(conn_pl2, "PRIVMSG", temp); - } - else if (std::strcmp(channelname, YURI_CHANNEL_COOP) == 0) { - DEBUG0("Generating COOP game for Yuri's Revenge"); - - /* We have madatory of game */ - snprintf(_temp, sizeof(_temp), ":Start %u,0,0,10000,10,0,1,1,0,1,3,0,x,2,1,163770,C1A01MD.MAP,1:", random); - std::strcat(temp, _temp); - - /* GameHost informations */ - snprintf(_temp, sizeof(_temp), "%s,0,4,0,-2,", conn_get_chatname(conn_pl1)); - std::strcat(temp, _temp); - snprintf(_temp, sizeof(_temp), "%x,1,%x,", anongame_wol_player_get_address(player1), anongame_wol_player_get_port(player1)); - std::strcat(temp, _temp); - - /* GameJoinie informations */ - snprintf(_temp, sizeof(_temp), "%s,0,5,1,-2,", conn_get_chatname(anongame_wol_player_get_conn(player2))); - std::strcat(temp, _temp); - snprintf(_temp, sizeof(_temp), "%x,1,%x", anongame_wol_player_get_address(player2), anongame_wol_player_get_port(player2)); - std::strcat(temp, _temp); - - /* Some computers for coop games */ - snprintf(_temp, sizeof(_temp), ":@:0,-1,-1,-2,-2,0,-1,-1,-2,-2,1,8,1,-2,-2,1,8,2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"); - std::strcat(temp, _temp); - - _send_msg(conn_pl1, "PRIVMSG", temp); - _send_msg(conn_pl2, "PRIVMSG", temp); - } - else - ERROR1("undefined channel type for %s channel", channelname); - } - return 0; - default: - DEBUG0("unsupported client for WOL Matchgame"); - return 0; - } - } - } - - return 0; - } - - static int anongame_wol_tokenize_line(t_connection * conn, char const * text) - { - t_anongame_wol_player * player; - t_tag ctag; - char const * channelname; - char * command; /* Match, CINFO, SINFO, Pings */ - char * tag; /* ADR, COL, COU... */ - char * param; /* value of paramtag */ - char * line; /* Copy of text */ - char * temp; - char * p; - - if (!conn) { - ERROR0("got NULL conn"); - return -1; - } - - if (!text) { - ERROR0("got NULL text"); - return -1; - } - - if (!(player = anongame_wol_player_create(conn))) { - ERROR0("player was not created"); - return -1; - } - - /** - * Here are expected privmsgs: - * :user!EMPR@host PRIVMSG matchbot :Match COU=-1,COL=-1,SHA=-1,SHB=-1,LOC=2,RAT=0 - * :user!RAL2@host PRIVMSG matchbot :Match COU=-2, COL=-2, LOC=1, RAT=3, RES=640, ADR=202680512, NAT=1, PRT=1295 - * :user!RAL2@host PRIVMSG matchbot :Match COU=-2, COL=-2, LOC=1, RAT=3, RES=640, ADR=202680512, NAT=1, PRT=1340 - * :user!RAL2@host PRIVMSG matchbot :Match COU=-2, COL=-2, LOC=25, RAT=1, RES=640, ADR=-501962560, NAT=1, PRT=1320 - * :user!YURI@host PRIVMSG matchbot :Match COU=-2, COL=-2, MBR=1, LOC=5, RAT=2, RES=800, ADR=202680512, NAT=1, PRT=1390 - * :user!RNGD@host PRIVMSG matchbot :CINFO VER=1329937315 CPU=2981 MEM=1023 TPOINTS=0 PLAYED=0 PINGS=00FFFFFFFFFFFFFF - * :user!RNGD@host PRIVMSG matchbot :SINFO 4F453BA3DBAE41CB00000000000000002d# 9Dedicated Renegade Server-C&C_Field.mix07FF0656FFFF1C2D|090000000000 - * :user!YURI@host PRIVMSG matchbot :Pings nickname,2; - */ - - line = (char *)xmalloc(std::strlen(text) + 2); - strcpy(line, text); - - command = line; - if (!(temp = strchr(command, ' '))) { - WARN0("got malformed line (missing command)"); - xfree(line); - return -1; - } - *temp++ = '\0'; - - if ((std::strcmp(command, "Match") == 0)) { - strcat(temp, ","); /* FIXME: This is DUMB - without that we lost the last tag/param */ - - for (p = temp; *p && (*p != '\0'); p++) { - if ((*p == ',') || (*p == ' ')) { - *p++ = '\0'; - if (temp[0] == ' ') /* Pelish: Emperor sends line without spaces but RA2/Yuri do */ - *temp++; - tag = temp; - param = strchr(tag, '='); - if (param) - *param++ = '\0'; - if (anongame_wol_set_playersetting(player, tag, param) == -1) - WARN2("[** WOL **] got unknown tag %s param %s", tag, param); - temp = p; - } - } - _send_msg(conn, "PRIVMSG", ":Working"); - anongame_wol_trystart(player); - } - else { - DEBUG1("[** WOL **] got line /%s/", text); - } - - if (line) - xfree(line); - - return 0; - } - - /* Functions for getting/sending player informations */ - - extern int anongame_wol_destroy(t_connection * conn) - { - t_elem *curr; - - /* Player destroying */ - - LIST_TRAVERSE(anongame_wol_matchlist_head, curr) { - t_anongame_wol_player * player = (t_anongame_wol_player*)elem_get_data(curr); - - if (conn == anongame_wol_player_get_conn(player)) - anongame_wol_player_destroy(player, &curr); - } - - return 0; - } - - extern int anongame_wol_privmsg(t_connection * conn, int numparams, char ** params, char * text) - { - - if (!conn) { - ERROR0("got NULL conn"); - return -1; - } - - anongame_wol_tokenize_line(conn, text); - - return 0; - } - - } - -} +/* + * Copyright (C) 2008 Pelish (pelish@gmail.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#define ANONGAME_WOL_INTERNAL_ACCESS +#include "common/setup_before.h" +#include "anongame_wol.h" + +#include +#include +#include + +#include "compat/snprintf.h" +#include "compat/strcasecmp.h" + +#include "common/irc_protocol.h" +#include "common/packet.h" +#include "common/eventlog.h" +#include "common/tag.h" +#include "common/list.h" +#include "common/anongame_protocol.h" + +#include "irc.h" +#include "handle_wol.h" +#include "connection.h" +#include "channel.h" +#include "anongame.h" +#include "common/setup_after.h" + +namespace pvpgn +{ + + namespace bnetd + { + + typedef int(*t_anong_tag)(t_anongame_wol_player * player, char * param); + + typedef struct { + const char * wol_anong_tag_string; + t_anong_tag wol_anong_tag_handler; + } t_wol_anongame_tag_table_row; + + static t_list * anongame_wol_matchlist_head = NULL; + + static int _handle_address_tag(t_anongame_wol_player * player, char * param); + static int _handle_port_tag(t_anongame_wol_player * player, char * param); + static int _handle_country_tag(t_anongame_wol_player * player, char * param); + static int _handle_colour_tag(t_anongame_wol_player * player, char * param); + + static const t_wol_anongame_tag_table_row t_wol_anongame_tag_table[] = + { + { MATCHTAG_ADDRESS, _handle_address_tag }, + { MATCHTAG_PORT, _handle_port_tag }, + { MATCHTAG_COUNTRY, _handle_country_tag }, + { MATCHTAG_COLOUR, _handle_colour_tag }, + + { NULL, NULL } + }; + + static int anongame_wol_set_playersetting(t_anongame_wol_player * player, char const * tag, char * param) + { + t_wol_anongame_tag_table_row const *p; + + for (p = t_wol_anongame_tag_table; p->wol_anong_tag_string != NULL; p++) { + if (strcasecmp(tag, p->wol_anong_tag_string) == 0) { + if (p->wol_anong_tag_handler != NULL) + return ((p->wol_anong_tag_handler)(player, param)); + } + } + return -1; + } + + /* anongame_wol player functions: */ + + static t_anongame_wol_player * anongame_wol_player_create(t_connection * conn) + { + t_anongame_wol_player * player; + + player = (t_anongame_wol_player*)xmalloc(sizeof(t_anongame_wol_player)); + + player->conn = conn; + + /* Used only in Red Alert 2 and Yuri's Revenge */ + player->address = 0; + player->port = 0; + player->country = -2; /* Default values are form packet dumps - not prefered country */ + player->colour = -2; /* Default values are form packet dumps - not prefered colour */ + + conn_wol_set_anongame_player(conn, player); + + list_append_data(anongame_wol_matchlist_head, player); + + DEBUG1("[** WOL **] annongame player created: %s", conn_get_chatname(conn)); + + return player; + } + + static int anongame_wol_player_destroy(t_anongame_wol_player * player, t_elem ** curr) + { + if (list_remove_data(anongame_wol_matchlist_head, player, curr) < 0){ + ERROR0("could not remove item from list"); + return -1; + } + + DEBUG0("[** WOL **] destroying annongame player"); + + xfree(player); + + return 0; + } + + static t_connection * anongame_wol_player_get_conn(t_anongame_wol_player const * player) + { + if (!player) { + ERROR0("got NULL player"); + return NULL; + } + + return player->conn; + } + + + static int anongame_wol_player_get_address(t_anongame_wol_player const * player) + { + if (!player) { + ERROR0("got NULL player"); + return -1; + } + + return player->address; + } + + static int _handle_address_tag(t_anongame_wol_player * player, char * param) + { + if (!player) { + ERROR0("got NULL player"); + return -1; + } + + if (param) + player->address = std::atoi(param); + + return 0; + } + + static int anongame_wol_player_get_port(t_anongame_wol_player const * player) + { + if (!player) { + ERROR0("got NULL player"); + return -1; + } + + return player->port; + } + + static int _handle_port_tag(t_anongame_wol_player * player, char * param) + { + if (!player) { + ERROR0("got NULL player"); + return -1; + } + + if (param) + player->port = std::atoi(param); + + return 0; + } + + static int anongame_wol_player_get_country(t_anongame_wol_player const * player) + { + if (!player) { + ERROR0("got NULL player"); + return -1; + } + + return player->country; + } + + static int _handle_country_tag(t_anongame_wol_player * player, char * param) + { + if (!player) { + ERROR0("got NULL player"); + return -1; + } + + if (param) + player->country = std::atoi(param); + + return 0; + } + + static int anongame_wol_player_get_colour(t_anongame_wol_player const * player) + { + if (!player) { + ERROR0("got NULL player"); + return -1; + } + + return player->colour; + } + + static int _handle_colour_tag(t_anongame_wol_player * player, char * param) + { + if (!player) { + ERROR0("got NULL player"); + return -1; + } + + if (param) + player->colour = std::atoi(param); + + return 0; + } + + /* Matchlist functions:*/ + + extern int anongame_wol_matchlist_create(void) + { + anongame_wol_matchlist_head = list_create(); + + return 0; + } + + extern int anongame_wol_matchlist_destroy(void) + { + t_anongame_wol_player * player; + t_elem * curr; + + if (anongame_wol_matchlist_head) { + LIST_TRAVERSE(anongame_wol_matchlist_head, curr) { + if (!(player = (t_anongame_wol_player*)elem_get_data(curr))) { /* should not happen */ + ERROR0("wol_matchlist contains NULL item"); + continue; + } + anongame_wol_player_destroy(player, &curr); + } + + if (list_destroy(anongame_wol_matchlist_head) < 0) + return -1; + anongame_wol_matchlist_head = NULL; + } + + return 0; + } + + extern t_list * anongame_wol_matchlist(void) + { + return anongame_wol_matchlist_head; + } + + static t_anongame_wol_player * anongame_wol_matchlist_find_player_by_conn(t_connection * conn) + { + t_anongame_wol_player * player; + t_elem * curr; + + if (!conn) { + ERROR0("got NULL conn"); + return NULL; + } + + LIST_TRAVERSE(anongame_wol_matchlist(), curr) { + t_anongame_wol_player * player = (t_anongame_wol_player *)elem_get_data(curr); + if (conn == anongame_wol_player_get_conn(player)) { + return player; + } + } + + return NULL; + } + + static int anongame_wol_matchlist_get_length(void) + { + return list_get_length(anongame_wol_matchlist_head); + } + + /* support functions */ + + static int _send_msg(t_connection * conn, char const * command, char const * text) + { + t_packet * p; + char data[MAX_IRC_MESSAGE_LEN + 1]; + unsigned len; + char const * nick; + + if (!conn) { + eventlog(eventlog_level_error, __FUNCTION__, "got NULL connection"); + return -1; + } + if (!command) { + eventlog(eventlog_level_error, __FUNCTION__, "got NULL command"); + return -1; + } + if (!text) { + eventlog(eventlog_level_error, __FUNCTION__, "got NULL text"); + return -1; + } + if (!(p = packet_create(packet_class_raw))) { + eventlog(eventlog_level_error, __FUNCTION__, "could not create packet"); + return -1; + } + + nick = conn_get_loggeduser(conn); + if (!nick) + nick = "UserName"; + + /* snprintf isn't portable -> check message length first */ + len = 1 + 12 + 1 + std::strlen(command) + 1 + std::strlen(nick) + 1 + std::strlen(text) + 2; + if (len > MAX_IRC_MESSAGE_LEN) { + eventlog(eventlog_level_error, __FUNCTION__, "message to send is too large (%u bytes)", len); + return -1; + } + else + std::sprintf(data, ":matchbot!u@h %s %s %s", command, nick, text); + + DEBUG2("[%d] sent \"%s\"", conn_get_socket(conn), data); + std::strcat(data, "\r\n"); + packet_set_size(p, 0); + packet_append_data(p, data, len); + conn_push_outqueue(conn, p); + packet_del_ref(p); + return 0; + } + + static int _get_pair(int * i, int * j, int max, bool different) + { + max++; /* We want to use just real maximum number - no metter what function do */ + + if (*i == -2) + *i = (max * rand() / (RAND_MAX + 1)); + + if (*j == -2) + *j = (max * rand() / (RAND_MAX + 1)); + + if ((different) && (*i == *j)) { + do { + *j = (max * rand() / (RAND_MAX + 1)); + } while (*i == *j); + } + return 0; + } + + + static int anongame_wol_trystart(t_anongame_wol_player const * player1) + { + t_elem * curr; + char temp[MAX_IRC_MESSAGE_LEN]; + char _temp[MAX_IRC_MESSAGE_LEN]; + int random; + + t_anongame_wol_player * player2; + t_connection * conn_pl1; + t_connection * conn_pl2; + char const * channelname; + const char * mapname; + t_clienttag ctag; + + std::memset(temp, 0, sizeof(temp)); + std::memset(_temp, 0, sizeof(_temp)); + + /** + * Expected start message is + * + * Red Alert 2: + * :Start [rand_num],0,0,[credits],0,1,[super_weapon],1,1,0,1,x,2,1,[mapsize_kilobytes],[mapname],1: + * [nick1_name],[nick1_country],[nick1_colour],[nick1_addr_hex],[nick1_nat],[nick1_prt_hex], + * [nick2_name],[nick2_country],[nick2_colour],[nick2_addr_hex],[nick2_nat],[nick2_prt_hex] + * + * Yuris Revenge Quick game: + * + * Yuris Revenge Quick Coop: + * + */ + + if (!player1) { + ERROR0("got NULL player"); + return -1; + } + + conn_pl1 = anongame_wol_player_get_conn(player1); + ctag = conn_get_clienttag(conn_pl1); + channelname = channel_get_name(conn_get_channel(conn_pl1)); + + LIST_TRAVERSE(anongame_wol_matchlist(), curr) { + player2 = (t_anongame_wol_player *)elem_get_data(curr); + conn_pl2 = anongame_wol_player_get_conn(player2); + + if ((player1 != player2) && ((conn_get_channel(conn_pl1)) == (conn_get_channel(conn_pl2)))) { + switch (ctag) { + case CLIENTTAG_REDALERT2_UINT: { + random = rand(); + + if (std::strcmp(channelname, RAL2_CHANNEL_FFA) == 0) { + int pl1_colour = anongame_wol_player_get_colour(player1); + int pl1_country = anongame_wol_player_get_country(player1); + int pl2_colour = anongame_wol_player_get_colour(player2); + int pl2_country = anongame_wol_player_get_country(player2); + + DEBUG0("Generating SOLO game for Red Alert 2"); + + _get_pair(&pl1_colour, &pl2_colour, 7, true); + _get_pair(&pl1_country, &pl2_country, 8, false); + mapname = anongame_get_map_from_prefs(ANONGAME_TYPE_1V1, ctag); + + /* We have madatory of game */ + snprintf(_temp, sizeof(_temp), ":Start %u,0,0,10000,0,1,0,1,1,0,1,x,2,1,165368,%s,1:", random, mapname); + std::strcat(temp, _temp); + + /* GameHost informations */ + snprintf(_temp, sizeof(_temp), "%s,%d,%d,%x,1,%x,", conn_get_chatname(conn_pl1), pl1_country, pl1_colour, anongame_wol_player_get_address(player1), anongame_wol_player_get_port(player1)); + std::strcat(temp, _temp); + + /* GameJoinie informations */ + snprintf(_temp, sizeof(_temp), "%s,%d,%d,%x,1,%x", conn_get_chatname(conn_pl2), pl2_country, pl2_colour, anongame_wol_player_get_address(player2), anongame_wol_player_get_port(player2)); + std::strcat(temp, _temp); + + _send_msg(conn_pl1, "PRIVMSG", temp); + _send_msg(conn_pl2, "PRIVMSG", temp); + } + else + ERROR1("undefined channel type for %s channel", channelname); + } + return 0; + case CLIENTTAG_YURISREV_UINT: { + random = rand(); + + if (std::strcmp(channelname, YURI_CHANNEL_FFA) == 0) { + int pl1_colour = anongame_wol_player_get_colour(player1); + int pl1_country = anongame_wol_player_get_country(player1); + int pl2_colour = anongame_wol_player_get_colour(player2); + int pl2_country = anongame_wol_player_get_country(player2); + + DEBUG0("Generating SOLO game for Yuri's Revenge"); + + _get_pair(&pl1_colour, &pl2_colour, 7, true); + _get_pair(&pl1_country, &pl2_country, 9, false); + mapname = anongame_get_map_from_prefs(ANONGAME_TYPE_1V1, ctag); + + /* We have madatory of game */ + snprintf(_temp, sizeof(_temp), ":Start %u,0,0,10000,0,0,1,1,1,0,3,0,x,2,1,163770,%s,1:", random, mapname); + std::strcat(temp, _temp); + + /* GameHost informations */ + snprintf(_temp, sizeof(_temp), "%s,%d,%d,-2,-2,", conn_get_chatname(conn_pl1), pl1_country, pl1_colour); + std::strcat(temp, _temp); + snprintf(_temp, sizeof(_temp), "%x,1,%x,", anongame_wol_player_get_address(player1), anongame_wol_player_get_port(player1)); + std::strcat(temp, _temp); + + /* GameJoinie informations */ + snprintf(_temp, sizeof(_temp), "%s,%d,%d,-2,-2,", conn_get_chatname(conn_pl2), pl2_country, pl2_colour); + std::strcat(temp, _temp); + snprintf(_temp, sizeof(_temp), "%x,1,%x", anongame_wol_player_get_address(player2), anongame_wol_player_get_port(player2)); + std::strcat(temp, _temp); + + _send_msg(conn_pl1, "PRIVMSG", temp); + _send_msg(conn_pl2, "PRIVMSG", temp); + } + else if (std::strcmp(channelname, YURI_CHANNEL_COOP) == 0) { + DEBUG0("Generating COOP game for Yuri's Revenge"); + + /* We have madatory of game */ + snprintf(_temp, sizeof(_temp), ":Start %u,0,0,10000,10,0,1,1,0,1,3,0,x,2,1,163770,C1A01MD.MAP,1:", random); + std::strcat(temp, _temp); + + /* GameHost informations */ + snprintf(_temp, sizeof(_temp), "%s,0,4,0,-2,", conn_get_chatname(conn_pl1)); + std::strcat(temp, _temp); + snprintf(_temp, sizeof(_temp), "%x,1,%x,", anongame_wol_player_get_address(player1), anongame_wol_player_get_port(player1)); + std::strcat(temp, _temp); + + /* GameJoinie informations */ + snprintf(_temp, sizeof(_temp), "%s,0,5,1,-2,", conn_get_chatname(anongame_wol_player_get_conn(player2))); + std::strcat(temp, _temp); + snprintf(_temp, sizeof(_temp), "%x,1,%x", anongame_wol_player_get_address(player2), anongame_wol_player_get_port(player2)); + std::strcat(temp, _temp); + + /* Some computers for coop games */ + snprintf(_temp, sizeof(_temp), ":@:0,-1,-1,-2,-2,0,-1,-1,-2,-2,1,8,1,-2,-2,1,8,2,-2,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"); + std::strcat(temp, _temp); + + _send_msg(conn_pl1, "PRIVMSG", temp); + _send_msg(conn_pl2, "PRIVMSG", temp); + } + else + ERROR1("undefined channel type for %s channel", channelname); + } + return 0; + default: + DEBUG0("unsupported client for WOL Matchgame"); + return 0; + } + } + } + + return 0; + } + + static int anongame_wol_tokenize_line(t_connection * conn, char const * text) + { + t_anongame_wol_player * player; + t_tag ctag; + char const * channelname; + char * command; /* Match, CINFO, SINFO, Pings */ + char * tag; /* ADR, COL, COU... */ + char * param; /* value of paramtag */ + char * line; /* Copy of text */ + char * temp; + char * p; + + if (!conn) { + ERROR0("got NULL conn"); + return -1; + } + + if (!text) { + ERROR0("got NULL text"); + return -1; + } + + if (!(player = anongame_wol_player_create(conn))) { + ERROR0("player was not created"); + return -1; + } + + /** + * Here are expected privmsgs: + * :user!EMPR@host PRIVMSG matchbot :Match COU=-1,COL=-1,SHA=-1,SHB=-1,LOC=2,RAT=0 + * :user!RAL2@host PRIVMSG matchbot :Match COU=-2, COL=-2, LOC=1, RAT=3, RES=640, ADR=202680512, NAT=1, PRT=1295 + * :user!RAL2@host PRIVMSG matchbot :Match COU=-2, COL=-2, LOC=1, RAT=3, RES=640, ADR=202680512, NAT=1, PRT=1340 + * :user!RAL2@host PRIVMSG matchbot :Match COU=-2, COL=-2, LOC=25, RAT=1, RES=640, ADR=-501962560, NAT=1, PRT=1320 + * :user!YURI@host PRIVMSG matchbot :Match COU=-2, COL=-2, MBR=1, LOC=5, RAT=2, RES=800, ADR=202680512, NAT=1, PRT=1390 + * :user!RNGD@host PRIVMSG matchbot :CINFO VER=1329937315 CPU=2981 MEM=1023 TPOINTS=0 PLAYED=0 PINGS=00FFFFFFFFFFFFFF + * :user!RNGD@host PRIVMSG matchbot :SINFO 4F453BA3DBAE41CB00000000000000002d# 9Dedicated Renegade Server-C&C_Field.mix07FF0656FFFF1C2D|090000000000 + * :user!YURI@host PRIVMSG matchbot :Pings nickname,2; + */ + + line = (char *)xmalloc(std::strlen(text) + 2); + strcpy(line, text); + + command = line; + if (!(temp = strchr(command, ' '))) { + WARN0("got malformed line (missing command)"); + xfree(line); + return -1; + } + *temp++ = '\0'; + + if ((std::strcmp(command, "Match") == 0)) { + strcat(temp, ","); /* FIXME: This is DUMB - without that we lost the last tag/param */ + + for (p = temp; *p && (*p != '\0'); p++) { + if ((*p == ',') || (*p == ' ')) { + *p++ = '\0'; + if (temp[0] == ' ') /* Pelish: Emperor sends line without spaces but RA2/Yuri do */ + *temp++; + tag = temp; + param = strchr(tag, '='); + if (param) + *param++ = '\0'; + if (anongame_wol_set_playersetting(player, tag, param) == -1) + WARN2("[** WOL **] got unknown tag %s param %s", tag, param); + temp = p; + } + } + _send_msg(conn, "PRIVMSG", ":Working"); + anongame_wol_trystart(player); + } + else { + DEBUG1("[** WOL **] got line /%s/", text); + } + + if (line) + xfree(line); + + return 0; + } + + /* Functions for getting/sending player informations */ + + extern int anongame_wol_destroy(t_connection * conn) + { + t_elem *curr; + + /* Player destroying */ + + LIST_TRAVERSE(anongame_wol_matchlist_head, curr) { + t_anongame_wol_player * player = (t_anongame_wol_player*)elem_get_data(curr); + + if (conn == anongame_wol_player_get_conn(player)) + anongame_wol_player_destroy(player, &curr); + } + + return 0; + } + + extern int anongame_wol_privmsg(t_connection * conn, int numparams, char ** params, char * text) + { + + if (!conn) { + ERROR0("got NULL conn"); + return -1; + } + + anongame_wol_tokenize_line(conn, text); + + return 0; + } + + } + +} diff --git a/pvpgn/src/bnetd/anongame_wol.h b/src/bnetd/anongame_wol.h similarity index 95% rename from pvpgn/src/bnetd/anongame_wol.h rename to src/bnetd/anongame_wol.h index ee4c210..3c01a53 100644 --- a/pvpgn/src/bnetd/anongame_wol.h +++ b/src/bnetd/anongame_wol.h @@ -1,97 +1,97 @@ -/* - * Copyright (C) 2008 Pelish (pelish@gmail.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef INCLUDED_ANONGAME_WOL_TYPES -#define INCLUDED_ANONGAME_WOL_TYPES - -#ifdef ANONGAME_WOL_INTERNAL_ACCESS - -#ifndef JUST_NEED_TYPES -# define JUST_NEED_TYPES -# include "connection.h" -# undef JUST_NEED_TYPES -#endif - -#define MATCHTAG_ADDRESS "ADR" -#define MATCHTAG_PORT "PRT" -#define MATCHTAG_COUNTRY "COU" -#define MATCHTAG_COLOUR "COL" -#define MATCHTAG_MATCHRESOLUTION "MBR" -#define MATCHTAG_LOCATION "LOC" -#define MATCHTAG_SCREENRESOLUTION "RES" - -#define RAL2_CHANNEL_FFA "Lob 38 0" -#define YURI_CHANNEL_FFA "Lob 40 0" -#define YURI_CHANNEL_COOP "Lob 39 0" - -#endif - -namespace pvpgn -{ - - namespace bnetd - { - - typedef struct anongame_wol_player -#ifdef ANONGAME_WOL_INTERNAL_ACCESS - { - t_connection * conn; - - /* Red Alert 2 and Yuri's Revnenge */ - int address; - int port; - int country; - int colour; - } -#endif - t_anongame_wol_player; - - } - -} - -#endif - -/*******/ -#ifndef JUST_NEED_TYPES -#ifndef INCLUDED_ANONGAME_WOL_PROTOS -#define INCLUDED_ANONGAME_WOL_PROTOS - -#define JUST_NEED_TYPES -# include "connection.h" -#undef JUST_NEED_TYPES - -namespace pvpgn -{ - - namespace bnetd - { - - extern int anongame_wol_matchlist_create(void); - extern int anongame_wol_matchlist_destroy(void); - - extern int anongame_wol_destroy(t_connection * conn); - extern int anongame_wol_privmsg(t_connection * conn, int numparams, char ** params, char * text); - - } - -} - -#endif -#endif - +/* + * Copyright (C) 2008 Pelish (pelish@gmail.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef INCLUDED_ANONGAME_WOL_TYPES +#define INCLUDED_ANONGAME_WOL_TYPES + +#ifdef ANONGAME_WOL_INTERNAL_ACCESS + +#ifndef JUST_NEED_TYPES +# define JUST_NEED_TYPES +# include "connection.h" +# undef JUST_NEED_TYPES +#endif + +#define MATCHTAG_ADDRESS "ADR" +#define MATCHTAG_PORT "PRT" +#define MATCHTAG_COUNTRY "COU" +#define MATCHTAG_COLOUR "COL" +#define MATCHTAG_MATCHRESOLUTION "MBR" +#define MATCHTAG_LOCATION "LOC" +#define MATCHTAG_SCREENRESOLUTION "RES" + +#define RAL2_CHANNEL_FFA "Lob 38 0" +#define YURI_CHANNEL_FFA "Lob 40 0" +#define YURI_CHANNEL_COOP "Lob 39 0" + +#endif + +namespace pvpgn +{ + + namespace bnetd + { + + typedef struct anongame_wol_player +#ifdef ANONGAME_WOL_INTERNAL_ACCESS + { + t_connection * conn; + + /* Red Alert 2 and Yuri's Revnenge */ + int address; + int port; + int country; + int colour; + } +#endif + t_anongame_wol_player; + + } + +} + +#endif + +/*******/ +#ifndef JUST_NEED_TYPES +#ifndef INCLUDED_ANONGAME_WOL_PROTOS +#define INCLUDED_ANONGAME_WOL_PROTOS + +#define JUST_NEED_TYPES +# include "connection.h" +#undef JUST_NEED_TYPES + +namespace pvpgn +{ + + namespace bnetd + { + + extern int anongame_wol_matchlist_create(void); + extern int anongame_wol_matchlist_destroy(void); + + extern int anongame_wol_destroy(t_connection * conn); + extern int anongame_wol_privmsg(t_connection * conn, int numparams, char ** params, char * text); + + } + +} + +#endif +#endif + diff --git a/pvpgn/src/bnetd/attr.h b/src/bnetd/attr.h similarity index 100% rename from pvpgn/src/bnetd/attr.h rename to src/bnetd/attr.h diff --git a/pvpgn/src/bnetd/attrgroup.cpp b/src/bnetd/attrgroup.cpp similarity index 100% rename from pvpgn/src/bnetd/attrgroup.cpp rename to src/bnetd/attrgroup.cpp diff --git a/pvpgn/src/bnetd/attrgroup.h b/src/bnetd/attrgroup.h similarity index 100% rename from pvpgn/src/bnetd/attrgroup.h rename to src/bnetd/attrgroup.h diff --git a/pvpgn/src/bnetd/attrlayer.cpp b/src/bnetd/attrlayer.cpp similarity index 100% rename from pvpgn/src/bnetd/attrlayer.cpp rename to src/bnetd/attrlayer.cpp diff --git a/pvpgn/src/bnetd/attrlayer.h b/src/bnetd/attrlayer.h similarity index 100% rename from pvpgn/src/bnetd/attrlayer.h rename to src/bnetd/attrlayer.h diff --git a/pvpgn/src/bnetd/autoupdate.cpp b/src/bnetd/autoupdate.cpp similarity index 100% rename from pvpgn/src/bnetd/autoupdate.cpp rename to src/bnetd/autoupdate.cpp diff --git a/pvpgn/src/bnetd/autoupdate.h b/src/bnetd/autoupdate.h similarity index 100% rename from pvpgn/src/bnetd/autoupdate.h rename to src/bnetd/autoupdate.h diff --git a/pvpgn/src/bnetd/channel.cpp b/src/bnetd/channel.cpp similarity index 100% rename from pvpgn/src/bnetd/channel.cpp rename to src/bnetd/channel.cpp diff --git a/pvpgn/src/bnetd/channel.h b/src/bnetd/channel.h similarity index 100% rename from pvpgn/src/bnetd/channel.h rename to src/bnetd/channel.h diff --git a/pvpgn/src/bnetd/channel_conv.cpp b/src/bnetd/channel_conv.cpp similarity index 100% rename from pvpgn/src/bnetd/channel_conv.cpp rename to src/bnetd/channel_conv.cpp diff --git a/pvpgn/src/bnetd/channel_conv.h b/src/bnetd/channel_conv.h similarity index 100% rename from pvpgn/src/bnetd/channel_conv.h rename to src/bnetd/channel_conv.h diff --git a/pvpgn/src/bnetd/character.cpp b/src/bnetd/character.cpp similarity index 100% rename from pvpgn/src/bnetd/character.cpp rename to src/bnetd/character.cpp diff --git a/pvpgn/src/bnetd/character.h b/src/bnetd/character.h similarity index 100% rename from pvpgn/src/bnetd/character.h rename to src/bnetd/character.h diff --git a/pvpgn/src/bnetd/clan.cpp b/src/bnetd/clan.cpp similarity index 100% rename from pvpgn/src/bnetd/clan.cpp rename to src/bnetd/clan.cpp diff --git a/pvpgn/src/bnetd/clan.h b/src/bnetd/clan.h similarity index 100% rename from pvpgn/src/bnetd/clan.h rename to src/bnetd/clan.h diff --git a/pvpgn/src/bnetd/cmdline.cpp b/src/bnetd/cmdline.cpp similarity index 100% rename from pvpgn/src/bnetd/cmdline.cpp rename to src/bnetd/cmdline.cpp diff --git a/pvpgn/src/bnetd/cmdline.h b/src/bnetd/cmdline.h similarity index 100% rename from pvpgn/src/bnetd/cmdline.h rename to src/bnetd/cmdline.h diff --git a/pvpgn/src/bnetd/command.cpp b/src/bnetd/command.cpp similarity index 100% rename from pvpgn/src/bnetd/command.cpp rename to src/bnetd/command.cpp diff --git a/pvpgn/src/bnetd/command.h b/src/bnetd/command.h similarity index 100% rename from pvpgn/src/bnetd/command.h rename to src/bnetd/command.h diff --git a/pvpgn/src/bnetd/command_groups.cpp b/src/bnetd/command_groups.cpp similarity index 100% rename from pvpgn/src/bnetd/command_groups.cpp rename to src/bnetd/command_groups.cpp diff --git a/pvpgn/src/bnetd/command_groups.h b/src/bnetd/command_groups.h similarity index 100% rename from pvpgn/src/bnetd/command_groups.h rename to src/bnetd/command_groups.h diff --git a/pvpgn/src/bnetd/connection.cpp b/src/bnetd/connection.cpp similarity index 100% rename from pvpgn/src/bnetd/connection.cpp rename to src/bnetd/connection.cpp diff --git a/pvpgn/src/bnetd/connection.h b/src/bnetd/connection.h similarity index 100% rename from pvpgn/src/bnetd/connection.h rename to src/bnetd/connection.h diff --git a/pvpgn/src/bnetd/file.cpp b/src/bnetd/file.cpp similarity index 100% rename from pvpgn/src/bnetd/file.cpp rename to src/bnetd/file.cpp diff --git a/pvpgn/src/bnetd/file.h b/src/bnetd/file.h similarity index 100% rename from pvpgn/src/bnetd/file.h rename to src/bnetd/file.h diff --git a/pvpgn/src/bnetd/file_cdb.cpp b/src/bnetd/file_cdb.cpp similarity index 100% rename from pvpgn/src/bnetd/file_cdb.cpp rename to src/bnetd/file_cdb.cpp diff --git a/pvpgn/src/bnetd/file_cdb.h b/src/bnetd/file_cdb.h similarity index 100% rename from pvpgn/src/bnetd/file_cdb.h rename to src/bnetd/file_cdb.h diff --git a/pvpgn/src/bnetd/file_plain.cpp b/src/bnetd/file_plain.cpp similarity index 100% rename from pvpgn/src/bnetd/file_plain.cpp rename to src/bnetd/file_plain.cpp diff --git a/pvpgn/src/bnetd/file_plain.h b/src/bnetd/file_plain.h similarity index 100% rename from pvpgn/src/bnetd/file_plain.h rename to src/bnetd/file_plain.h diff --git a/pvpgn/src/bnetd/friends.cpp b/src/bnetd/friends.cpp similarity index 100% rename from pvpgn/src/bnetd/friends.cpp rename to src/bnetd/friends.cpp diff --git a/pvpgn/src/bnetd/friends.h b/src/bnetd/friends.h similarity index 100% rename from pvpgn/src/bnetd/friends.h rename to src/bnetd/friends.h diff --git a/pvpgn/src/bnetd/game.cpp b/src/bnetd/game.cpp similarity index 100% rename from pvpgn/src/bnetd/game.cpp rename to src/bnetd/game.cpp diff --git a/pvpgn/src/bnetd/game.h b/src/bnetd/game.h similarity index 100% rename from pvpgn/src/bnetd/game.h rename to src/bnetd/game.h diff --git a/pvpgn/src/bnetd/game_conv.cpp b/src/bnetd/game_conv.cpp similarity index 100% rename from pvpgn/src/bnetd/game_conv.cpp rename to src/bnetd/game_conv.cpp diff --git a/pvpgn/src/bnetd/game_conv.h b/src/bnetd/game_conv.h similarity index 100% rename from pvpgn/src/bnetd/game_conv.h rename to src/bnetd/game_conv.h diff --git a/pvpgn/src/bnetd/handle_anongame.cpp b/src/bnetd/handle_anongame.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_anongame.cpp rename to src/bnetd/handle_anongame.cpp diff --git a/pvpgn/src/bnetd/handle_anongame.h b/src/bnetd/handle_anongame.h similarity index 100% rename from pvpgn/src/bnetd/handle_anongame.h rename to src/bnetd/handle_anongame.h diff --git a/pvpgn/src/bnetd/handle_apireg.cpp b/src/bnetd/handle_apireg.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_apireg.cpp rename to src/bnetd/handle_apireg.cpp diff --git a/pvpgn/src/bnetd/handle_apireg.h b/src/bnetd/handle_apireg.h similarity index 100% rename from pvpgn/src/bnetd/handle_apireg.h rename to src/bnetd/handle_apireg.h diff --git a/pvpgn/src/bnetd/handle_bnet.cpp b/src/bnetd/handle_bnet.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_bnet.cpp rename to src/bnetd/handle_bnet.cpp diff --git a/pvpgn/src/bnetd/handle_bnet.h b/src/bnetd/handle_bnet.h similarity index 100% rename from pvpgn/src/bnetd/handle_bnet.h rename to src/bnetd/handle_bnet.h diff --git a/pvpgn/src/bnetd/handle_bot.cpp b/src/bnetd/handle_bot.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_bot.cpp rename to src/bnetd/handle_bot.cpp diff --git a/pvpgn/src/bnetd/handle_bot.h b/src/bnetd/handle_bot.h similarity index 100% rename from pvpgn/src/bnetd/handle_bot.h rename to src/bnetd/handle_bot.h diff --git a/pvpgn/src/bnetd/handle_d2cs.cpp b/src/bnetd/handle_d2cs.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_d2cs.cpp rename to src/bnetd/handle_d2cs.cpp diff --git a/pvpgn/src/bnetd/handle_d2cs.h b/src/bnetd/handle_d2cs.h similarity index 100% rename from pvpgn/src/bnetd/handle_d2cs.h rename to src/bnetd/handle_d2cs.h diff --git a/pvpgn/src/bnetd/handle_file.cpp b/src/bnetd/handle_file.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_file.cpp rename to src/bnetd/handle_file.cpp diff --git a/pvpgn/src/bnetd/handle_file.h b/src/bnetd/handle_file.h similarity index 100% rename from pvpgn/src/bnetd/handle_file.h rename to src/bnetd/handle_file.h diff --git a/pvpgn/src/bnetd/handle_init.cpp b/src/bnetd/handle_init.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_init.cpp rename to src/bnetd/handle_init.cpp diff --git a/pvpgn/src/bnetd/handle_init.h b/src/bnetd/handle_init.h similarity index 100% rename from pvpgn/src/bnetd/handle_init.h rename to src/bnetd/handle_init.h diff --git a/pvpgn/src/bnetd/handle_irc.cpp b/src/bnetd/handle_irc.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_irc.cpp rename to src/bnetd/handle_irc.cpp diff --git a/pvpgn/src/bnetd/handle_irc.h b/src/bnetd/handle_irc.h similarity index 100% rename from pvpgn/src/bnetd/handle_irc.h rename to src/bnetd/handle_irc.h diff --git a/pvpgn/src/bnetd/handle_irc_common.cpp b/src/bnetd/handle_irc_common.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_irc_common.cpp rename to src/bnetd/handle_irc_common.cpp diff --git a/pvpgn/src/bnetd/handle_irc_common.h b/src/bnetd/handle_irc_common.h similarity index 100% rename from pvpgn/src/bnetd/handle_irc_common.h rename to src/bnetd/handle_irc_common.h diff --git a/pvpgn/src/bnetd/handle_telnet.cpp b/src/bnetd/handle_telnet.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_telnet.cpp rename to src/bnetd/handle_telnet.cpp diff --git a/pvpgn/src/bnetd/handle_telnet.h b/src/bnetd/handle_telnet.h similarity index 100% rename from pvpgn/src/bnetd/handle_telnet.h rename to src/bnetd/handle_telnet.h diff --git a/pvpgn/src/bnetd/handle_udp.cpp b/src/bnetd/handle_udp.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_udp.cpp rename to src/bnetd/handle_udp.cpp diff --git a/pvpgn/src/bnetd/handle_udp.h b/src/bnetd/handle_udp.h similarity index 100% rename from pvpgn/src/bnetd/handle_udp.h rename to src/bnetd/handle_udp.h diff --git a/pvpgn/src/bnetd/handle_wol.cpp b/src/bnetd/handle_wol.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_wol.cpp rename to src/bnetd/handle_wol.cpp diff --git a/pvpgn/src/bnetd/handle_wol.h b/src/bnetd/handle_wol.h similarity index 100% rename from pvpgn/src/bnetd/handle_wol.h rename to src/bnetd/handle_wol.h diff --git a/pvpgn/src/bnetd/handle_wol_gameres.cpp b/src/bnetd/handle_wol_gameres.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_wol_gameres.cpp rename to src/bnetd/handle_wol_gameres.cpp diff --git a/pvpgn/src/bnetd/handle_wol_gameres.h b/src/bnetd/handle_wol_gameres.h similarity index 100% rename from pvpgn/src/bnetd/handle_wol_gameres.h rename to src/bnetd/handle_wol_gameres.h diff --git a/pvpgn/src/bnetd/handle_wserv.cpp b/src/bnetd/handle_wserv.cpp similarity index 100% rename from pvpgn/src/bnetd/handle_wserv.cpp rename to src/bnetd/handle_wserv.cpp diff --git a/pvpgn/src/bnetd/handle_wserv.h b/src/bnetd/handle_wserv.h similarity index 100% rename from pvpgn/src/bnetd/handle_wserv.h rename to src/bnetd/handle_wserv.h diff --git a/pvpgn/src/bnetd/handlers.h b/src/bnetd/handlers.h similarity index 100% rename from pvpgn/src/bnetd/handlers.h rename to src/bnetd/handlers.h diff --git a/pvpgn/src/bnetd/helpfile.cpp b/src/bnetd/helpfile.cpp similarity index 100% rename from pvpgn/src/bnetd/helpfile.cpp rename to src/bnetd/helpfile.cpp diff --git a/pvpgn/src/bnetd/helpfile.h b/src/bnetd/helpfile.h similarity index 100% rename from pvpgn/src/bnetd/helpfile.h rename to src/bnetd/helpfile.h diff --git a/pvpgn/src/bnetd/ipban.cpp b/src/bnetd/ipban.cpp similarity index 100% rename from pvpgn/src/bnetd/ipban.cpp rename to src/bnetd/ipban.cpp diff --git a/pvpgn/src/bnetd/ipban.h b/src/bnetd/ipban.h similarity index 100% rename from pvpgn/src/bnetd/ipban.h rename to src/bnetd/ipban.h diff --git a/pvpgn/src/bnetd/irc.cpp b/src/bnetd/irc.cpp similarity index 100% rename from pvpgn/src/bnetd/irc.cpp rename to src/bnetd/irc.cpp diff --git a/pvpgn/src/bnetd/irc.h b/src/bnetd/irc.h similarity index 100% rename from pvpgn/src/bnetd/irc.h rename to src/bnetd/irc.h diff --git a/pvpgn/src/bnetd/ladder.cpp b/src/bnetd/ladder.cpp similarity index 100% rename from pvpgn/src/bnetd/ladder.cpp rename to src/bnetd/ladder.cpp diff --git a/pvpgn/src/bnetd/ladder.h b/src/bnetd/ladder.h similarity index 100% rename from pvpgn/src/bnetd/ladder.h rename to src/bnetd/ladder.h diff --git a/pvpgn/src/bnetd/ladder_calc.cpp b/src/bnetd/ladder_calc.cpp similarity index 100% rename from pvpgn/src/bnetd/ladder_calc.cpp rename to src/bnetd/ladder_calc.cpp diff --git a/pvpgn/src/bnetd/ladder_calc.h b/src/bnetd/ladder_calc.h similarity index 100% rename from pvpgn/src/bnetd/ladder_calc.h rename to src/bnetd/ladder_calc.h diff --git a/pvpgn/src/bnetd/mail.cpp b/src/bnetd/mail.cpp similarity index 100% rename from pvpgn/src/bnetd/mail.cpp rename to src/bnetd/mail.cpp diff --git a/pvpgn/src/bnetd/mail.h b/src/bnetd/mail.h similarity index 100% rename from pvpgn/src/bnetd/mail.h rename to src/bnetd/mail.h diff --git a/pvpgn/src/bnetd/main.cpp b/src/bnetd/main.cpp similarity index 100% rename from pvpgn/src/bnetd/main.cpp rename to src/bnetd/main.cpp diff --git a/pvpgn/src/bnetd/message.cpp b/src/bnetd/message.cpp similarity index 100% rename from pvpgn/src/bnetd/message.cpp rename to src/bnetd/message.cpp diff --git a/pvpgn/src/bnetd/message.h b/src/bnetd/message.h similarity index 100% rename from pvpgn/src/bnetd/message.h rename to src/bnetd/message.h diff --git a/pvpgn/src/bnetd/news.cpp b/src/bnetd/news.cpp similarity index 100% rename from pvpgn/src/bnetd/news.cpp rename to src/bnetd/news.cpp diff --git a/pvpgn/src/bnetd/news.h b/src/bnetd/news.h similarity index 100% rename from pvpgn/src/bnetd/news.h rename to src/bnetd/news.h diff --git a/pvpgn/src/bnetd/output.cpp b/src/bnetd/output.cpp similarity index 100% rename from pvpgn/src/bnetd/output.cpp rename to src/bnetd/output.cpp diff --git a/pvpgn/src/bnetd/output.h b/src/bnetd/output.h similarity index 100% rename from pvpgn/src/bnetd/output.h rename to src/bnetd/output.h diff --git a/pvpgn/src/bnetd/prefs.cpp b/src/bnetd/prefs.cpp similarity index 100% rename from pvpgn/src/bnetd/prefs.cpp rename to src/bnetd/prefs.cpp diff --git a/pvpgn/src/bnetd/prefs.h b/src/bnetd/prefs.h similarity index 100% rename from pvpgn/src/bnetd/prefs.h rename to src/bnetd/prefs.h diff --git a/pvpgn/src/bnetd/quota.h b/src/bnetd/quota.h similarity index 100% rename from pvpgn/src/bnetd/quota.h rename to src/bnetd/quota.h diff --git a/pvpgn/src/bnetd/realm.cpp b/src/bnetd/realm.cpp similarity index 100% rename from pvpgn/src/bnetd/realm.cpp rename to src/bnetd/realm.cpp diff --git a/pvpgn/src/bnetd/realm.h b/src/bnetd/realm.h similarity index 100% rename from pvpgn/src/bnetd/realm.h rename to src/bnetd/realm.h diff --git a/pvpgn/src/bnetd/runprog.cpp b/src/bnetd/runprog.cpp similarity index 100% rename from pvpgn/src/bnetd/runprog.cpp rename to src/bnetd/runprog.cpp diff --git a/pvpgn/src/bnetd/runprog.h b/src/bnetd/runprog.h similarity index 100% rename from pvpgn/src/bnetd/runprog.h rename to src/bnetd/runprog.h diff --git a/pvpgn/src/bnetd/server.cpp b/src/bnetd/server.cpp similarity index 100% rename from pvpgn/src/bnetd/server.cpp rename to src/bnetd/server.cpp diff --git a/pvpgn/src/bnetd/server.h b/src/bnetd/server.h similarity index 100% rename from pvpgn/src/bnetd/server.h rename to src/bnetd/server.h diff --git a/pvpgn/src/bnetd/sql_common.cpp b/src/bnetd/sql_common.cpp similarity index 100% rename from pvpgn/src/bnetd/sql_common.cpp rename to src/bnetd/sql_common.cpp diff --git a/pvpgn/src/bnetd/sql_common.h b/src/bnetd/sql_common.h similarity index 100% rename from pvpgn/src/bnetd/sql_common.h rename to src/bnetd/sql_common.h diff --git a/pvpgn/src/bnetd/sql_dbcreator.cpp b/src/bnetd/sql_dbcreator.cpp similarity index 100% rename from pvpgn/src/bnetd/sql_dbcreator.cpp rename to src/bnetd/sql_dbcreator.cpp diff --git a/pvpgn/src/bnetd/sql_dbcreator.h b/src/bnetd/sql_dbcreator.h similarity index 100% rename from pvpgn/src/bnetd/sql_dbcreator.h rename to src/bnetd/sql_dbcreator.h diff --git a/pvpgn/src/bnetd/sql_mysql.cpp b/src/bnetd/sql_mysql.cpp similarity index 99% rename from pvpgn/src/bnetd/sql_mysql.cpp rename to src/bnetd/sql_mysql.cpp index ab228d4..52ad282 100644 --- a/pvpgn/src/bnetd/sql_mysql.cpp +++ b/src/bnetd/sql_mysql.cpp @@ -190,7 +190,7 @@ namespace pvpgn #if MYSQL_VERSION_ID >= 50013 #if MYSQL_VERSION_ID < 50019 - my_bool my_true = true; + my_bool my_true = true; if (mysql_options(mysql, MYSQL_OPT_RECONNECT, &my_true)){ eventlog(eventlog_level_warn, __FUNCTION__, "Failed to turn on MYSQL_OPT_RECONNECT."); } diff --git a/pvpgn/src/bnetd/sql_mysql.h b/src/bnetd/sql_mysql.h similarity index 100% rename from pvpgn/src/bnetd/sql_mysql.h rename to src/bnetd/sql_mysql.h diff --git a/pvpgn/src/bnetd/sql_odbc.cpp b/src/bnetd/sql_odbc.cpp similarity index 100% rename from pvpgn/src/bnetd/sql_odbc.cpp rename to src/bnetd/sql_odbc.cpp diff --git a/pvpgn/src/bnetd/sql_odbc.h b/src/bnetd/sql_odbc.h similarity index 100% rename from pvpgn/src/bnetd/sql_odbc.h rename to src/bnetd/sql_odbc.h diff --git a/pvpgn/src/bnetd/sql_pgsql.cpp b/src/bnetd/sql_pgsql.cpp similarity index 100% rename from pvpgn/src/bnetd/sql_pgsql.cpp rename to src/bnetd/sql_pgsql.cpp diff --git a/pvpgn/src/bnetd/sql_pgsql.h b/src/bnetd/sql_pgsql.h similarity index 100% rename from pvpgn/src/bnetd/sql_pgsql.h rename to src/bnetd/sql_pgsql.h diff --git a/pvpgn/src/bnetd/sql_sqlite3.cpp b/src/bnetd/sql_sqlite3.cpp similarity index 100% rename from pvpgn/src/bnetd/sql_sqlite3.cpp rename to src/bnetd/sql_sqlite3.cpp diff --git a/pvpgn/src/bnetd/sql_sqlite3.h b/src/bnetd/sql_sqlite3.h similarity index 100% rename from pvpgn/src/bnetd/sql_sqlite3.h rename to src/bnetd/sql_sqlite3.h diff --git a/pvpgn/src/bnetd/storage.cpp b/src/bnetd/storage.cpp similarity index 100% rename from pvpgn/src/bnetd/storage.cpp rename to src/bnetd/storage.cpp diff --git a/pvpgn/src/bnetd/storage.h b/src/bnetd/storage.h similarity index 100% rename from pvpgn/src/bnetd/storage.h rename to src/bnetd/storage.h diff --git a/pvpgn/src/bnetd/storage_file.cpp b/src/bnetd/storage_file.cpp similarity index 100% rename from pvpgn/src/bnetd/storage_file.cpp rename to src/bnetd/storage_file.cpp diff --git a/pvpgn/src/bnetd/storage_file.h b/src/bnetd/storage_file.h similarity index 100% rename from pvpgn/src/bnetd/storage_file.h rename to src/bnetd/storage_file.h diff --git a/pvpgn/src/bnetd/storage_sql.cpp b/src/bnetd/storage_sql.cpp similarity index 100% rename from pvpgn/src/bnetd/storage_sql.cpp rename to src/bnetd/storage_sql.cpp diff --git a/pvpgn/src/bnetd/storage_sql.h b/src/bnetd/storage_sql.h similarity index 100% rename from pvpgn/src/bnetd/storage_sql.h rename to src/bnetd/storage_sql.h diff --git a/pvpgn/src/bnetd/storage_sql2.cpp b/src/bnetd/storage_sql2.cpp similarity index 100% rename from pvpgn/src/bnetd/storage_sql2.cpp rename to src/bnetd/storage_sql2.cpp diff --git a/pvpgn/src/bnetd/storage_sql2.h b/src/bnetd/storage_sql2.h similarity index 100% rename from pvpgn/src/bnetd/storage_sql2.h rename to src/bnetd/storage_sql2.h diff --git a/pvpgn/src/bnetd/support.cpp b/src/bnetd/support.cpp similarity index 100% rename from pvpgn/src/bnetd/support.cpp rename to src/bnetd/support.cpp diff --git a/pvpgn/src/bnetd/support.h b/src/bnetd/support.h similarity index 100% rename from pvpgn/src/bnetd/support.h rename to src/bnetd/support.h diff --git a/pvpgn/src/bnetd/team.cpp b/src/bnetd/team.cpp similarity index 100% rename from pvpgn/src/bnetd/team.cpp rename to src/bnetd/team.cpp diff --git a/pvpgn/src/bnetd/team.h b/src/bnetd/team.h similarity index 100% rename from pvpgn/src/bnetd/team.h rename to src/bnetd/team.h diff --git a/pvpgn/src/bnetd/tick.cpp b/src/bnetd/tick.cpp similarity index 100% rename from pvpgn/src/bnetd/tick.cpp rename to src/bnetd/tick.cpp diff --git a/pvpgn/src/bnetd/tick.h b/src/bnetd/tick.h similarity index 100% rename from pvpgn/src/bnetd/tick.h rename to src/bnetd/tick.h diff --git a/pvpgn/src/bnetd/timer.cpp b/src/bnetd/timer.cpp similarity index 100% rename from pvpgn/src/bnetd/timer.cpp rename to src/bnetd/timer.cpp diff --git a/pvpgn/src/bnetd/timer.h b/src/bnetd/timer.h similarity index 100% rename from pvpgn/src/bnetd/timer.h rename to src/bnetd/timer.h diff --git a/pvpgn/src/bnetd/topic.cpp b/src/bnetd/topic.cpp similarity index 100% rename from pvpgn/src/bnetd/topic.cpp rename to src/bnetd/topic.cpp diff --git a/pvpgn/src/bnetd/topic.h b/src/bnetd/topic.h similarity index 100% rename from pvpgn/src/bnetd/topic.h rename to src/bnetd/topic.h diff --git a/pvpgn/src/bnetd/tournament.cpp b/src/bnetd/tournament.cpp similarity index 100% rename from pvpgn/src/bnetd/tournament.cpp rename to src/bnetd/tournament.cpp diff --git a/pvpgn/src/bnetd/tournament.h b/src/bnetd/tournament.h similarity index 100% rename from pvpgn/src/bnetd/tournament.h rename to src/bnetd/tournament.h diff --git a/pvpgn/src/bnetd/tracker.cpp b/src/bnetd/tracker.cpp similarity index 100% rename from pvpgn/src/bnetd/tracker.cpp rename to src/bnetd/tracker.cpp diff --git a/pvpgn/src/bnetd/tracker.h b/src/bnetd/tracker.h similarity index 100% rename from pvpgn/src/bnetd/tracker.h rename to src/bnetd/tracker.h diff --git a/pvpgn/src/bnetd/udptest_send.cpp b/src/bnetd/udptest_send.cpp similarity index 100% rename from pvpgn/src/bnetd/udptest_send.cpp rename to src/bnetd/udptest_send.cpp diff --git a/pvpgn/src/bnetd/udptest_send.h b/src/bnetd/udptest_send.h similarity index 100% rename from pvpgn/src/bnetd/udptest_send.h rename to src/bnetd/udptest_send.h diff --git a/pvpgn/src/bnetd/versioncheck.cpp b/src/bnetd/versioncheck.cpp similarity index 100% rename from pvpgn/src/bnetd/versioncheck.cpp rename to src/bnetd/versioncheck.cpp diff --git a/pvpgn/src/bnetd/versioncheck.h b/src/bnetd/versioncheck.h similarity index 100% rename from pvpgn/src/bnetd/versioncheck.h rename to src/bnetd/versioncheck.h diff --git a/pvpgn/src/bnetd/watch.cpp b/src/bnetd/watch.cpp similarity index 100% rename from pvpgn/src/bnetd/watch.cpp rename to src/bnetd/watch.cpp diff --git a/pvpgn/src/bnetd/watch.h b/src/bnetd/watch.h similarity index 100% rename from pvpgn/src/bnetd/watch.h rename to src/bnetd/watch.h diff --git a/pvpgn/src/bniutils/CMakeLists.txt b/src/bniutils/CMakeLists.txt similarity index 100% rename from pvpgn/src/bniutils/CMakeLists.txt rename to src/bniutils/CMakeLists.txt diff --git a/pvpgn/src/bniutils/Makefile.am b/src/bniutils/Makefile.am similarity index 100% rename from pvpgn/src/bniutils/Makefile.am rename to src/bniutils/Makefile.am diff --git a/pvpgn/src/bniutils/bni.cpp b/src/bniutils/bni.cpp similarity index 100% rename from pvpgn/src/bniutils/bni.cpp rename to src/bniutils/bni.cpp diff --git a/pvpgn/src/bniutils/bni.h b/src/bniutils/bni.h similarity index 100% rename from pvpgn/src/bniutils/bni.h rename to src/bniutils/bni.h diff --git a/pvpgn/src/bniutils/bni2tga.cpp b/src/bniutils/bni2tga.cpp similarity index 100% rename from pvpgn/src/bniutils/bni2tga.cpp rename to src/bniutils/bni2tga.cpp diff --git a/pvpgn/src/bniutils/bnibuild.cpp b/src/bniutils/bnibuild.cpp similarity index 100% rename from pvpgn/src/bniutils/bnibuild.cpp rename to src/bniutils/bnibuild.cpp diff --git a/pvpgn/src/bniutils/bniextract.cpp b/src/bniutils/bniextract.cpp similarity index 100% rename from pvpgn/src/bniutils/bniextract.cpp rename to src/bniutils/bniextract.cpp diff --git a/pvpgn/src/bniutils/bnilist.cpp b/src/bniutils/bnilist.cpp similarity index 100% rename from pvpgn/src/bniutils/bnilist.cpp rename to src/bniutils/bnilist.cpp diff --git a/pvpgn/src/bniutils/fileio.cpp b/src/bniutils/fileio.cpp similarity index 100% rename from pvpgn/src/bniutils/fileio.cpp rename to src/bniutils/fileio.cpp diff --git a/pvpgn/src/bniutils/fileio.h b/src/bniutils/fileio.h similarity index 100% rename from pvpgn/src/bniutils/fileio.h rename to src/bniutils/fileio.h diff --git a/pvpgn/src/bniutils/tga.cpp b/src/bniutils/tga.cpp similarity index 100% rename from pvpgn/src/bniutils/tga.cpp rename to src/bniutils/tga.cpp diff --git a/pvpgn/src/bniutils/tga.h b/src/bniutils/tga.h similarity index 100% rename from pvpgn/src/bniutils/tga.h rename to src/bniutils/tga.h diff --git a/pvpgn/src/bniutils/tgainfo.cpp b/src/bniutils/tgainfo.cpp similarity index 100% rename from pvpgn/src/bniutils/tgainfo.cpp rename to src/bniutils/tgainfo.cpp diff --git a/pvpgn/src/bnpass/CMakeLists.txt b/src/bnpass/CMakeLists.txt similarity index 100% rename from pvpgn/src/bnpass/CMakeLists.txt rename to src/bnpass/CMakeLists.txt diff --git a/pvpgn/src/bnpass/Makefile.am b/src/bnpass/Makefile.am similarity index 100% rename from pvpgn/src/bnpass/Makefile.am rename to src/bnpass/Makefile.am diff --git a/pvpgn/src/bnpass/bnpass.cpp b/src/bnpass/bnpass.cpp similarity index 100% rename from pvpgn/src/bnpass/bnpass.cpp rename to src/bnpass/bnpass.cpp diff --git a/pvpgn/src/bnpass/sha1hash.cpp b/src/bnpass/sha1hash.cpp similarity index 100% rename from pvpgn/src/bnpass/sha1hash.cpp rename to src/bnpass/sha1hash.cpp diff --git a/pvpgn/src/bnpcap/CMakeLists.txt b/src/bnpcap/CMakeLists.txt similarity index 100% rename from pvpgn/src/bnpcap/CMakeLists.txt rename to src/bnpcap/CMakeLists.txt diff --git a/pvpgn/src/bnpcap/Makefile.am b/src/bnpcap/Makefile.am similarity index 100% rename from pvpgn/src/bnpcap/Makefile.am rename to src/bnpcap/Makefile.am diff --git a/pvpgn/src/bnpcap/bnpcap.cpp b/src/bnpcap/bnpcap.cpp similarity index 100% rename from pvpgn/src/bnpcap/bnpcap.cpp rename to src/bnpcap/bnpcap.cpp diff --git a/pvpgn/src/bnproxy/bnproxy.c b/src/bnproxy/bnproxy.c similarity index 100% rename from pvpgn/src/bnproxy/bnproxy.c rename to src/bnproxy/bnproxy.c diff --git a/pvpgn/src/bnproxy/virtconn.c b/src/bnproxy/virtconn.c similarity index 100% rename from pvpgn/src/bnproxy/virtconn.c rename to src/bnproxy/virtconn.c diff --git a/pvpgn/src/bnproxy/virtconn.h b/src/bnproxy/virtconn.h similarity index 100% rename from pvpgn/src/bnproxy/virtconn.h rename to src/bnproxy/virtconn.h diff --git a/pvpgn/src/bntrackd/CMakeLists.txt b/src/bntrackd/CMakeLists.txt similarity index 100% rename from pvpgn/src/bntrackd/CMakeLists.txt rename to src/bntrackd/CMakeLists.txt diff --git a/pvpgn/src/bntrackd/Makefile.am b/src/bntrackd/Makefile.am similarity index 100% rename from pvpgn/src/bntrackd/Makefile.am rename to src/bntrackd/Makefile.am diff --git a/pvpgn/src/bntrackd/bntrackd.cpp b/src/bntrackd/bntrackd.cpp similarity index 100% rename from pvpgn/src/bntrackd/bntrackd.cpp rename to src/bntrackd/bntrackd.cpp diff --git a/pvpgn/src/bntrackd/servers.xsl b/src/bntrackd/servers.xsl similarity index 100% rename from pvpgn/src/bntrackd/servers.xsl rename to src/bntrackd/servers.xsl diff --git a/pvpgn/src/client/CMakeLists.txt b/src/client/CMakeLists.txt similarity index 100% rename from pvpgn/src/client/CMakeLists.txt rename to src/client/CMakeLists.txt diff --git a/pvpgn/src/client/Makefile.am b/src/client/Makefile.am similarity index 100% rename from pvpgn/src/client/Makefile.am rename to src/client/Makefile.am diff --git a/pvpgn/src/client/ansi_term.h b/src/client/ansi_term.h similarity index 100% rename from pvpgn/src/client/ansi_term.h rename to src/client/ansi_term.h diff --git a/pvpgn/src/client/bnbot.cpp b/src/client/bnbot.cpp similarity index 100% rename from pvpgn/src/client/bnbot.cpp rename to src/client/bnbot.cpp diff --git a/pvpgn/src/client/bnchat.cpp b/src/client/bnchat.cpp similarity index 100% rename from pvpgn/src/client/bnchat.cpp rename to src/client/bnchat.cpp diff --git a/pvpgn/src/client/bnftp.cpp b/src/client/bnftp.cpp similarity index 100% rename from pvpgn/src/client/bnftp.cpp rename to src/client/bnftp.cpp diff --git a/pvpgn/src/client/bnstat.cpp b/src/client/bnstat.cpp similarity index 100% rename from pvpgn/src/client/bnstat.cpp rename to src/client/bnstat.cpp diff --git a/pvpgn/src/client/client.cpp b/src/client/client.cpp similarity index 100% rename from pvpgn/src/client/client.cpp rename to src/client/client.cpp diff --git a/pvpgn/src/client/client.h b/src/client/client.h similarity index 100% rename from pvpgn/src/client/client.h rename to src/client/client.h diff --git a/pvpgn/src/client/client_connect.cpp b/src/client/client_connect.cpp similarity index 100% rename from pvpgn/src/client/client_connect.cpp rename to src/client/client_connect.cpp diff --git a/pvpgn/src/client/client_connect.h b/src/client/client_connect.h similarity index 100% rename from pvpgn/src/client/client_connect.h rename to src/client/client_connect.h diff --git a/pvpgn/src/client/udptest.cpp b/src/client/udptest.cpp similarity index 100% rename from pvpgn/src/client/udptest.cpp rename to src/client/udptest.cpp diff --git a/pvpgn/src/client/udptest.h b/src/client/udptest.h similarity index 100% rename from pvpgn/src/client/udptest.h rename to src/client/udptest.h diff --git a/pvpgn/src/common/CMakeLists.txt b/src/common/CMakeLists.txt similarity index 100% rename from pvpgn/src/common/CMakeLists.txt rename to src/common/CMakeLists.txt diff --git a/pvpgn/src/common/Makefile.am b/src/common/Makefile.am similarity index 100% rename from pvpgn/src/common/Makefile.am rename to src/common/Makefile.am diff --git a/pvpgn/src/common/addr.cpp b/src/common/addr.cpp similarity index 100% rename from pvpgn/src/common/addr.cpp rename to src/common/addr.cpp diff --git a/pvpgn/src/common/addr.h b/src/common/addr.h similarity index 100% rename from pvpgn/src/common/addr.h rename to src/common/addr.h diff --git a/pvpgn/src/common/anongame_protocol.h b/src/common/anongame_protocol.h similarity index 100% rename from pvpgn/src/common/anongame_protocol.h rename to src/common/anongame_protocol.h diff --git a/pvpgn/src/common/asnprintf.cpp b/src/common/asnprintf.cpp similarity index 100% rename from pvpgn/src/common/asnprintf.cpp rename to src/common/asnprintf.cpp diff --git a/pvpgn/src/common/asnprintf.h b/src/common/asnprintf.h similarity index 100% rename from pvpgn/src/common/asnprintf.h rename to src/common/asnprintf.h diff --git a/pvpgn/src/common/bigint.cpp b/src/common/bigint.cpp similarity index 100% rename from pvpgn/src/common/bigint.cpp rename to src/common/bigint.cpp diff --git a/pvpgn/src/common/bigint.h b/src/common/bigint.h similarity index 100% rename from pvpgn/src/common/bigint.h rename to src/common/bigint.h diff --git a/pvpgn/src/common/bn_type.cpp b/src/common/bn_type.cpp similarity index 100% rename from pvpgn/src/common/bn_type.cpp rename to src/common/bn_type.cpp diff --git a/pvpgn/src/common/bn_type.h b/src/common/bn_type.h similarity index 100% rename from pvpgn/src/common/bn_type.h rename to src/common/bn_type.h diff --git a/pvpgn/src/common/bnet_protocol.h b/src/common/bnet_protocol.h similarity index 100% rename from pvpgn/src/common/bnet_protocol.h rename to src/common/bnet_protocol.h diff --git a/pvpgn/src/common/bnethash.cpp b/src/common/bnethash.cpp similarity index 100% rename from pvpgn/src/common/bnethash.cpp rename to src/common/bnethash.cpp diff --git a/pvpgn/src/common/bnethash.h b/src/common/bnethash.h similarity index 100% rename from pvpgn/src/common/bnethash.h rename to src/common/bnethash.h diff --git a/pvpgn/src/common/bnethashconv.cpp b/src/common/bnethashconv.cpp similarity index 100% rename from pvpgn/src/common/bnethashconv.cpp rename to src/common/bnethashconv.cpp diff --git a/pvpgn/src/common/bnethashconv.h b/src/common/bnethashconv.h similarity index 100% rename from pvpgn/src/common/bnethashconv.h rename to src/common/bnethashconv.h diff --git a/pvpgn/src/common/bnetsrp3.cpp b/src/common/bnetsrp3.cpp similarity index 100% rename from pvpgn/src/common/bnetsrp3.cpp rename to src/common/bnetsrp3.cpp diff --git a/pvpgn/src/common/bnetsrp3.h b/src/common/bnetsrp3.h similarity index 100% rename from pvpgn/src/common/bnetsrp3.h rename to src/common/bnetsrp3.h diff --git a/pvpgn/src/common/bnettime.cpp b/src/common/bnettime.cpp similarity index 100% rename from pvpgn/src/common/bnettime.cpp rename to src/common/bnettime.cpp diff --git a/pvpgn/src/common/bnettime.h b/src/common/bnettime.h similarity index 100% rename from pvpgn/src/common/bnettime.h rename to src/common/bnettime.h diff --git a/pvpgn/src/common/bot_protocol.h b/src/common/bot_protocol.h similarity index 100% rename from pvpgn/src/common/bot_protocol.h rename to src/common/bot_protocol.h diff --git a/pvpgn/src/common/cdbhash.h b/src/common/cdbhash.h similarity index 100% rename from pvpgn/src/common/cdbhash.h rename to src/common/cdbhash.h diff --git a/pvpgn/src/common/conf.cpp b/src/common/conf.cpp similarity index 100% rename from pvpgn/src/common/conf.cpp rename to src/common/conf.cpp diff --git a/pvpgn/src/common/conf.h b/src/common/conf.h similarity index 100% rename from pvpgn/src/common/conf.h rename to src/common/conf.h diff --git a/pvpgn/src/common/d2char_checksum.cpp b/src/common/d2char_checksum.cpp similarity index 100% rename from pvpgn/src/common/d2char_checksum.cpp rename to src/common/d2char_checksum.cpp diff --git a/pvpgn/src/common/d2char_checksum.h b/src/common/d2char_checksum.h similarity index 100% rename from pvpgn/src/common/d2char_checksum.h rename to src/common/d2char_checksum.h diff --git a/pvpgn/src/common/d2char_file.h b/src/common/d2char_file.h similarity index 100% rename from pvpgn/src/common/d2char_file.h rename to src/common/d2char_file.h diff --git a/pvpgn/src/common/d2cs_bnetd_protocol.h b/src/common/d2cs_bnetd_protocol.h similarity index 100% rename from pvpgn/src/common/d2cs_bnetd_protocol.h rename to src/common/d2cs_bnetd_protocol.h diff --git a/pvpgn/src/common/d2cs_d2dbs_ladder.h b/src/common/d2cs_d2dbs_ladder.h similarity index 100% rename from pvpgn/src/common/d2cs_d2dbs_ladder.h rename to src/common/d2cs_d2dbs_ladder.h diff --git a/pvpgn/src/common/d2cs_d2gs_character.h b/src/common/d2cs_d2gs_character.h similarity index 100% rename from pvpgn/src/common/d2cs_d2gs_character.h rename to src/common/d2cs_d2gs_character.h diff --git a/pvpgn/src/common/d2cs_d2gs_protocol.h b/src/common/d2cs_d2gs_protocol.h similarity index 100% rename from pvpgn/src/common/d2cs_d2gs_protocol.h rename to src/common/d2cs_d2gs_protocol.h diff --git a/pvpgn/src/common/d2cs_protocol.h b/src/common/d2cs_protocol.h similarity index 100% rename from pvpgn/src/common/d2cs_protocol.h rename to src/common/d2cs_protocol.h diff --git a/pvpgn/src/common/d2game_protocol.h b/src/common/d2game_protocol.h similarity index 100% rename from pvpgn/src/common/d2game_protocol.h rename to src/common/d2game_protocol.h diff --git a/pvpgn/src/common/elist.h b/src/common/elist.h similarity index 100% rename from pvpgn/src/common/elist.h rename to src/common/elist.h diff --git a/pvpgn/src/common/eventlog.cpp b/src/common/eventlog.cpp similarity index 100% rename from pvpgn/src/common/eventlog.cpp rename to src/common/eventlog.cpp diff --git a/pvpgn/src/common/eventlog.h b/src/common/eventlog.h similarity index 100% rename from pvpgn/src/common/eventlog.h rename to src/common/eventlog.h diff --git a/pvpgn/src/common/fdwatch.cpp b/src/common/fdwatch.cpp similarity index 100% rename from pvpgn/src/common/fdwatch.cpp rename to src/common/fdwatch.cpp diff --git a/pvpgn/src/common/fdwatch.h b/src/common/fdwatch.h similarity index 100% rename from pvpgn/src/common/fdwatch.h rename to src/common/fdwatch.h diff --git a/pvpgn/src/common/fdwatch_epoll.cpp b/src/common/fdwatch_epoll.cpp similarity index 100% rename from pvpgn/src/common/fdwatch_epoll.cpp rename to src/common/fdwatch_epoll.cpp diff --git a/pvpgn/src/common/fdwatch_epoll.h b/src/common/fdwatch_epoll.h similarity index 100% rename from pvpgn/src/common/fdwatch_epoll.h rename to src/common/fdwatch_epoll.h diff --git a/pvpgn/src/common/fdwatch_kqueue.cpp b/src/common/fdwatch_kqueue.cpp similarity index 100% rename from pvpgn/src/common/fdwatch_kqueue.cpp rename to src/common/fdwatch_kqueue.cpp diff --git a/pvpgn/src/common/fdwatch_kqueue.h b/src/common/fdwatch_kqueue.h similarity index 100% rename from pvpgn/src/common/fdwatch_kqueue.h rename to src/common/fdwatch_kqueue.h diff --git a/pvpgn/src/common/fdwatch_poll.cpp b/src/common/fdwatch_poll.cpp similarity index 100% rename from pvpgn/src/common/fdwatch_poll.cpp rename to src/common/fdwatch_poll.cpp diff --git a/pvpgn/src/common/fdwatch_poll.h b/src/common/fdwatch_poll.h similarity index 100% rename from pvpgn/src/common/fdwatch_poll.h rename to src/common/fdwatch_poll.h diff --git a/pvpgn/src/common/fdwatch_select.cpp b/src/common/fdwatch_select.cpp similarity index 100% rename from pvpgn/src/common/fdwatch_select.cpp rename to src/common/fdwatch_select.cpp diff --git a/pvpgn/src/common/fdwatch_select.h b/src/common/fdwatch_select.h similarity index 100% rename from pvpgn/src/common/fdwatch_select.h rename to src/common/fdwatch_select.h diff --git a/pvpgn/src/common/fdwbackend.cpp b/src/common/fdwbackend.cpp similarity index 100% rename from pvpgn/src/common/fdwbackend.cpp rename to src/common/fdwbackend.cpp diff --git a/pvpgn/src/common/fdwbackend.h b/src/common/fdwbackend.h similarity index 100% rename from pvpgn/src/common/fdwbackend.h rename to src/common/fdwbackend.h diff --git a/pvpgn/src/common/field_sizes.h b/src/common/field_sizes.h similarity index 100% rename from pvpgn/src/common/field_sizes.h rename to src/common/field_sizes.h diff --git a/pvpgn/src/common/file_protocol.h b/src/common/file_protocol.h similarity index 100% rename from pvpgn/src/common/file_protocol.h rename to src/common/file_protocol.h diff --git a/pvpgn/src/common/flags.h b/src/common/flags.h similarity index 100% rename from pvpgn/src/common/flags.h rename to src/common/flags.h diff --git a/pvpgn/src/common/give_up_root_privileges.cpp b/src/common/give_up_root_privileges.cpp similarity index 100% rename from pvpgn/src/common/give_up_root_privileges.cpp rename to src/common/give_up_root_privileges.cpp diff --git a/pvpgn/src/common/give_up_root_privileges.h b/src/common/give_up_root_privileges.h similarity index 100% rename from pvpgn/src/common/give_up_root_privileges.h rename to src/common/give_up_root_privileges.h diff --git a/pvpgn/src/common/gui_printf.cpp b/src/common/gui_printf.cpp similarity index 100% rename from pvpgn/src/common/gui_printf.cpp rename to src/common/gui_printf.cpp diff --git a/pvpgn/src/common/gui_printf.h b/src/common/gui_printf.h similarity index 100% rename from pvpgn/src/common/gui_printf.h rename to src/common/gui_printf.h diff --git a/pvpgn/src/common/hashtable.cpp b/src/common/hashtable.cpp similarity index 100% rename from pvpgn/src/common/hashtable.cpp rename to src/common/hashtable.cpp diff --git a/pvpgn/src/common/hashtable.h b/src/common/hashtable.h similarity index 100% rename from pvpgn/src/common/hashtable.h rename to src/common/hashtable.h diff --git a/pvpgn/src/common/hexdump.cpp b/src/common/hexdump.cpp similarity index 100% rename from pvpgn/src/common/hexdump.cpp rename to src/common/hexdump.cpp diff --git a/pvpgn/src/common/hexdump.h b/src/common/hexdump.h similarity index 100% rename from pvpgn/src/common/hexdump.h rename to src/common/hexdump.h diff --git a/pvpgn/src/common/init_protocol.h b/src/common/init_protocol.h similarity index 100% rename from pvpgn/src/common/init_protocol.h rename to src/common/init_protocol.h diff --git a/d2pack109/src/common/introtate.h b/src/common/introtate.h similarity index 100% rename from d2pack109/src/common/introtate.h rename to src/common/introtate.h diff --git a/pvpgn/src/common/irc_protocol.h b/src/common/irc_protocol.h similarity index 100% rename from pvpgn/src/common/irc_protocol.h rename to src/common/irc_protocol.h diff --git a/pvpgn/src/common/list.cpp b/src/common/list.cpp similarity index 100% rename from pvpgn/src/common/list.cpp rename to src/common/list.cpp diff --git a/pvpgn/src/common/list.h b/src/common/list.h similarity index 100% rename from pvpgn/src/common/list.h rename to src/common/list.h diff --git a/pvpgn/src/common/lstr.h b/src/common/lstr.h similarity index 100% rename from pvpgn/src/common/lstr.h rename to src/common/lstr.h diff --git a/pvpgn/src/common/network.cpp b/src/common/network.cpp similarity index 100% rename from pvpgn/src/common/network.cpp rename to src/common/network.cpp diff --git a/pvpgn/src/common/network.h b/src/common/network.h similarity index 100% rename from pvpgn/src/common/network.h rename to src/common/network.h diff --git a/pvpgn/src/common/packet.cpp b/src/common/packet.cpp similarity index 100% rename from pvpgn/src/common/packet.cpp rename to src/common/packet.cpp diff --git a/pvpgn/src/common/packet.h b/src/common/packet.h similarity index 100% rename from pvpgn/src/common/packet.h rename to src/common/packet.h diff --git a/pvpgn/src/common/peerchat.cpp b/src/common/peerchat.cpp similarity index 100% rename from pvpgn/src/common/peerchat.cpp rename to src/common/peerchat.cpp diff --git a/pvpgn/src/common/peerchat.h b/src/common/peerchat.h similarity index 100% rename from pvpgn/src/common/peerchat.h rename to src/common/peerchat.h diff --git a/pvpgn/src/common/proginfo.cpp b/src/common/proginfo.cpp similarity index 100% rename from pvpgn/src/common/proginfo.cpp rename to src/common/proginfo.cpp diff --git a/pvpgn/src/common/proginfo.h b/src/common/proginfo.h similarity index 100% rename from pvpgn/src/common/proginfo.h rename to src/common/proginfo.h diff --git a/pvpgn/src/common/queue.cpp b/src/common/queue.cpp similarity index 100% rename from pvpgn/src/common/queue.cpp rename to src/common/queue.cpp diff --git a/pvpgn/src/common/queue.h b/src/common/queue.h similarity index 100% rename from pvpgn/src/common/queue.h rename to src/common/queue.h diff --git a/pvpgn/src/common/rcm.cpp b/src/common/rcm.cpp similarity index 100% rename from pvpgn/src/common/rcm.cpp rename to src/common/rcm.cpp diff --git a/pvpgn/src/common/rcm.h b/src/common/rcm.h similarity index 100% rename from pvpgn/src/common/rcm.h rename to src/common/rcm.h diff --git a/pvpgn/src/common/rlimit.cpp b/src/common/rlimit.cpp similarity index 100% rename from pvpgn/src/common/rlimit.cpp rename to src/common/rlimit.cpp diff --git a/pvpgn/src/common/rlimit.h b/src/common/rlimit.h similarity index 100% rename from pvpgn/src/common/rlimit.h rename to src/common/rlimit.h diff --git a/pvpgn/src/common/scoped_array.h b/src/common/scoped_array.h similarity index 100% rename from pvpgn/src/common/scoped_array.h rename to src/common/scoped_array.h diff --git a/pvpgn/src/common/scoped_ptr.h b/src/common/scoped_ptr.h similarity index 100% rename from pvpgn/src/common/scoped_ptr.h rename to src/common/scoped_ptr.h diff --git a/d2pack109/src/common/setup_after.h b/src/common/setup_after.h similarity index 100% rename from d2pack109/src/common/setup_after.h rename to src/common/setup_after.h diff --git a/pvpgn/src/common/setup_before.h b/src/common/setup_before.h similarity index 100% rename from pvpgn/src/common/setup_before.h rename to src/common/setup_before.h diff --git a/pvpgn/src/common/systemerror.cpp b/src/common/systemerror.cpp similarity index 100% rename from pvpgn/src/common/systemerror.cpp rename to src/common/systemerror.cpp diff --git a/pvpgn/src/common/systemerror.h b/src/common/systemerror.h similarity index 100% rename from pvpgn/src/common/systemerror.h rename to src/common/systemerror.h diff --git a/pvpgn/src/common/tag.cpp b/src/common/tag.cpp similarity index 100% rename from pvpgn/src/common/tag.cpp rename to src/common/tag.cpp diff --git a/pvpgn/src/common/tag.h b/src/common/tag.h similarity index 100% rename from pvpgn/src/common/tag.h rename to src/common/tag.h diff --git a/pvpgn/src/common/token.cpp b/src/common/token.cpp similarity index 100% rename from pvpgn/src/common/token.cpp rename to src/common/token.cpp diff --git a/pvpgn/src/common/token.h b/src/common/token.h similarity index 100% rename from pvpgn/src/common/token.h rename to src/common/token.h diff --git a/pvpgn/src/common/tracker.h b/src/common/tracker.h similarity index 100% rename from pvpgn/src/common/tracker.h rename to src/common/tracker.h diff --git a/pvpgn/src/common/trans.cpp b/src/common/trans.cpp similarity index 100% rename from pvpgn/src/common/trans.cpp rename to src/common/trans.cpp diff --git a/pvpgn/src/common/trans.h b/src/common/trans.h similarity index 100% rename from pvpgn/src/common/trans.h rename to src/common/trans.h diff --git a/pvpgn/src/common/udp_protocol.h b/src/common/udp_protocol.h similarity index 100% rename from pvpgn/src/common/udp_protocol.h rename to src/common/udp_protocol.h diff --git a/pvpgn/src/common/util.cpp b/src/common/util.cpp similarity index 100% rename from pvpgn/src/common/util.cpp rename to src/common/util.cpp diff --git a/pvpgn/src/common/util.h b/src/common/util.h similarity index 100% rename from pvpgn/src/common/util.h rename to src/common/util.h diff --git a/pvpgn/src/common/version.h b/src/common/version.h similarity index 100% rename from pvpgn/src/common/version.h rename to src/common/version.h diff --git a/pvpgn/src/common/wol_gameres_protocol.h b/src/common/wol_gameres_protocol.h similarity index 100% rename from pvpgn/src/common/wol_gameres_protocol.h rename to src/common/wol_gameres_protocol.h diff --git a/pvpgn/src/common/wolhash.cpp b/src/common/wolhash.cpp similarity index 100% rename from pvpgn/src/common/wolhash.cpp rename to src/common/wolhash.cpp diff --git a/pvpgn/src/common/wolhash.h b/src/common/wolhash.h similarity index 100% rename from pvpgn/src/common/wolhash.h rename to src/common/wolhash.h diff --git a/pvpgn/src/common/xalloc.cpp b/src/common/xalloc.cpp similarity index 100% rename from pvpgn/src/common/xalloc.cpp rename to src/common/xalloc.cpp diff --git a/pvpgn/src/common/xalloc.h b/src/common/xalloc.h similarity index 100% rename from pvpgn/src/common/xalloc.h rename to src/common/xalloc.h diff --git a/pvpgn/src/common/xstr.cpp b/src/common/xstr.cpp similarity index 100% rename from pvpgn/src/common/xstr.cpp rename to src/common/xstr.cpp diff --git a/pvpgn/src/common/xstr.h b/src/common/xstr.h similarity index 100% rename from pvpgn/src/common/xstr.h rename to src/common/xstr.h diff --git a/pvpgn/src/common/xstring.cpp b/src/common/xstring.cpp similarity index 100% rename from pvpgn/src/common/xstring.cpp rename to src/common/xstring.cpp diff --git a/pvpgn/src/common/xstring.h b/src/common/xstring.h similarity index 100% rename from pvpgn/src/common/xstring.h rename to src/common/xstring.h diff --git a/pvpgn/src/compat/CMakeLists.txt b/src/compat/CMakeLists.txt similarity index 100% rename from pvpgn/src/compat/CMakeLists.txt rename to src/compat/CMakeLists.txt diff --git a/pvpgn/src/compat/Makefile.am b/src/compat/Makefile.am similarity index 100% rename from pvpgn/src/compat/Makefile.am rename to src/compat/Makefile.am diff --git a/pvpgn/src/compat/access.h b/src/compat/access.h similarity index 100% rename from pvpgn/src/compat/access.h rename to src/compat/access.h diff --git a/pvpgn/src/compat/gethostname.h b/src/compat/gethostname.h similarity index 100% rename from pvpgn/src/compat/gethostname.h rename to src/compat/gethostname.h diff --git a/pvpgn/src/compat/gettimeofday.cpp b/src/compat/gettimeofday.cpp similarity index 100% rename from pvpgn/src/compat/gettimeofday.cpp rename to src/compat/gettimeofday.cpp diff --git a/pvpgn/src/compat/gettimeofday.h b/src/compat/gettimeofday.h similarity index 100% rename from pvpgn/src/compat/gettimeofday.h rename to src/compat/gettimeofday.h diff --git a/pvpgn/src/compat/inet_aton.cpp b/src/compat/inet_aton.cpp similarity index 100% rename from pvpgn/src/compat/inet_aton.cpp rename to src/compat/inet_aton.cpp diff --git a/pvpgn/src/compat/inet_aton.h b/src/compat/inet_aton.h similarity index 100% rename from pvpgn/src/compat/inet_aton.h rename to src/compat/inet_aton.h diff --git a/pvpgn/src/compat/inet_ntoa.cpp b/src/compat/inet_ntoa.cpp similarity index 100% rename from pvpgn/src/compat/inet_ntoa.cpp rename to src/compat/inet_ntoa.cpp diff --git a/pvpgn/src/compat/inet_ntoa.h b/src/compat/inet_ntoa.h similarity index 100% rename from pvpgn/src/compat/inet_ntoa.h rename to src/compat/inet_ntoa.h diff --git a/pvpgn/src/compat/mkdir.h b/src/compat/mkdir.h similarity index 100% rename from pvpgn/src/compat/mkdir.h rename to src/compat/mkdir.h diff --git a/pvpgn/src/compat/mmap.cpp b/src/compat/mmap.cpp similarity index 100% rename from pvpgn/src/compat/mmap.cpp rename to src/compat/mmap.cpp diff --git a/pvpgn/src/compat/mmap.h b/src/compat/mmap.h similarity index 100% rename from pvpgn/src/compat/mmap.h rename to src/compat/mmap.h diff --git a/d2pack109/src/compat/netinet_in.h b/src/compat/netinet_in.h similarity index 100% rename from d2pack109/src/compat/netinet_in.h rename to src/compat/netinet_in.h diff --git a/pvpgn/src/compat/pdir.cpp b/src/compat/pdir.cpp similarity index 100% rename from pvpgn/src/compat/pdir.cpp rename to src/compat/pdir.cpp diff --git a/pvpgn/src/compat/pdir.h b/src/compat/pdir.h similarity index 100% rename from pvpgn/src/compat/pdir.h rename to src/compat/pdir.h diff --git a/pvpgn/src/compat/pgetopt.cpp b/src/compat/pgetopt.cpp similarity index 100% rename from pvpgn/src/compat/pgetopt.cpp rename to src/compat/pgetopt.cpp diff --git a/pvpgn/src/compat/pgetopt.h b/src/compat/pgetopt.h similarity index 100% rename from pvpgn/src/compat/pgetopt.h rename to src/compat/pgetopt.h diff --git a/pvpgn/src/compat/pgetpid.h b/src/compat/pgetpid.h similarity index 100% rename from pvpgn/src/compat/pgetpid.h rename to src/compat/pgetpid.h diff --git a/pvpgn/src/compat/psock.cpp b/src/compat/psock.cpp similarity index 100% rename from pvpgn/src/compat/psock.cpp rename to src/compat/psock.cpp diff --git a/pvpgn/src/compat/psock.h b/src/compat/psock.h similarity index 100% rename from pvpgn/src/compat/psock.h rename to src/compat/psock.h diff --git a/d2pack109/src/compat/read.h b/src/compat/read.h similarity index 100% rename from d2pack109/src/compat/read.h rename to src/compat/read.h diff --git a/pvpgn/src/compat/recv.h b/src/compat/recv.h similarity index 100% rename from pvpgn/src/compat/recv.h rename to src/compat/recv.h diff --git a/pvpgn/src/compat/rename.h b/src/compat/rename.h similarity index 100% rename from pvpgn/src/compat/rename.h rename to src/compat/rename.h diff --git a/pvpgn/src/compat/runtime_libs.h b/src/compat/runtime_libs.h similarity index 100% rename from pvpgn/src/compat/runtime_libs.h rename to src/compat/runtime_libs.h diff --git a/pvpgn/src/compat/send.h b/src/compat/send.h similarity index 100% rename from pvpgn/src/compat/send.h rename to src/compat/send.h diff --git a/pvpgn/src/compat/snprintf.cpp b/src/compat/snprintf.cpp similarity index 100% rename from pvpgn/src/compat/snprintf.cpp rename to src/compat/snprintf.cpp diff --git a/pvpgn/src/compat/snprintf.h b/src/compat/snprintf.h similarity index 100% rename from pvpgn/src/compat/snprintf.h rename to src/compat/snprintf.h diff --git a/pvpgn/src/compat/socket.h b/src/compat/socket.h similarity index 100% rename from pvpgn/src/compat/socket.h rename to src/compat/socket.h diff --git a/d2pack109/src/compat/statmacros.h b/src/compat/statmacros.h similarity index 100% rename from d2pack109/src/compat/statmacros.h rename to src/compat/statmacros.h diff --git a/pvpgn/src/compat/stdfileno.h b/src/compat/stdfileno.h similarity index 100% rename from pvpgn/src/compat/stdfileno.h rename to src/compat/stdfileno.h diff --git a/pvpgn/src/compat/strcasecmp.cpp b/src/compat/strcasecmp.cpp similarity index 100% rename from pvpgn/src/compat/strcasecmp.cpp rename to src/compat/strcasecmp.cpp diff --git a/pvpgn/src/compat/strcasecmp.h b/src/compat/strcasecmp.h similarity index 100% rename from pvpgn/src/compat/strcasecmp.h rename to src/compat/strcasecmp.h diff --git a/pvpgn/src/compat/strdup.cpp b/src/compat/strdup.cpp similarity index 100% rename from pvpgn/src/compat/strdup.cpp rename to src/compat/strdup.cpp diff --git a/pvpgn/src/compat/strdup.h b/src/compat/strdup.h similarity index 100% rename from pvpgn/src/compat/strdup.h rename to src/compat/strdup.h diff --git a/pvpgn/src/compat/strerror.cpp b/src/compat/strerror.cpp similarity index 100% rename from pvpgn/src/compat/strerror.cpp rename to src/compat/strerror.cpp diff --git a/pvpgn/src/compat/strerror.h b/src/compat/strerror.h similarity index 100% rename from pvpgn/src/compat/strerror.h rename to src/compat/strerror.h diff --git a/pvpgn/src/compat/strncasecmp.cpp b/src/compat/strncasecmp.cpp similarity index 100% rename from pvpgn/src/compat/strncasecmp.cpp rename to src/compat/strncasecmp.cpp diff --git a/pvpgn/src/compat/strncasecmp.h b/src/compat/strncasecmp.h similarity index 100% rename from pvpgn/src/compat/strncasecmp.h rename to src/compat/strncasecmp.h diff --git a/pvpgn/src/compat/strsep.cpp b/src/compat/strsep.cpp similarity index 100% rename from pvpgn/src/compat/strsep.cpp rename to src/compat/strsep.cpp diff --git a/pvpgn/src/compat/strsep.h b/src/compat/strsep.h similarity index 100% rename from pvpgn/src/compat/strsep.h rename to src/compat/strsep.h diff --git a/pvpgn/src/compat/strtoul.cpp b/src/compat/strtoul.cpp similarity index 100% rename from pvpgn/src/compat/strtoul.cpp rename to src/compat/strtoul.cpp diff --git a/pvpgn/src/compat/strtoul.h b/src/compat/strtoul.h similarity index 100% rename from pvpgn/src/compat/strtoul.h rename to src/compat/strtoul.h diff --git a/pvpgn/src/compat/termios.h b/src/compat/termios.h similarity index 100% rename from pvpgn/src/compat/termios.h rename to src/compat/termios.h diff --git a/pvpgn/src/compat/uint.h b/src/compat/uint.h similarity index 100% rename from pvpgn/src/compat/uint.h rename to src/compat/uint.h diff --git a/pvpgn/src/compat/uname.cpp b/src/compat/uname.cpp similarity index 100% rename from pvpgn/src/compat/uname.cpp rename to src/compat/uname.cpp diff --git a/pvpgn/src/compat/uname.h b/src/compat/uname.h similarity index 100% rename from pvpgn/src/compat/uname.h rename to src/compat/uname.h diff --git a/pvpgn/src/compat/vsnprintf.cpp b/src/compat/vsnprintf.cpp similarity index 100% rename from pvpgn/src/compat/vsnprintf.cpp rename to src/compat/vsnprintf.cpp diff --git a/pvpgn/src/compat/vsnprintf.h b/src/compat/vsnprintf.h similarity index 100% rename from pvpgn/src/compat/vsnprintf.h rename to src/compat/vsnprintf.h diff --git a/pvpgn/src/d2cs/CMakeLists.txt b/src/d2cs/CMakeLists.txt similarity index 100% rename from pvpgn/src/d2cs/CMakeLists.txt rename to src/d2cs/CMakeLists.txt diff --git a/pvpgn/src/d2cs/Makefile.am b/src/d2cs/Makefile.am similarity index 100% rename from pvpgn/src/d2cs/Makefile.am rename to src/d2cs/Makefile.am diff --git a/pvpgn/src/d2cs/bit.h b/src/d2cs/bit.h similarity index 100% rename from pvpgn/src/d2cs/bit.h rename to src/d2cs/bit.h diff --git a/pvpgn/src/d2cs/bnetd.cpp b/src/d2cs/bnetd.cpp similarity index 100% rename from pvpgn/src/d2cs/bnetd.cpp rename to src/d2cs/bnetd.cpp diff --git a/pvpgn/src/d2cs/bnetd.h b/src/d2cs/bnetd.h similarity index 100% rename from pvpgn/src/d2cs/bnetd.h rename to src/d2cs/bnetd.h diff --git a/pvpgn/src/d2cs/cmdline.cpp b/src/d2cs/cmdline.cpp similarity index 100% rename from pvpgn/src/d2cs/cmdline.cpp rename to src/d2cs/cmdline.cpp diff --git a/pvpgn/src/d2cs/cmdline.h b/src/d2cs/cmdline.h similarity index 100% rename from pvpgn/src/d2cs/cmdline.h rename to src/d2cs/cmdline.h diff --git a/pvpgn/src/d2cs/connection.cpp b/src/d2cs/connection.cpp similarity index 100% rename from pvpgn/src/d2cs/connection.cpp rename to src/d2cs/connection.cpp diff --git a/pvpgn/src/d2cs/connection.h b/src/d2cs/connection.h similarity index 100% rename from pvpgn/src/d2cs/connection.h rename to src/d2cs/connection.h diff --git a/pvpgn/src/d2cs/d2charfile.cpp b/src/d2cs/d2charfile.cpp similarity index 100% rename from pvpgn/src/d2cs/d2charfile.cpp rename to src/d2cs/d2charfile.cpp diff --git a/pvpgn/src/d2cs/d2charfile.h b/src/d2cs/d2charfile.h similarity index 100% rename from pvpgn/src/d2cs/d2charfile.h rename to src/d2cs/d2charfile.h diff --git a/pvpgn/src/d2cs/d2charlist.cpp b/src/d2cs/d2charlist.cpp similarity index 100% rename from pvpgn/src/d2cs/d2charlist.cpp rename to src/d2cs/d2charlist.cpp diff --git a/pvpgn/src/d2cs/d2charlist.h b/src/d2cs/d2charlist.h similarity index 100% rename from pvpgn/src/d2cs/d2charlist.h rename to src/d2cs/d2charlist.h diff --git a/pvpgn/src/d2cs/d2gs.cpp b/src/d2cs/d2gs.cpp similarity index 100% rename from pvpgn/src/d2cs/d2gs.cpp rename to src/d2cs/d2gs.cpp diff --git a/pvpgn/src/d2cs/d2gs.h b/src/d2cs/d2gs.h similarity index 100% rename from pvpgn/src/d2cs/d2gs.h rename to src/d2cs/d2gs.h diff --git a/pvpgn/src/d2cs/d2ladder.cpp b/src/d2cs/d2ladder.cpp similarity index 100% rename from pvpgn/src/d2cs/d2ladder.cpp rename to src/d2cs/d2ladder.cpp diff --git a/pvpgn/src/d2cs/d2ladder.h b/src/d2cs/d2ladder.h similarity index 100% rename from pvpgn/src/d2cs/d2ladder.h rename to src/d2cs/d2ladder.h diff --git a/pvpgn/src/d2cs/game.cpp b/src/d2cs/game.cpp similarity index 100% rename from pvpgn/src/d2cs/game.cpp rename to src/d2cs/game.cpp diff --git a/pvpgn/src/d2cs/game.h b/src/d2cs/game.h similarity index 100% rename from pvpgn/src/d2cs/game.h rename to src/d2cs/game.h diff --git a/pvpgn/src/d2cs/gamequeue.cpp b/src/d2cs/gamequeue.cpp similarity index 100% rename from pvpgn/src/d2cs/gamequeue.cpp rename to src/d2cs/gamequeue.cpp diff --git a/pvpgn/src/d2cs/gamequeue.h b/src/d2cs/gamequeue.h similarity index 100% rename from pvpgn/src/d2cs/gamequeue.h rename to src/d2cs/gamequeue.h diff --git a/pvpgn/src/d2cs/handle_bnetd.cpp b/src/d2cs/handle_bnetd.cpp similarity index 100% rename from pvpgn/src/d2cs/handle_bnetd.cpp rename to src/d2cs/handle_bnetd.cpp diff --git a/pvpgn/src/d2cs/handle_bnetd.h b/src/d2cs/handle_bnetd.h similarity index 100% rename from pvpgn/src/d2cs/handle_bnetd.h rename to src/d2cs/handle_bnetd.h diff --git a/pvpgn/src/d2cs/handle_d2cs.cpp b/src/d2cs/handle_d2cs.cpp similarity index 100% rename from pvpgn/src/d2cs/handle_d2cs.cpp rename to src/d2cs/handle_d2cs.cpp diff --git a/pvpgn/src/d2cs/handle_d2cs.h b/src/d2cs/handle_d2cs.h similarity index 100% rename from pvpgn/src/d2cs/handle_d2cs.h rename to src/d2cs/handle_d2cs.h diff --git a/pvpgn/src/d2cs/handle_d2gs.cpp b/src/d2cs/handle_d2gs.cpp similarity index 100% rename from pvpgn/src/d2cs/handle_d2gs.cpp rename to src/d2cs/handle_d2gs.cpp diff --git a/pvpgn/src/d2cs/handle_d2gs.h b/src/d2cs/handle_d2gs.h similarity index 100% rename from pvpgn/src/d2cs/handle_d2gs.h rename to src/d2cs/handle_d2gs.h diff --git a/pvpgn/src/d2cs/handle_init.cpp b/src/d2cs/handle_init.cpp similarity index 100% rename from pvpgn/src/d2cs/handle_init.cpp rename to src/d2cs/handle_init.cpp diff --git a/pvpgn/src/d2cs/handle_init.h b/src/d2cs/handle_init.h similarity index 100% rename from pvpgn/src/d2cs/handle_init.h rename to src/d2cs/handle_init.h diff --git a/pvpgn/src/d2cs/handle_signal.cpp b/src/d2cs/handle_signal.cpp similarity index 100% rename from pvpgn/src/d2cs/handle_signal.cpp rename to src/d2cs/handle_signal.cpp diff --git a/pvpgn/src/d2cs/handle_signal.h b/src/d2cs/handle_signal.h similarity index 100% rename from pvpgn/src/d2cs/handle_signal.h rename to src/d2cs/handle_signal.h diff --git a/pvpgn/src/d2cs/main.cpp b/src/d2cs/main.cpp similarity index 100% rename from pvpgn/src/d2cs/main.cpp rename to src/d2cs/main.cpp diff --git a/pvpgn/src/d2cs/net.cpp b/src/d2cs/net.cpp similarity index 100% rename from pvpgn/src/d2cs/net.cpp rename to src/d2cs/net.cpp diff --git a/pvpgn/src/d2cs/net.h b/src/d2cs/net.h similarity index 100% rename from pvpgn/src/d2cs/net.h rename to src/d2cs/net.h diff --git a/pvpgn/src/d2cs/prefs.cpp b/src/d2cs/prefs.cpp similarity index 100% rename from pvpgn/src/d2cs/prefs.cpp rename to src/d2cs/prefs.cpp diff --git a/pvpgn/src/d2cs/prefs.h b/src/d2cs/prefs.h similarity index 100% rename from pvpgn/src/d2cs/prefs.h rename to src/d2cs/prefs.h diff --git a/pvpgn/src/d2cs/s2s.cpp b/src/d2cs/s2s.cpp similarity index 100% rename from pvpgn/src/d2cs/s2s.cpp rename to src/d2cs/s2s.cpp diff --git a/pvpgn/src/d2cs/s2s.h b/src/d2cs/s2s.h similarity index 100% rename from pvpgn/src/d2cs/s2s.h rename to src/d2cs/s2s.h diff --git a/pvpgn/src/d2cs/server.cpp b/src/d2cs/server.cpp similarity index 100% rename from pvpgn/src/d2cs/server.cpp rename to src/d2cs/server.cpp diff --git a/pvpgn/src/d2cs/server.h b/src/d2cs/server.h similarity index 100% rename from pvpgn/src/d2cs/server.h rename to src/d2cs/server.h diff --git a/pvpgn/src/d2cs/serverqueue.cpp b/src/d2cs/serverqueue.cpp similarity index 100% rename from pvpgn/src/d2cs/serverqueue.cpp rename to src/d2cs/serverqueue.cpp diff --git a/pvpgn/src/d2cs/serverqueue.h b/src/d2cs/serverqueue.h similarity index 100% rename from pvpgn/src/d2cs/serverqueue.h rename to src/d2cs/serverqueue.h diff --git a/pvpgn/src/d2cs/setup.h b/src/d2cs/setup.h similarity index 100% rename from pvpgn/src/d2cs/setup.h rename to src/d2cs/setup.h diff --git a/pvpgn/src/d2cs/version.h b/src/d2cs/version.h similarity index 100% rename from pvpgn/src/d2cs/version.h rename to src/d2cs/version.h diff --git a/pvpgn/src/d2dbs/CMakeLists.txt b/src/d2dbs/CMakeLists.txt similarity index 100% rename from pvpgn/src/d2dbs/CMakeLists.txt rename to src/d2dbs/CMakeLists.txt diff --git a/pvpgn/src/d2dbs/Makefile.am b/src/d2dbs/Makefile.am similarity index 100% rename from pvpgn/src/d2dbs/Makefile.am rename to src/d2dbs/Makefile.am diff --git a/pvpgn/src/d2dbs/charlock.cpp b/src/d2dbs/charlock.cpp similarity index 100% rename from pvpgn/src/d2dbs/charlock.cpp rename to src/d2dbs/charlock.cpp diff --git a/pvpgn/src/d2dbs/charlock.h b/src/d2dbs/charlock.h similarity index 100% rename from pvpgn/src/d2dbs/charlock.h rename to src/d2dbs/charlock.h diff --git a/pvpgn/src/d2dbs/cmdline.cpp b/src/d2dbs/cmdline.cpp similarity index 100% rename from pvpgn/src/d2dbs/cmdline.cpp rename to src/d2dbs/cmdline.cpp diff --git a/pvpgn/src/d2dbs/cmdline.h b/src/d2dbs/cmdline.h similarity index 100% rename from pvpgn/src/d2dbs/cmdline.h rename to src/d2dbs/cmdline.h diff --git a/pvpgn/src/d2dbs/d2ladder.cpp b/src/d2dbs/d2ladder.cpp similarity index 100% rename from pvpgn/src/d2dbs/d2ladder.cpp rename to src/d2dbs/d2ladder.cpp diff --git a/pvpgn/src/d2dbs/d2ladder.h b/src/d2dbs/d2ladder.h similarity index 100% rename from pvpgn/src/d2dbs/d2ladder.h rename to src/d2dbs/d2ladder.h diff --git a/pvpgn/src/d2dbs/dbsdupecheck.cpp b/src/d2dbs/dbsdupecheck.cpp similarity index 100% rename from pvpgn/src/d2dbs/dbsdupecheck.cpp rename to src/d2dbs/dbsdupecheck.cpp diff --git a/pvpgn/src/d2dbs/dbsdupecheck.h b/src/d2dbs/dbsdupecheck.h similarity index 100% rename from pvpgn/src/d2dbs/dbsdupecheck.h rename to src/d2dbs/dbsdupecheck.h diff --git a/pvpgn/src/d2dbs/dbserver.cpp b/src/d2dbs/dbserver.cpp similarity index 100% rename from pvpgn/src/d2dbs/dbserver.cpp rename to src/d2dbs/dbserver.cpp diff --git a/pvpgn/src/d2dbs/dbserver.h b/src/d2dbs/dbserver.h similarity index 100% rename from pvpgn/src/d2dbs/dbserver.h rename to src/d2dbs/dbserver.h diff --git a/pvpgn/src/d2dbs/dbspacket.cpp b/src/d2dbs/dbspacket.cpp similarity index 100% rename from pvpgn/src/d2dbs/dbspacket.cpp rename to src/d2dbs/dbspacket.cpp diff --git a/pvpgn/src/d2dbs/dbspacket.h b/src/d2dbs/dbspacket.h similarity index 100% rename from pvpgn/src/d2dbs/dbspacket.h rename to src/d2dbs/dbspacket.h diff --git a/pvpgn/src/d2dbs/handle_signal.cpp b/src/d2dbs/handle_signal.cpp similarity index 100% rename from pvpgn/src/d2dbs/handle_signal.cpp rename to src/d2dbs/handle_signal.cpp diff --git a/pvpgn/src/d2dbs/handle_signal.h b/src/d2dbs/handle_signal.h similarity index 100% rename from pvpgn/src/d2dbs/handle_signal.h rename to src/d2dbs/handle_signal.h diff --git a/pvpgn/src/d2dbs/main.cpp b/src/d2dbs/main.cpp similarity index 100% rename from pvpgn/src/d2dbs/main.cpp rename to src/d2dbs/main.cpp diff --git a/pvpgn/src/d2dbs/prefs.cpp b/src/d2dbs/prefs.cpp similarity index 100% rename from pvpgn/src/d2dbs/prefs.cpp rename to src/d2dbs/prefs.cpp diff --git a/pvpgn/src/d2dbs/prefs.h b/src/d2dbs/prefs.h similarity index 100% rename from pvpgn/src/d2dbs/prefs.h rename to src/d2dbs/prefs.h diff --git a/pvpgn/src/d2dbs/setup.h b/src/d2dbs/setup.h similarity index 100% rename from pvpgn/src/d2dbs/setup.h rename to src/d2dbs/setup.h diff --git a/pvpgn/src/d2dbs/version.h b/src/d2dbs/version.h similarity index 100% rename from pvpgn/src/d2dbs/version.h rename to src/d2dbs/version.h diff --git a/pvpgn/src/test/CMakeLists.txt b/src/test/CMakeLists.txt similarity index 100% rename from pvpgn/src/test/CMakeLists.txt rename to src/test/CMakeLists.txt diff --git a/pvpgn/src/test/bigint.cpp b/src/test/bigint.cpp similarity index 100% rename from pvpgn/src/test/bigint.cpp rename to src/test/bigint.cpp diff --git a/pvpgn/src/test/bnetsrp3_test.cpp b/src/test/bnetsrp3_test.cpp similarity index 100% rename from pvpgn/src/test/bnetsrp3_test.cpp rename to src/test/bnetsrp3_test.cpp diff --git a/pvpgn/src/tinycdb/CMakeLists.txt b/src/tinycdb/CMakeLists.txt similarity index 100% rename from pvpgn/src/tinycdb/CMakeLists.txt rename to src/tinycdb/CMakeLists.txt diff --git a/pvpgn/src/tinycdb/ChangeLog b/src/tinycdb/ChangeLog similarity index 100% rename from pvpgn/src/tinycdb/ChangeLog rename to src/tinycdb/ChangeLog diff --git a/pvpgn/src/tinycdb/Makefile.am b/src/tinycdb/Makefile.am similarity index 100% rename from pvpgn/src/tinycdb/Makefile.am rename to src/tinycdb/Makefile.am diff --git a/pvpgn/src/tinycdb/cdb.cpp b/src/tinycdb/cdb.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb.cpp rename to src/tinycdb/cdb.cpp diff --git a/pvpgn/src/tinycdb/cdb.h b/src/tinycdb/cdb.h similarity index 100% rename from pvpgn/src/tinycdb/cdb.h rename to src/tinycdb/cdb.h diff --git a/pvpgn/src/tinycdb/cdb_find.cpp b/src/tinycdb/cdb_find.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_find.cpp rename to src/tinycdb/cdb_find.cpp diff --git a/pvpgn/src/tinycdb/cdb_findnext.cpp b/src/tinycdb/cdb_findnext.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_findnext.cpp rename to src/tinycdb/cdb_findnext.cpp diff --git a/pvpgn/src/tinycdb/cdb_hash.cpp b/src/tinycdb/cdb_hash.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_hash.cpp rename to src/tinycdb/cdb_hash.cpp diff --git a/pvpgn/src/tinycdb/cdb_init.cpp b/src/tinycdb/cdb_init.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_init.cpp rename to src/tinycdb/cdb_init.cpp diff --git a/pvpgn/src/tinycdb/cdb_int.h b/src/tinycdb/cdb_int.h similarity index 100% rename from pvpgn/src/tinycdb/cdb_int.h rename to src/tinycdb/cdb_int.h diff --git a/pvpgn/src/tinycdb/cdb_make.cpp b/src/tinycdb/cdb_make.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_make.cpp rename to src/tinycdb/cdb_make.cpp diff --git a/pvpgn/src/tinycdb/cdb_make_add.cpp b/src/tinycdb/cdb_make_add.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_make_add.cpp rename to src/tinycdb/cdb_make_add.cpp diff --git a/pvpgn/src/tinycdb/cdb_make_find.cpp b/src/tinycdb/cdb_make_find.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_make_find.cpp rename to src/tinycdb/cdb_make_find.cpp diff --git a/pvpgn/src/tinycdb/cdb_make_put.cpp b/src/tinycdb/cdb_make_put.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_make_put.cpp rename to src/tinycdb/cdb_make_put.cpp diff --git a/pvpgn/src/tinycdb/cdb_seek.cpp b/src/tinycdb/cdb_seek.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_seek.cpp rename to src/tinycdb/cdb_seek.cpp diff --git a/pvpgn/src/tinycdb/cdb_seq.cpp b/src/tinycdb/cdb_seq.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_seq.cpp rename to src/tinycdb/cdb_seq.cpp diff --git a/pvpgn/src/tinycdb/cdb_unpack.cpp b/src/tinycdb/cdb_unpack.cpp similarity index 100% rename from pvpgn/src/tinycdb/cdb_unpack.cpp rename to src/tinycdb/cdb_unpack.cpp diff --git a/pvpgn/src/win32/CMakeLists.txt b/src/win32/CMakeLists.txt similarity index 100% rename from pvpgn/src/win32/CMakeLists.txt rename to src/win32/CMakeLists.txt diff --git a/pvpgn/src/win32/Makefile.am b/src/win32/Makefile.am similarity index 100% rename from pvpgn/src/win32/Makefile.am rename to src/win32/Makefile.am diff --git a/pvpgn/src/win32/configwin.h b/src/win32/configwin.h similarity index 100% rename from pvpgn/src/win32/configwin.h rename to src/win32/configwin.h diff --git a/pvpgn/src/win32/console_output.cpp b/src/win32/console_output.cpp similarity index 100% rename from pvpgn/src/win32/console_output.cpp rename to src/win32/console_output.cpp diff --git a/pvpgn/src/win32/console_output.h b/src/win32/console_output.h similarity index 100% rename from pvpgn/src/win32/console_output.h rename to src/win32/console_output.h diff --git a/d2pack109/src/win32/console_resource.h b/src/win32/console_resource.h similarity index 100% rename from d2pack109/src/win32/console_resource.h rename to src/win32/console_resource.h diff --git a/d2pack109/src/win32/console_resource.rc b/src/win32/console_resource.rc similarity index 100% rename from d2pack109/src/win32/console_resource.rc rename to src/win32/console_resource.rc diff --git a/d2pack109/src/win32/d2cs_resource.h b/src/win32/d2cs_resource.h similarity index 100% rename from d2pack109/src/win32/d2cs_resource.h rename to src/win32/d2cs_resource.h diff --git a/d2pack109/src/win32/d2cs_resource.rc b/src/win32/d2cs_resource.rc similarity index 100% rename from d2pack109/src/win32/d2cs_resource.rc rename to src/win32/d2cs_resource.rc diff --git a/pvpgn/src/win32/d2cs_winmain.cpp b/src/win32/d2cs_winmain.cpp similarity index 100% rename from pvpgn/src/win32/d2cs_winmain.cpp rename to src/win32/d2cs_winmain.cpp diff --git a/d2pack109/src/win32/d2dbs_resource.h b/src/win32/d2dbs_resource.h similarity index 100% rename from d2pack109/src/win32/d2dbs_resource.h rename to src/win32/d2dbs_resource.h diff --git a/d2pack109/src/win32/d2dbs_resource.rc b/src/win32/d2dbs_resource.rc similarity index 100% rename from d2pack109/src/win32/d2dbs_resource.rc rename to src/win32/d2dbs_resource.rc diff --git a/pvpgn/src/win32/d2dbs_winmain.cpp b/src/win32/d2dbs_winmain.cpp similarity index 100% rename from pvpgn/src/win32/d2dbs_winmain.cpp rename to src/win32/d2dbs_winmain.cpp diff --git a/d2pack109/src/win32/logo01.ico b/src/win32/logo01.ico similarity index 100% rename from d2pack109/src/win32/logo01.ico rename to src/win32/logo01.ico diff --git a/pvpgn/src/win32/resource.h b/src/win32/resource.h similarity index 100% rename from pvpgn/src/win32/resource.h rename to src/win32/resource.h diff --git a/pvpgn/src/win32/resource.rc b/src/win32/resource.rc similarity index 100% rename from pvpgn/src/win32/resource.rc rename to src/win32/resource.rc diff --git a/pvpgn/src/win32/service.cpp b/src/win32/service.cpp similarity index 100% rename from pvpgn/src/win32/service.cpp rename to src/win32/service.cpp diff --git a/pvpgn/src/win32/service.h b/src/win32/service.h similarity index 100% rename from pvpgn/src/win32/service.h rename to src/win32/service.h diff --git a/pvpgn/src/win32/winmain.cpp b/src/win32/winmain.cpp similarity index 100% rename from pvpgn/src/win32/winmain.cpp rename to src/win32/winmain.cpp diff --git a/pvpgn/src/win32/winmain.h b/src/win32/winmain.h similarity index 100% rename from pvpgn/src/win32/winmain.h rename to src/win32/winmain.h diff --git a/pvpgn/version-history.txt b/version-history.txt similarity index 100% rename from pvpgn/version-history.txt rename to version-history.txt diff --git a/web/site/admin/downloads.php b/web/site/admin/downloads.php deleted file mode 100644 index fb0d4c0..0000000 --- a/web/site/admin/downloads.php +++ /dev/null @@ -1,127 +0,0 @@ - - - -Site admin - - -

Submit news | Edit news | Create new user | Edit links | Edit downloads | Edit user profile | Misc config | Logout

-

-\n"; - echo "filename:
\n"; - echo "size: bytes
\n"; - echo "description:
\n"; - echo ""; - echo ""; -} else { -?> - - -"; - if ($row[3] <> 1) { - echo ""; - } else { - echo ""; - } - if ($row[3] <> $max[0]) { - echo ""; - } else { - echo ""; - } - } while ($row = mysql_fetch_row($query)); -} else { - echo ""; -} -?> -
#filenamesizedescriptioneditdeletemove upmove down
".$row[3]."".$row[0]."".$row[1]."".$row[2]."editdeletemove up---move down---
No ".$_GET['type']." downloads!
-

-

-filename
-size bytes
-description
- -
- -

- - diff --git a/web/site/admin/index.php b/web/site/admin/index.php deleted file mode 100644 index e938191..0000000 --- a/web/site/admin/index.php +++ /dev/null @@ -1,212 +0,0 @@ - - - -Site admin - - - -

-Username:
-Password:
- -

-User \"".$_POST['username']."\" does not exist

\n"; - } else if ($row[2] != md5($_POST['password'])) { - echo "

Password incorrect

\n"; - } else { - $_SESSION['uid'] = $row[0]; - $_SESSION['user'] = $row[1]; - $_SESSION['email'] = $row[3]; - echo "

Login successful

\n"; - echo "

Click here to continue

\n"; - } - } else { - if ($_GET['action'] != 'logout' && $_GET['action'] != 'dochpass') { - ?> -

Submit news | Edit news | Create new user | Edit links | Edit downloads | Edit user profile | Misc config | Logout

- -

- Username:
- Password:
- Confirm password:
- Email address:
- -

- $_POST['pass2']) { - echo "

Password and repeated password do not match

\n"; - } else { - if (@mysql_query("INSERT INTO `users`(`username`,`passhash`,`email`) VALUES('".$_POST['username']."','".md5($_POST['pass1'])."','".$_POST['email']."');",$dbh)) { - echo "

User \"".$_POST['username']."\" created successfully

\n"; - } else { - echo "

Error: Could not create new user

\n"; - echo "

MySQL said: ".mysql_error()."

\n"; - } - } - } else if ($_GET['action'] == 'submit') { - echo "

\n"; - echo "Username: ".$_SESSION['user']."
\n"; - echo "Email: ".$_SESSION['email']."
\n"; - echo "Date: ".date($dateformat)."
\n"; - ?> - Subject:
- News text:
-
- -

- News added successfully

\n"; - } else { - echo "

Error: Could not insert news

\n"; - echo "

MySQL said: ".mysql_error()."

\n"; - } - } else if ($_GET['action'] == 'edit') { - echo "
"; - echo "\n"; - $query = mysql_query("SELECT timestamp,subject FROM news ORDER BY `timestamp` DESC",$dbh); - if ($row = mysql_fetch_row($query)) { - do { - echo "\n"; - } while ($row = mysql_fetch_row($query)); - } else { - echo "\n"; - } - echo "
TimestampSubjectEditDelete
".$row[0]."".$row[1]."editdelete
No news is good news!
\n"; - } else if ($_GET['action'] == 'dodelete') { - mysql_query("DELETE FROM news WHERE `timestamp` = ".$_GET['x'].";",$dbh); - echo "

Newsitem deleted

\n"; - } else if ($_GET['action'] == 'edititem') { - $row = mysql_fetch_row($temp = mysql_query("SELECT subject,text FROM news WHERE `timestamp` = ".$_GET['x'].";",$dbh)); - echo "

\n"; - echo "Date: ".date($dateformat,$_GET['x'])."
\n"; - echo "Subject:
\n"; - echo "
\n"; - echo "\n"; - echo "

\n"; - mysql_free_result($temp); - unset($temp); - unset($row); - } else if ($_GET['action'] == 'doedit') { - if (@mysql_query("UPDATE news SET `subject` = '".$_POST['subject']."', `text` = '".$_POST['text']."' WHERE `timestamp` = ".$_GET['x'].";",$dbh)) { - echo "

News updated successfully

\n"; - } else { - echo "

Error: Could not update news

\n"; - echo "

MySQL said: ".mysql_error()."

\n"; - } - } else if ($_GET['action'] == 'chpass') { - $row = mysql_fetch_row(mysql_query("SELECT username,email FROM users WHERE uid = ".$_SESSION['uid'].";",$dbh)); - ?> -

- Username:
- Password:
- Confirm password:
- Email address:
- -

- Profile updated successfully

\n"; - echo "

You must log in again before you can perform further actions.

\n"; - } else { - echo "

Error: Could not update profile

\n"; - echo "

MySQL said: ".mysql_error()."

\n"; - } - } else { - echo "

Error: Password and repeated password do not match

\n"; - } - } else if ($_GET['action'] == 'downloads') { - $row = mysql_fetch_row($temp = mysql_query("SELECT value FROM config WHERE `key` = 'latest_stable'",$dbh)); - $latest_stable = $row[0]; - mysql_free_result($temp); - $row = mysql_fetch_row($temp = mysql_query("SELECT value FROM config WHERE `key` = 'latest_development'",$dbh)); - $latest_development = $row[0]; - mysql_free_result($temp); - $row = mysql_fetch_row($temp = mysql_query("SELECT value FROM config WHERE `key` = 'latest_d2pack109'",$dbh)); - $latest_d2pack109 = $row[0]; - mysql_free_result($temp); - unset($temp); - unset($row); - echo "
\n"; - echo "Latest development release: (enter 0 to disable)
\n"; - echo "Edit files for development
\n
\n"; - echo "Latest stable release:
\n"; - echo "Edit files for stable
\n
\n"; - echo "Latest d2pack109 release:
\n"; - echo "Edit files for d2pack109
\n
\n"; - echo "\n"; - echo "
\n"; - } else if ($_GET['action'] == 'dodownloads') { - if (mysql_query("UPDATE config SET `value` = '".$_POST['development']."' WHERE `key` = 'latest_development';",$dbh) && mysql_query("UPDATE config SET `value` = '".$_POST['stable']."' WHERE `key` = 'latest_stable';",$dbh) && mysql_query("UPDATE config SET `value` = '".$_POST['d2pack109']."' WHERE `key` = 'latest_d2pack109';",$dbh)) { - echo "

Updated successfully

\n"; - } else { - echo "

Error: Could not apply changes

\n"; - echo "

MySQL said: ".mysql_error()."

\n"; - } - } else if ($_GET['action'] == 'config') { - $row = mysql_fetch_row($temp = mysql_query("SELECT COUNT(*) FROM news",$dbh)); - $total_newsitems = $row[0]; - mysql_free_result($temp); - $row = mysql_fetch_row($temp = mysql_query("SELECT value+0 FROM config WHERE `key` = 'items_front_page'",$dbh)); - $items_front_page = $row[0]; - mysql_free_result($temp); - $row = mysql_fetch_row($temp = mysql_query("SELECT value+0 FROM config WHERE `key` = 'items_archive_page'",$dbh)); - $items_archive_page = $row[0]; - mysql_free_result($temp); - $row = mysql_fetch_row($temp = mysql_query("SELECT value FROM config WHERE `key` = 'footer'",$dbh)); - $footer = $row[0]; - mysql_free_result($temp); - unset($temp); - unset($row); - echo "

\n"; - echo "News items on front page:
\n"; - echo "News items per archive page:

\n"; - echo "Page footer:
\n"; - echo "
\n"; - echo "\n"; - echo "

\n"; - } else if ($_GET['action'] == 'doconfig') { - if (mysql_query("UPDATE config SET `value` = '".$_POST['items_front_page']."' WHERE `key` = 'items_front_page';",$dbh) && mysql_query("UPDATE config SET `value` = '".$_POST['items_archive_page']."' WHERE `key` = 'items_archive_page';",$dbh) && mysql_query("UPDATE config SET `value` = '".$_POST['footer']."' WHERE `key` = 'footer';",$dbh)) { - echo "

Updated successfully

\n"; - } else { - echo "

Error: Could not apply changes

\n"; - echo "

MySQL said: ".mysql_error()."

\n"; - } - } else if ($_GET['action'] == 'logout') { - echo "

Logout successful

\n"; - } - } -} -?> - - diff --git a/web/site/admin/links.php b/web/site/admin/links.php deleted file mode 100644 index 6b9281c..0000000 --- a/web/site/admin/links.php +++ /dev/null @@ -1,128 +0,0 @@ - - - -Site admin - - -

Submit news | Edit news | Create new user | Edit links | Edit downloads | Edit user profile | Misc config | Logout

-

-\n"; - echo "URL:
\n"; - echo "target:
\n"; - echo "name:
\n"; - echo ""; - echo ""; -} else { -?> - - - -"; - if ($row[3] <> 1) { - echo ""; - } else { - echo ""; - } - if ($row[3] <> $max[0]) { - echo ""; - } else { - echo ""; - } - } while ($row = mysql_fetch_row($query)); -} else { - echo ""; -} -?> -
#URLtargetnameeditdeletemove upmove down
".$row[3]."".$row[0]."".$row[1]."".$row[2]."editdeletemove up---move down---
No links
-

-

-URL
-target
-name
- -
- -

- - diff --git a/web/site/files.php b/web/site/files.php deleted file mode 100644 index 94003f1..0000000 --- a/web/site/files.php +++ /dev/null @@ -1,44 +0,0 @@ - - - - - -\n"; - echo "\n"; - echo "\n"; - } while ($row = mysql_fetch_row($query)); -} else { - echo "\n"; -} -?> -
-Diablo II 1.09d support

"; -} elseif ($filesphp['type'] == 'development') { - echo "

Latest development release: PvPGN ".$filesphp['version']."

"; -} else { - echo "

Latest stable release: PvPGN ".$filesphp['version']."  [Changelog]

"; -} -?> -
\n"; - echo " \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "".$row[0]."\n"; - echo "
\n"; - echo "
\n"; - echo $row[1]."\n"; - echo "\n"; - echo formatsize($row[2])."\n"; - echo "
 We recommend using the latest development release at this time.
diff --git a/web/site/images/botbar-bg.gif b/web/site/images/botbar-bg.gif deleted file mode 100644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I>U+jLK8ju|3>(ILoU$XUccVU|HuoYAe4K*mm5=kbKtlwn0p z>QMZ_;7IWx%Rhi6e7f=)h4_J&dZ!f~BXwHA$~fe(h|P)`IQ-7r*J6c|E!UoXAa(BdN>61yFDEtpRD`4T z`vy(6%a*fkQ!2DJy!^|?CA&j4N}MgaF30S#l)@AFv$e%b<(&{RCC^_sc1U_kTfuNR zcMLm87;|0AtqCjgLwtLAXso$~vF;>cf-+9umP+lQkf|H5bONU?F^+~GNLtcaE0kh&(RJz3`jWGPQ z$5~JYwrd2jx-!)KIu%;*=ssk=Z)#AT+ z`a~?_*5#o2fu+Yg0RHd^mYHYKw*SY%*WX0vH-FQWbtgBiSZ)=+R=#pOqnr54u-VvM z#CI0q8YU{Q)N}8bGA}i~yCGT`86y?+e0;)I!N2MkSg2_&QN${`W&Z<`jSL+=OU9X$ zm?Wt|S+@&6e?t?CU*_gwHa1tekDHswPwg!NC!e!FZYJ*mE8N(pfBnwYom0E??l6+v zd6+x*r@EHhB7_=P2At)A{sFX5n@TX5b*;|O8rWTObhSmipL9C=B*t|2sN#NW)*&)+ zNB9qbI8CJ5wsR%@Y6wMHqca?@p;-IW_1l`gY(vGW(AW|qGd;>UUrw#)!B}VhcSrh# zv)9ZD7R!eq`U?hkCt(-&RT9`c4o`Fj0sSHG9+60&kAV;(AMqH;~BGTM3*TJ z8ZZ#!VJOixrt9El;( zR6BgQyhA2Qy>dona^4NIUygGmu{Rfe+%2nlqg{o^L}5nCPX7R!?>Owy9=E@bHD6Pi zk2N5;Rl#(x2}qtP@kKee@&Ezd+P*Ni0aQ zh@V6ZADqf_M8(Z0BnuMTOFebkaXlp@_XdHi=zYf@OaE|7Q<;LyViiE}K`+K5By- -

- What is PvPGN? -

-
-

PvPGN (Player vs Player Gaming Network) is a bnetd based gaming network server emulation project. It currently supports all Battle.net games (such as StarCraft, Diablo II, and Warcraft III), and most Westwood Online clients (Tiberian Sun, Red Alert 2, Yuri's Revenge). It gives you the power to run your own server, manage your own users, run your own tournaments, etc.

-

Some common uses of a PvPGN server:

-
    -
  • When wanting to have a small community with local users and small ladders (lots of internet cafes do that)
  • -
  • For people who want to play on a LAN but with Battle.net-like statistics
  • -
  • For people who find Battle.net too slow or laggy and want to play on a local server with no lag
  • -
-

It puts you as a "System Administrator" in control. Use a PvPGN server to host your own LAN parties or put the server online and on the internet for everyone. You can run tournaments, have your own local competition ladders. The power is in your hands.

-
-

- Where do I start? -

-
-

- If you are interested in setting up your own PvPGN server, start here.
- If you are a gamer who wants to play on a PvPGN server, start here. -

-
diff --git a/web/site/includes/help.htm b/web/site/includes/help.htm deleted file mode 100644 index 2d76a55..0000000 --- a/web/site/includes/help.htm +++ /dev/null @@ -1,22 +0,0 @@ - - - - - -
-

Getting help

-

Need help using PvPGN? Here are your options:

-

Documentation. This is where you should start. The documentation is currently under construction although constantly growing, and it is definately helpful.

-

PvPGN Wiki. Further documentation and help can be found in the wiki.

-

pvpgn-users mailing list. Get help from other users. Sign up here.

-

PvPGN Forums. If you can't figure out your problem yourself (after reading through the documentation), then you should try the forums at http://forums.pvpgn.org. Before posting for help, please search the forums to see if your question has already been answered as it is annoying for us to answer the same question over and over again.

-

PvPGN IRC. Channel #pvpgn on irc.pvpgn.org. You can chat with other PvPGN users and the developers there.

- -
-

Giving help

-

PvPGN is a volunteer effort. Here's how you can help:

-

The pvpgn-dev mailing list. Whether you're a potential developer, tester, or just want to know what's going on with PvPGN, anyone interested in PvPGN development should join the pvpgn-dev mailing list. We will occasionally ask for new code to be tested and get your feedback, as well as discussing new features, bugs, new releases, etc.

-

Developers. PvPGN has very few active developers and needs a lot more! If you can code C, then the best way to give something back to the PvPGN community is to become a developer. Start by reading the README.DEV document.

-

Testing. PvPGN is always looking for good testers (see above)

-

Documentation. The project is always short on people willing to write documentation.

-
diff --git a/web/site/includes/sqlerror.htm b/web/site/includes/sqlerror.htm deleted file mode 100644 index 4669f4a..0000000 --- a/web/site/includes/sqlerror.htm +++ /dev/null @@ -1,85 +0,0 @@ - - - - PvPGN - - - - - - - - -
- - - - - - - - - -
- - - -
-
- - - - -
-   -
-
-
- - - - - -
-
- -
-
-

- Error -

-

- There seems to be a problem with the MySQL server. Please try again later -

-
-
- - - - - - -
-   - - - - - - - - -
- Hosted -
- by -
-
- - BerliOS - -
-
- diff --git a/web/site/includes/viewnews.php b/web/site/includes/viewnews.php deleted file mode 100644 index e3152bd..0000000 --- a/web/site/includes/viewnews.php +++ /dev/null @@ -1,80 +0,0 @@ - $total_newsitems) { - $limit = $items_front_page .','. $items_archive_page; - $curpage = 1; -} else { - $limit = $_GET['start'] .','. $items_archive_page; - if (!is_int($curpage = ((($_GET['start'] - $items_front_page) / $items_archive_page) + 1))) { - $curpage = 0; - } -} - -$query = mysql_query("SELECT t1.username,t1.email,t2.timestamp,t2.subject,t2.text FROM users AS t1, news AS t2 WHERE t1.uid = t2.poster ORDER BY t2.timestamp DESC LIMIT ".$limit.";",$dbh); - -if ($row = mysql_fetch_row($query)) { - do { - echo " "; - echo " "; - echo "
"; - echo " " . $row[3]. ""; - echo "
Posted by ". $row[0] ." on ".date($dateformat,$row[2])."

"; - echo " " . str_replace("\n","
\n",str_replace("changelog","changelog",$row[4])) . "
"; - echo "
"; - echo "
 
"; - echo "
 
"; - } while ($row = mysql_fetch_row($query)); - mysql_free_result($query); -} else { - echo "
No news found
\n"; -} -if ($_GET['page'] == 'newsarchive') { -?> - - - - -
- Page: -".round($x+1).""; - } - } -?> -

- - - - - -
- News archive -

- diff --git a/web/site/index.php b/web/site/index.php deleted file mode 100644 index 041ae14..0000000 --- a/web/site/index.php +++ /dev/null @@ -1,293 +0,0 @@ -\n"; - $time = microtime_float() - $time_start; - echo " Page generation time: ".sprintf("%2.2f",$time)." seconds\n"; - echo "\n"; - echo ""; - echo ""; - die(); -} -mysql_select_db($dbname,$dbh); - -if (!isset($_GET['page'])) { - $_GET['page'] = 'index'; -} - -$query = mysql_query("SELECT title FROM titles WHERE `page` = '".$_GET['page']."';",$dbh); -if ($row = mysql_fetch_row($query)) { - $title = $row[0]; - mysql_free_result($query); - unset($query); - unset($row); -} else { - die('Hacking attempt!'); -} -?> - - - - <?php echo $title; ?> - - - - - - - - -
- - - - - - - - - -
- - - -
-
- - - - -
- - - \n"; - } - mysql_free_result($query); - unset($query); - unset($row); - unset($linkwidth); - ?> - -
-
-
-
- - - - - -
-
- \n"; - ?> -
-
- $mb ) { - $mysize = sprintf ("%01.2f",$size/$mb) . " MB"; - } elseif ( $size >= 1024 ) { - $mysize = sprintf ("%01.2f",$size/1024) . " KB"; - } else { - $mysize = $size . " bytes"; - } - return $mysize; - } - - // Check to see if there is a development release currently - if ($latest_development <> 0) { - // Pass some instructions to files.php and run it - $filesphp = array( - 'type' => 'development', - 'version' => $latest_development); - include('files.php'); - } - // We will assume that there will always be a stable release - $filesphp = array( - 'type' => 'stable', - 'version' => $latest_stable); - include('files.php'); - // And finally, d2pack109 - $filesphp = array( - 'type' => 'd2pack109', - 'version' => $latest_d2pack109); - include('files.php'); - - // Show downloads for support files. There is no reason to keep these in a database - // cos they rarely change. - ?> - - - - - - - - - - - - - - - - -
-

Support files

-
  - - - - - -
- pvpgn-support-1.2.tar.gz -
-
- Support files - - 123.09 KB -
  - - - - - - -
- pvpgn-support-1.2.zip -
-
- Support files - - 125.11 KB -

- - - - -
- More files... -
-
- \n"; - $changelog = file('includes/version-history.txt'); - $changelog[0] = 'skipme'; - $changelog[1] = 'skipme'; - foreach ($changelog as $line) { - $line = trim($line); - if ($line == 'skipme') { - continue; - } elseif (substr($line,0,1) == '[') { - $pos = strpos($line,']'); - echo "".substr($line,0,$pos+1).""; - echo substr($line,$pos+2)."
\n"; - } elseif (substr($line,0,13) == 'Changelog for' || substr($line,0,13) == 'ChangeLog for') { - echo "$line\n"; - } elseif (ereg('^========================+', $line)) { - echo "$line
\n"; - } else { - echo $line . "
\n"; - } - } - echo "

\n"; - } else if ($_GET['page'] == 'about') { - // "What is PvPGN?" page - readfile('includes/about.htm'); - } else if ($_GET['page'] == 'help') { - // "Help" page - echo "
 
\n"; - readfile('includes/help.htm'); - } else { - // To show the news page, we just include viewnews.php - echo "
 
"; - include('includes/viewnews.php'); - } - ?> -
-
- - - - - - -
-   - - - - - - - - -
- Hosted -
- by -
-
- - BerliOS - -
-
- - - - diff --git a/web/site/pvpgn.css b/web/site/pvpgn.css deleted file mode 100644 index d00f16e..0000000 --- a/web/site/pvpgn.css +++ /dev/null @@ -1,86 +0,0 @@ -body { - margin-left: 0px; - margin-top: 0px; - margin-right: 0px; - margin-bottom: 0px; - background-color: #000000; - color: #FFFFFF; -} -a { - color: #FFB019; - text-decoration: underline; -} -a.link { - display: block; - text-decoration: none; - font-family: Arial, Helvetica, sans-serif; - font-weight: bold; - font-size: 12px; - color: #FFB019; - BORDER: none; -} -a.link:hover { - background-color: #333333; -} -a.link2 { - font-weight: bold; - font-family: Arial, Helvetica, sans-serif; - font-size: 13px; - color: #FFB019; - text-decoration: none; -} -.text13 { - font-family: Arial, Helvetica, sans-serif; - font-size: 13px; - color: #FFFFFF; -} -.text12 { - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - color: #FFFFFF; -} -.text9 { - font-family: Arial, Helvetica, sans-serif; - font-size: 9px; - color: #FFFFFF; -} -.helptitle { - font-family: Arial, Helvetica, sans-serif; - font-size: 18px; - color: #FFB019; -} -.newstitle { - font-family: Arial, Helvetica, sans-serif; - font-size: 13px; - color: #FFB019; -} -.newsarchive { - text-align: center; - font-family: Arial, Helvetica, sans-serif; - font-size: 13px; - color: #FFFFFF; -} -.hostedby { - font-family: Arial, Helvetica, sans-serif; - font-size: 9px; - color: #FFFFFF; - text-align: right; -} -.footer { - font-size: 9px; - color: #666666; - font-family: Verdana, Arial, Helvetica, sans-serif; - text-align: center; - border: 0px; -} -td.topbar { - height: 68px; - vertical-align: bottom; - background-image: url(images/topbar-bg.gif); -} -td.botbar { - height: 63px; - vertical-align: top; - background-image: url(images/botbar-bg.gif); - text-align: right; -}

xExzV zE!ztiTGVSt*b2&F1eu7gT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)a^YkC*^e1PN$Y`&9B>+ z)cyn^i#nutTZNc!k}oGeQI|R6&v}hY%xchrg)0k4fTDOd4TU^kP`{_*E~`GCQvw}{ znQJUj26)u0T=a_*1`hrdV?6eXUKVr~-H|IDpFe9vSip!Cy5*X?Wa2LoR-x%AV4h0~ z+B5<+l1O&Z4_DPs5wN>PzpjWF`$ z>v97@GSuWsgZn4J8{+I@RfJVcsizI@*;mvT*|%SjpLmp6KDLBW#ehHGr1FZG$8sOe zQ))a)$l4#;XYgF>GS@uE%5?oC7qa99S`ei(aSq7pu*G5FXG&aUGSAlh) zkgMcn0gQeTddBn9@4m)NhsoQaoW5kSvl`y8YX1e=9y3k8jgfzIc)CY%W8?zEJ1Y@j z_#jvM(TV2sLPP=GvZ5vFica&F{9A!XHGv1>4(n&3Ia}^e-~A)RJ9O487~i22T&mFS4t=*cW7Vg8VM| z{71tO(wp=^=&k+(i_L5H#B|52)q1s*<0BW0pb#(rGV31*5UMj;cO#Y_E4qb)o=fuM zZ7yP8-l^cw9F@Q2YJ20KgpiJZ=4Gww>*oJKR@UhqceH`h|+_A)SC@&Fnv*wvo)ktYm->qV~x=ZYKO_uCj>Xa*G^-S z=LdwRDiWm2nPYxNdcq6z1U1U9aX-eFyrz9yBDsXGH1Q~UOxg_rI-bPZxtM?Nk5**kwtoBO&L6d}eVM)QY>m73T@1gqoi29|y`afj&-;c+3F2i%o6Yms z86rzq@eO~|BP*o_UYCp(5lSMD+{}MzSw0L@Y^}suO}A>@i~hOx0e$aB&*$f#!!P&| VA36UVG>jE4`uERPJ01==`+qE8y)Xa( diff --git a/web/site/includes/about.htm b/web/site/includes/about.htm deleted file mode 100644 index 2c30eb6..0000000 --- a/web/site/includes/about.htm +++ /dev/null @@ -1,23 +0,0 @@ -