| 1 | /* |
| 2 | * Copyright (C) 2001 faster ([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_CHARLOCK_H |
| 19 | #define INCLUDED_CHARLOCK_H |
| 20 | |
| 21 | #define DEFAULT_HASHTBL_LEN 65000 |
| 22 | |
| 23 | #include "common/field_sizes.h" |
| 24 | |
| 25 | namespace pvpgn |
| 26 | { |
| 27 | |
| 28 | namespace d2dbs |
| 29 | { |
| 30 | |
| 31 | /* char locking info */ |
| 32 | typedef struct raw_charlockinfo { |
| 33 | unsigned char charname[MAX_CHARNAME_LEN]; |
| 34 | unsigned char realmname[MAX_REALMNAME_LEN]; |
| 35 | unsigned int gsid; |
| 36 | struct raw_charlockinfo *next; |
| 37 | struct raw_charlockinfo *gsqnext; |
| 38 | struct raw_charlockinfo *gsqprev; |
| 39 | } t_charlockinfo; |
| 40 | |
| 41 | |
| 42 | /* functions */ |
| 43 | int cl_init(unsigned int tbllen, unsigned int maxgs); |
| 44 | int cl_destroy(void); |
| 45 | int cl_query_charlock_status(unsigned char *charname, |
| 46 | unsigned char *realmnamei, unsigned int *gsid); |
| 47 | int cl_lock_char(unsigned char *charname, |
| 48 | unsigned char *realmname, unsigned int gsid); |
| 49 | int cl_unlock_char(unsigned char *charname, unsigned char *realmname, unsigned int gsid); |
| 50 | int cl_unlock_all_char_by_gsid(unsigned int gsid); |
| 51 | |
| 52 | } |
| 53 | |
| 54 | } |
| 55 | |
| 56 | #endif /* INCLUDED_CHARLOCK_H */ |