| 1 | /* |
| 2 | * Copyright (C) 1998 Mark Baysinger ([email protected]) |
| 3 | * Copyright (C) 1998,1999 Ross Combs ([email protected]) |
| 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_SERVER_TYPES |
| 20 | #define INCLUDED_SERVER_TYPES |
| 21 | |
| 22 | #include <ctime> |
| 23 | |
| 24 | namespace pvpgn |
| 25 | { |
| 26 | |
| 27 | namespace bnetd |
| 28 | { |
| 29 | |
| 30 | #ifdef SERVER_INTERNAL_ACCESS |
| 31 | |
| 32 | typedef enum |
| 33 | { |
| 34 | laddr_type_bnet, /* classic battle.net service (usually on port 6112) */ |
| 35 | laddr_type_w3route, /* warcraft 3 playgame routing (def. port 6200) */ |
| 36 | laddr_type_irc, /* Internet Relay Chat service (port is varying; mostly on port 6667 or 7000) */ |
| 37 | laddr_type_wolv1, /* Westwood Online v1 (IRC) Services (port is 4000) */ |
| 38 | laddr_type_wolv2, /* Westwood Online v2 (IRC) Services (port is 4005) */ |
| 39 | laddr_type_apireg, /* Westwood API Register Services (port is 5700) */ |
| 40 | laddr_type_wgameres,/* Westwood gameres Services (port is 4807) */ |
| 41 | laddr_type_telnet /* telnet service (usually on port 23) */ |
| 42 | } t_laddr_type; |
| 43 | |
| 44 | |
| 45 | /* listen address structure */ |
| 46 | typedef struct |
| 47 | { |
| 48 | int ssocket; /* TCP listen socket */ |
| 49 | int usocket; /* UDP socket */ |
| 50 | t_laddr_type type; |
| 51 | } t_laddr_info; |
| 52 | |
| 53 | #endif |
| 54 | |
| 55 | extern std::time_t now; |
| 56 | |
| 57 | } |
| 58 | |
| 59 | } |
| 60 | |
| 61 | #endif |
| 62 | |
| 63 | |
| 64 | /*****/ |
| 65 | #ifndef JUST_NEED_TYPES |
| 66 | #ifndef INCLUDED_SERVER_PROTOS |
| 67 | #define INCLUDED_SERVER_PROTOS |
| 68 | |
| 69 | namespace pvpgn |
| 70 | { |
| 71 | |
| 72 | namespace bnetd |
| 73 | { |
| 74 | enum restart_mode |
| 75 | { |
| 76 | restart_mode_none, // always first (0) |
| 77 | |
| 78 | restart_mode_all, |
| 79 | restart_mode_i18n, |
| 80 | restart_mode_channels, |
| 81 | restart_mode_realms, |
| 82 | restart_mode_autoupdate, |
| 83 | restart_mode_news, |
| 84 | restart_mode_versioncheck, |
| 85 | restart_mode_ipbans, |
| 86 | restart_mode_helpfile, |
| 87 | restart_mode_banners, |
| 88 | restart_mode_tracker, |
| 89 | restart_mode_commandgroups, |
| 90 | restart_mode_aliasfile, |
| 91 | restart_mode_transfile, |
| 92 | restart_mode_tournament, |
| 93 | restart_mode_icons, |
| 94 | restart_mode_anongame, |
| 95 | restart_mode_lua |
| 96 | }; |
| 97 | |
| 98 | extern unsigned int server_get_uptime(void); |
| 99 | extern unsigned int server_get_starttime(void); |
| 100 | extern void server_quit_delay(int delay); |
| 101 | extern void server_set_hostname(void); |
| 102 | extern char const * server_get_hostname(void); |
| 103 | extern void server_clear_hostname(void); |
| 104 | extern int server_process(void); |
| 105 | |
| 106 | extern void server_quit_wraper(void); |
| 107 | extern void server_restart_wraper(int mode); |
| 108 | extern void server_save_wraper(void); |
| 109 | |
| 110 | } |
| 111 | |
| 112 | } |
| 113 | |
| 114 | #endif |
| 115 | #endif |