├── .github └── workflows │ └── codeql-analysis.yml ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── CREDITS ├── ConfigureChecks.cmake ├── LICENSE ├── NEWS ├── README.DEV ├── README.md ├── UPDATE ├── appveyor.yml ├── cmake └── Modules │ ├── CheckMkdirArgs.cmake │ ├── DefineInstallationPaths.cmake │ ├── FindMySQL.cmake │ ├── FindODBC.cmake │ ├── FindPostgreSQL.cmake │ ├── FindSQLite3.cmake │ ├── cmake_purge.cmake.in │ └── cmake_uninstall.cmake.in ├── conf ├── CMakeLists.txt ├── ad.json.in ├── address_translation.conf.in ├── anongame_infos.conf.in ├── autoupdate.conf.in ├── bnalias.conf.in ├── bnban.conf.in ├── bnetd.conf.in ├── bnetd.conf.win32 ├── bnetd_default_user.plain.in ├── bnissue.txt.in ├── bnmaps.conf.in ├── bnxpcalc.conf.in ├── bnxplevel.conf.in ├── channel.conf.in ├── command_groups.conf.in ├── d2cs.conf.in ├── d2cs.conf.win32 ├── d2dbs.conf.in ├── d2dbs.conf.win32 ├── i18n │ ├── CMakeLists.txt │ ├── bgBG │ │ ├── bnmotd.txt │ │ └── common.xml │ ├── bnhelp.conf │ ├── bnmotd.txt │ ├── chathelp-war3.txt │ ├── common.xml │ ├── csCZ │ │ ├── bnmotd.txt │ │ └── common.xml │ ├── deDE │ │ ├── bnhelp.conf │ │ ├── bnmotd.txt │ │ ├── chathelp-war3.txt │ │ ├── common.xml │ │ ├── newaccount.txt │ │ ├── termsofservice.txt │ │ └── w3motd.txt │ ├── esES │ │ ├── bnhelp.conf │ │ ├── bnmotd.txt │ │ ├── chathelp-war3.txt │ │ ├── common.xml │ │ ├── newaccount.txt │ │ ├── termsofservice.txt │ │ └── w3motd.txt │ ├── frFR │ │ ├── bnmotd.txt │ │ ├── chathelp-war3.txt │ │ └── common.xml │ ├── itIT │ │ ├── bnmotd.txt │ │ └── common.xml │ ├── jpJA │ │ ├── bnmotd.txt │ │ └── common.xml │ ├── koKR │ │ ├── bnmotd.txt │ │ ├── common.xml │ │ └── termsofservice.txt │ ├── newaccount.txt │ ├── news.txt │ ├── nlNL │ │ ├── bnmotd.txt │ │ └── common.xml │ ├── plPL │ │ ├── bnmotd.txt │ │ └── common.xml │ ├── ptBR │ │ ├── bnmotd.txt │ │ └── common.xml │ ├── ruRU │ │ ├── bnmotd.txt │ │ ├── chathelp-war3.txt │ │ └── common.xml │ ├── svSE │ │ ├── bnmotd.txt │ │ └── common.xml │ ├── termsofservice.txt │ ├── w3motd.txt │ ├── zhCN │ │ ├── bnmotd.txt │ │ ├── chathelp-war3.txt │ │ └── common.xml │ └── zhTW │ │ ├── bnmotd.txt │ │ └── common.xml ├── icons.conf.in ├── realm.conf.in ├── sql_DB_layout.conf.in ├── supportfile.conf.in ├── topics.conf.in ├── tournament.conf.in └── versioncheck.json.in ├── config.h.cmake ├── docs ├── adbanners.md ├── bnmotd.md ├── compile.g++.md ├── compile.visualstudio2015.md ├── fdwatch.txt ├── ports.md ├── readme.md ├── storage.txt └── versioncheck.md ├── files ├── CMakeLists.txt ├── IX86ExtraWork.mpq ├── IX86ver1.mpq ├── PMACver1.mpq ├── XMACver1.mpq ├── ad000001.png ├── ad000001.smk ├── ad000002.mng ├── ad000002.smk ├── bnserver-D2DV.ini ├── bnserver-D2XP.ini ├── bnserver-WAR3.ini ├── bnserver.ini ├── icons-WAR3.bni ├── icons.bni ├── icons_STAR.bni ├── newbie.save └── ver-IX86-1.mpq ├── lib └── fmt │ ├── CMakeLists.txt │ ├── core.h │ ├── format-inl.h │ ├── format.cc │ ├── format.h │ ├── ostream.h │ ├── posix.cc │ ├── posix.h │ ├── printf.h │ ├── ranges.h │ └── time.h ├── lua ├── CMakeLists.txt ├── antihack │ └── starcraft.lua ├── command │ ├── ping.lua │ ├── redirect.lua │ ├── stats.lua │ └── w3motd.lua ├── config.lua ├── extend │ ├── account.lua │ ├── account_wrap.lua │ ├── channel.lua │ ├── enum │ │ ├── attr.lua │ │ ├── eventlog.lua │ │ ├── game.lua │ │ ├── message.lua │ │ ├── messagebox.lua │ │ └── tag.lua │ ├── eventlog.lua │ ├── game.lua │ └── message.lua ├── ghost │ ├── command.lua │ ├── command_callback.lua │ ├── ghost.lua │ ├── handle.lua │ ├── helper.lua │ └── maplist.txt ├── handle_channel.lua ├── handle_client.lua ├── handle_command.lua ├── handle_game.lua ├── handle_server.lua ├── handle_user.lua ├── include │ ├── bitwise.lua │ ├── common.lua │ ├── convert.lua │ ├── file.lua │ ├── math.lua │ ├── string.lua │ ├── table.lua │ └── timer.lua ├── main.lua └── quiz │ ├── command.lua │ ├── helper.lua │ ├── questions │ ├── dota.txt │ ├── misc.txt │ └── warcraft.txt │ ├── quiz.lua │ └── records.lua ├── man ├── CMakeLists.txt ├── bnbot.1 ├── bnchat.1 ├── bnetd.1 ├── bnetd.conf.5 ├── bnftp.1 ├── bni2tga.1 ├── bnibuild.1 ├── bniextract.1 ├── bnilist.1 ├── bnpass.1 ├── bnpcap.1 ├── bnproxy.1 ├── bnstat.1 ├── bntext.5 ├── bntrackd.1 └── tgainfo.1 ├── scripts ├── S98bnetd ├── announce.sh ├── bnetd.init ├── bnetd.logrotate ├── bnetmasq.sh ├── convert_w3.pl ├── cvs2cl.pl ├── flat2cdb.pl ├── fsgs2bnetd.pl ├── ladder.py ├── lastlogin.pl ├── localize │ ├── pvpgn_localize_generator.cs │ ├── pvpgn_localize_generator.exe │ ├── pvpgn_localize_validator.cs │ ├── pvpgn_localize_validator.exe │ ├── update.bat │ └── validate.bat ├── login_testusers.sh ├── make_testusers.sh ├── process.pl ├── pvpgn_hash.inc.php ├── pvpgn_wol_hash.inc.php ├── rc.bnetd ├── reform.awk ├── sql │ └── repairlevels.pl ├── storage │ ├── cdb2sql.pl │ └── plain2sql.pl ├── tos.bat └── tos.sh ├── src ├── CMakeLists.txt ├── bnetd │ ├── CMakeLists.txt │ ├── account.cpp │ ├── account.h │ ├── account_wrap.cpp │ ├── account_wrap.h │ ├── adbanner.cpp │ ├── adbanner.h │ ├── alias_command.cpp │ ├── alias_command.h │ ├── anongame.cpp │ ├── anongame.h │ ├── anongame_gameresult.cpp │ ├── anongame_gameresult.h │ ├── anongame_infos.cpp │ ├── anongame_infos.h │ ├── anongame_maplists.cpp │ ├── anongame_maplists.h │ ├── anongame_wol.cpp │ ├── anongame_wol.h │ ├── attr.h │ ├── attrgroup.cpp │ ├── attrgroup.h │ ├── attrlayer.cpp │ ├── attrlayer.h │ ├── autoupdate.cpp │ ├── autoupdate.h │ ├── channel.cpp │ ├── channel.h │ ├── channel_conv.cpp │ ├── channel_conv.h │ ├── character.cpp │ ├── character.h │ ├── clan.cpp │ ├── clan.h │ ├── cmdline.cpp │ ├── cmdline.h │ ├── command.cpp │ ├── command.h │ ├── command_groups.cpp │ ├── command_groups.h │ ├── connection.cpp │ ├── connection.h │ ├── file.cpp │ ├── file.h │ ├── file_plain.cpp │ ├── file_plain.h │ ├── friends.cpp │ ├── friends.h │ ├── game.cpp │ ├── game.h │ ├── game_conv.cpp │ ├── game_conv.h │ ├── handle_anongame.cpp │ ├── handle_anongame.h │ ├── handle_apireg.cpp │ ├── handle_apireg.h │ ├── handle_bnet.cpp │ ├── handle_bnet.h │ ├── handle_bot.cpp │ ├── handle_bot.h │ ├── handle_d2cs.cpp │ ├── handle_d2cs.h │ ├── handle_file.cpp │ ├── handle_file.h │ ├── handle_init.cpp │ ├── handle_init.h │ ├── handle_irc.cpp │ ├── handle_irc.h │ ├── handle_irc_common.cpp │ ├── handle_irc_common.h │ ├── handle_telnet.cpp │ ├── handle_telnet.h │ ├── handle_udp.cpp │ ├── handle_udp.h │ ├── handle_wol.cpp │ ├── handle_wol.h │ ├── handle_wol_gameres.cpp │ ├── handle_wol_gameres.h │ ├── handle_wserv.cpp │ ├── handle_wserv.h │ ├── handlers.h │ ├── helpfile.cpp │ ├── helpfile.h │ ├── i18n.cpp │ ├── i18n.h │ ├── icons.cpp │ ├── icons.h │ ├── ipban.cpp │ ├── ipban.h │ ├── irc.cpp │ ├── irc.h │ ├── ladder.cpp │ ├── ladder.h │ ├── ladder_calc.cpp │ ├── ladder_calc.h │ ├── luafunctions.cpp │ ├── luafunctions.h │ ├── luainterface.cpp │ ├── luainterface.h │ ├── luaobjects.cpp │ ├── luaobjects.h │ ├── luawrapper.cpp │ ├── luawrapper.h │ ├── mail.cpp │ ├── mail.h │ ├── main.cpp │ ├── message.cpp │ ├── message.h │ ├── news.cpp │ ├── news.h │ ├── output.cpp │ ├── output.h │ ├── prefs.cpp │ ├── prefs.h │ ├── quota.h │ ├── realm.cpp │ ├── realm.h │ ├── runprog.cpp │ ├── runprog.h │ ├── server.cpp │ ├── server.h │ ├── sql_common.cpp │ ├── sql_common.h │ ├── sql_dbcreator.cpp │ ├── sql_dbcreator.h │ ├── sql_mysql.cpp │ ├── sql_mysql.h │ ├── sql_odbc.cpp │ ├── sql_odbc.h │ ├── sql_pgsql.cpp │ ├── sql_pgsql.h │ ├── sql_sqlite3.cpp │ ├── sql_sqlite3.h │ ├── storage.cpp │ ├── storage.h │ ├── storage_file.cpp │ ├── storage_file.h │ ├── storage_sql.cpp │ ├── storage_sql.h │ ├── support.cpp │ ├── support.h │ ├── team.cpp │ ├── team.h │ ├── tick.cpp │ ├── tick.h │ ├── timer.cpp │ ├── timer.h │ ├── topic.cpp │ ├── topic.h │ ├── tournament.cpp │ ├── tournament.h │ ├── tracker.cpp │ ├── tracker.h │ ├── udptest_send.cpp │ ├── udptest_send.h │ ├── userlog.cpp │ ├── userlog.h │ ├── versioncheck.cpp │ ├── versioncheck.h │ ├── watch.cpp │ └── watch.h ├── bniutils │ ├── CMakeLists.txt │ ├── bni.cpp │ ├── bni.h │ ├── bni2tga.cpp │ ├── bnibuild.cpp │ ├── bniextract.cpp │ ├── bnilist.cpp │ ├── fileio.cpp │ ├── fileio.h │ ├── tga.cpp │ ├── tga.h │ └── tgainfo.cpp ├── bnpass │ ├── CMakeLists.txt │ ├── bnpass.cpp │ └── sha1hash.cpp ├── bnproxy │ ├── bnproxy.c │ ├── virtconn.c │ └── virtconn.h ├── bntrackd │ ├── CMakeLists.txt │ ├── bntrackd.cpp │ └── servers.xsl ├── client │ ├── CMakeLists.txt │ ├── ansi_term.h │ ├── bnbot.cpp │ ├── bnchat.cpp │ ├── bnftp.cpp │ ├── bnstat.cpp │ ├── client.cpp │ ├── client.h │ ├── client_connect.cpp │ ├── client_connect.h │ ├── udptest.cpp │ └── udptest.h ├── common │ ├── CMakeLists.txt │ ├── addr.cpp │ ├── addr.h │ ├── anongame_protocol.h │ ├── asnprintf.cpp │ ├── asnprintf.h │ ├── bigint.cpp │ ├── bigint.h │ ├── bn_type.cpp │ ├── bn_type.h │ ├── bnet_protocol.h │ ├── bnethash.cpp │ ├── bnethash.h │ ├── bnethashconv.cpp │ ├── bnethashconv.h │ ├── bnetsrp3.cpp │ ├── bnetsrp3.h │ ├── bnettime.cpp │ ├── bnettime.h │ ├── bot_protocol.h │ ├── conf.cpp │ ├── conf.h │ ├── d2char_checksum.cpp │ ├── d2char_checksum.h │ ├── d2char_file.h │ ├── d2cs_bnetd_protocol.h │ ├── d2cs_d2dbs_ladder.h │ ├── d2cs_d2gs_character.h │ ├── d2cs_d2gs_protocol.h │ ├── d2cs_protocol.h │ ├── d2game_protocol.h │ ├── elist.h │ ├── eventlog.cpp │ ├── eventlog.h │ ├── fdwatch.cpp │ ├── fdwatch.h │ ├── fdwatch_epoll.cpp │ ├── fdwatch_epoll.h │ ├── fdwatch_kqueue.cpp │ ├── fdwatch_kqueue.h │ ├── fdwatch_poll.cpp │ ├── fdwatch_poll.h │ ├── fdwatch_select.cpp │ ├── fdwatch_select.h │ ├── fdwbackend.cpp │ ├── fdwbackend.h │ ├── field_sizes.h │ ├── file_protocol.h │ ├── flags.h │ ├── give_up_root_privileges.cpp │ ├── give_up_root_privileges.h │ ├── gui_printf.cpp │ ├── gui_printf.h │ ├── hash_tuple.hpp │ ├── hashtable.cpp │ ├── hashtable.h │ ├── hexdump.cpp │ ├── hexdump.h │ ├── init_protocol.h │ ├── introtate.h │ ├── irc_protocol.h │ ├── list.cpp │ ├── list.h │ ├── lstr.h │ ├── network.cpp │ ├── network.h │ ├── packet.cpp │ ├── packet.h │ ├── peerchat.cpp │ ├── peerchat.h │ ├── proginfo.cpp │ ├── proginfo.h │ ├── pugiconfig.h │ ├── pugixml.cpp │ ├── pugixml.h │ ├── queue.cpp │ ├── queue.h │ ├── rcm.cpp │ ├── rcm.h │ ├── rlimit.cpp │ ├── rlimit.h │ ├── scoped_array.h │ ├── scoped_ptr.h │ ├── setup_after.h │ ├── setup_before.h │ ├── systemerror.cpp │ ├── systemerror.h │ ├── tag.cpp │ ├── tag.h │ ├── token.cpp │ ├── token.h │ ├── tracker.h │ ├── trans.cpp │ ├── trans.h │ ├── udp_protocol.h │ ├── util.cpp │ ├── util.h │ ├── version.h │ ├── wol_gameres_protocol.h │ ├── wolhash.cpp │ ├── wolhash.h │ ├── xalloc.cpp │ ├── xalloc.h │ ├── xstr.cpp │ ├── xstr.h │ ├── xstring.cpp │ └── xstring.h ├── compat │ ├── CMakeLists.txt │ ├── access.h │ ├── gethostname.h │ ├── gettimeofday.cpp │ ├── gettimeofday.h │ ├── mkdir.h │ ├── mmap.cpp │ ├── mmap.h │ ├── netinet_in.h │ ├── pdir.cpp │ ├── pdir.h │ ├── pgetopt.cpp │ ├── pgetopt.h │ ├── pgetpid.h │ ├── psock.cpp │ ├── psock.h │ ├── read.h │ ├── recv.h │ ├── rename.h │ ├── runtime_libs.h │ ├── send.h │ ├── socket.h │ ├── statmacros.h │ ├── stdfileno.h │ ├── strcasecmp.cpp │ ├── strcasecmp.h │ ├── strdup.cpp │ ├── strdup.h │ ├── strerror.cpp │ ├── strerror.h │ ├── strncasecmp.cpp │ ├── strncasecmp.h │ ├── strsep.cpp │ ├── strsep.h │ ├── termios.h │ ├── uname.cpp │ └── uname.h ├── d2cs │ ├── CMakeLists.txt │ ├── bit.h │ ├── bnetd.cpp │ ├── bnetd.h │ ├── cmdline.cpp │ ├── cmdline.h │ ├── connection.cpp │ ├── connection.h │ ├── d2charfile.cpp │ ├── d2charfile.h │ ├── d2charlist.cpp │ ├── d2charlist.h │ ├── d2gs.cpp │ ├── d2gs.h │ ├── d2ladder.cpp │ ├── d2ladder.h │ ├── game.cpp │ ├── game.h │ ├── gamequeue.cpp │ ├── gamequeue.h │ ├── handle_bnetd.cpp │ ├── handle_bnetd.h │ ├── handle_d2cs.cpp │ ├── handle_d2cs.h │ ├── handle_d2gs.cpp │ ├── handle_d2gs.h │ ├── handle_init.cpp │ ├── handle_init.h │ ├── handle_signal.cpp │ ├── handle_signal.h │ ├── main.cpp │ ├── net.cpp │ ├── net.h │ ├── prefs.cpp │ ├── prefs.h │ ├── s2s.cpp │ ├── s2s.h │ ├── server.cpp │ ├── server.h │ ├── serverqueue.cpp │ ├── serverqueue.h │ ├── setup.h │ └── version.h ├── d2dbs │ ├── CMakeLists.txt │ ├── charlock.cpp │ ├── charlock.h │ ├── cmdline.cpp │ ├── cmdline.h │ ├── d2ladder.cpp │ ├── d2ladder.h │ ├── dbsdupecheck.cpp │ ├── dbsdupecheck.h │ ├── dbserver.cpp │ ├── dbserver.h │ ├── dbspacket.cpp │ ├── dbspacket.h │ ├── handle_signal.cpp │ ├── handle_signal.h │ ├── main.cpp │ ├── prefs.cpp │ ├── prefs.h │ ├── setup.h │ └── version.h ├── json │ └── json.hpp ├── test │ ├── CMakeLists.txt │ ├── bigint.cpp │ └── bnetsrp3_test.cpp └── win32 │ ├── CMakeLists.txt │ ├── console_output.cpp │ ├── console_output.h │ ├── console_resource.h │ ├── console_resource.rc │ ├── d2cs_resource.h │ ├── d2cs_resource.rc │ ├── d2cs_winmain.cpp │ ├── d2dbs_resource.h │ ├── d2dbs_resource.rc │ ├── d2dbs_winmain.cpp │ ├── dirent.h │ ├── logo01.ico │ ├── resource.h │ ├── resource.rc │ ├── service.cpp │ ├── service.h │ ├── windump.cpp │ ├── windump.h │ ├── winmain.cpp │ └── winmain.h └── version-history.txt /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # This .gitignore file was automatically created by Microsoft(R) Visual Studio. 3 | ################################################################################ 4 | 5 | /zlib 6 | /cmake/Modules 7 | /build 8 | /lua5.1 9 | /.vs 10 | /CMakeSettings.json 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | os: linux 2 | dist: focal 3 | arch: amd64 4 | 5 | language: cpp 6 | compiler: 7 | - gcc 8 | 9 | branches: 10 | only: 11 | - master 12 | - develop 13 | 14 | addons: 15 | apt: 16 | packages: 17 | - zlib1g-dev 18 | - build-essential 19 | - libmysqlclient-dev 20 | - liblua5.1-0-dev 21 | 22 | before_script: 23 | - mkdir build 24 | - cd build 25 | - cmake -D WITH_MYSQL=true -D WITH_LUA=true ../ 26 | 27 | script: 28 | - make 29 | 30 | after_script: 31 | - sudo make install 32 | - sudo make uninstall 33 | -------------------------------------------------------------------------------- /cmake/Modules/FindSQLite3.cmake: -------------------------------------------------------------------------------- 1 | # - Find sqlite3 2 | # Find the native SQLite3 includes and library 3 | # 4 | # SQLITE3_INCLUDE_DIR - where to find sqlite3.h 5 | # SQLITE3_LIBRARIES - List of libraries when using SQLite3. 6 | # SQLITE3_FOUND - True if SQLite3 found. 7 | 8 | IF (SQLITE3_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | SET(SQLite3_FIND_QUIETLY TRUE) 11 | ENDIF (SQLITE3_INCLUDE_DIR) 12 | 13 | FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h 14 | /usr/local/include/sqlite3 15 | /usr/local/include 16 | /usr/include/sqlite3 17 | /usr/include 18 | ${CMAKE_SOURCE_DIR}/sqlite3 19 | ) 20 | 21 | SET(SQLITE3_NAMES sqlite3) 22 | FIND_LIBRARY(SQLITE3_LIBRARY 23 | NAMES ${SQLITE3_NAMES} 24 | PATHS /usr/local/lib /usr/lib 25 | ${CMAKE_SOURCE_DIR}/sqlite3 26 | ) 27 | 28 | IF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY) 29 | SET(SQLITE3_FOUND TRUE) 30 | SET( SQLITE3_LIBRARIES ${SQLITE3_LIBRARY} ) 31 | ELSE (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY) 32 | SET(SQLITE3_FOUND FALSE) 33 | SET( SQLITE3_LIBRARIES ) 34 | ENDIF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY) 35 | 36 | IF (SQLITE3_FOUND) 37 | IF (NOT SQLite3_FIND_QUIETLY) 38 | MESSAGE(STATUS "Found SQLite3: ${SQLITE3_LIBRARY}") 39 | ENDIF (NOT SQLite3_FIND_QUIETLY) 40 | ELSE (SQLITE3_FOUND) 41 | IF (SQLite3_FIND_REQUIRED) 42 | MESSAGE(STATUS "Looked for SQLite3 libraries named ${SQLITE3_NAMES}.") 43 | MESSAGE(FATAL_ERROR "Could NOT find SQLite3 library") 44 | ENDIF (SQLite3_FIND_REQUIRED) 45 | ENDIF (SQLITE3_FOUND) 46 | 47 | MARK_AS_ADVANCED( 48 | SQLITE3_LIBRARY 49 | SQLITE3_INCLUDE_DIR 50 | ) 51 | -------------------------------------------------------------------------------- /cmake/Modules/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 9 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if(NOT "${rm_retval}" STREQUAL 0) 16 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 17 | endif(NOT "${rm_retval}" STREQUAL 0) 18 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 19 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 20 | endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 21 | endforeach(file) -------------------------------------------------------------------------------- /conf/ad.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "ads": 3 | [ 4 | {"filename": "ad000001.png", "url": "http://pvpgn.pro", "client": "W3XP", "lang": "NULL"}, 5 | {"filename": "ad000002.mng", "url": "http://pvpgn.pro", "client": "W3XP", "lang": "NULL"}, 6 | {"filename": "ad000001.smk", "url": "http://pvpgn.pro", "client": "NULL", "lang": "NULL"}, 7 | {"filename": "ad000002.smk", "url": "http://pvpgn.pro", "client": "NULL", "lang": "NULL"} 8 | ] 9 | } -------------------------------------------------------------------------------- /conf/anongame_infos.conf.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/conf/anongame_infos.conf.in -------------------------------------------------------------------------------- /conf/bnban.conf.in: -------------------------------------------------------------------------------- 1 | # an example wildcard-match entry 2 | #127.*.*.* 3 | 4 | # an example exact-match entry 5 | #127.0.0.1 6 | 7 | # an example range-match entry 8 | #127.0.0.79-127.0.0.84 9 | 10 | # two example network entries 11 | #127.0.0.0/8 12 | #127.0.0.0/255.0.0.0 13 | -------------------------------------------------------------------------------- /conf/bnissue.txt.in: -------------------------------------------------------------------------------- 1 | BOT or Telnet Connection from [%r] 2 | 3 | Enter your account name and password. 4 | Sorry, there is no guest account. 5 | 6 | -------------------------------------------------------------------------------- /conf/bnxpcalc.conf.in: -------------------------------------------------------------------------------- 1 | # This file is used to compute the XP points gained/lost by Warcraft III 2 | # anonymous matchmaking games 3 | # 4 | # 5 | # 6 | # Note: you may notice that blizzard has columns for points win/loss by 7 | # higher and lower opponets but because they must keep constant the sum 8 | # of points the columns are in "mirror" 9 | 10 | # used for all players 11 | 65 0 100 100 100 100 12 | 65 1 95 105 115 85 13 | 65 2 90 110 130 70 14 | 65 3 85 115 145 55 15 | 65 4 80 120 155 45 16 | 65 5 75 125 165 35 17 | 65 6 70 130 175 25 18 | -------------------------------------------------------------------------------- /conf/i18n/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # copy all files from directory 2 | 3 | file(GLOB DEPLOY_FILES_AND_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/*") 4 | 5 | foreach(ITEM ${DEPLOY_FILES_AND_DIRS}) 6 | IF( IS_DIRECTORY "${ITEM}" ) 7 | LIST( APPEND DIRS_TO_DEPLOY "${ITEM}" ) 8 | ELSE() 9 | IF(NOT ${ITEM} MATCHES "CMakeLists.txt") 10 | LIST( APPEND FILES_TO_DEPLOY "${ITEM}" ) 11 | ENDIF(NOT ${ITEM} MATCHES "CMakeLists.txt") 12 | ENDIF() 13 | endforeach() 14 | 15 | INSTALL( FILES ${FILES_TO_DEPLOY} DESTINATION ${SYSCONFDIR}/i18n ) 16 | INSTALL( DIRECTORY ${DIRS_TO_DEPLOY} DESTINATION ${SYSCONFDIR}/i18n ) 17 | 18 | -------------------------------------------------------------------------------- /conf/i18n/bgBG/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EЗдравей %l, добре дошъл в %s! 2 | %IВерсията на сървъра е %v на %h. 3 | %IТози сървър се хоства от %H 4 | %I 5 | %IИма %a потребителски акаунти на този сървър. 6 | %IВ момента има %U потребители в %G игри на %N 7 | %Iи общо %u потребители играещи общо %g игри и разговарящи в общо %c канала. 8 | %IИмате проблем с команда? Въведете /help за да 9 | %Iнаучите повече за нея. 10 | %IType /language to switch translation. 11 | %I 12 | %I%m -------------------------------------------------------------------------------- /conf/i18n/bgBG/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bulgarian 5 | 6 | BGR 7 | 8 | 9 | -------------------------------------------------------------------------------- /conf/i18n/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EHello %l, welcome to %s! 2 | %IRunning version %v on %h. 3 | %IThis server is hosted by %H 4 | %I 5 | %IThere are %a user accounts on this server. 6 | %IThere are currently %U users in %G games of %N, 7 | %Iand %u users playing %g games and chatting in %c channels. 8 | %IHaving trouble with a command? Type /help to 9 | %Ilearn more about it. 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/chathelp-war3.txt: -------------------------------------------------------------------------------- 1 | PvPGN Bnet Emulation Chat Help Commands 2 | 3 | New Commands: 4 | 5 | use /f help for a friend lists help 6 | use /users to view users online 7 | use /w or /msg to whisper people 8 | use /join to join a channel 9 | 10 | For Chan Ops: 11 | 12 | use /ban bans a user from channel 13 | use /kick kicks a user from channel 14 | 15 | For a more detailed help type: /help -------------------------------------------------------------------------------- /conf/i18n/csCZ/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EAhoj %l, 2 | %IVitej na serveru %s, verze %v. 3 | %I 4 | %IMomentalne je zde registrovanych %a uzivatelu, z toho je %u online, hrajicich %g hry. 5 | %I 6 | %I%N si muzes zahrat s %U hraci, v %G prave probihajicich hrach nebo si muzes pokecat v %c chatech. 7 | %I 8 | %INevis si rady ? Napis /help pro napovedu. 9 | %I 10 | %ITvoje IP adresa: %r, tvoje ID %i a tvuj klient %t. 11 | %IType /language to switch translation. 12 | %I 13 | %M%m -------------------------------------------------------------------------------- /conf/i18n/csCZ/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Czech 5 | 6 | CZE 7 | 8 | 9 | -------------------------------------------------------------------------------- /conf/i18n/deDE/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EHallo %l, willkommen zu %s! 2 | %ILaufende Version %v auf %h. 3 | %IDer Server ist von %H gehostet 4 | %I 5 | %IEs sind %a Benutzerprofile auf dem Server. 6 | %IAktuell sind %U Spieler in %G Spielen von %N, 7 | %Iund %u Spieler spielen %g Spiele und chatten in %c Kanälen. 8 | %IEin Problem mit den Befehlen? Schreibe /help und 9 | %Ilerne mehr über die Befehle. 10 | %IType /language to switch translation. 11 | %I 12 | %M%m 13 | -------------------------------------------------------------------------------- /conf/i18n/deDE/chathelp-war3.txt: -------------------------------------------------------------------------------- 1 | PvPGN Bnet Emulation Chat Hilfe Befehle 2 | 3 | Neue Befehle: 4 | 5 | nutze /f help für Hilfe mit der Freundesliste. 6 | nutze /users um zu sehen, welche Nutzer online sind. 7 | nutze /w or /msg um Nutzer anzuflüstern. 8 | nutze /join um einem Kanal beizutreten 9 | 10 | Fuerr Chan Ops: 11 | 12 | nutze /ban um einen Nutzer aus dem Kanal zu bannen. 13 | nutze /kick um einen Nutzer aus dem Kanal zu kicken. 14 | 15 | Für eine genauere Hilfe schreibe: /help 16 | -------------------------------------------------------------------------------- /conf/i18n/deDE/w3motd.txt: -------------------------------------------------------------------------------- 1 | |c00FF0000Welcome |c00FF9933to |c0000CCFFthe |c00FF66FF%s |c0000CC00Version |c009999FF%v |c00FFFFFF 2 | 3 | Es sind zur Zeit %U Nutzer in %G Spielen von %N und %u Nutzer spielen %g Spiele and chatten in %c Kanälen. 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Dieser Text ist nicht sichtbar wegen der 11 Zeilen Begrenzung! 12 | -------------------------------------------------------------------------------- /conf/i18n/esES/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EHola %l, bienvenido a %s! 2 | %IEn %h se usa la versión %v 3 | %IEste servidor está alojado por %H 4 | %I 5 | %IEn este servidor hay %a cuentas registradas. 6 | %IActualmente hay %U usuarios en %G partidas de %N, 7 | %Iy %u usuarios jugando %g partidas y conversando en %c salas. 8 | %I¿Tiene problemas con algun comando? Teclee "/help" para 9 | %Iaprender más sobre los comandos. 10 | %IEscribir /language para cambiar el idioma de traducción. 11 | %I 12 | %M%m 13 | -------------------------------------------------------------------------------- /conf/i18n/esES/chathelp-war3.txt: -------------------------------------------------------------------------------- 1 | Comandos de Ayuda para el Chat de la Emulación de Bnet PvPGN 2 | 3 | Nuevos Comandos: 4 | 5 | usar /f help para ayuda sobre la lista de amigos 6 | usar /users para ver usuarios online 7 | usar /w o /msg para sususrrar a gente 8 | usar /join para unirse a un canal 9 | 10 | Para Operadores de Canal: 11 | 12 | usar /ban prohibe permanentenmente al usuario usar el canal 13 | usar /kick expulsa al usuario del canal 14 | 15 | Para una ayuda más detallada escribir: /help 16 | -------------------------------------------------------------------------------- /conf/i18n/esES/newaccount.txt: -------------------------------------------------------------------------------- 1 | Actualmente está conectado al Servidor PvPGN ( Player -vs- Player Gaming Network) 2 | 3 | TÉRMINOS DE USO del PvPGN: 4 | 5 | PVPGN es una emulación del servidor de Battle.net(r) y de ninguna manera afiliado con bnetd, warforge o Blizzard Entertainment (R). 6 | PVPGN está disponible al público "tal y como es" sin ningún tipo de garantias. 7 | No apoyamos la idea de software Pirata y incitamos a todos a obtener una copia legal de cualquiera de los juegos disponibles en nuestros servidores. 8 | 9 | 1. Información sobre PvPGN. 10 | PvPGN no aprueba ni se apela a la precisión, veracidad o fiabilidad de cualquier información ( incluídas declaraciones sobre opinión o consejos) dada en o por cualquier medio de PvPGN. Cualquiera y todas las declaraciones hechas en foros, chat o durante juegos reflejan solamente el parecer de su autor. 11 | 12 | 2. Exclusión de Garantía. 13 | PvPGN está disponible al público "tal y como es" sin ningún tipo de garantias. PvPGN no garantiza que su programa sea ininterrumpido o libre de errores. 14 | 15 | 3. Limitaciones de Responsabilidad. 16 | PvPGN es de ninguna manera responsable por pérdidas o daños de cualquier tipo al usar PvPGN, incluyendo pero no limitándose a, pérdida de libre voluntad, paro laboral, fallos o defectos en los ordenadores, o cualquier y todos otros tipos de daños o perdidas, comerciales o de cualquier otro tipo. 17 | 18 | Battle.net(R) y Blizzard Entertainment(R) son marcas registrada de Blizzard Entertainment en los E.U. y/o otros países. 19 | 20 | Aparte de todo esto... Disfrutar jugando.. 21 | PvPGN Project Page: http://pvpgn.berlios.de/ 22 | -------------------------------------------------------------------------------- /conf/i18n/esES/termsofservice.txt: -------------------------------------------------------------------------------- 1 | Actualmente está conectado al Servidor PvPGN ( Player -vs- Player Gaming Network) 2 | 3 | TÉRMINOS DE USO del PvPGN: 4 | 5 | PVPGN es una emulación del servidor de Battle.net(r) y de ninguna manera afiliado con bnetd, warforge o Blizzard Entertainment (R). 6 | PVPGN está disponible al público "tal y como es" sin ningún tipo de garantias. 7 | No apoyamos la idea de software Pirata y incitamos a todos a obtener una copia legal de cualquiera de los juegos disponibles en nuestros servidores. 8 | 9 | 1. Información sobre PvPGN. 10 | PvPGN no aprueba ni se apela a la precisión, veracidad o fiabilidad de cualquier información ( incluídas declaraciones sobre opinión o consejos) dada en o por cualquier medio de PvPGN. Cualquiera y todas las declaraciones hechas en foros, chat o durante juegos reflejan solamente el parecer de su autor. 11 | 12 | 2. Exclusión de Garantía. 13 | PvPGN está disponible al público "tal y como es" sin ningún tipo de garantias. PvPGN no garantiza que su programa sea ininterrumpido o libre de errores. 14 | 15 | 3. Limitaciones de Responsabilidad. 16 | PvPGN es de ninguna manera responsable por pérdidas o daños de cualquier tipo al usar PvPGN, incluyendo pero no limitándose a, pérdida de libre voluntad, paro laboral, fallos o defectos en los ordenadores, o cualquier y todos otros tipos de daños o perdidas, comerciales o de cualquier otro tipo. 17 | 18 | Battle.net(R) y Blizzard Entertainment(R) son marcas registrada de Blizzard Entertainment en los E.U. y/o otros países. 19 | 20 | Aparte de todo esto... Disfrutar jugando.. 21 | PvPGN Project Page: http://pvpgn.berlios.de/ 22 | -------------------------------------------------------------------------------- /conf/i18n/esES/w3motd.txt: -------------------------------------------------------------------------------- 1 | |c00FF0000Bienvenido |c00FF9933to |c0000CCFFthe |c00FF66FF%s |c0000CC00Versión |c009999FF%v |c00FFFFFF 2 | 3 | Actualmente hay %U usuario(s) en %G partidas de %N, y %u usuario(s) jugando %g partidas y chateando en %c canales. 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Este texto es invisible, debido a limitación de 11 lineas. 12 | -------------------------------------------------------------------------------- /conf/i18n/frFR/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EBonjour %l, bienvenue sur %s! 2 | %IUtilisant la version %v sur %h. 3 | %ICe serveur est hébergé par %H 4 | %I 5 | %IIl y à %a comptes utilisateur sur ce serveur. 6 | %IIl y à en ce moment %U ultilisateurs dans %G parties de %N, 7 | %Iainsi que %u utilisateurs jouant dans %g parties et discutant dans %c canaux. 8 | %IUn problème avec une commande ? Tappez /help pour 9 | %Ien savoir plus. 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/frFR/chathelp-war3.txt: -------------------------------------------------------------------------------- 1 | Commandes d'aides du salon de discussions de PvPGN(serveur Emulateur Bnet) 2 | 3 | Nouvelles commandes: 4 | 5 | utiliser /f pour afficher la liste d'amis 6 | utiliser /users pour voir les utilisateur en ligne 7 | utiliser /w ou /msg pour chuchoter a une personne 8 | utiliser /join pour joindre un canal de discussions 9 | 10 | Pour les opйrateurs du canal: 11 | 12 | utiliser /ban banni l'utilisateur du canal de discussions 13 | utiliser /kick pour sortir un utilisateur du canal de discussions 14 | 15 | pour une aide plus dйtaillй taper: /help -------------------------------------------------------------------------------- /conf/i18n/frFR/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | French 5 | 6 | FRA 7 | BEL 8 | CAN 9 | FRA 10 | LUX 11 | MCO 12 | CHE 13 | 14 | 15 | -------------------------------------------------------------------------------- /conf/i18n/itIT/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EHello %l, welcome to %s! 2 | %IRunning version %v on %h. 3 | %IThis server is hosted by %H 4 | %I 5 | %IThere are %a user accounts on this server. 6 | %IThere are currently %U users in %G games of %N, 7 | %Iand %u users playing %g games and chatting in %c channels. 8 | %IHaving trouble with a command? Type /help to 9 | %Ilearn more about it. 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/itIT/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Italian 5 | 6 | ITA 7 | CHE 8 | 9 | 10 | -------------------------------------------------------------------------------- /conf/i18n/jpJA/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %E%l さん, PvPGN サーバへようこそ! 2 | %I%h さんが %v を運用します。 3 | %Iこのサーバは今 %H さんがホスティング中です。 4 | %I 5 | %I登録ユーザの数は %a 名です。 6 | %I今 %U 名のユーザさんが %N に %G 個のゲームをプレー中です。 7 | %Iすべては %u 名のユーザさんが %g 個のゲームをプレーします。 8 | %I%c 個のチャンネが生成しました。 9 | %Iコマンド・リストは「/help」をタイプして下さい。 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/jpJA/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Japanese 5 | 6 | JPN 7 | 8 | 9 | -------------------------------------------------------------------------------- /conf/i18n/koKR/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %E안녕하세요 %l 님, PvPGN 서버에 오신것을 환영합니다! 2 | %I%h 님이 %v 를 구동하고 계십니다. 3 | %I본 서버는 %H 님이 호스팅하고 계십니다. 4 | %I 5 | %I현재 %a 개의 계정이 저장되어 있습니다. 6 | %I현재 %U 명의 유저들이 %N 에서 %G 개의 게임을 즐기시고 계십니다. 7 | %I모두 %u 명의 유저가 %g 개의 게임을 즐기고 있으며 %c 개의 채널이 있습니다. 8 | %I명령어의 대해 궁금한 사항이 있으시다구요? 9 | %I/help 명령어를 이용해 보세요. 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/koKR/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Korean 5 | 6 | KOR 7 | 8 | 9 | -------------------------------------------------------------------------------- /conf/i18n/koKR/termsofservice.txt: -------------------------------------------------------------------------------- 1 | 현재 PvPGN 서버를 연걸했습니다. (플레이어 대 플레이어 게임잉 네트워크) 2 | 3 | PvPGN 조건: 4 | 5 | PvPGN은 배틀넷 (Battle.net®) 에물레이션 서버 라고 bnetd, warforge, Blizzard Entertainment과 제휴하고 있지 않다. 6 | PvPGN이 그대로 제공하고 보증서를 없다. 7 | 불법 복제된 소프트웨어의 사용을 지지하지 않다. 우리의 서버들에서 게임을 하려고 합법적인 버전을 구입하세요. 8 | 9 | 1. Information found on PvPGN. 10 | 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. 11 | 12 | 2. Disclaimer of Warrenty. 13 | 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. 14 | 15 | 3. Limitations of Liability 16 | 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. 17 | 18 | Battle.net(R) and Blizzard Entertainment(R) are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries. 19 | 20 | Besides all this... Happy gaming.. 21 | PvPGN Project Page: http://pvpgn.berlios.de/ 22 | -------------------------------------------------------------------------------- /conf/i18n/newaccount.txt: -------------------------------------------------------------------------------- 1 | You are currently connected to a PvPGN Server (Player -vs- Player Gaming Network) 2 | 3 | PvPGN TERMS OF USE: 4 | 5 | PvPGN is a Battle.net(R) emulation server and in no way affiliated with bnetd, warforge, or Blizzard Entertainment(R). 6 | PvPGN is provided "as is" without warrenties of any kind. 7 | 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. 8 | 9 | 1. Information found on PvPGN. 10 | 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. 11 | 12 | 2. Disclaimer of Warrenty. 13 | 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. 14 | 15 | 3. Limitations of Liability 16 | 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. 17 | 18 | Battle.net(R) and Blizzard Entertainment(R) are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries. 19 | 20 | Besides all this... Happy gaming.. 21 | PvPGN Project Page: http://pvpgn.berlios.de/ 22 | -------------------------------------------------------------------------------- /conf/i18n/news.txt: -------------------------------------------------------------------------------- 1 | {03/29/2014} 2 | 3 | Note that text of news is cached in Warcraft 3 client. Be careful when deleting existing news - 4 | it remain on a client side until bncache.dat won't be removed or outdated! 5 | A file news.txt is loaded once when the server starts. Use command "/rehash news" to reload the file. 6 | 7 | 8 | New support channel at: 9 | http://pvpgn.pro 10 | 11 | 12 | {10/01/2004} 13 | Welcome To The Player-vs-Player Gaming Network! 14 | Bringing Emulation To New Levels! 15 | 16 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-= 17 | 18 | ** IF YOU EXPERIENCE PROBLEMS USING THIS SERVER PLEASE REPORT IT TO THE ** 19 | ********* ADMINISTRATOR OF THE SERVER NOT TO THE PVPGN TEAM ************ 20 | 21 | Project development homepage: http://pvpgn.berlios.de 22 | 23 | Support channels (ONLY for the admins): 24 | ======================================== 25 | 26 | 1. Forums: http://forums.pvpgn.org 27 | 28 | 2. IRC live support: #pvpgn on irc.pvpgn.org 29 | 30 | Enjoy! 31 | The PvPGN Team 32 | -------------------------------------------------------------------------------- /conf/i18n/nlNL/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %IHallo %l, welom bij %s! 2 | %EWe draaien versie %v op %h. 3 | %IDeze server wordt gehost bij %H 4 | %I 5 | %IEr zijn %a gebruikers accounts op deze server. 6 | %IEr zijn momenteel %U gebruikers in %G games van %N, 7 | %Ien %u gebruikers spelen %g spellen en chatten in %c channels. 8 | %IProblemen met een commando? Type /help om 9 | %Ier meer te weten over te komen. 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/nlNL/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dutch 5 | 6 | NLD 7 | BEL 8 | 9 | 10 | -------------------------------------------------------------------------------- /conf/i18n/plPL/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %ECześć %l, witaj w %s! 2 | %IWersja serwera %v uruchomiona na %h. 3 | %ISerwer obsługuje %H 4 | %I 5 | %IDo tej pory zarejestrowaliśmy %a kont. 6 | %IAktualnie jest %U użytkowników zalogowanych, w %G grach, z pośród %N, 7 | %I%u użytkowników gra w %g gier, i rozmawia na %c kanałach. 8 | %IJeśli masz jakieś problemy z poleceniami, to napiszsz /help aby 9 | %Idowiedzieć się wiecej. 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/plPL/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Polish 5 | 6 | POL 7 | 8 | 9 | -------------------------------------------------------------------------------- /conf/i18n/ptBR/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EOlá %l, Bem vindo a %s! 2 | %IRodando a versão %v em %h. 3 | %IEste servidor é hosteado por %H 4 | %I 5 | %IExistem %a contas criadas nesse servidor. 6 | %IAtuamente existe %U usuarios %G jogos de %N, 7 | %IE %u usuários jogando %g jogos e conversando em %c canais. 8 | %ITendo algum problema com comando? Digite /help ra 9 | %Aprender mais sobre. 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/ptBR/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Portuguese 5 | 6 | BRA 7 | PRT 8 | 9 | 10 | -------------------------------------------------------------------------------- /conf/i18n/ruRU/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EПривет %l, добро пожаловать на %s! 2 | %IСервер версии %v на %h. 3 | %IСервер расположен на %H (%h) 4 | %I 5 | %IНа сервере зарегистрировано %a аккаунтов. 6 | %IСейчас %G игр и %U игроков в %N 7 | %Iиз них %u находятся в %g играх и общаются на %c каналах. 8 | %IПроблемы с использованием команды? Введите /help, чтобы 9 | %Iузнать больше о командах чата. 10 | %IНаберите /language, чтобы переключить язык перевода. 11 | %I 12 | %M%m 13 | -------------------------------------------------------------------------------- /conf/i18n/ruRU/chathelp-war3.txt: -------------------------------------------------------------------------------- 1 | PvPGN Bnet Emulation Chat Help Commands 2 | 3 | Новые команды: 4 | 5 | наберите /f help для вызова справки по списку друзей 6 | наберите /users для просмотра пользоватей в онлайне 7 | наберите /w или /msg <имя_пользователя> для личного сообщения 8 | наберите /join <канал> для присоединения к каналу 9 | 10 | Для операторов каналов: 11 | 12 | наберите /ban <имя_пользователя>, чтобы забанить игрока на данном канале 13 | наберите /kick <имя_пользователя>, чтобы кикнуть пользователя с этого канала 14 | 15 | Для более подробной справки наберите: /help 16 | -------------------------------------------------------------------------------- /conf/i18n/ruRU/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Russian 5 | 6 | RUS 7 | UZB 8 | TTT 9 | UKR 10 | AZE 11 | ARM 12 | 13 | 14 | -------------------------------------------------------------------------------- /conf/i18n/svSE/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %EHej %l, välkommen till %s! 2 | %IKör version %v på %h. 3 | %IVärden för den här servern är %H 4 | %I 5 | %IDet finns %a användarkonton på denna server. 6 | %IDet finns förnärvarande %U användare i %G spel av %N, 7 | %Ioch %u användare som spelar %g spel och chattar i %c kanaler. 8 | %IHar du problem med ett kommando? Skriv /help för 9 | %Iatt lära dig mer om det. 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/svSE/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Swedish 5 | 6 | SWE 7 | FIN 8 | 9 | 10 | -------------------------------------------------------------------------------- /conf/i18n/termsofservice.txt: -------------------------------------------------------------------------------- 1 | You are currently connected to a PvPGN Server (Player -vs- Player Gaming Network) 2 | 3 | PvPGN TERMS OF USE: 4 | 5 | PvPGN is a Battle.net(R) emulation server and in no way affiliated with bnetd, warforge, or Blizzard Entertainment(R). 6 | PvPGN is provided "as is" without warrenties of any kind. 7 | 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. 8 | 9 | 1. Information found on PvPGN. 10 | 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. 11 | 12 | 2. Disclaimer of Warrenty. 13 | 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. 14 | 15 | 3. Limitations of Liability 16 | 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. 17 | 18 | Battle.net(R) and Blizzard Entertainment(R) are trademarks or registered trademarks of Blizzard Entertainment in the U.S. and/or other countries. 19 | 20 | Besides all this... Happy gaming.. 21 | PvPGN Project Page: http://pvpgn.berlios.de/ 22 | -------------------------------------------------------------------------------- /conf/i18n/w3motd.txt: -------------------------------------------------------------------------------- 1 | |c00FF0000Welcome |c00FF9933to |c0000CCFFthe |c00FF66FF%s |c0000CC00Version |c009999FF%v |c00FFFFFF 2 | 3 | There are currently %U user(s) in %G games of %N, and %u user(s) playing %g games and chatting in %c channels. 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | This text invisible, because of limitation of 11 lines -------------------------------------------------------------------------------- /conf/i18n/zhCN/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %E%l,你好。欢迎来到 %s! 2 | %I现在 %h 正在运行的版本为 %v 3 | %I本服务器由 %H 管理维护 4 | %I 5 | %I本服务器现在有 %a 个用户账号 6 | %I当前有 %U 人登陆到 %G 个 %N 游戏中 7 | %I有 %u 人在玩 %g 个游戏,以及在 %c 个频道中聊天 8 | %I还不了解可以使用哪些命令? 9 | %I输入 /help 就可以学习了 10 | %IType /language to switch translation. 11 | %I 12 | %M%m -------------------------------------------------------------------------------- /conf/i18n/zhCN/chathelp-war3.txt: -------------------------------------------------------------------------------- 1 | PvPGN模拟战网聊天命令帮助 2 | 3 | 新命令: 4 | 5 | 使用 /f help 显示朋友命令帮助 6 | 使用 /users 显示在线玩家数 7 | 使用 /w 或者 /msg <玩家名称> 发送消息给玩家 8 | 使用 /join <频道> 加入指定的频道 9 | 10 | 频道管理员: 11 | 12 | 使用 /ban <玩家名称> 把玩家从该频道中踢出,并禁止玩家再次进入此频道 13 | 使用 /kick <玩家名称> 把玩家从该频道中踢出 14 | 15 | 更多的帮助:输入/help 16 | -------------------------------------------------------------------------------- /conf/i18n/zhCN/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Chinese Simplified 5 | 6 | CHN 7 | SGP 8 | 9 | 10 | -------------------------------------------------------------------------------- /conf/i18n/zhTW/bnmotd.txt: -------------------------------------------------------------------------------- 1 | %E哈囉! %l, 歡迎蒞臨 %s! 2 | %I本伺服器由 %H 架設於 %h. 3 | %I現行的伺服器版本是 %v. 4 | %I 5 | %I本伺服器已有 %a 個使用者帳號. 6 | %I共有 %U 個玩家在玩 %N 的 %G 個遊戲, 7 | %I其中有 %u 個玩家一邊在玩 %g 個遊戲一邊在 %c 個聊天頻道. 8 | %I不懂使用指令? 請輸入 /help 來了解更多... 9 | %IType /language to switch translation. 10 | %I 11 | %M%m -------------------------------------------------------------------------------- /conf/i18n/zhTW/common.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Chinese Traditional 5 | 6 | TWN 7 | MCO 8 | HKG 9 | 10 | 11 | -------------------------------------------------------------------------------- /conf/realm.conf.in: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | # realm.list - List of Diablo II Realms # 3 | #-------------------------------------------------------------------------------# 4 | # # 5 | # Realms are areas that hold closed characters and games. # 6 | # Users are given this list of realms to choose from when # 7 | # creating a new character. Next time the character is # 8 | # used, they will automatically join the same realm. # 9 | # # 10 | # The realm server runs on port 6113 by default. # 11 | # If you do not specify a port number, it will use this by default. # 12 | # # 13 | # : the realm name (mandatory; must start and end with " ) # 14 | # : the realm description (optional; must start and end with " ) # 15 | # ip:port - actual ip the d2cs server is running on (mandatory) # 16 | # # 17 | # --- realm name --- --- description --- --- real address --- # 18 | # (mandatory) (optional) (mandatory) # 19 | #-------------------------------------------------------------------------------# 20 | # "" [""] # 21 | # # 22 | ################################################################################# 23 | 24 | # WARNING!! DO NOT USE "127.0.0.1" or "localhost" FOR ANY IP ADDRESS 25 | 26 | # example (having a d2cs server running on IP 1.2.3.4): 27 | #"D2CS" "PvPGN Closed Realm" 1.2.3.4:6113 28 | -------------------------------------------------------------------------------- /conf/supportfile.conf.in: -------------------------------------------------------------------------------- 1 | # this file contains the names of all files that need to be installed in the filedir 2 | # some lines are commented out, cause they weren't installed by default in older versions 3 | 4 | IX86ver1.mpq 5 | ver-IX86-1.mpq 6 | PMACver1.mpq 7 | XMACver1.mpq 8 | bnserver-D2DV.ini 9 | bnserver-D2XP.ini 10 | bnserver-WAR3.ini 11 | bnserver.ini 12 | icons-WAR3.bni 13 | icons_STAR.bni 14 | icons.bni 15 | -------------------------------------------------------------------------------- /conf/topics.conf.in: -------------------------------------------------------------------------------- 1 | Chat This is the public chat channel. Feel free to chat... 2 | Moderated Support Support is provided in this channel... -------------------------------------------------------------------------------- /docs/bnmotd.md: -------------------------------------------------------------------------------- 1 | # PvPGN Message Of The Day 2 | --- 3 | ### Notes 4 | - All lines must begin with **%I** 5 | 6 | ### Parameters 7 | Parameter | Description 8 | ----------- | ------------- 9 | %a | Number of registered accounts 10 | %c | Number of existing channels 11 | %g | Number of running games 12 | %G | Number of games with the same clienttag. 13 | %h | Hostname of the server 14 | %H | Contact name (as set in bnetd.conf) 15 | %i | The userid of the user 16 | %l | The username of the user 17 | %N | Name of the game the user has connected with 18 | %m | Check the user's mail 19 | %r | IP address of the user 20 | %s | Servername 21 | %t | The clienttag of the user 22 | %u | Number of users currently logged in 23 | %U | Number of users logged in with the same clienttag 24 | %v | Server version -------------------------------------------------------------------------------- /docs/compile.g++.md: -------------------------------------------------------------------------------- 1 | REFER TO http://harpywar.com/?a=articles&b=2&c=1&d=74&lang=en -------------------------------------------------------------------------------- /docs/ports.md: -------------------------------------------------------------------------------- 1 | # PvPGN Porting Status 2 | Arch | Operating System | Status | Compiler | CMake 3 | ----- | ------------------------- | --------- | ----------------------------------- | --------- 4 | x86_64 | Arch Linux 2015.09.29 | OK | G++ 5.2.0 | 3.3.2 5 | x86_64 | Arch Linux 2015.09.29 | OK | Clang 3.7.0 | 3.3.2 6 | x86_64 | Arch Linux 2015.09.29 | NO | MinGW 5.2.0 | 3.3.2 7 | x86_64 | Ubuntu Server 15.04 | OK | G++ 5.1.1 | 3.3.2 8 | x86_64 | Ubuntu Server 15.04 | OK | G++ 5.1.0 | 3.4.0-rc1 9 | x86_64 | Ubuntu Server 14.04 | OK | G++ 5.1.0 | 3.4.0-rc1 10 | x86_64 | CentOS 7.3.1611 | OK | G++ 5.3.1 | 3.6.1 11 | x86_64 | Fedora 25 | OK | G++ 6.2.1 | 3.6.2 12 | x86_64 | Windows 10.0.10240 | OK | VC++ 14 | 3.3.1 13 | x86_64 | Windows 10.0.10240 | OK | Clang r249555 | 3.3.1 14 | x86_64 | OS X 10.11.6 | OK | Apple LLVM 7.3.0 (clang-703.0.31) | 3.6.1 15 | 16 | # Notes 17 | - Any POSIX/WIN32 OS with a C++11 compliant compiler should work 18 | - The minimum required compiler version for G++ and Visual Studio is hardcoded 19 | -------------------------------------------------------------------------------- /docs/readme.md: -------------------------------------------------------------------------------- 1 | # Index 2 | --- 3 | File | Description 4 | --------------- | ------------- 5 | adbanners.md | Instructions on creating SMK ad banners for PvPGN 6 | bnmotd.md | Documentation of parameters for bnmotd.txt 7 | compile.g++.md | Instructions for compiling with G++ 8 | compile.visualstudio2015.md | Instructions for compiling with Visual Studio 2015 9 | fdwatch.txt | Documentation of the fdwatch API 10 | ports.md | Documentation on tested operating systems, compilers, and tools for compiling PvPGN 11 | readme.md | This file 12 | storage.txt | Documentation of PvPGN's storage systems 13 | -------------------------------------------------------------------------------- /files/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # these lines create the empty directory structure pvpgn needs installed 2 | # in ./var and then installs it portably using install(DIRECTORY...) 3 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/users") 4 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/userscdb") 5 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/bnmail") 6 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/clans") 7 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/teams") 8 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/reports") 9 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/chanlogs") 10 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/userlogs") 11 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/charinfo") 12 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/charsave") 13 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/bak/charinfo") 14 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/bak/charsave") 15 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/ladders") 16 | file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/var/status") 17 | 18 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/var/ DESTINATION ${LOCALSTATEDIR}) 19 | 20 | install(FILES ad000001.png 21 | ad000001.smk 22 | ad000002.mng 23 | ad000002.smk 24 | bnserver.ini 25 | bnserver-D2DV.ini 26 | bnserver-D2XP.ini 27 | bnserver-WAR3.ini 28 | icons.bni 29 | icons_STAR.bni 30 | icons-WAR3.bni 31 | IX86ExtraWork.mpq 32 | IX86ver1.mpq 33 | newbie.save 34 | PMACver1.mpq 35 | ver-IX86-1.mpq 36 | XMACver1.mpq 37 | DESTINATION ${LOCALSTATEDIR}/files) 38 | -------------------------------------------------------------------------------- /files/IX86ExtraWork.mpq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/IX86ExtraWork.mpq -------------------------------------------------------------------------------- /files/IX86ver1.mpq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/IX86ver1.mpq -------------------------------------------------------------------------------- /files/PMACver1.mpq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/PMACver1.mpq -------------------------------------------------------------------------------- /files/XMACver1.mpq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/XMACver1.mpq -------------------------------------------------------------------------------- /files/ad000001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/ad000001.png -------------------------------------------------------------------------------- /files/ad000001.smk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/ad000001.smk -------------------------------------------------------------------------------- /files/ad000002.mng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/ad000002.mng -------------------------------------------------------------------------------- /files/ad000002.smk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/ad000002.smk -------------------------------------------------------------------------------- /files/bnserver-D2DV.ini: -------------------------------------------------------------------------------- 1 | [Server List Version] 2 | VER=1001 3 | 4 | [Server Gateways] 5 | 1=uswest.battle.net 6 | 2=useast.battle.net 7 | 3=asia.battle.net 8 | 4=europe.battle.net 9 | 10 | [uswest.battle.net] 11 | ZONE=8 12 | ENU=U.S. West 13 | FRA=U.S. Ouest 14 | 15 | [useast.battle.net] 16 | ZONE=6 17 | ENU=U.S. East 18 | FRA=U.S. Est 19 | 20 | [asia.battle.net] 21 | ZONE=-9 22 | ENU=Asia 23 | FRA=Asie 24 | 25 | [europe.battle.net] 26 | ZONE=-1 27 | ENU=Europe 28 | FRA=Europe 29 | -------------------------------------------------------------------------------- /files/bnserver-D2XP.ini: -------------------------------------------------------------------------------- 1 | [Server List Version] 2 | VER=1001 3 | 4 | [Server Gateways] 5 | 1=uswest.battle.net 6 | 2=useast.battle.net 7 | 3=asia.battle.net 8 | 4=europe.battle.net 9 | 10 | [uswest.battle.net] 11 | ZONE=8 12 | ENU=U.S. West 13 | FRA=U.S. Ouest 14 | 15 | [useast.battle.net] 16 | ZONE=6 17 | ENU=U.S. East 18 | FRA=U.S. Est 19 | 20 | [asia.battle.net] 21 | ZONE=-9 22 | ENU=Asia 23 | FRA=Asie 24 | 25 | [europe.battle.net] 26 | ZONE=-1 27 | ENU=Europe 28 | FRA=Europe 29 | -------------------------------------------------------------------------------- /files/bnserver-WAR3.ini: -------------------------------------------------------------------------------- 1 | [Server List Version] 2 | VER=1001 3 | 4 | [Server Gateways] 5 | 1=uswest.battle.net 6 | 2=useast.battle.net 7 | 3=asia.battle.net 8 | 4=europe.battle.net 9 | 10 | [uswest.battle.net] 11 | ZONE=8 12 | ENU=Lordaeron (U.S. West) 13 | 14 | [useast.battle.net] 15 | ZONE=6 16 | ENU=Azeroth (U.S. East) 17 | 18 | [asia.battle.net] 19 | ZONE=-9 20 | ENU=Kalimdor (Asia) 21 | 22 | [europe.battle.net] 23 | ZONE=-1 24 | ENU=Northrend (Europe) 25 | -------------------------------------------------------------------------------- /files/bnserver.ini: -------------------------------------------------------------------------------- 1 | [Server List Version] 2 | VER=1001 3 | 4 | [Server Gateways] 5 | 1=uswest.battle.net 6 | 2=useast.battle.net 7 | 3=asia.battle.net 8 | 4=europe.battle.net 9 | 10 | [uswest.battle.net] 11 | ZONE=8 12 | ENU=U.S. West 13 | FRA=U.S. Ouest 14 | 15 | [useast.battle.net] 16 | ZONE=6 17 | ENU=U.S. East 18 | FRA=U.S. Est 19 | 20 | [asia.battle.net] 21 | ZONE=-9 22 | ENU=Asia 23 | FRA=Asie 24 | 25 | [europe.battle.net] 26 | ZONE=-1 27 | ENU=Europe 28 | FRA=Europe 29 | -------------------------------------------------------------------------------- /files/icons-WAR3.bni: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/icons-WAR3.bni -------------------------------------------------------------------------------- /files/icons.bni: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/icons.bni -------------------------------------------------------------------------------- /files/icons_STAR.bni: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/icons_STAR.bni -------------------------------------------------------------------------------- /files/newbie.save: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/newbie.save -------------------------------------------------------------------------------- /files/ver-IX86-1.mpq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/files/ver-IX86-1.mpq -------------------------------------------------------------------------------- /lib/fmt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(FMT_SOURCES ${FMT_SOURCES} 2 | ${CMAKE_CURRENT_SOURCE_DIR}/core.h 3 | ${CMAKE_CURRENT_SOURCE_DIR}/format.cc 4 | ${CMAKE_CURRENT_SOURCE_DIR}/format.h 5 | ${CMAKE_CURRENT_SOURCE_DIR}/format-inl.h 6 | ${CMAKE_CURRENT_SOURCE_DIR}/ostream.h 7 | ${CMAKE_CURRENT_SOURCE_DIR}/posix.cc 8 | ${CMAKE_CURRENT_SOURCE_DIR}/posix.h 9 | ${CMAKE_CURRENT_SOURCE_DIR}/printf.h 10 | ${CMAKE_CURRENT_SOURCE_DIR}/ranges.h 11 | ${CMAKE_CURRENT_SOURCE_DIR}/time.h 12 | ) 13 | 14 | add_library(fmt ${FMT_SOURCES}) 15 | 16 | target_include_directories(fmt 17 | PUBLIC 18 | $ 19 | $ 20 | ) -------------------------------------------------------------------------------- /lua/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # copy all files from lua directory 2 | 3 | file(GLOB DEPLOY_FILES_AND_DIRS "${PROJECT_SOURCE_DIR}/lua/*") 4 | 5 | foreach(ITEM ${DEPLOY_FILES_AND_DIRS}) 6 | IF( IS_DIRECTORY "${ITEM}" ) 7 | LIST( APPEND DIRS_TO_DEPLOY "${ITEM}" ) 8 | ELSE() 9 | IF(NOT ${ITEM} MATCHES "CMakeLists.txt") 10 | LIST( APPEND FILES_TO_DEPLOY "${ITEM}" ) 11 | ENDIF(NOT ${ITEM} MATCHES "CMakeLists.txt") 12 | ENDIF() 13 | endforeach() 14 | 15 | INSTALL( FILES ${FILES_TO_DEPLOY} DESTINATION ${LOCALSTATEDIR}/lua ) 16 | INSTALL( DIRECTORY ${DIRS_TO_DEPLOY} DESTINATION ${LOCALSTATEDIR}/lua ) 17 | 18 | -------------------------------------------------------------------------------- /lua/command/ping.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | function command_ping(account, text) 10 | -- allow warcraft 3 client only 11 | if (account.clienttag == CLIENTTAG_WAR3XP) and (config.ghost) then 12 | return gh_command_ping(account, text) 13 | end 14 | 15 | return 1 16 | end 17 | -------------------------------------------------------------------------------- /lua/command/redirect.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- Send text to user from server. Works like /announce, 10 | -- but directly to user and message text is not red. 11 | -- /redirect 12 | function command_redirect(account, text) 13 | 14 | local args = split_command(text, 2) 15 | 16 | if not args[1] or not args[2] then 17 | api.describe_command(account.name, args[0]) 18 | return -1 19 | end 20 | 21 | -- get destination account 22 | local dest = api.account_get_by_name(args[1]) 23 | 24 | if next(dest) == nil or dest.online == "false" then 25 | api.message_send_text(account.name, message_type_error, account.name, localize(account.name, "User \"{}\" is offline", args[1])) 26 | return -1 27 | end 28 | 29 | api.message_send_text(dest.name, message_type_info, dest.name, args[2]) 30 | 31 | return 0 32 | end 33 | -------------------------------------------------------------------------------- /lua/command/stats.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | function command_stats(account, text) 10 | if config.ghost_dota_server and config.ghost and (account.clienttag == CLIENTTAG_WAR3XP) then 11 | return gh_command_stats(account, text) 12 | end 13 | 14 | return 1 15 | end 16 | -------------------------------------------------------------------------------- /lua/command/w3motd.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- 10 | -- Read file w3motd.txt line by line and send text to user 11 | -- 12 | 13 | local username = nil 14 | 15 | function command_w3motd(account, text) 16 | -- allow warcraft 3 client only 17 | if not (account.clienttag == CLIENTTAG_WAR3XP or account.clienttag == CLIENTTAG_WARCRAFT3) then 18 | return 1 19 | end 20 | 21 | username = account.name 22 | local data = file_load(config.motdw3file, w3motd_sendline_callback) 23 | 24 | return 0 25 | end 26 | 27 | function w3motd_sendline_callback(line) 28 | api.message_send_text(username, message_type_info, nil, line) 29 | end 30 | -------------------------------------------------------------------------------- /lua/extend/account.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- Get count of all online users 10 | function users_count() 11 | local count = 0 12 | for i,account in pairs(api.server_get_users()) do 13 | count = count + 1 14 | end 15 | return count 16 | end 17 | 18 | -- Get count of all server account that were used by the server 19 | function accounts_count() 20 | local count = 0 21 | for i,account in pairs(api.server_get_users(true)) do 22 | count = count + 1 23 | end 24 | return count 25 | end 26 | 27 | -------------------------------------------------------------------------------- /lua/extend/channel.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- Return channel id by name (if channel not found then return -1) 10 | function channel_get_id_by_name(channel_name) 11 | for i,channel in pairs(api.server_get_channels()) do 12 | if channel.name == channel_name then 13 | return channel.id 14 | end 15 | end 16 | return -1 17 | end 18 | 19 | 20 | -- Send message in channel 21 | -- message_type: message_type_info | message_type_error 22 | function channel_send_message(channel_name, text, message_type) 23 | channel_id = channel_get_id_by_name(channel_name) 24 | if (channel_id == -1) then 25 | return nil 26 | end 27 | 28 | channel = api.channel_get_by_id(channel_id) 29 | 30 | for username in string.split(channel.memberlist,",") do 31 | api.message_send_text(username, message_type, nil, text) 32 | end 33 | end 34 | 35 | 36 | -- Get count of all channels 37 | function channels_count() 38 | local count = 0 39 | for i,channel in pairs(api.server_get_channels()) do 40 | count = count + 1 41 | end 42 | return count 43 | end -------------------------------------------------------------------------------- /lua/extend/enum/attr.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | attr_type_str, 10 | attr_type_num, 11 | attr_type_bool, 12 | attr_type_raw 13 | = 0,1,2,3 -------------------------------------------------------------------------------- /lua/extend/enum/eventlog.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | eventlog_level_none, 10 | eventlog_level_trace, 11 | eventlog_level_debug, 12 | eventlog_level_info, 13 | eventlog_level_warn, 14 | eventlog_level_error, 15 | eventlog_level_fatal, 16 | eventlog_level_gui -- Win32 GUI 17 | = 0,1,2,4,8,16,32,64 18 | -------------------------------------------------------------------------------- /lua/extend/enum/message.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | message_type_adduser, 10 | message_type_join, 11 | message_type_part, 12 | message_type_whisper, 13 | message_type_talk, 14 | message_type_broadcast, 15 | message_type_channel, 16 | message_type_userflags, 17 | message_type_whisperack, 18 | message_type_friendwhisperack, 19 | message_type_channelfull, 20 | message_type_channeldoesnotexist, 21 | message_type_channelrestricted, 22 | message_type_info, 23 | message_type_error, 24 | message_type_emote, 25 | message_type_uniqueid, -- bad message type? 26 | message_type_mode, -- bad message type? 27 | message_type_kick, 28 | message_type_quit, 29 | -- IRC specific messages 30 | message_type_nick, 31 | message_type_notice, 32 | message_type_namreply, 33 | message_type_topic, 34 | -- Westwood Online Extensions 35 | message_type_host, 36 | message_type_invmsg, 37 | message_type_page, 38 | message_type_wol_joingame, 39 | message_type_gameopt_talk, 40 | message_type_gameopt_whisper, 41 | message_type_wol_start_game, 42 | message_type_wol_advertr, 43 | message_type_wol_chanchk, 44 | message_type_wol_userip, 45 | message_type_null 46 | = 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 47 | -------------------------------------------------------------------------------- /lua/extend/enum/messagebox.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- https://github.com/pvpgn/pvpgn-server/issues/15 10 | -- http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx 11 | -- 12 | -- use math_or(mb_type1, mb_type2) to combine two messagebox types 13 | --[[ Example code to display Windows MessageBox: 14 | local mb_type = math_or(MB_DEFBUTTON2, math_or(MB_ABORTRETRYIGNORE, MB_ICONEXCLAMATION) ) 15 | api.messagebox_show(account.name, "aaaaaaaaaaaaaaaaaaaaaaaaawwadwwadawdawdawdwadawdaaw", "MessageBox from " .. config.servername, mb_type) 16 | ]]-- 17 | 18 | MB_ABORTRETRYIGNORE, 19 | MB_CANCELTRYCONTINUE, 20 | MB_HELP, 21 | MB_OK, 22 | MB_OKCANCEL, 23 | MB_RETRYCANCEL, 24 | MB_YESNO, 25 | MB_YESNOCANCEL, 26 | 27 | MB_ICONEXCLAMATION, 28 | MB_ICONWARNING, 29 | MB_ICONINFORMATION, 30 | MB_ICONASTERISK, 31 | MB_ICONQUESTION, 32 | MB_ICONSTOP, 33 | MB_ICONERROR, 34 | MB_ICONHAND, 35 | 36 | MB_DEFBUTTON1, 37 | MB_DEFBUTTON2, 38 | MB_DEFBUTTON3, 39 | MB_DEFBUTTON4, 40 | 41 | MB_APPLMODAL, 42 | MB_SYSTEMMODAL, 43 | MB_TASKMODAL, 44 | 45 | MB_DEFAULT_DESKTOP_ONLY, 46 | MB_RIGHT, 47 | MB_RTLREADING, 48 | MB_SETFOREGROUND, 49 | MB_TOPMOST, 50 | MB_SERVICE_NOTIFICATION 51 | = 0x00000002,0x00000006,0x00004000,0x00000000,0x00000001,0x00000005,0x00000004,0x00000003,0x00000030,0x00000030,0x00000040,0x00000040,0x00000020,0x00000010,0x00000010,0x00000010,0x00000000,0x00000100,0x00000200,0x00000300,0x00000000,0x00001000,0x00002000,0x00020000,0x00080000,0x00100000,0x00010000,0x00040000,0x00200000 52 | -------------------------------------------------------------------------------- /lua/extend/eventlog.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | -- Log event wrappers 9 | 10 | function FATAL(text) 11 | api.eventlog(eventlog_level_fatal, __function__, text) 12 | end 13 | 14 | function ERROR(text) 15 | api.eventlog(eventlog_level_error, __function__, text) 16 | end 17 | 18 | function WARN(text) 19 | api.eventlog(eventlog_level_warn, __function__, text) 20 | end 21 | 22 | function INFO(text) 23 | api.eventlog(eventlog_level_info, __function__, text) 24 | end 25 | 26 | function DEBUG(text) 27 | if (type(text) == "table") then 28 | text = table.dump(text) 29 | end 30 | api.eventlog(eventlog_level_debug, __function__, text) 31 | end 32 | 33 | function TRACE(text) 34 | api.eventlog(eventlog_level_trace, __function__, text) 35 | end 36 | 37 | function GUI(text) 38 | api.eventlog(eventlog_level_gui, __function__, text) 39 | end 40 | 41 | 42 | -------------------------------------------------------------------------------- /lua/extend/game.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- Get count of all games 10 | function games_count() 11 | local count = 0 12 | for i,game in pairs(api.server_get_games()) do 13 | count = count + 1 14 | end 15 | return count 16 | end 17 | 18 | function server_get_games(clienttag) 19 | local gamelist = {} 20 | 21 | for i,game in pairs(api.server_get_games()) do 22 | if clienttag then 23 | if (game.tag == clienttag) then 24 | table.insert(gamelist, game) 25 | end 26 | else 27 | table.insert(gamelist, game) 28 | end 29 | end 30 | return gamelist 31 | end -------------------------------------------------------------------------------- /lua/extend/message.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- Send announce to all connected users 10 | function message_send_all(text) 11 | for i,account in pairs(api.server_get_users()) do 12 | api.message_send_text(account.name, message_type_broadcast, nil, text) 13 | end 14 | end 15 | 16 | function localize(username, arg1, arg2, arg3, arg4, arg5) 17 | return api.localize(username, arg1, arg2, arg3, arg4, arg5) 18 | end -------------------------------------------------------------------------------- /lua/ghost/ghost.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | -- custom map list 9 | gh_maplist = {} 10 | 11 | function gh_load() 12 | -- load ghost state 13 | local filename = config.vardir() .. "ghost_users.dmp" 14 | if file_exists(filename) then 15 | gh_load_userbots(filename) 16 | DEBUG("Loaded GHost state from " .. filename) 17 | end 18 | 19 | -- preload custom map list 20 | local mapfile = gh_directory() .. "/maplist.txt" 21 | if file_exists(mapfile) then 22 | gh_load_maps(mapfile) 23 | DEBUG("Loaded " .. #gh_maplist .. " GHost custom maps") 24 | else 25 | WARN("File with GHost custom map list is not found: " .. mapfile) 26 | end 27 | 28 | end 29 | 30 | function gh_unload() 31 | -- save ghost state 32 | local filename = config.vardir() .. "ghost_users.dmp" 33 | gh_save_userbots(filename) 34 | 35 | DEBUG("Saved GHost state to " .. filename) 36 | end 37 | 38 | 39 | 40 | 41 | function gh_load_maps(filename) 42 | -- load maps from the file 43 | file_load(filename, file_load_dictionary_callback, 44 | function(a,b) 45 | -- split second part of the line to get mapname and filename 46 | local idx = 0 47 | for v in string.split(b, "|") do 48 | if idx == 0 then 49 | mapname = string:trim(v) 50 | else 51 | mapfile = string:trim(v) 52 | end 53 | idx = idx + 1 54 | end 55 | table.insert(gh_maplist, { code = a, name = mapname, filename = mapfile }) 56 | end) 57 | end -------------------------------------------------------------------------------- /lua/ghost/handle.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | function gh_handle_game_userjoin(game, account) 10 | -- check that game owner is ghost bot 11 | if not gh_is_bot(game.owner) then return end 12 | 13 | -- send ping silently 14 | gh_set_silentflag(account.name) 15 | 16 | local botaccount = api.account_get_by_name(game.owner) 17 | -- send ping to bot (to save result) 18 | command_ping(botaccount, "/ping") 19 | 20 | if (config.ghost_dota_server) then 21 | -- user who is owner of the hostbot in the current game 22 | local owner = gh_find_userbot_by_game(game.name) 23 | -- if game is not ladder 24 | if string:empty(gh_get_userbot_gametype(owner)) then return end 25 | 26 | 27 | for u in string.split(game.players, ",") do 28 | -- show stats of the player who joined the game for each other player 29 | local useracc = api.account_get_by_name(u) 30 | command_stats(useracc, "/stats " .. account.name) 31 | 32 | -- show stats of each player in the game to a player who joined the game 33 | command_stats(account, "/stats " .. u) 34 | end 35 | api.message_send_text(account.name, message_type_info, nil, localize(account.name, "Joined ladder game. Game owner: {}", owner)) 36 | end 37 | end 38 | 39 | function gh_handle_user_login(account) 40 | if gh_is_bot(account.name) then 41 | -- activate pvpgn mode on ghost side 42 | gh_message_send(account.name, "/pvpgn init"); 43 | DEBUG("init bot " .. account.name) 44 | end 45 | end -------------------------------------------------------------------------------- /lua/ghost/maplist.txt: -------------------------------------------------------------------------------- 1 | ************************************************** 2 | Custom maps that can be hosted using /chost 3 | ************************************************** 4 | 5 | DOTA = DotA|DotA v6.80c.w3x 6 | MW = Mirana Wars Final|Mirana Wars Final.w3x -------------------------------------------------------------------------------- /lua/handle_channel.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | function handle_channel_message(channel, account, text, message_type) 10 | if config.quiz and channel.name == config.quiz_channel then 11 | quiz_handle_message(account.name, text) 12 | end 13 | 14 | --DEBUG(text) 15 | --return 1 16 | end 17 | function handle_channel_userjoin(channel, account) 18 | --DEBUG(account.name.." joined "..channel.name) 19 | end 20 | function handle_channel_userleft(channel, account) 21 | --DEBUG(account.name.." left "..channel.name) 22 | end 23 | -------------------------------------------------------------------------------- /lua/handle_client.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | -- Receive SID_READMEMORY 9 | function handle_client_readmemory(account, request_id, data) 10 | 11 | --DEBUG("Read memory request Id: " .. request_id) 12 | 13 | -- display memory bytes 14 | --TRACE(data) 15 | 16 | if (config.ah) then 17 | ah_handle_client(account, request_id, data) 18 | end 19 | 20 | end 21 | 22 | -- Receive SID_EXTRAWORK 23 | function handle_client_extrawork(account, gametype, length, data) 24 | --DEBUG(string.format("Received EXTRAWORK packet with GameType: %d and Length: %d (%s)", gametype, length, data)) 25 | 26 | end 27 | -------------------------------------------------------------------------------- /lua/handle_server.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- Loop each second 10 | function handle_server_mainloop() 11 | -- Tick all timers 12 | for t in pairs(__timers) do 13 | __timers[t]:tick() 14 | end 15 | 16 | -- DEBUG(os.time()) 17 | end 18 | 19 | 20 | -- When restart Lua VM 21 | function handle_server_rehash() 22 | if (config.ghost) then 23 | gh_unload() 24 | end 25 | 26 | end -------------------------------------------------------------------------------- /lua/handle_user.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | function handle_user_whisper(account_src, account_dst, text) 10 | --DEBUG(account_src.name.."->"..account_dst.name.. ": ".. text) 11 | --return 1; 12 | end 13 | 14 | function handle_user_login(account) 15 | if (config.ghost) then 16 | gh_handle_user_login(account) 17 | end 18 | 19 | -- send SID_REQUIREDWORK 20 | --if account.archtag == ARCHTAG_WINX86 then 21 | -- api.client_requiredwork(account.name, "IX86ExtraWork.mpq") 22 | --end 23 | 24 | --DEBUG(account.name.." logged in") 25 | --return 1; 26 | end 27 | 28 | function handle_user_disconnect(account) 29 | --DEBUG(account.name.." disconnected") 30 | end 31 | 32 | function handle_user_icon(account, iconinfo) 33 | --TRACE("iconinfo"..iconinfo) 34 | --return iconinfo 35 | end 36 | 37 | -------------------------------------------------------------------------------- /lua/include/bitwise.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- 10 | -- Bitwise functions: 11 | -- math_not, math_and, math_or, math_xor 12 | -- 13 | 14 | local function nand(x,y,z) 15 | z=z or 2^16 16 | if z<2 then 17 | return 1-x*y 18 | else 19 | return nand((x-x%z)/z,(y-y%z)/z,math.sqrt(z))*z+nand(x%z,y%z,math.sqrt(z)) 20 | end 21 | end 22 | function math_not(y,z) 23 | return nand(nand(0,0,z),y,z) 24 | end 25 | function math_and(x,y,z) 26 | return nand(math_not(0,z),nand(x,y,z),z) 27 | end 28 | function math_or(x,y,z) 29 | return nand(math_not(x,z),math_not(y,z),z) 30 | end 31 | function math_xor(x,y,z) 32 | return math_and(nand(x,y,z),math_or(x,y,z),z) 33 | end -------------------------------------------------------------------------------- /lua/include/common.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- Return the script path and line of the CURRENT function where it is executed 10 | __FUNCTION__ = nil 11 | -- Return the script path and line of the PARENT function where it is executed 12 | __function__ = nil 13 | 14 | setmetatable(_G, {__index = 15 | function(t, k) 16 | if k == '__FUNCTION__' then 17 | local w = debug.getinfo(2, "S") 18 | return w.short_src..":"..w.linedefined 19 | elseif k == '__function__' then 20 | local w = debug.getinfo(3, "S") 21 | return w.short_src..":"..w.linedefined 22 | end 23 | end 24 | }) 25 | 26 | -------------------------------------------------------------------------------- /lua/include/convert.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | -- Convert bytes table to integer 9 | function bytes_to_int(bytes, offset, length) 10 | 11 | local t = table.slice(bytes, offset, length) 12 | local n = 0 13 | for k = 0, #t do 14 | n = n + byte_to_utf8(t[k]) * 2^((k)*8) 15 | end 16 | return n 17 | end 18 | 19 | -- Convert bytes table to string 20 | function bytes_to_string(bytes) 21 | local t = bytes; 22 | local bytearr = {} 23 | for k = 0, #t do 24 | table.insert( bytearr, string.char(byte_to_utf8(t[k])) ) 25 | end 26 | return string:trim( table.concat(bytearr) ) 27 | end 28 | 29 | -- Convert C byte to Dec 30 | function byte_to_utf8(v) 31 | return v < 0 and (0xff + v + 1) or v 32 | end -------------------------------------------------------------------------------- /lua/include/math.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- return rounded float value 10 | function math.round(num, idp) 11 | local mult = 10^(idp or 0) 12 | return math.floor(num * mult + 0.5) / mult 13 | end 14 | 15 | function math.isnan(x) return x ~= x end 16 | function math.isinf(x) return (x+1)==x end -------------------------------------------------------------------------------- /lua/include/timer.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- Global table with timers 10 | __timers = {} 11 | 12 | function timer_add(id, interval, callback) 13 | timer_object = timer:new(id, interval, callback) 14 | table.insert(__timers, timer_object) 15 | end 16 | 17 | function timer_del(id) 18 | -- safe remove from the timers (we can not just use __timers = nil here) 19 | local i = 0 20 | for k,v in pairs(__timers) do 21 | i = i + 1 22 | if (v.id == id) then 23 | table.remove(__timers, i) 24 | return true 25 | end 26 | end 27 | return false 28 | end 29 | 30 | function timer_get(id) 31 | local i = 0 32 | for k,v in pairs(__timers) do 33 | i = i + 1 34 | if (v.id == id) then 35 | return v 36 | end 37 | end 38 | end 39 | 40 | 41 | -- 42 | -- Timer class 43 | -- 44 | timer = {} 45 | 46 | -- Create a new timer with unique id and given interval 47 | function timer:new(id, interval, callback) 48 | options = { id = id, interval = interval, prev_time = 0, callback = callback } 49 | self.__index = self 50 | return setmetatable(options, self) 51 | end 52 | 53 | -- Event when timer executes 54 | function timer:tick() 55 | if os.time() < self.prev_time + self.interval then return 0 end 56 | self.prev_time = os.time() 57 | 58 | -- Debug: display time when the timer ticks 59 | -- TRACE(self.interval .. ": " .. os.time()) 60 | 61 | -- execute callback function 62 | return self.callback(self) 63 | end 64 | 65 | 66 | -------------------------------------------------------------------------------- /lua/main.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | -- Entry point 9 | -- Executes after preload all the lua files 10 | function main() 11 | 12 | if (config.ah) then 13 | -- start antihack 14 | ah_init() 15 | end 16 | 17 | if (config.ghost) then 18 | gh_load() 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /lua/quiz/helper.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright (C) 2014 HarpyWar (harpywar@gmail.com) 3 | 4 | This file is a part of the PvPGN Project http://pvpgn.pro 5 | Licensed under the same terms as Lua itself. 6 | ]]-- 7 | 8 | 9 | -- Get path to Quiz directory 10 | function q_directory() 11 | return config.scriptdir .. "/quiz" 12 | end 13 | 14 | -- Replace each symbol in string with * 15 | -- Example: input = "hello world", return = "***** *****" 16 | function q_hide_unswer(input) 17 | local output = input 18 | for i = 1, #input do 19 | local c = input:sub(i,i) 20 | if not (c == " ") then 21 | output = replace_char(i, output, "*") 22 | end 23 | end 24 | return output 25 | end 26 | 27 | -- Open one random symbol in hidden (with *) string from original string 28 | -- Example: hidden = "***** *****", original = "hello world", return = "***l* *****" 29 | function q_show_next_symbol(hidden, original) 30 | local output = hidden 31 | 32 | if hidden == original then 33 | return output 34 | end 35 | 36 | local replaced = false 37 | while not replaced do 38 | local i = math.random(#hidden) 39 | local c = hidden:sub(i,i) 40 | if c == "*" then 41 | local c2 = original:sub(i,i) 42 | output = replace_char(i, hidden, c2) 43 | replaced = true 44 | end 45 | end 46 | return output 47 | end 48 | 49 | 50 | 51 | -- Callback to sort records table descending 52 | function q_compare_desc(a,b) 53 | return tonumber(a.points) > tonumber(b.points) 54 | end 55 | -------------------------------------------------------------------------------- /lua/quiz/questions/misc.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/lua/quiz/questions/misc.txt -------------------------------------------------------------------------------- /man/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(FILES bnbot.1 bnchat.1 bnetd.1 bnetd.conf.5 bnftp.1 bni2tga.1 2 | bnibuild.1 bniextract.1 bnilist.1 bnpass.1 bnpcap.1 bnproxy.1 bnstat.1 3 | bntext.5 bntrackd.1 tgainfo.1 4 | DESTINATION ${MANDIR}) 5 | -------------------------------------------------------------------------------- /scripts/S98bnetd: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A semi-RedHat style init script for staring bnetd 4 | 5 | . /etc/rc.d/init.d/functions 6 | 7 | bnetduser="bnetd" 8 | bnetdhome="/home/bnetd" 9 | bnetdpid="${bnetdhome}/bnetd.pid" 10 | bnetdexe="${bnetdhome}/sbin/bnetd" 11 | 12 | case "$1" in 13 | start) 14 | echo -n "Starting bnetd: " 15 | if [ -r "${bnetdpid}" ] && kill -0 `cat "${bnetdpid}"`; then 16 | echo "${bnetdpid} exists and the pid is still valid." 17 | else 18 | if [ -d "${bnetdhome}" ]; then 19 | if [ -x "${bnetdexe}" ]; then 20 | # su -c "cd ${bnetdhome}; ${bnetdexe} -f &" - "${bnetduser}" 2>&1 > /dev/null 21 | su -c "${bnetdexe}" - "${bnetduser}" 2>&1 > /dev/null 22 | # "${bnetdexe}" 23 | echo bnetd 24 | else 25 | echo "${bnetdexe} is not an executable." 26 | fi 27 | else 28 | echo "${bnetdhome} is not a directory." 29 | fi 30 | fi 31 | ;; 32 | restart) 33 | echo -n "Restarting bnetd: " 34 | if [ -f "${bnetdpid}" ] && kill -0 `cat "${bnetdpid}"`; then 35 | kill -HUP `cat "${bnetdpid}"` 36 | echo "bnetd" 37 | else 38 | echo "bnetd is not running." 39 | fi 40 | ;; 41 | stop) 42 | echo -n "Stopping bnetd: " 43 | if [ -f "${bnetdpid}" ]; then 44 | kill -TERM `cat "${bnetdpid}"` 45 | sleep 1 46 | if [ -f "${bnetdpid}" ] && kill -0 `cat "${bnetdpid}"` 2>&1 > /dev/null; then 47 | echo "waiting for users to log out." 48 | else 49 | rm -f "${bnetdpid}" 50 | echo "bnetd" 51 | fi 52 | else 53 | echo "bnetd is not running." 54 | fi 55 | ;; 56 | status) 57 | status bnetd 58 | ;; 59 | *) 60 | echo "Usage: $0 {start|stop|restart|status}" 61 | exit 1 62 | esac 63 | 64 | exit 0 65 | 66 | -------------------------------------------------------------------------------- /scripts/bnetd.init: -------------------------------------------------------------------------------- 1 | # -*- sh -*- 2 | # 3 | # bnetd Script to control the Unix Battle.net Daemon 4 | # 5 | # Author: Hakan Tandogan 6 | # 7 | # chkconfig: 2345 21 79 8 | # description: bnetd is a Unix clone of the Battle.net Daemon 9 | # 10 | 11 | # Source function library. 12 | . /etc/rc.d/init.d/functions 13 | 14 | # See how we were called. 15 | case "$1" in 16 | start) 17 | # Start daemons. 18 | echo -n "Starting bnetd: " 19 | daemon bnetd 20 | echo 21 | touch /var/lock/subsys/bnetd 22 | ;; 23 | 24 | stop) 25 | # Stop daemons. 26 | echo -n "Shutting down bnetd: " 27 | killproc bnetd 28 | echo 29 | rm -f /var/lock/subsys/bnetd 30 | ;; 31 | 32 | reload) 33 | $0 stop 34 | $0 start 35 | ;; 36 | 37 | restart) 38 | $0 stop 39 | $0 start 40 | ;; 41 | 42 | status) 43 | status bnetd 44 | ;; 45 | 46 | *) 47 | echo "Usage: bnetd {start|stop|restart|reload|status}" 48 | exit 1 49 | esac 50 | 51 | exit 0 52 | -------------------------------------------------------------------------------- /scripts/bnetd.logrotate: -------------------------------------------------------------------------------- 1 | /var/log/bnetd/bnetd.log { 2 | rotate 9 3 | missingok 4 | notifempty 5 | postrotate 6 | /usr/bin/killall -HUP bnetd 7 | endscript 8 | } 9 | -------------------------------------------------------------------------------- /scripts/lastlogin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | #Usage: lastlogins.pl 4 | 5 | $ARGV[1] eq "" && die "error arguments"; 6 | 7 | $userdir=$ARGV[0]; 8 | opendir(DIR,$userdir) || die "error open dir $userdir"; 9 | @files= grep { /^[^.]/ && -f "$userdir/$_" } readdir(DIR); 10 | closedir DIR; 11 | 12 | $tbl{'name'}='"BNET\\acct\\lastlogin_time"'; 13 | foreach (@files) { 14 | open(S_FILE,"$s_dir/$_") || die "error open s_file"; 15 | $dest_file=lc("$d_dir/$_"); 16 | while () { 17 | chop($_); 18 | ($name,$value)=split(/:/,$_); 19 | foreach (keys %tbl) { 20 | if ($_ eq $name) { 21 | if ( $_ eq "password" ) { 22 | $value=&passconv($value); 23 | } 24 | break; 25 | } 26 | } 27 | } 28 | $userid++; 29 | close(S_FILE); 30 | } 31 | -------------------------------------------------------------------------------- /scripts/localize/pvpgn_localize_generator.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/scripts/localize/pvpgn_localize_generator.exe -------------------------------------------------------------------------------- /scripts/localize/pvpgn_localize_validator.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/scripts/localize/pvpgn_localize_validator.exe -------------------------------------------------------------------------------- /scripts/localize/update.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\common.xml 4 | 5 | if exist ..\..\conf\i18n\deDE\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\deDE\common.xml 6 | if exist ..\..\conf\i18n\csCZ\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\csCZ\common.xml 7 | if exist ..\..\conf\i18n\esES\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\esES\common.xml 8 | if exist ..\..\conf\i18n\frFR\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\frFR\common.xml 9 | if exist ..\..\conf\i18n\itIT\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\itIT\common.xml 10 | if exist ..\..\conf\i18n\jaJA\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\jaJA\common.xml 11 | if exist ..\..\conf\i18n\koKR\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\koKR\common.xml 12 | if exist ..\..\conf\i18n\plPL\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\plPL\common.xml 13 | if exist ..\..\conf\i18n\ruRU\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\ruRU\common.xml 14 | if exist ..\..\conf\i18n\zhCN\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\zhCN\common.xml 15 | if exist ..\..\conf\i18n\zhTW\common.xml pvpgn_localize_generator.exe ..\..\ ..\..\conf\i18n\zhTW\common.xml 16 | 17 | pause -------------------------------------------------------------------------------- /scripts/localize/validate.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | if exist ..\..\conf\i18n\deDE\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\deDE\common.xml 4 | if exist ..\..\conf\i18n\csCZ\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\csCZ\common.xml 5 | if exist ..\..\conf\i18n\esES\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\esES\common.xml 6 | if exist ..\..\conf\i18n\frFR\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\frFR\common.xml 7 | if exist ..\..\conf\i18n\itIT\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\itIT\common.xml 8 | if exist ..\..\conf\i18n\jaJA\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\jaJA\common.xml 9 | if exist ..\..\conf\i18n\koKR\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\koKR\common.xml 10 | if exist ..\..\conf\i18n\plPL\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\plPL\common.xml 11 | if exist ..\..\conf\i18n\ruRU\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\ruRU\common.xml 12 | if exist ..\..\conf\i18n\zhCN\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\zhCN\common.xml 13 | if exist ..\..\conf\i18n\zhTW\common.xml pvpgn_localize_validator.exe ..\..\conf\i18n\zhTW\common.xml 14 | 15 | pause -------------------------------------------------------------------------------- /scripts/login_testusers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # tries to login with a massive number of test accounts 4 | 5 | # See make_testusers.sh for a way to create these accounts. 6 | 7 | 8 | # number of accounts to connect with 9 | numaccts=400 10 | 11 | # "prefix" of account names 12 | name="bob" 13 | 14 | # account password 15 | pass="bob" 16 | 17 | # delay between printing messages 18 | delay=30 19 | 20 | # where to connect 21 | server=localhost 22 | 23 | # number of zero-padded columns in suffix 24 | padding=6 25 | 26 | # how many seconds until logout 27 | total=600 28 | 29 | 30 | num=0 31 | while [ "${num}" -lt "${numaccts}" ]; do 32 | num="`expr \"${num}\" '+' '1'`" 33 | form="`printf \"%0${padding}d\" \"${num}\"`" 34 | ( 35 | echo '' 36 | echo "${name}${form}" 37 | echo "${pass}" 38 | total=0; 39 | while [ "${total}" -lt "${maxtime}" ]; do 40 | sleep "${delay}" 41 | echo "My name is ${name}${form}" 42 | total="`expr \"${total}\" '+' \"${delay}\"`" 43 | done 44 | echo "/quit" 45 | ) | telnet "${server}" 6112 & 46 | done 47 | 48 | exit 0 49 | -------------------------------------------------------------------------------- /scripts/make_testusers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # creates massive numbers of dummy "test" accounts 4 | 5 | 6 | # number of accounts to connect with 7 | numaccts=400 8 | 9 | # "prefix" of account names 10 | name="bob" 11 | 12 | # account password 13 | pass="bob" 14 | 15 | # number of zero-padded columns in suffix 16 | padding=6 17 | 18 | # "users" directory 19 | users=/usr/local/bnetd/var/users 20 | 21 | # bnpass command 22 | bnpass=/usr/local/bnetd/bin/bnpass 23 | 24 | 25 | hash="`echo \"${pass}\" | \"${bnpass}\" | sed -e 's/^.*"\([0-9a-f]*\)"/\1/'`" 26 | 27 | num=0 28 | while [ "${num}" -lt 400 ]; do 29 | num="`expr \"${num}\" '+' '1'`" 30 | form="`printf \"%06d\" \"${num}\"`" 31 | ( 32 | echo '"BNET\\acct\\username"="'"${name}${form}"'"' 33 | echo '"BNET\\acct\\passhash1"="'"${hash}"'"' 34 | echo '"BNET\\acct\\userid"="'"${num}"'"' 35 | ) > "${users}/${form}" 36 | done 37 | 38 | exit 0 39 | -------------------------------------------------------------------------------- /scripts/pvpgn_wol_hash.inc.php: -------------------------------------------------------------------------------- 1 | 8) 18 | { 19 | return false; 20 | } 21 | $pwd1=$pass; 22 | $esi=8; 23 | $pwd2=array(null,null,null,null,null,null,null,null); 24 | $p1=0; 25 | $p2=0; 26 | $edx=""; 27 | for($i=0;$i<8;$i++) 28 | { 29 | if(ord($pwd1[$p1]) & 1) 30 | { 31 | $edx = ord($pwd1[$p1]) << 1; 32 | $edx &= ord($pwd1[$esi]); 33 | } 34 | else 35 | { 36 | $edx = ord($pwd1[$p1]) ^ ord($pwd1[$esi]); 37 | } 38 | $pwd2[$p2] = $edx; 39 | $p2++; 40 | $esi--; 41 | $p1++; 42 | } 43 | 44 | 45 | $WOL_HASH_CHAR = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; 46 | $p1 = 0; 47 | $p2 = 0; 48 | for($i=0;$i<8;$i++) 49 | { 50 | $edx = $pwd2[$p2] & 0x3f; 51 | $p2++; 52 | $pwd1[$p1] = $WOL_HASH_CHAR[$edx]; 53 | $p1++; 54 | } 55 | return $pwd1; 56 | } 57 | 58 | ?> -------------------------------------------------------------------------------- /scripts/tos.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd ../files 3 | 4 | copy tos.txt tos_RUS.txt 5 | copy tos.txt tos_POL.txt 6 | copy tos.txt tos_CHI.txt 7 | copy tos.txt tos_SIN.txt 8 | copy tos.txt tos_HAN.txt 9 | copy tos.txt tos_KOR.txt 10 | copy tos.txt tos_JPN.txt 11 | copy tos.txt tos_ITA.txt 12 | copy tos.txt tos_BRA.txt 13 | copy tos.txt tos_POR.txt 14 | copy tos.txt tos_FRA.txt 15 | copy tos.txt tos_DEU.txt 16 | copy tos.txt tos_ESP.txt 17 | copy tos.txt tos_USA.txt 18 | copy tos.txt tos_ENU.txt 19 | 20 | copy tos.txt tos-unicode_RUS.txt 21 | copy tos.txt tos-unicode_POL.txt 22 | copy tos.txt tos-unicode_CHI.txt 23 | copy tos.txt tos-unicode_SIN.txt 24 | copy tos.txt tos-unicode_HAN.txt 25 | copy tos.txt tos-unicode_KOR.txt 26 | copy tos.txt tos-unicode_JPN.txt 27 | copy tos.txt tos-unicode_ITA.txt 28 | copy tos.txt tos-unicode_BRA.txt 29 | copy tos.txt tos-unicode_POR.txt 30 | copy tos.txt tos-unicode_FRA.txt 31 | copy tos.txt tos-unicode_DEU.txt 32 | copy tos.txt tos-unicode_ESP.txt 33 | copy tos.txt tos-unicode_USA.txt 34 | copy tos.txt tos-unicode_ENU.txt 35 | 36 | cd ../scripts -------------------------------------------------------------------------------- /scripts/tos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ X"$1" != X"" ]; then 4 | cd "$1" 5 | fi 6 | 7 | LNG="RUS POL CHI SIN HAN KOR JPN ITA BRA POR FRA DEU ESP USA ENU" 8 | 9 | for i in $LNG 10 | do 11 | echo "Generating Term Of Service for language \"$i\"" 12 | cp -f tos.txt tos_"$i".txt 13 | cp -f tos.txt tos-unicode_"$i".txt 14 | done 15 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}) 2 | 3 | 4 | if(MYSQL_FOUND) 5 | add_definitions("-DWITH_SQL_MYSQL") 6 | endif(MYSQL_FOUND) 7 | if(SQLITE3_FOUND) 8 | add_definitions("-DWITH_SQL_SQLITE3") 9 | endif(SQLITE3_FOUND) 10 | if(PGSQL_FOUND) 11 | add_definitions("-DWITH_SQL_PGSQL") 12 | endif(PGSQL_FOUND) 13 | 14 | 15 | if(LUA_FOUND) 16 | add_definitions("-DWITH_LUA") 17 | endif(LUA_FOUND) 18 | 19 | 20 | 21 | if (WITH_WIN32_GUI) 22 | add_definitions("-DWIN32_GUI") 23 | endif (WITH_WIN32_GUI) 24 | 25 | 26 | add_subdirectory(bniutils) 27 | add_subdirectory(bnpass) 28 | add_subdirectory(bntrackd) 29 | add_subdirectory(client) 30 | add_subdirectory(common) 31 | add_subdirectory(compat) 32 | add_subdirectory(win32) 33 | 34 | 35 | if(WITH_BNETD) 36 | add_subdirectory(bnetd) 37 | endif(WITH_BNETD) 38 | 39 | if(WITH_D2CS) 40 | add_subdirectory(d2cs) 41 | endif(WITH_D2CS) 42 | 43 | if(WITH_D2DBS) 44 | add_subdirectory(d2dbs) 45 | endif(WITH_D2DBS) 46 | 47 | 48 | if(CMAKE_TESTING_ENABLED) 49 | add_subdirectory(test) 50 | endif(CMAKE_TESTING_ENABLED) 51 | 52 | -------------------------------------------------------------------------------- /src/bnetd/channel_conv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_CHANNEL_CONV_TYPES 19 | #define INCLUDED_CHANNEL_CONV_TYPES 20 | 21 | #endif 22 | 23 | #ifndef JUST_NEED_TYPES 24 | #ifndef INCLUDED_CHANNEL_CONV_PROTOS 25 | #define INCLUDED_CHANNEL_CONV_PROTOS 26 | 27 | #define JUST_NEED_TYPES 28 | #include "channel.h" 29 | #undef JUST_NEED_TYPES 30 | 31 | namespace pvpgn 32 | { 33 | 34 | namespace bnetd 35 | { 36 | 37 | extern unsigned int cflags_to_bncflags(unsigned flags); 38 | 39 | } 40 | 41 | } 42 | 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /src/bnetd/cmdline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef __CMDLINE_H_PROTOS__ 20 | #define __CMDLINE_H_PROTOS__ 21 | 22 | namespace pvpgn 23 | { 24 | 25 | namespace bnetd 26 | { 27 | 28 | extern int cmdline_load(int argc, char * * argv); 29 | extern void cmdline_unload(void); 30 | 31 | /* options exported by cmdline */ 32 | #ifdef DO_DAEMONIZE 33 | extern int cmdline_get_foreground(void); 34 | #endif 35 | extern const char* cmdline_get_preffile(void); 36 | extern const char* cmdline_get_hexfile(void); 37 | #ifdef WIN32_GUI 38 | extern unsigned cmdline_get_console(void); 39 | extern unsigned cmdline_get_gui(void); 40 | #endif 41 | 42 | } 43 | 44 | } 45 | 46 | #endif /* __CMDLINE_H_PROTOS__ */ 47 | -------------------------------------------------------------------------------- /src/bnetd/command.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | /*****/ 19 | #ifndef JUST_NEED_TYPES 20 | #ifndef INCLUDED_COMMAND_PROTOS 21 | #define INCLUDED_COMMAND_PROTOS 22 | 23 | #define JUST_NEED_TYPES 24 | #include 25 | #include 26 | #include "connection.h" 27 | #undef JUST_NEED_TYPES 28 | 29 | namespace pvpgn 30 | { 31 | 32 | namespace bnetd 33 | { 34 | 35 | extern int handle_command(t_connection * c, char const * text); 36 | extern std::vector split_command(char const * text, int args_count); 37 | 38 | } 39 | 40 | } 41 | 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bnetd/command_groups.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU General Public License 4 | * as published by the Free Software Foundation; either version 2 5 | * of the License, or (at your option) any later version. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 | */ 16 | #ifndef INCLUDED_COMMAND_GROUPS_TYPES 17 | #define INCLUDED_COMMAND_GROUPS_TYPES 18 | 19 | namespace pvpgn 20 | { 21 | 22 | namespace bnetd 23 | { 24 | 25 | #ifdef COMMAND_GROUPS_INTERNAL_ACCESS 26 | 27 | typedef struct 28 | { 29 | char * command; 30 | unsigned int group; 31 | } t_command_groups; 32 | 33 | #endif 34 | 35 | } 36 | 37 | } 38 | 39 | #endif 40 | 41 | #ifndef JUST_NEED_TYPES 42 | #ifndef INCLUDED_COMMAND_GROUPS_PROTOS 43 | #define INCLUDED_COMMAND_GROUPS_PROTOS 44 | 45 | namespace pvpgn 46 | { 47 | 48 | namespace bnetd 49 | { 50 | 51 | extern int command_groups_load(char const * filename); 52 | extern int command_groups_unload(void); 53 | extern int command_groups_reload(char const * filename); 54 | extern unsigned int command_get_group(char const * command); 55 | 56 | } 57 | 58 | } 59 | 60 | #endif 61 | #endif 62 | -------------------------------------------------------------------------------- /src/bnetd/file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Rob Crittenden (rcrit@greyoak.com) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_FILE_PROTOS 23 | #define INCLUDED_FILE_PROTOS 24 | 25 | #define JUST_NEED_TYPES 26 | # include "common/bn_type.h" 27 | # include "connection.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | namespace bnetd 34 | { 35 | 36 | extern int file_to_mod_time(t_connection * c, char const * rawname, bn_long * modtime); 37 | extern int file_send(t_connection * c, char const * rawname, unsigned int adid, unsigned int etag, unsigned int startoffset, int need_header); 38 | 39 | } 40 | 41 | } 42 | 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /src/bnetd/file_plain.h: -------------------------------------------------------------------------------- 1 | #ifndef JUST_NEED_TYPES 2 | #ifndef INClUDED_FILE_PLAIN_PROTOS 3 | #define INClUDED_FILE_PLAIN_PROTOS 4 | 5 | #include "storage_file.h" 6 | 7 | namespace pvpgn 8 | { 9 | 10 | namespace bnetd 11 | { 12 | 13 | extern t_file_engine file_plain; 14 | 15 | } 16 | 17 | } 18 | 19 | #endif /* INClUDED_FILE_PLAIN_PROTOS */ 20 | #endif /* JUST_NEED_TYPES */ 21 | -------------------------------------------------------------------------------- /src/bnetd/handle_anongame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU General Public License 4 | * as published by the Free Software Foundation; either version 2 5 | * of the License, or (at your option) any later version. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 | */ 16 | #ifndef INCLUDED_HANDLE_ANONGAME_PROTOS 17 | #define INCLUDED_HANDLE_ANONGAME_PROTOS 18 | 19 | #include "common/packet.h" 20 | #include "connection.h" 21 | 22 | namespace pvpgn 23 | { 24 | 25 | namespace bnetd 26 | { 27 | 28 | extern int handle_anongame_packet(t_connection * c, t_packet const * const packet); 29 | 30 | } 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/bnetd/handle_bnet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_HANDLE_BNET_PROTOS 23 | #define INCLUDED_HANDLE_BNET_PROTOS 24 | 25 | #define JUST_NEED_TYPES 26 | #include "connection.h" 27 | #include "common/packet.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | namespace bnetd 34 | { 35 | 36 | extern int handle_bnet_packet(t_connection * c, t_packet const * const packet); 37 | 38 | } 39 | 40 | } 41 | 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bnetd/handle_bot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_HANDLE_BOT_PROTOS 23 | #define INCLUDED_HANDLE_BOT_PROTOS 24 | 25 | #define JUST_NEED_TYPES 26 | #include "connection.h" 27 | #include "common/packet.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | namespace bnetd 34 | { 35 | 36 | extern int handle_bot_packet(t_connection * c, t_packet const * const packet); 37 | 38 | } 39 | 40 | } 41 | 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bnetd/handle_d2cs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_HANDLE_D2CS_H 19 | #define INCLUDED_HANDLE_D2CS_H 20 | 21 | #include "common/packet.h" 22 | #include "connection.h" 23 | 24 | namespace pvpgn 25 | { 26 | 27 | namespace bnetd 28 | { 29 | 30 | extern int handle_d2cs_packet(t_connection * c, t_packet const * packet); 31 | extern int handle_d2cs_init(t_connection * c); 32 | extern int send_d2cs_gameinforeq(t_connection * c); 33 | 34 | } 35 | 36 | } 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /src/bnetd/handle_file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_HANDLE_FILE_PROTOS 23 | #define INCLUDED_HANDLE_FILE_PROTOS 24 | 25 | #define JUST_NEED_TYPES 26 | #include "connection.h" 27 | #include "common/packet.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | namespace bnetd 34 | { 35 | 36 | extern int handle_file_packet(t_connection * c, t_packet const * const packet); 37 | 38 | } 39 | 40 | } 41 | 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bnetd/handle_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_HANDLE_INIT_PROTOS 23 | #define INCLUDED_HANDLE_INIT_PROTOS 24 | 25 | #define JUST_NEED_TYPES 26 | #include "connection.h" 27 | #include "common/packet.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | namespace bnetd 34 | { 35 | 36 | extern int handle_init_packet(t_connection * c, t_packet const * const packet); 37 | 38 | } 39 | 40 | } 41 | 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bnetd/handle_irc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Marco Ziech (mmz@gmx.net) 3 | * Copyright (C) 2007 Pelish (pelish@gmail.com) 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | 21 | /*****/ 22 | #ifndef JUST_NEED_TYPES 23 | #ifndef INCLUDED_HANDLE_IRC_PROTOS 24 | #define INCLUDED_HANDLE_IRC_PROTOS 25 | 26 | #include "common/packet.h" 27 | #include "connection.h" 28 | 29 | namespace pvpgn 30 | { 31 | 32 | namespace bnetd 33 | { 34 | 35 | extern int handle_irc_con_command(t_connection * conn, char const * command, int numparams, char ** params, char * text); 36 | extern int handle_irc_log_command(t_connection * conn, char const * command, int numparams, char ** params, char * text); 37 | extern int handle_irc_welcome(t_connection * conn); 38 | 39 | } 40 | 41 | } 42 | 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /src/bnetd/handle_irc_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Pelish (pelish@gmail.com) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_HANDLE_IRC_COMMON_PROTOS 23 | #define INCLUDED_HANDLE_IRC_COMMON_PROTOS 24 | 25 | #include "common/packet.h" 26 | #include "connection.h" 27 | 28 | namespace pvpgn 29 | { 30 | 31 | namespace bnetd 32 | { 33 | 34 | extern int handle_irc_common_packet(t_connection * conn, t_packet const * const packet); 35 | 36 | } 37 | 38 | } 39 | 40 | #endif 41 | #endif 42 | -------------------------------------------------------------------------------- /src/bnetd/handle_telnet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_HANDLE_TELNET_PROTOS 23 | #define INCLUDED_HANDLE_TELNET_PROTOS 24 | 25 | #define JUST_NEED_TYPES 26 | #include "connection.h" 27 | #include "common/packet.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | namespace bnetd 34 | { 35 | 36 | extern int handle_telnet_packet(t_connection * c, t_packet const * const packet); 37 | 38 | } 39 | 40 | } 41 | 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bnetd/handle_udp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_HANDLE_UDP_PROTOS 23 | #define INCLUDED_HANDLE_UDP_PROTOS 24 | 25 | #define JUST_NEED_TYPES 26 | #include "connection.h" 27 | #include "common/packet.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | namespace bnetd 34 | { 35 | 36 | extern int handle_udp_packet(int usock, unsigned int src_addr, unsigned short src_port, t_packet const * const packet); 37 | 38 | } 39 | 40 | } 41 | 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bnetd/handle_wol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006,2007 Pelish (pelish@gmail.com) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_HANDLE_WOL_PROTOS 23 | #define INCLUDED_HANDLE_WOL_PROTOS 24 | 25 | #include "common/packet.h" 26 | #include "connection.h" 27 | 28 | namespace pvpgn 29 | { 30 | 31 | namespace bnetd 32 | { 33 | 34 | extern int handle_wol_con_command(t_connection * conn, char const * command, int numparams, char ** params, char * text); 35 | extern int handle_wol_log_command(t_connection * conn, char const * command, int numparams, char ** params, char * text); 36 | extern int handle_wol_welcome(t_connection * conn); 37 | 38 | } 39 | 40 | } 41 | 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /src/bnetd/handle_wserv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Pelish (pelish@gmail.com) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_HANDLE_WSERV_PROTOS 23 | #define INCLUDED_HANDLE_WSERV_PROTOS 24 | 25 | #include "common/packet.h" 26 | #include "connection.h" 27 | 28 | namespace pvpgn 29 | { 30 | 31 | namespace bnetd 32 | { 33 | 34 | extern int handle_wserv_con_command(t_connection * conn, char const * command, int numparams, char ** params, char * text); 35 | 36 | } 37 | 38 | } 39 | 40 | #endif 41 | #endif 42 | -------------------------------------------------------------------------------- /src/bnetd/handlers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef __HANDLERS_H__ 20 | #define __HANDLERS_H__ 21 | 22 | #include "common/packet.h" 23 | #include "connection.h" 24 | 25 | namespace pvpgn 26 | { 27 | 28 | namespace bnetd 29 | { 30 | 31 | typedef int(*t_handler)(t_connection *, t_packet const * const); 32 | 33 | typedef struct { 34 | int type; 35 | t_handler handler; 36 | } t_htable_row; 37 | 38 | } 39 | 40 | } 41 | 42 | #endif /* __HANDLERS_H__ */ 43 | -------------------------------------------------------------------------------- /src/bnetd/helpfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef INCLUDED_HELPFILE_H 22 | #define INCLUDED_HELPFILE_H 23 | 24 | #ifndef JUST_NEED_TYPES 25 | 26 | #define JUST_NEED_TYPES 27 | #include "connection.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | namespace bnetd 34 | { 35 | 36 | extern int helpfile_init(char const * filename); 37 | extern int helpfile_unload(void); 38 | extern int handle_help_command(t_connection *, char const *); 39 | extern int describe_command(t_connection * c, char const * cmd); 40 | } 41 | 42 | } 43 | 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /src/bnetd/output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU General Public License 4 | * as published by the Free Software Foundation; either version 2 5 | * of the License, or (at your option) any later version. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 | */ 16 | 17 | #ifndef __OUTPUT_H_INCLUDED__ 18 | #define __OUTPUT_H_INCLUDED__ 19 | 20 | namespace pvpgn 21 | { 22 | 23 | namespace bnetd 24 | { 25 | 26 | extern void output_init(); 27 | extern int output_write_to_file(); 28 | 29 | } 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/bnetd/quota.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_QUOTA_TYPES 19 | #define INCLUDED_QUOTA_TYPES 20 | 21 | #include 22 | 23 | #ifdef JUST_NEED_TYPES 24 | # include "common/list.h" 25 | #else 26 | # define JUST_NEED_TYPES 27 | # include "common/list.h" 28 | # undef JUST_NEED_TYPES 29 | #endif 30 | 31 | namespace pvpgn 32 | { 33 | 34 | namespace bnetd 35 | { 36 | 37 | typedef struct 38 | { 39 | std::time_t inf; 40 | unsigned int count; 41 | } t_qline; 42 | 43 | typedef struct 44 | { 45 | unsigned int totcount; 46 | t_list * list; 47 | } t_quota; 48 | 49 | } 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/bnetd/runprog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_RUNPROG_PROTOS 23 | #define INCLUDED_RUNPROG_PROTOS 24 | 25 | #include 26 | 27 | namespace pvpgn 28 | { 29 | 30 | namespace bnetd 31 | { 32 | 33 | extern std::FILE * runprog_open(char const * command); 34 | extern int runprog_close(std::FILE * pp); 35 | 36 | } 37 | 38 | } 39 | 40 | #endif 41 | #endif 42 | -------------------------------------------------------------------------------- /src/bnetd/sql_mysql.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002,2003 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_SQL_MYSQL_PROTOS 19 | #define INCLUDED_SQL_MYSQL_PROTOS 20 | 21 | #define JUST_NEED_TYPES 22 | # include "sql_common.h" 23 | #undef JUST_NEED_TYPES 24 | 25 | namespace pvpgn 26 | { 27 | 28 | namespace bnetd 29 | { 30 | 31 | extern t_sql_engine sql_mysql; 32 | 33 | } 34 | 35 | } 36 | 37 | #endif /* INCLUDED_SQL_MYSQL_PROTOS */ 38 | -------------------------------------------------------------------------------- /src/bnetd/sql_odbc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 CreepLord (creeplord@pvpgn.org) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_SQL_ODBC_PROTOS 19 | #define INCLUDED_SQL_ODBC_PROTOS 20 | 21 | #define JUST_NEED_TYPES 22 | # include "sql_common.h" 23 | #undef JUST_NEED_TYPES 24 | 25 | namespace pvpgn 26 | { 27 | 28 | namespace bnetd 29 | { 30 | 31 | extern t_sql_engine sql_odbc; 32 | 33 | } 34 | 35 | } 36 | 37 | #endif /* INCLUDED_SQL_ODBC_PROTOS */ 38 | -------------------------------------------------------------------------------- /src/bnetd/sql_pgsql.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002,2003 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_SQL_PGSQL_PROTOS 19 | #define INCLUDED_SQL_PGSQL_PROTOS 20 | 21 | #define JUST_NEED_TYPES 22 | # include "sql_common.h" 23 | #undef JUST_NEED_TYPES 24 | 25 | namespace pvpgn 26 | { 27 | 28 | namespace bnetd 29 | { 30 | 31 | extern t_sql_engine sql_pgsql; 32 | 33 | } 34 | 35 | } 36 | 37 | #endif /* INCLUDED_SQL_PGSQL_PROTOS */ 38 | -------------------------------------------------------------------------------- /src/bnetd/sql_sqlite3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_SQL_SQLITE3_PROTOS 19 | #define INCLUDED_SQL_SQLITE3_PROTOS 20 | 21 | #define JUST_NEED_TYPES 22 | # include "sql_common.h" 23 | #undef JUST_NEED_TYPES 24 | 25 | namespace pvpgn 26 | { 27 | 28 | namespace bnetd 29 | { 30 | 31 | extern t_sql_engine sql_sqlite3; 32 | 33 | } 34 | 35 | } 36 | 37 | #endif /* INCLUDED_SQL_MYSQL_PROTOS */ 38 | -------------------------------------------------------------------------------- /src/bnetd/storage_sql.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002,2003 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef JUST_NEED_TYPES 20 | #ifndef INCLUDED_STORAGE_SQL_PROTOS 21 | #define INCLUDED_STORAGE_SQL_PROTOS 22 | 23 | #include "storage.h" 24 | 25 | namespace pvpgn 26 | { 27 | 28 | namespace bnetd 29 | { 30 | 31 | extern t_storage storage_sql; 32 | 33 | } 34 | 35 | } 36 | 37 | #endif /* INCLUDED_STORAGE_SQL_PROTOS */ 38 | #endif /* JUST_NEED_TYPES */ 39 | -------------------------------------------------------------------------------- /src/bnetd/support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004 Lector 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef INCLUDED_SUPPORT_PROTOS 20 | #define INCLUDED_SUPPORT_PROTOS 21 | 22 | namespace pvpgn 23 | { 24 | 25 | namespace bnetd 26 | { 27 | 28 | extern int support_check_files(char const * supportfile); 29 | 30 | } 31 | 32 | } 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /src/bnetd/tick.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_TICK_PROTOS 23 | #define INCLUDED_TICK_PROTOS 24 | 25 | namespace pvpgn 26 | { 27 | 28 | namespace bnetd 29 | { 30 | 31 | extern unsigned int get_ticks(void); 32 | 33 | } 34 | 35 | } 36 | 37 | #endif 38 | #endif 39 | -------------------------------------------------------------------------------- /src/bnetd/tracker.h: -------------------------------------------------------------------------------- 1 | #ifndef BNETD_TRACKER_H_INCLUDED 2 | #define BNETD_TRACKER_H_INCLUDED 3 | 4 | #include "common/addr.h" 5 | 6 | namespace pvpgn 7 | { 8 | 9 | namespace bnetd 10 | { 11 | 12 | extern int tracker_set_servers(char const * servers); 13 | extern int tracker_send_report(t_addrlist const * addrs); 14 | 15 | } 16 | 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/bnetd/udptest_send.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef JUST_NEED_TYPES 19 | #ifndef INCLUDED_UDPTEST_SEND_PROTOS 20 | #define INCLUDED_UDPTEST_SEND_PROTOS 21 | 22 | #include "connection.h" 23 | 24 | namespace pvpgn 25 | { 26 | 27 | namespace bnetd 28 | { 29 | 30 | extern int udptest_send(t_connection const * c); 31 | 32 | } 33 | 34 | } 35 | 36 | #endif 37 | #endif 38 | -------------------------------------------------------------------------------- /src/bniutils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(bnilist bnilist.cpp fileio.cpp fileio.h tga.cpp tga.h) 2 | target_link_libraries(bnilist PRIVATE common compat) 3 | 4 | add_executable(bni2tga bni2tga.cpp fileio.cpp fileio.h) 5 | target_link_libraries(bni2tga PRIVATE common) 6 | 7 | add_executable(bniextract bniextract.cpp fileio.cpp fileio.h tga.cpp tga.h bni.cpp bni.h) 8 | target_link_libraries(bniextract PRIVATE common compat) 9 | 10 | add_executable(bnibuild bnibuild.cpp fileio.cpp fileio.h bni.cpp bni.h tga.cpp tga.h) 11 | target_link_libraries(bnibuild PRIVATE common compat) 12 | 13 | add_executable(tgainfo tgainfo.cpp fileio.cpp fileio.h tga.cpp tga.h) 14 | target_link_libraries(tgainfo PRIVATE common compat) 15 | 16 | install(TARGETS bnilist bni2tga bniextract bnibuild tgainfo DESTINATION ${BINDIR}) 17 | -------------------------------------------------------------------------------- /src/bnpass/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(bnpass bnpass.cpp) 2 | target_link_libraries(bnpass PRIVATE common compat fmt) 3 | 4 | add_executable(sha1hash sha1hash.cpp) 5 | target_link_libraries(sha1hash PRIVATE common compat fmt) 6 | 7 | install(TARGETS bnpass sha1hash DESTINATION ${BINDIR}) 8 | -------------------------------------------------------------------------------- /src/bntrackd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(bntrackd bntrackd.cpp) 2 | target_link_libraries(bntrackd PRIVATE common compat fmt ${NETWORK_LIBRARIES}) 3 | install(TARGETS bntrackd DESTINATION ${SBINDIR}) 4 | -------------------------------------------------------------------------------- /src/client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(bnchat bnchat.cpp client.cpp client.h client_connect.cpp 2 | client_connect.h udptest.cpp udptest.h ansi_term.h) 3 | target_link_libraries(bnchat PRIVATE common compat fmt ${NETWORK_LIBRARIES}) 4 | 5 | add_executable(bnftp bnftp.cpp client.cpp client.h) 6 | target_link_libraries(bnftp PRIVATE common compat fmt ${NETWORK_LIBRARIES}) 7 | 8 | add_executable(bnbot bnbot.cpp client.cpp client.h) 9 | target_link_libraries(bnbot PRIVATE common compat fmt ${NETWORK_LIBRARIES}) 10 | 11 | add_executable(bnstat bnstat.cpp client.cpp client.h client_connect.cpp 12 | client_connect.h udptest.cpp udptest.h) 13 | target_link_libraries(bnstat PRIVATE common compat fmt ${NETWORK_LIBRARIES}) 14 | 15 | install(TARGETS bnchat bnftp bnbot bnstat DESTINATION ${BINDIR}) 16 | -------------------------------------------------------------------------------- /src/client/client.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999,2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef JUST_NEED_TYPES 19 | #ifndef INCLUDED_CLIENT_PROTOS 20 | #define INCLUDED_CLIENT_PROTOS 21 | 22 | #include "common/packet.h" 23 | 24 | namespace pvpgn 25 | { 26 | 27 | namespace client 28 | { 29 | 30 | extern int client_blocksend_packet(int sock, t_packet const * packet); 31 | extern int client_blockrecv_packet(int sock, t_packet * packet); 32 | extern int client_blockrecv_raw_packet(int sock, t_packet * packet, unsigned int len); 33 | extern int client_get_termsize(int fd, unsigned int * w, unsigned int * h); 34 | extern int client_get_comm(char const * prompt, char * text, unsigned int maxlen, unsigned int * curpos, int visible, int redraw, unsigned int width); 35 | 36 | } 37 | 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /src/client/udptest.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef JUST_NEED_TYPES 19 | #ifndef INCLUDED_UDPTEST_PROTOS 20 | #define INCLUDED_UDPTEST_PROTOS 21 | 22 | namespace pvpgn 23 | { 24 | 25 | namespace client 26 | { 27 | 28 | extern int client_udptest_setup(char const * progname, unsigned short * lsock_port_ret); 29 | extern int client_udptest_recv(char const * progname, int lsock, unsigned short lsock_port, unsigned int timeout); 30 | 31 | } 32 | 33 | } 34 | 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /src/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(COMMON_SOURCES 2 | addr.cpp addr.h anongame_protocol.h asnprintf.cpp asnprintf.h 3 | bnethashconv.cpp bnethashconv.h bnethash.cpp bnethash.h bnet_protocol.h 4 | bnettime.cpp bnettime.h bn_type.cpp bn_type.h bot_protocol.h conf.cpp 5 | conf.h d2char_checksum.cpp d2char_checksum.h d2char_file.h 6 | d2cs_bnetd_protocol.h d2cs_d2dbs_ladder.h d2cs_d2gs_character.h 7 | d2cs_d2gs_protocol.h d2cs_protocol.h d2game_protocol.h elist.h 8 | eventlog.cpp eventlog.h fdwatch.cpp fdwatch_epoll.cpp fdwatch_epoll.h 9 | fdwatch.h fdwatch_kqueue.cpp fdwatch_kqueue.h fdwatch_poll.cpp 10 | fdwatch_poll.h fdwatch_select.cpp fdwatch_select.h fdwbackend.cpp 11 | fdwbackend.h field_sizes.h file_protocol.h flags.h 12 | give_up_root_privileges.cpp give_up_root_privileges.h hashtable.cpp 13 | hashtable.h hash_tuple.hpp hexdump.cpp hexdump.h init_protocol.h introtate.h 14 | irc_protocol.h list.cpp list.h lstr.h network.cpp network.h 15 | packet.cpp packet.h proginfo.cpp proginfo.h queue.cpp queue.h rcm.cpp rcm.h 16 | rlimit.cpp rlimit.h scoped_array.h scoped_ptr.h setup_after.h 17 | setup_before.h systemerror.cpp systemerror.h tag.cpp tag.h token.cpp 18 | token.h tracker.h trans.cpp trans.h udp_protocol.h util.cpp util.h 19 | version.h wolhash.cpp wolhash.h xalloc.cpp xalloc.h xstr.cpp xstr.h 20 | xstring.cpp xstring.h gui_printf.h gui_printf.cpp 21 | bigint.cpp bigint.h bnetsrp3.cpp bnetsrp3.h peerchat.cpp peerchat.h 22 | wol_gameres_protocol.h pugiconfig.h pugixml.cpp pugixml.h) 23 | 24 | add_library(common STATIC ${COMMON_SOURCES}) 25 | 26 | target_link_libraries(common PRIVATE fmt) -------------------------------------------------------------------------------- /src/common/bnethashconv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | /*****/ 21 | #ifndef JUST_NEED_TYPES 22 | #ifndef INCLUDED_BNETHASHCONV_PROTOS 23 | #define INCLUDED_BNETHASHCONV_PROTOS 24 | 25 | #define JUST_NEED_TYPES 26 | #include "common/bn_type.h" 27 | #include "common/bnethash.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | extern void bnhash_to_hash(bn_int const * bnhash, t_hash * hash); 34 | extern void hash_to_bnhash(t_hash const * hash, bn_int * bnhash); 35 | 36 | } 37 | 38 | #endif 39 | #endif 40 | -------------------------------------------------------------------------------- /src/common/d2char_checksum.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #include "common/setup_before.h" 19 | #include "d2char_checksum.h" 20 | #include "common/setup_after.h" 21 | 22 | namespace pvpgn 23 | { 24 | 25 | extern int d2charsave_checksum(unsigned char const * data, unsigned int len, unsigned int offset) 26 | { 27 | int checksum; 28 | unsigned int i; 29 | unsigned int ch; 30 | 31 | if (!data) return 0; 32 | checksum = 0; 33 | for (i = 0; i < len; i++) { 34 | if (i >= offset && i < offset + sizeof(int)) ch = 0; 35 | else ch = *data; 36 | ch += (checksum < 0); 37 | checksum = 2 * checksum + ch; 38 | data++; 39 | } 40 | return checksum; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/common/d2char_checksum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_D2CHAR_CHECKSUM_H 19 | #define INCLUDED_D2CHAR_CHECKSUM_H 20 | 21 | #define D2CHARSAVE_CHECKSUM_OFFSET 0x0C 22 | 23 | namespace pvpgn 24 | { 25 | 26 | extern int d2charsave_checksum(unsigned char const * data, unsigned int len, unsigned int offset); 27 | 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/common/fdwbackend.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Abstraction API/layer for the various ways PvPGN can inspect sockets state 3 | * 2003 (C) 4 | * 5 | * Code is based on the ideas found in thttpd project. 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #include "common/setup_before.h" 23 | #include "fdwbackend.h" 24 | #include "common/setup_after.h" 25 | 26 | namespace pvpgn 27 | { 28 | 29 | FDWBackend::FDWBackend(int nfds_) 30 | :nfds(nfds_) 31 | {} 32 | 33 | FDWBackend::~FDWBackend() throw() 34 | {} 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/common/flags.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef INCLUDED_FLAGS_H 20 | #define INCLUDED_FLAGS_H 21 | 22 | #define FLAG_ZERO(var) *(var) = 0 23 | #define FLAG_SET(var,flag) *(var) |= flag 24 | #define FLAG_CLEAR(var,flag) *(var) &= ~flag 25 | #define FLAG_ISSET(var,flag) (var & flag) 26 | 27 | #endif /* INCLUDED_FLAGS_H */ 28 | -------------------------------------------------------------------------------- /src/common/give_up_root_privileges.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Hakan Tandogan (hakan@gurkensalat.com) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_GIVE_UP_ROOT_PRIVILEGES 19 | #define INCLUDED_GIVE_UP_ROOT_PRIVILEGES 20 | 21 | namespace pvpgn 22 | { 23 | 24 | extern int give_up_root_privileges(char const * user_name, char const * group_name); 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/common/gui_printf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef INCLUDED_GUI_PRINTF_H 20 | #define INCLUDED_GUI_PRINTF_H 21 | 22 | #ifdef WIN32_GUI 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | #include "common/eventlog.h" 32 | 33 | namespace pvpgn 34 | { 35 | extern void guiAddText(t_eventlog_level level, const char *str); 36 | 37 | template 38 | void gui_lvprintf(t_eventlog_level level, fmt::string_view format_str, const Args& ... args) 39 | { 40 | guiAddText(level, fmt::format(format_str, args...).c_str()); 41 | } 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/common/hexdump.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu) 3 | * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu) 4 | * Copyright (C) 2004 Donny Redmond (dredmond@linuxmail.org) 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License 8 | * as published by the Free Software Foundation; either version 2 9 | * of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | 22 | #ifndef JUST_NEED_TYPES 23 | #ifndef INCLUDED_HEXDUMP_PROTOS 24 | #define INCLUDED_HEXDUMP_PROTOS 25 | 26 | #include 27 | 28 | namespace pvpgn 29 | { 30 | 31 | extern void hexdump(std::FILE * stream, void const * data, unsigned int len); 32 | extern void hexdump_string(unsigned char * data, unsigned int datalen, char * dst, unsigned int counter); 33 | 34 | } 35 | 36 | #endif 37 | #endif 38 | -------------------------------------------------------------------------------- /src/common/network.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1998 Mark Baysinger (mbaysing@ucsd.edu) 3 | * Copyright (C) 1998,1999 Ross Combs (rocombs@cs.nmsu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | 21 | /*****/ 22 | #ifndef JUST_NEED_TYPES 23 | #ifndef INCLUDED_NETWORK_PROTOS 24 | #define INCLUDED_NETWORK_PROTOS 25 | 26 | #define JUST_NEED_TYPES 27 | #include "common/packet.h" 28 | #undef JUST_NEED_TYPES 29 | 30 | namespace pvpgn 31 | { 32 | 33 | extern int net_recv(int sock, void *buff, int len); 34 | extern int net_send(int sock, const void *buff, int len); 35 | extern int net_recv_packet(int sock, t_packet * packet, unsigned int * currsize); 36 | extern int net_send_packet(int sock, t_packet const * packet, unsigned int * currsize); 37 | 38 | } 39 | 40 | #endif 41 | #endif 42 | -------------------------------------------------------------------------------- /src/common/peerchat.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | GS peerchat encryption/decryption algorithm 0.2 4 | by Luigi Auriemma 5 | e-mail: aluigi@autistici.org 6 | web: aluigi.org 7 | 8 | 9 | LICENSE 10 | ======= 11 | Copyright 2004,2005,2006 Luigi Auriemma 12 | 13 | This program is free software; you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation; either version 2 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program; if not, write to the Free Software 25 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 26 | 27 | http://www.gnu.org/licenses/gpl.txt 28 | 29 | */ 30 | 31 | #ifndef __PEERCHAT_INCLUDED__ 32 | #define __PEERCHAT_INCLUDED__ 33 | 34 | namespace pvpgn 35 | { 36 | 37 | 38 | typedef struct { 39 | unsigned char gs_peerchat_1; 40 | unsigned char gs_peerchat_2; 41 | unsigned char gs_peerchat_crypt[256]; 42 | } gs_peerchat_ctx; 43 | 44 | extern gs_peerchat_ctx * gs_peerchat_create(); 45 | extern void gs_peerchat_destroy(gs_peerchat_ctx const * ctx); 46 | extern void gs_peerchat_init(gs_peerchat_ctx *ctx, unsigned char *chall, unsigned char *gamekey); 47 | extern void gs_peerchat(gs_peerchat_ctx *ctx, unsigned char *data, int size); 48 | 49 | } 50 | 51 | #endif /* __PEERCHAT_INCLUDED__ */ 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/common/proginfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Ross Combs (ross@bnetd.org) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef JUST_NEED_TYPES 19 | #ifndef INCLUDED_PROGINFO_PROTOS 20 | #define INCLUDED_PROGINFO_PROTOS 21 | 22 | namespace pvpgn 23 | { 24 | 25 | extern int verparts_to_vernum(unsigned short v1, unsigned short v2, unsigned short v3, unsigned short v4, unsigned long * vernum); 26 | extern int verstr_to_vernum(char const * verstr, unsigned long * vernum); 27 | extern char const * vernum_to_verstr(unsigned long vernum); 28 | 29 | } 30 | 31 | #endif 32 | #endif 33 | -------------------------------------------------------------------------------- /src/common/rlimit.h: -------------------------------------------------------------------------------- 1 | #ifndef COMMON_RLIMIT_H_INCLUDED 2 | #define COMMON_RLIMIT_H_INCLUDED 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /*****/ 20 | 21 | namespace pvpgn 22 | { 23 | 24 | extern int get_socket_limit(void); 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/common/setup_after.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_SETUP_BEFORE_H 19 | # error "This file must be included after all other header files" 20 | #endif 21 | #ifndef INCLUDED_SETUP_AFTER_H 22 | #define INCLUDED_SETUP_AFTER_H 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/common/systemerror.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #include "common/setup_before.h" 20 | #include "systemerror.h" 21 | 22 | #include 23 | 24 | #include "compat/strerror.h" 25 | #include "common/setup_after.h" 26 | 27 | namespace pvpgn 28 | { 29 | 30 | SystemError::SystemError(const std::string& prefix, int err) 31 | :std::runtime_error((prefix + ": ") + pstrerror(err)) 32 | { 33 | } 34 | 35 | 36 | SystemError::~SystemError() throw() 37 | { 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/common/systemerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 Dizzy 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef PVPGN_SYSTEMERROR_H 20 | #define PVPGN_SYSTEMERROR_H 21 | 22 | #include 23 | 24 | #include 25 | 26 | namespace pvpgn 27 | { 28 | 29 | class SystemError : public std::runtime_error 30 | { 31 | public: 32 | SystemError(const std::string& prefix, int err = errno); 33 | ~SystemError() throw(); 34 | }; 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/common/token.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Rob Crittenden (rcrit@greyoak.com) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef JUST_NEED_TYPES 19 | #ifndef INCLUDED_TOKEN_PROTOS 20 | #define INCLUDED_TOKEN_PROTOS 21 | namespace pvpgn 22 | { 23 | 24 | extern char * next_token(char * ptr, unsigned int * pos); 25 | 26 | } 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /src/common/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU General Public License 4 | * as published by the Free Software Foundation; either version 2 5 | * of the License, or (at your option) any later version. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 | */ 16 | #ifndef INCLUDED_COMMON_VERSION_H 17 | #define INCLUDED_COMMON_VERSION_H 18 | 19 | #define WIDEN(quote) WIDEN2(quote) 20 | #define WIDEN2(quote) L##quote 21 | 22 | #ifndef PVPGN_VERSION 23 | #define PVPGN_VERSION "1.99.7.2.1-PRO" 24 | #define PVPGN_VERSIONW WIDEN(PVPGN_VERSION) 25 | #endif 26 | 27 | #ifndef PVPGN_SOFTWARE 28 | #define PVPGN_SOFTWARE "PvPGN" 29 | #define PVPGN_SOFTWAREW WIDEN(PVPGN_SOFTWARE) 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/common/wolhash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Pelish (pelish@gmail.com) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_WOLHASH_TYPES 19 | #define INCLUDED_WOLHASH_TYPES 20 | 21 | namespace pvpgn 22 | { 23 | using t_wolhash = char[9]; 24 | } 25 | 26 | #endif 27 | 28 | /*****/ 29 | #define WOL_HASH_CHAR "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./" 30 | 31 | #ifndef JUST_NEED_TYPES 32 | #ifndef INCLUDED_WOLHASH_PROTOS 33 | #define INCLUDED_WOLHASH_PROTOS 34 | 35 | 36 | namespace pvpgn 37 | { 38 | 39 | extern int wol_hash(t_wolhash * hashout, unsigned int size, void const * datain); 40 | //extern int wolhash_eq(t_wolhash const h1, t_wolhash const h2) ; 41 | 42 | } 43 | 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /src/compat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(COMPAT_SOURCES access.h gethostname.h gettimeofday.cpp gettimeofday.h 2 | mkdir.h mmap.cpp mmap.h netinet_in.h pdir.cpp pdir.h 3 | pgetopt.cpp pgetopt.h pgetpid.h psock.cpp psock.h read.h recv.h 4 | rename.h send.h socket.h statmacros.h 5 | stdfileno.h strcasecmp.cpp strcasecmp.h strdup.cpp strdup.h 6 | strerror.cpp strerror.h strncasecmp.cpp strncasecmp.h strsep.cpp 7 | strsep.h termios.h uname.cpp uname.h) 8 | 9 | add_library(compat STATIC ${COMPAT_SOURCES}) 10 | 11 | target_link_libraries(compat PRIVATE common fmt) -------------------------------------------------------------------------------- /src/compat/access.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_ACCESS_PROTOS 19 | #define INCLUDED_ACCESS_PROTOS 20 | 21 | #ifdef WIN32 22 | # include 23 | /* Values for the second argument to access. These may be OR'd together. */ 24 | # define R_OK 4 /* Test for read permission. */ 25 | # define W_OK 2 /* Test for write permission. */ 26 | # define X_OK 1 /* Test for execute permission. */ 27 | # define F_OK 0 /* Test for existence. */ 28 | #endif 29 | 30 | #ifdef HAVE_UNISTD_H 31 | # include 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/compat/gethostname.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_GETHOSTNAME_PROTOS 19 | #define INCLUDED_GETHOSTNAME_PROTOS 20 | 21 | /* 22 | * This is from unistd.h on Unix systems, but it's included with 23 | * the socket stuff under Windows. This tries to hide that. 24 | */ 25 | 26 | #ifdef HAVE_UNISTD_H 27 | # include 28 | #endif 29 | #ifdef HAVE_WINSOCK2_H 30 | # include 31 | #else 32 | # ifndef HAVE_GETHOSTNAME 33 | # error "This program requires gethostname()" 34 | # endif 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/compat/gettimeofday.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_GETTIMEOFDAY_TYPES 19 | #define INCLUDED_GETTIMEOFDAY_TYPES 20 | 21 | #ifdef HAVE_SYS_TIME_H 22 | # include 23 | #endif 24 | 25 | #ifndef HAVE_GETTIMEOFDAY 26 | 27 | namespace pvpgn 28 | { 29 | 30 | /* FIXME: these might already exist even if gettimeofday() doesn't */ 31 | struct timeval 32 | { 33 | long tv_sec; 34 | long tv_usec; 35 | }; 36 | 37 | 38 | struct timezone 39 | { 40 | int tz_minuteswest; 41 | int tz_dsttime; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | 48 | #endif 49 | 50 | 51 | #ifndef INCLUDED_GETTIMEOFDAY_PROTOS 52 | #define INCLUDED_GETTIMEOFDAY_PROTOS 53 | 54 | #ifndef HAVE_GETTIMEOFDAY 55 | namespace pvpgn 56 | { 57 | 58 | extern int gettimeofday(struct timeval * tv, struct timezone * tz); 59 | 60 | } 61 | #endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/compat/netinet_in.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_NETINET_IN_PROTOS 19 | #define INCLUDED_NETINET_IN_PROTOS 20 | 21 | #ifndef INADDR_LOOPBACK 22 | #define INADDR_LOOPBACK 0x7f000001 23 | #endif 24 | 25 | #ifndef INADDR_ANY 26 | #define INADDR_ANY 0x00000000 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/compat/pgetpid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Olaf Freyer aaron@cs.tu-berlin.de 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_PGETPID_PROTOS 19 | #define INCLUDED_PGETPID_PROTOS 20 | 21 | #ifdef HAVE_GETPID 22 | # ifdef HAVE_UNISTD_H 23 | # include 24 | # endif 25 | # ifdef HAVE_SYS_TYPES_H 26 | # include 27 | # endif 28 | # ifdef HAVE_PROCESS_H 29 | # include 30 | # endif 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/compat/read.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_READ_PROTOS 19 | #define INCLUDED_READ_PROTOS 20 | 21 | /* Unix puts this in unistd.h */ 22 | #ifdef WIN32 23 | # include 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/compat/recv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_RECV_PROTOS 19 | #define INCLUDED_RECV_PROTOS 20 | 21 | #ifndef HAVE_RECV 22 | 23 | /* some recvfrom()s don't handle NULL, but recv is called depreciated on BSD */ 24 | #ifdef HAVE_RECVFROM 25 | # include 26 | # define recv(s, b, l, f) recvfrom(s, b, l, f, NULL, NULL) 27 | #else 28 | # ifdef HAVE_WINSOCK2_H 29 | # include 30 | # define recv(s, b, l, f) recvfrom(s, b, l, f, NULL, NULL) 31 | # else 32 | # error "This program requires recvfrom()" 33 | # endif 34 | #endif 35 | 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/compat/rename.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004 CreepLord (creeplord@pvpgn.org) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_RENAME_PROTOS 19 | #define INCLUDED_RENAME_PROTOS 20 | 21 | #include 22 | #include "compat/access.h" 23 | 24 | namespace pvpgn 25 | { 26 | 27 | static inline int p_rename(const char * oldpath, const char * newpath) 28 | { 29 | #ifdef WIN32 30 | if (access(newpath, F_OK) == 0) 31 | if (std::remove(newpath) < 0) 32 | return -1; 33 | #endif 34 | return std::rename(oldpath, newpath); 35 | } 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/compat/send.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_SEND_PROTOS 19 | #define INCLUDED_SEND_PROTOS 20 | 21 | #ifndef HAVE_SEND 22 | 23 | /* some sendto()s don't handle NULL, but send is called depreciated on BSD */ 24 | #ifdef HAVE_SENDTO 25 | # include 26 | # define send(s, b, l, f) sendto(s, b, l, f, NULL, NULL) 27 | #else 28 | # ifdef HAVE_WINSOCK2_H 29 | # include 30 | # define send(s, b, l, f) sendto(s, b, l, f, NULL, NULL) 31 | # else 32 | # error "This program requires sendto()" 33 | # endif 34 | #endif 35 | 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/compat/socket.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Philippe Dubois (pdubois1@hotmail.com) 3 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | #ifndef INCLUDED_SOCKET_PROTOS 20 | #define INCLUDED_SOCKET_PROTOS 21 | 22 | #ifdef WIN32 /* assume winsock2 is available */ 23 | 24 | # include 25 | /* 26 | * Including that file is basically equivalent to including: 27 | * 28 | * 29 | * 30 | * 31 | * 32 | * 33 | * 34 | * It should be included once for any file needing one or more 35 | * of those headers. 36 | */ 37 | 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/compat/stdfileno.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_STDFILENO_PROTOS 19 | #define INCLUDED_STDFILENO_PROTOS 20 | 21 | #ifdef HAVE_UNISTD_H 22 | # include 23 | #endif 24 | 25 | #ifdef STDIN_FILENO 26 | # define STDINFD STDIN_FILENO 27 | #else 28 | # define STDINFD 0 29 | #endif 30 | 31 | #ifdef STDOUT_FILENO 32 | # define STDOUTFD STDOUT_FILENO 33 | #else 34 | # define STDOUTFD 1 35 | #endif 36 | 37 | #ifdef STDERR_FILENO 38 | # define STDERRFD STDERR_FILENO 39 | #else 40 | # define STDERRFD 2 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/compat/strcasecmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_STRCASECMP_PROTOS 19 | #define INCLUDED_STRCASECMP_PROTOS 20 | 21 | #include 22 | 23 | #ifndef HAVE_STRCASECMP 24 | 25 | #ifdef HAVE_STRICMP 26 | # define strcasecmp(s1, s2) stricmp(s1, s2) 27 | # define HAVE_STRCASECMP 28 | #else 29 | 30 | namespace pvpgn 31 | { 32 | 33 | extern int strcasecmp(char const * str1, char const * str2); 34 | 35 | } 36 | 37 | #endif 38 | 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/compat/strdup.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #include "common/setup_before.h" 19 | 20 | #ifndef HAVE_STRDUP 21 | #include "strdup.h" 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include "common/xalloc.h" 28 | 29 | #include "common/setup_after.h" 30 | 31 | 32 | namespace pvpgn 33 | { 34 | 35 | extern char * strdup(char const * str) 36 | { 37 | char * out; 38 | 39 | if (!(out = (char *)xmalloc(std::strlen(str) + 1))) 40 | return NULL; 41 | std::strcpy(out, str); 42 | return out; 43 | } 44 | 45 | } 46 | 47 | #else 48 | typedef int filenotempty; /* make ISO standard happy */ 49 | #endif 50 | -------------------------------------------------------------------------------- /src/compat/strdup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_STRDUP_PROTOS 19 | #define INCLUDED_STRDUP_PROTOS 20 | 21 | #ifndef HAVE_STRDUP 22 | 23 | namespace pvpgn 24 | { 25 | 26 | extern char * strdup(char const * str); 27 | 28 | } 29 | #else 30 | // dirty hack? but I don't like to include directly when I just want this one... 31 | // better solutions welcome 32 | # include 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/compat/strerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_STRERROR_PROTOS 19 | #define INCLUDED_STRERROR_PROTOS 20 | 21 | #if defined(WIN32) 22 | namespace pvpgn 23 | { 24 | 25 | extern char const * pstrerror(int errornum); 26 | 27 | } 28 | 29 | #else 30 | 31 | #include 32 | 33 | # define pstrerror(e) strerror(e) 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/compat/strncasecmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 1999 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_STRNCASECMP_PROTOS 19 | #define INCLUDED_STRNCASECMP_PROTOS 20 | 21 | #include 22 | 23 | #ifndef HAVE_STRNCASECMP 24 | 25 | #ifdef HAVE_STRNICMP 26 | # define strncasecmp(s1, s2, cnt) strnicmp(s1, s2, cnt) 27 | # define HAVE_STRNCASECMP /* don't include our own function */ 28 | #else 29 | 30 | namespace pvpgn 31 | { 32 | 33 | extern int strncasecmp(char const * str1, char const * str2, unsigned int cnt); 34 | 35 | } 36 | 37 | #endif 38 | 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/compat/strsep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_STRSEP_PROTOS 19 | #define INCLUDED_STRSEP_PROTOS 20 | 21 | #ifndef HAVE_STRSEP 22 | 23 | namespace pvpgn 24 | { 25 | 26 | extern char * strsep(char * * str, char const * delim); 27 | 28 | } 29 | 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/compat/uname.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000 Ross Combs (rocombs@cs.nmsu.edu) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | */ 18 | #ifndef INCLUDED_UNAME_H 19 | #define INCLUDED_UNAME_H 20 | 21 | #ifdef HAVE_UNAME 22 | #ifdef HAVE_SYS_UTSNAME_H 23 | #include 24 | #endif 25 | #else 26 | 27 | #ifndef SYS_NMLN 28 | #define SYS_NMLN 64 29 | #endif 30 | 31 | namespace pvpgn 32 | { 33 | struct utsname 34 | { 35 | char sysname[SYS_NMLN + 1]; 36 | char nodename[SYS_NMLN + 1]; 37 | char release[SYS_NMLN + 1]; 38 | char version[SYS_NMLN + 1]; 39 | char machine[SYS_NMLN + 1]; 40 | char domainname[SYS_NMLN + 1]; 41 | }; 42 | 43 | int uname(struct utsname* buf); 44 | } 45 | 46 | #endif // HAVE_UNAME 47 | #endif // INCLUDED_UNAME_H -------------------------------------------------------------------------------- /src/d2cs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(D2CS_SOURCES 2 | bit.h bnetd.cpp bnetd.h cmdline.cpp cmdline.h connection.cpp 3 | connection.h d2charfile.cpp d2charfile.h d2charlist.cpp d2charlist.h 4 | d2gs.cpp d2gs.h d2ladder.cpp d2ladder.h game.cpp game.h gamequeue.cpp 5 | gamequeue.h handle_bnetd.cpp handle_bnetd.h handle_d2cs.cpp 6 | handle_d2cs.h handle_d2gs.cpp handle_d2gs.h handle_init.cpp 7 | handle_init.h handle_signal.cpp handle_signal.h main.cpp net.cpp 8 | net.h prefs.cpp prefs.h s2s.cpp s2s.h server.cpp server.h 9 | serverqueue.h serverqueue.cpp setup.h version.h ../win32/d2cs_winmain.cpp 10 | ../win32/d2cs_resource.h ../win32/d2cs_resource.rc) 11 | 12 | if(WITH_WIN32_GUI) 13 | add_executable(d2cs WIN32 ${D2CS_SOURCES}) 14 | else(WITH_WIN32_GUI) 15 | add_executable(d2cs ${D2CS_SOURCES}) 16 | endif(WITH_WIN32_GUI) 17 | 18 | target_link_libraries(d2cs PRIVATE common compat fmt win32 ${NETWORK_LIBRARIES}) 19 | install(TARGETS d2cs DESTINATION ${SBINDIR}) 20 | if(WIN32 AND MSVC) 21 | install(FILES $ DESTINATION ${SBINDIR} OPTIONAL) 22 | endif() -------------------------------------------------------------------------------- /src/d2cs/bit.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_BIT_H 19 | #define INCLUDED_BIT_H 20 | 21 | #define BIT_POS(n) ( 1u << (n) ) 22 | #define BIT_SET_FLAG(n,f) ( (n) |= (f) ) 23 | #define BIT_CLR_FLAG(n,f) ( (n) &= ~(f) ) 24 | #define BIT_TST_FLAG(n,f) ( ((n) & (f)) ? 1: 0 ) 25 | #define BIT_SET_CLR_FLAG(n, f, v) ( (v)?(BIT_SET_FLAG(n,f)):(BIT_CLR_FLAG(n,f)) ) 26 | 27 | #define BIT_RANGE(n,m) ( BIT_POS((m)+1-(n)) - BIT_POS(n) ) 28 | #define BIT_LSHIFT(n,m) ( (n) << (m) ) 29 | #define BIT_RSHIFT(n,m) ( (n) >> (m) ) 30 | 31 | #define BIT_GET(n, m) ( ((n) >> (m)) & 1) 32 | #define BIT_GET_RANGE(n, m, l) ( ((n) >> (m)) & (1u << (l) -1)) 33 | #define BIT_GET_RANGE_MASK(n, m, mask) ( ((n) >> (m)) & (mask)) 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/d2cs/bnetd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_BNETD_H 19 | #define INCLUDED_BNETD_H 20 | 21 | #include "connection.h" 22 | 23 | namespace pvpgn 24 | { 25 | 26 | namespace d2cs 27 | { 28 | 29 | extern int bnetd_init(void); 30 | extern int bnetd_check(void); 31 | extern t_connection * bnetd_conn(void); 32 | extern int bnetd_destroy(t_connection * c); 33 | extern int bnetd_set_connection(t_connection * c); 34 | extern int bnetd_keepalive(void); 35 | 36 | } 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/d2cs/cmdline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 Dizzy 3 | * Copyright (C) 2005 Olaf Freyer (aaron@cs.tu-berlin.de) 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __D2CS_CMDLINE_H_PROTOS__ 21 | #define __D2CS_CMDLINE_H_PROTOS__ 22 | namespace pvpgn 23 | { 24 | 25 | namespace d2cs 26 | { 27 | 28 | 29 | extern int cmdline_load(int argc, char * * argv); 30 | extern void cmdline_unload(void); 31 | 32 | /* options exported by cmdline */ 33 | #ifdef DO_DAEMONIZE 34 | extern int cmdline_get_foreground(void); 35 | #endif 36 | extern const char* cmdline_get_preffile(void); 37 | extern const char* cmdline_get_logfile(void); 38 | #ifdef WIN32_GUI 39 | extern unsigned cmdline_get_console(void); 40 | extern unsigned cmdline_get_gui(void); 41 | #endif 42 | 43 | } 44 | 45 | } 46 | 47 | #endif /* __D2CS_CMDLINE_H_PROTOS__ */ 48 | -------------------------------------------------------------------------------- /src/d2cs/d2charlist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2004 ls_sons (ls@gamelife.org) 3 | * Copyright (C) 2004 Olaf Freyer (aaron@cs.tu-berlin.de) 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #include "common/elist.h" 21 | #include "common/d2cs_d2gs_character.h" 22 | 23 | namespace pvpgn 24 | { 25 | 26 | namespace d2cs 27 | { 28 | 29 | typedef struct d2charlist{ 30 | t_d2charinfo_file *charinfo; 31 | int expiration_time; 32 | t_elist list; 33 | } t_d2charlist; 34 | 35 | extern int d2charlist_add_char(t_elist *, t_d2charinfo_file *i, unsigned int); 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/d2cs/handle_bnetd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_HANDLE_BNETD_H 19 | #define INCLUDED_HANDLE_BNETD_H 20 | 21 | #include "common/packet.h" 22 | #include "connection.h" 23 | 24 | namespace pvpgn 25 | { 26 | 27 | namespace d2cs 28 | { 29 | 30 | extern int handle_bnetd_packet(t_connection * c, t_packet * packet); 31 | extern int handle_bnetd_init(t_connection * c); 32 | 33 | } 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/d2cs/handle_d2cs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_HANDLE_D2CS_H 19 | #define INCLUDED_HANDLE_D2CS_H 20 | 21 | #include "common/packet.h" 22 | #include "connection.h" 23 | 24 | namespace pvpgn 25 | { 26 | 27 | namespace d2cs 28 | { 29 | 30 | extern int d2cs_handle_d2cs_packet(t_connection * c, t_packet * packet); 31 | extern int d2cs_handle_client_creategame(t_connection * c, t_packet * packet); 32 | extern int d2cs_send_client_creategamewait(t_connection * c, unsigned int position); 33 | 34 | } 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/d2cs/handle_d2gs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_HANDLE_D2GS_H 19 | #define INCLUDED_HANDLE_D2GS_H 20 | 21 | #include "connection.h" 22 | #include "common/packet.h" 23 | 24 | namespace pvpgn 25 | { 26 | 27 | namespace d2cs 28 | { 29 | 30 | extern int handle_d2gs_packet(t_connection * c, t_packet * packet); 31 | extern int handle_d2gs_init(t_connection * c); 32 | 33 | } 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/d2cs/handle_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_HANDLE_INIT_H 19 | #define INCLUDED_HANDLE_INIT_H 20 | 21 | #include "connection.h" 22 | #include "common/packet.h" 23 | 24 | namespace pvpgn 25 | { 26 | 27 | namespace d2cs 28 | { 29 | 30 | extern int d2cs_handle_init_packet(t_connection * c, t_packet * packet); 31 | 32 | } 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/d2cs/handle_signal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_HANDLE_SIGNAL_H 19 | #define INCLUDED_HANDLE_SIGNAL_H 20 | 21 | namespace pvpgn 22 | { 23 | 24 | namespace d2cs 25 | { 26 | 27 | #ifndef WIN32 28 | extern int handle_signal_init(void); 29 | #else 30 | extern void signal_quit_wrapper(void); 31 | extern void signal_reload_config_wrapper(void); 32 | extern void signal_load_ladder_wrapper(void); 33 | extern void signal_exit_wrapper(void); 34 | extern void signal_restart_d2gs_wrapper(void); 35 | #endif 36 | 37 | extern int handle_signal(void); 38 | 39 | } 40 | 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/d2cs/net.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_NET_H 19 | #define INCLUDED_NET_H 20 | 21 | namespace pvpgn 22 | { 23 | 24 | namespace d2cs 25 | { 26 | 27 | extern int net_socket(int type); 28 | extern unsigned long int net_inet_addr(char const * host); 29 | extern int net_check_connected(int sock); 30 | extern int net_listen(unsigned int ip, unsigned int port, int type); 31 | extern int net_send_data(int sock, char * buff, int buffsize, int * pos, int * currsize); 32 | extern int net_recv_data(int sock, char * buff, int buffsize, int * pos, int * currsize); 33 | 34 | } 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/d2cs/s2s.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_S2S_H 19 | #define INCLUDED_S2S_H 20 | 21 | #include "connection.h" 22 | 23 | namespace pvpgn 24 | { 25 | 26 | namespace d2cs 27 | { 28 | 29 | extern int s2s_init(void); 30 | extern int s2s_check(void); 31 | extern t_connection * s2s_create(char const * server, unsigned short def_port, t_conn_class cclass); 32 | extern int s2s_destroy(t_connection * s2s); 33 | 34 | } 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/d2cs/server.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_SERVER_H 19 | #define INCLUDED_SERVER_H 20 | 21 | #include "common/fdwatch.h" 22 | 23 | namespace pvpgn 24 | { 25 | 26 | namespace d2cs 27 | { 28 | 29 | extern int d2cs_server_process(void); 30 | extern int d2cs_server_handle_tcp(void*, t_fdwatch_type); 31 | extern int d2cs_server_handle_accept(void*, t_fdwatch_type); 32 | 33 | } 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/d2cs/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_VERSION_H 19 | #define INCLUDED_VERSION_H 20 | 21 | #define D2CS_VERSION_NUMBER 0x010A0101 22 | #define D2CS_VERSION_STRING "1.10.1.1" 23 | #define D2CS_VERSION "D2CS Version " D2CS_VERSION_STRING " Built " __DATE__ 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/d2dbs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(D2DBS_SOURCES 2 | charlock.cpp charlock.h cmdline.cpp cmdline.h d2ladder.cpp d2ladder.h 3 | dbsdupecheck.cpp dbsdupecheck.h dbserver.cpp dbserver.h dbspacket.cpp 4 | dbspacket.h handle_signal.cpp handle_signal.h main.cpp prefs.cpp 5 | prefs.h setup.h version.h ../win32/d2dbs_winmain.cpp ../win32/d2dbs_resource.h 6 | ../win32/d2dbs_resource.rc) 7 | 8 | if(WITH_WIN32_GUI) 9 | add_executable(d2dbs WIN32 ${D2DBS_SOURCES}) 10 | else(WITH_WIN32_GUI) 11 | add_executable(d2dbs ${D2DBS_SOURCES}) 12 | endif(WITH_WIN32_GUI) 13 | 14 | target_link_libraries(d2dbs PRIVATE common compat fmt win32 ${NETWORK_LIBRARIES}) 15 | install(TARGETS d2dbs DESTINATION ${SBINDIR}) 16 | if(WIN32 AND MSVC) 17 | install(FILES $ DESTINATION ${SBINDIR} OPTIONAL) 18 | endif() -------------------------------------------------------------------------------- /src/d2dbs/cmdline.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 Dizzy 3 | * Copyright (C) 2005 Olaf Freyer (aaron@cs.tu-berlin.de) 4 | * 5 | * This program is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU General Public License 7 | * as published by the Free Software Foundation; either version 2 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __DDBS_CMDLINE_H_PROTOS__ 21 | #define __D2DBS_CMDLINE_H_PROTOS__ 22 | 23 | namespace pvpgn 24 | { 25 | 26 | namespace d2dbs 27 | { 28 | 29 | extern int cmdline_load(int argc, char * * argv); 30 | extern void cmdline_unload(void); 31 | 32 | /* options exported by cmdline */ 33 | #ifdef DO_DAEMONIZE 34 | extern int cmdline_get_foreground(void); 35 | #endif 36 | extern const char* cmdline_get_preffile(void); 37 | extern const char* cmdline_get_logfile(void); 38 | #ifdef WIN32_GUI 39 | extern unsigned cmdline_get_console(void); 40 | extern unsigned cmdline_get_gui(void); 41 | #endif 42 | 43 | } 44 | 45 | } 46 | 47 | #endif /* __D2DBS_CMDLINE_H_PROTOS__ */ 48 | -------------------------------------------------------------------------------- /src/d2dbs/dbsdupecheck.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #define DBSDUPECHECK_CONTAINS_DUPE 0 20 | #define DBSDUPECHECK_CONTAINS_NO_DUPE 1 21 | 22 | namespace pvpgn 23 | { 24 | 25 | namespace d2dbs 26 | { 27 | 28 | extern int dbsdupecheck(char * data, unsigned int datalen); 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/d2dbs/handle_signal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2000,2001 Onlyer (onlyer@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_HANDLE_SIGNAL_H 19 | #define INCLUDED_HANDLE_SIGNAL_H 20 | 21 | namespace pvpgn 22 | { 23 | 24 | namespace d2dbs 25 | { 26 | 27 | #ifndef WIN32 28 | extern int d2dbs_handle_signal_init(void); 29 | #else 30 | extern void d2dbs_signal_quit_wrapper(void); 31 | extern void d2dbs_signal_reload_config_wrapper(void); 32 | extern void d2dbs_signal_save_ladder_wrapper(void); 33 | extern void d2dbs_signal_exit_wrapper(void); 34 | #endif 35 | 36 | extern int d2dbs_handle_signal(void); 37 | 38 | } 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/d2dbs/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 sousou (liupeng.cs@263.net) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifndef INCLUDED_VERSION_H 19 | #define INCLUDED_VERSION_H 20 | 21 | #define D2DBS_VERSION_NUMBER "1.10.1.1" 22 | #define D2DBS_VERSION "D2DBS Version " D2DBS_VERSION_NUMBER " Built " __DATE__ " " __TIME__ 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(bnetsrp3_test bnetsrp3_test.cpp ) 2 | target_link_libraries(bnetsrp3_test PRIVATE common) 3 | add_test(bnetsrp3_test bnetsrp3_test) 4 | 5 | add_executable(bigint bigint.cpp ) 6 | target_link_libraries(bigint PRIVATE common) 7 | add_test(bigint bigint) 8 | -------------------------------------------------------------------------------- /src/win32/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(WIN32_SOURCES 2 | service.cpp service.h console_output.h console_output.cpp dirent.h windump.cpp windump.h 3 | ) 4 | 5 | add_library(win32 STATIC ${WIN32_SOURCES}) 6 | -------------------------------------------------------------------------------- /src/win32/console_resource.h: -------------------------------------------------------------------------------- 1 | #define IDI_ICON1 101 2 | 3 | -------------------------------------------------------------------------------- /src/win32/console_resource.rc: -------------------------------------------------------------------------------- 1 | #include "console_resource.h" 2 | 3 | #define APSTUDIO_READONLY_SYMBOLS 4 | 5 | #ifndef __BORLANDC__ 6 | #ifdef __AFXRES_H__ 7 | #include "afxres.h" 8 | #else 9 | #include "winres.h" 10 | #endif 11 | #endif 12 | 13 | /* Icon */ 14 | ID_ICON1 ICON DISCARDABLE "win32/logo01.ico" 15 | 16 | -------------------------------------------------------------------------------- /src/win32/d2cs_resource.h: -------------------------------------------------------------------------------- 1 | #define ID_TRAY 4 2 | #define ID_RESTORE 5 3 | #define ID_EXIT 6 4 | 5 | #define ID_ABOUT_BOX 101 6 | #define ID_ICON1 102 7 | #define ID_MENU 103 8 | 9 | #define ID_START_D2CS 40001 10 | #define ID_SHUTDOWN_D2CS 40002 11 | #define ID_RESTART_D2CS 40003 12 | #define ID_EDITCONFIG_D2CS 40004 13 | #define ID_LOADCONFIG_D2CS 40005 14 | #define ID_LADDER_LOAD 40006 15 | #define ID_RESTART_D2GS 40007 16 | #define ID_CLEAR 40008 17 | #define ID_ABOUT 40009 18 | -------------------------------------------------------------------------------- /src/win32/d2cs_resource.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/src/win32/d2cs_resource.rc -------------------------------------------------------------------------------- /src/win32/d2dbs_resource.h: -------------------------------------------------------------------------------- 1 | #define ID_TRAY 4 2 | #define ID_RESTORE 5 3 | #define ID_EXIT 6 4 | 5 | #define ID_ABOUT_BOX 101 6 | #define ID_ICON1 102 7 | #define ID_MENU 103 8 | 9 | #define ID_START_D2DBS 40001 10 | #define ID_SHUTDOWN_D2DBS 40002 11 | #define ID_RESTART_D2DBS 40003 12 | #define ID_EDITCONFIG_D2DBS 40004 13 | #define ID_LOADCONFIG_D2DBS 40005 14 | #define ID_LADDER_SAVE 40006 15 | #define ID_CLEAR 40007 16 | #define ID_ABOUT 40008 17 | -------------------------------------------------------------------------------- /src/win32/d2dbs_resource.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/src/win32/d2dbs_resource.rc -------------------------------------------------------------------------------- /src/win32/logo01.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/src/win32/logo01.ico -------------------------------------------------------------------------------- /src/win32/resource.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BNETDocs/pvpgn-server/fcdf00fedfd79a041e1a7b2f20c8d15995b0a762/src/win32/resource.rc -------------------------------------------------------------------------------- /src/win32/service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU General Public License 4 | * as published by the Free Software Foundation; either version 2 5 | * of the License, or (at your option) any later version. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 | */ 16 | 17 | #ifdef WIN32 18 | #ifndef WIN32_SERVICE_INCLUDED 19 | #define WIN32_SERVICE_INCLUDED 20 | 21 | void Win32_ServiceInstall(void); 22 | void Win32_ServiceUninstall(void); 23 | void Win32_ServiceRun(void); 24 | 25 | #endif /* !WIN32_SERVICE_INCLUDED */ 26 | #endif /* WIN32 */ 27 | -------------------------------------------------------------------------------- /src/win32/windump.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 HarpyWar (harpywar@gmail.com) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifdef WIN32 19 | 20 | #include 21 | 22 | 23 | LONG WINAPI unhandled_handler(struct _EXCEPTION_POINTERS* e); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/win32/winmain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2001 Erik Latoshek [forester] (laterk@inbox.lv) 3 | * 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License 6 | * as published by the Free Software Foundation; either version 2 7 | * of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | #ifdef WIN32_GUI 19 | #ifndef __WINMAIN_H__ 20 | #define __WINMAIN_H__ 21 | 22 | namespace pvpgn 23 | { 24 | 25 | namespace bnetd 26 | { 27 | 28 | extern void guiOnUpdateUserList(void); 29 | 30 | } 31 | 32 | } 33 | 34 | #endif 35 | #endif 36 | --------------------------------------------------------------------------------