| 1 | /* |
| 2 | * Copyright (C) 2001 sousou ([email protected]) |
| 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_D2LADDER_H |
| 19 | #define INCLUDED_D2LADDER_H |
| 20 | |
| 21 | #include <cstdio> |
| 22 | #include <cstddef> |
| 23 | #include "common/list.h" |
| 24 | #include "common/d2cs_d2dbs_ladder.h" |
| 25 | #define JUST_NEED_TYPES |
| 26 | #include "d2cs/d2charfile.h" |
| 27 | #undef JUST_NEED_TYPES |
| 28 | |
| 29 | #define LADDER_BACKUP_PREFIX "ladderbk" |
| 30 | #define DEFAULT_LADDER_DIR "var/ladders" |
| 31 | #define LADDERFILE_CHECKSUM_OFFSET offsetof(t_d2ladderfile_header,checksum) |
| 32 | |
| 33 | namespace pvpgn |
| 34 | { |
| 35 | |
| 36 | namespace d2dbs |
| 37 | { |
| 38 | |
| 39 | typedef struct |
| 40 | { |
| 41 | unsigned int experience; |
| 42 | unsigned short status; |
| 43 | unsigned char level; |
| 44 | unsigned char chclass; |
| 45 | char charname[MAX_CHARNAME_LEN]; |
| 46 | } t_d2ladder_info; |
| 47 | |
| 48 | typedef struct |
| 49 | { |
| 50 | unsigned int type; |
| 51 | t_d2ladder_info * info; |
| 52 | unsigned int len; |
| 53 | } t_d2ladder; |
| 54 | |
| 55 | typedef t_list t_d2ladderlist; |
| 56 | |
| 57 | #define D2LADDER_MAXNUM 200 |
| 58 | #define D2LADDER_OVERALL_MAXNUM 1000 |
| 59 | #define D2LADDER_MAXTYPE 35 |
| 60 | |
| 61 | extern int d2dbs_d2ladder_init(void); |
| 62 | extern int d2dbs_d2ladder_destroy(void); |
| 63 | extern int d2ladder_rebuild(void); |
| 64 | extern int d2ladder_update(t_d2ladder_info * pcharladderinfo); |
| 65 | extern int d2ladder_print(std::FILE * ladderstrm); |
| 66 | extern int d2ladder_saveladder(void); |
| 67 | |
| 68 | } |
| 69 | |
| 70 | } |
| 71 | |
| 72 | #endif |