A lot of changes. login and char server compile under both TXT and SQL under g++. Same for the convertors (login and char). One change that I felt iffy about, but it worked, was the char* buf -> unsinged char* bug in clif.c
git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@975 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
974e977764
commit
dea15d7c9a
@ -1,6 +1,8 @@
|
||||
Date Added
|
||||
|
||||
01/23
|
||||
* char-server (SQL & TXT), login-server (SQL & TXT), and txt-coonvertors
|
||||
(char and login) all compile on g++ now [svn 975] [Ajarn]
|
||||
* Fixed the sizeof errors in g++ [SVN 972] [Ajarn]
|
||||
* Reverted back some of the char* changes [SVN 972] [Ajarn]
|
||||
* Changed parse_script to now return char* [SVN 969] [Ajarn]
|
||||
|
@ -853,14 +853,14 @@ int make_new_char(int fd, unsigned char *dat) {
|
||||
|
||||
// remove control characters from the name
|
||||
dat[23] = '\0';
|
||||
if (remove_control_chars(dat)) {
|
||||
if (remove_control_chars((char*)dat)) {
|
||||
char_log("Make new char error (control char received in the name): (connection #%d, account: %d)." RETCODE,
|
||||
fd, sd->account_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// check lenght of character name
|
||||
if (strlen(dat) < 4) {
|
||||
if (strlen((const char*)dat) < 4) {
|
||||
char_log("Make new char error (character name too small): (connection #%d, account: %d, name: '%s')." RETCODE,
|
||||
fd, sd->account_id, dat);
|
||||
return -1;
|
||||
@ -902,8 +902,8 @@ int make_new_char(int fd, unsigned char *dat) {
|
||||
}
|
||||
|
||||
for(i = 0; i < char_num; i++) {
|
||||
if ((name_ignoring_case != 0 && strcmp(char_dat[i].name, dat) == 0) ||
|
||||
(name_ignoring_case == 0 && strcmpi(char_dat[i].name, dat) == 0)) {
|
||||
if ((name_ignoring_case != 0 && strcmp(char_dat[i].name, (const char*)dat) == 0) ||
|
||||
(name_ignoring_case == 0 && strcmpi(char_dat[i].name, (const char*)dat) == 0)) {
|
||||
char_log("Make new char error (name already exists): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %d), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d." RETCODE,
|
||||
fd, sd->account_id, dat[30], dat, char_dat[i].name, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29], dat[33], dat[31]);
|
||||
return -1;
|
||||
@ -915,7 +915,7 @@ int make_new_char(int fd, unsigned char *dat) {
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(wisp_server_name, dat) == 0) {
|
||||
if (strcmp(wisp_server_name, (const char*)dat) == 0) {
|
||||
char_log("Make new char error (name used is wisp name for server): (connection #%d, account: %d) slot %d, name: %s (actual name of other char: %d), stats: %d+%d+%d+%d+%d+%d=%d, hair: %d, hair color: %d." RETCODE,
|
||||
fd, sd->account_id, dat[30], dat, char_dat[i].name, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[24] + dat[25] + dat[26] + dat[27] + dat[28] + dat[29], dat[33], dat[31]);
|
||||
return -1;
|
||||
@ -949,7 +949,7 @@ int make_new_char(int fd, unsigned char *dat) {
|
||||
char_dat[i].char_id = char_id_count++;
|
||||
char_dat[i].account_id = sd->account_id;
|
||||
char_dat[i].char_num = dat[30];
|
||||
strcpy(char_dat[i].name, dat);
|
||||
strcpy(char_dat[i].name, (const char*)dat);
|
||||
char_dat[i].class_ = 0;
|
||||
char_dat[i].base_level = 1;
|
||||
char_dat[i].job_level = 1;
|
||||
@ -1507,9 +1507,9 @@ int char_divorce(struct mmo_charstatus *cs) {
|
||||
//------------------------------------------------------------
|
||||
// E-mail check: return 0 (not correct) or 1 (valid). by [Yor]
|
||||
//------------------------------------------------------------
|
||||
int e_mail_check(unsigned char *email) {
|
||||
int e_mail_check(char *email) {
|
||||
char ch;
|
||||
unsigned char* last_arobas;
|
||||
char* last_arobas;
|
||||
|
||||
// athena limits
|
||||
if (strlen(email) < 3 || strlen(email) > 39)
|
||||
@ -1585,7 +1585,7 @@ static int char_delete(struct mmo_charstatus *cs) {
|
||||
// —£<E28094>¥
|
||||
if (cs->partner_id){
|
||||
// —£<E28094>¥<EFBFBD>î•ñ‚ðmap‚É’Ê’m
|
||||
char buf[10];
|
||||
unsigned char buf[10];
|
||||
WBUFW(buf,0) = 0x2b12;
|
||||
WBUFL(buf,2) = cs->char_id;
|
||||
WBUFL(buf,6) = cs->partner_id;
|
||||
@ -1798,7 +1798,7 @@ int parse_tologin(int fd) {
|
||||
if (i == MAX_MAP_SERVERS)
|
||||
char_log("'ladmin': Receiving a message for broadcast, but no map-server is online." RETCODE);
|
||||
else {
|
||||
char buf[128];
|
||||
unsigned char buf[128];
|
||||
char message[RFIFOL(fd,4) + 1]; // +1 to add a null terminated if not exist in the packet
|
||||
int lp;
|
||||
char *p;
|
||||
@ -1946,7 +1946,7 @@ int parse_tologin(int fd) {
|
||||
if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2))
|
||||
return 0;
|
||||
{
|
||||
char buf[32000];
|
||||
unsigned char buf[32000];
|
||||
if (gm_account != NULL)
|
||||
aFree(gm_account);
|
||||
gm_account = (struct gm_account*)aCalloc(sizeof(struct gm_account) * ((RFIFOW(fd,2) - 4) / 5), 1);
|
||||
@ -2559,7 +2559,7 @@ int parse_char(int fd) {
|
||||
else
|
||||
printf("Account Logged On; Account ID: %d.\n", RFIFOL(fd,2));
|
||||
if (sd == NULL) {
|
||||
sd = session[fd]->session_data = (struct char_session_data*)aCalloc(sizeof(struct char_session_data), 1);
|
||||
sd = (struct char_session_data*)session[fd]->session_data = (struct char_session_data*)aCalloc(sizeof(struct char_session_data), 1);
|
||||
memset(sd, 0, sizeof(struct char_session_data));
|
||||
memcpy(sd->email, "no mail", 40); // put here a mail without '@' to refuse deletion if we don't receive the e-mail
|
||||
sd->connect_until_time = 0; // unknow or illimited (not displaying on map-server)
|
||||
@ -2881,7 +2881,7 @@ int parse_char(int fd) {
|
||||
if (server_fd[i] < 0)
|
||||
break;
|
||||
}
|
||||
if (i == MAX_MAP_SERVERS || strcmp(RFIFOP(fd,2), userid) || strcmp(RFIFOP(fd,26), passwd)){
|
||||
if (i == MAX_MAP_SERVERS || strcmp((char*)RFIFOP(fd,2), userid) || strcmp((char*)RFIFOP(fd,26), passwd)){
|
||||
WFIFOB(fd,2) = 3;
|
||||
WFIFOSET(fd,3);
|
||||
RFIFOSKIP(fd,60);
|
||||
@ -3019,7 +3019,7 @@ int mapif_send(int fd, unsigned char *buf, unsigned int len) {
|
||||
|
||||
int send_users_tologin(int tid, unsigned int tick, int id, int data) {
|
||||
int users = count_users();
|
||||
char buf[16];
|
||||
unsigned char buf[16];
|
||||
|
||||
if (login_fd > 0 && session[login_fd]) {
|
||||
// send number of user to login server
|
||||
|
@ -1419,21 +1419,21 @@ int mapif_parse_GuildCheck(int fd, int guild_id, int account_id, int char_id) {
|
||||
// ・エラーなら0(false)、そうでないなら1(true)をかえさなければならない
|
||||
int inter_guild_parse_frommap(int fd) {
|
||||
switch(RFIFOW(fd,0)) {
|
||||
case 0x3030: mapif_parse_CreateGuild(fd, RFIFOL(fd,4), RFIFOP(fd,8), (struct guild_member *)RFIFOP(fd,32)); break;
|
||||
case 0x3030: mapif_parse_CreateGuild(fd, RFIFOL(fd,4), (char*)RFIFOP(fd,8), (struct guild_member *)RFIFOP(fd,32)); break;
|
||||
case 0x3031: mapif_parse_GuildInfo(fd, RFIFOL(fd,2)); break;
|
||||
case 0x3032: mapif_parse_GuildAddMember(fd, RFIFOL(fd,4), (struct guild_member *)RFIFOP(fd,8)); break;
|
||||
case 0x3034: mapif_parse_GuildLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOB(fd,14), RFIFOP(fd,15)); break;
|
||||
case 0x3034: mapif_parse_GuildLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOB(fd,14), (const char*)RFIFOP(fd,15)); break;
|
||||
case 0x3035: mapif_parse_GuildChangeMemberInfoShort(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOB(fd,14), RFIFOW(fd,15), RFIFOW(fd,17)); break;
|
||||
case 0x3036: mapif_parse_BreakGuild(fd, RFIFOL(fd,2)); break;
|
||||
case 0x3037: mapif_parse_GuildMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
|
||||
case 0x3037: mapif_parse_GuildMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), (char*)RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
|
||||
case 0x3038: mapif_parse_GuildCheck(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
|
||||
case 0x3039: mapif_parse_GuildBasicInfoChange(fd, RFIFOL(fd,4), RFIFOW(fd,8), RFIFOP(fd,10), RFIFOW(fd,2)-10); break;
|
||||
case 0x303A: mapif_parse_GuildMemberInfoChange(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOL(fd,12), RFIFOW(fd,16), RFIFOP(fd,18), RFIFOW(fd,2)-18); break;
|
||||
case 0x3039: mapif_parse_GuildBasicInfoChange(fd, RFIFOL(fd,4), RFIFOW(fd,8), (const char*)RFIFOP(fd,10), RFIFOW(fd,2)-10); break;
|
||||
case 0x303A: mapif_parse_GuildMemberInfoChange(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOL(fd,12), RFIFOW(fd,16), (const char*)RFIFOP(fd,18), RFIFOW(fd,2)-18); break;
|
||||
case 0x303B: mapif_parse_GuildPosition(fd, RFIFOL(fd,4), RFIFOL(fd,8), (struct guild_position *)RFIFOP(fd,12)); break;
|
||||
case 0x303C: mapif_parse_GuildSkillUp(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
|
||||
case 0x303D: mapif_parse_GuildAlliance(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14), RFIFOB(fd,18)); break;
|
||||
case 0x303E: mapif_parse_GuildNotice(fd, RFIFOL(fd,2), RFIFOP(fd,6), RFIFOP(fd,66)); break;
|
||||
case 0x303F: mapif_parse_GuildEmblem(fd, RFIFOW(fd,2)-12, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12)); break;
|
||||
case 0x303E: mapif_parse_GuildNotice(fd, RFIFOL(fd,2), (const char*)RFIFOP(fd,6), (const char*)RFIFOP(fd,66)); break;
|
||||
case 0x303F: mapif_parse_GuildEmblem(fd, RFIFOW(fd,2)-12, RFIFOL(fd,4), RFIFOL(fd,8), (const char*)RFIFOP(fd,12)); break;
|
||||
case 0x3040: mapif_parse_GuildCastleDataLoad(fd, RFIFOW(fd,2), RFIFOB(fd,4)); break;
|
||||
case 0x3041: mapif_parse_GuildCastleDataSave(fd, RFIFOW(fd,2), RFIFOB(fd,4), RFIFOL(fd,5)); break;
|
||||
|
||||
|
@ -94,7 +94,7 @@ int inter_party_init() {
|
||||
continue;
|
||||
}
|
||||
|
||||
p = aCalloc(sizeof(struct party), 1);
|
||||
p = (struct party*)aCalloc(sizeof(struct party), 1);
|
||||
if (p == NULL){
|
||||
printf("int_party: out of memory!\n");
|
||||
exit(0);
|
||||
@ -572,15 +572,15 @@ int mapif_parse_PartyCheck(int fd, int party_id, int account_id, char *nick) {
|
||||
// ・エラーなら0(false)、そうでないなら1(true)をかえさなければならない
|
||||
int inter_party_parse_frommap(int fd) {
|
||||
switch(RFIFOW(fd,0)) {
|
||||
case 0x3020: mapif_parse_CreateParty(fd, RFIFOL(fd,2), RFIFOP(fd,6), RFIFOP(fd,30), RFIFOP(fd,54), RFIFOW(fd,70)); break;
|
||||
case 0x3020: mapif_parse_CreateParty(fd, RFIFOL(fd,2), (char*)RFIFOP(fd,6), (char*)RFIFOP(fd,30), (char*)RFIFOP(fd,54), RFIFOW(fd,70)); break;
|
||||
case 0x3021: mapif_parse_PartyInfo(fd, RFIFOL(fd,2)); break;
|
||||
case 0x3022: mapif_parse_PartyAddMember(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOP(fd,10), RFIFOP(fd,34), RFIFOW(fd,50)); break;
|
||||
case 0x3022: mapif_parse_PartyAddMember(fd, RFIFOL(fd,2), RFIFOL(fd,6), (char*)RFIFOP(fd,10), (char*)RFIFOP(fd,34), RFIFOW(fd,50)); break;
|
||||
case 0x3023: mapif_parse_PartyChangeOption(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOW(fd,10), RFIFOW(fd,12)); break;
|
||||
case 0x3024: mapif_parse_PartyLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
|
||||
case 0x3025: mapif_parse_PartyChangeMap(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOP(fd,10), RFIFOB(fd,26), RFIFOW(fd,27)); break;
|
||||
case 0x3025: mapif_parse_PartyChangeMap(fd, RFIFOL(fd,2), RFIFOL(fd,6), (char*)RFIFOP(fd,10), RFIFOB(fd,26), RFIFOW(fd,27)); break;
|
||||
case 0x3026: mapif_parse_BreakParty(fd, RFIFOL(fd,2)); break;
|
||||
case 0x3027: mapif_parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
|
||||
case 0x3028: mapif_parse_PartyCheck(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOP(fd,10)); break;
|
||||
case 0x3027: mapif_parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), (char*)RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
|
||||
case 0x3028: mapif_parse_PartyCheck(fd, RFIFOL(fd,2), RFIFOL(fd,6), (char*)RFIFOP(fd,10)); break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ int inter_pet_init()
|
||||
if( (fp=fopen(pet_txt,"r"))==NULL )
|
||||
return 1;
|
||||
while(fgets(line,sizeof(line),fp)){
|
||||
p=aCalloc(sizeof(struct s_pet), 1);
|
||||
p = (struct s_pet*)aCalloc(sizeof(struct s_pet), 1);
|
||||
if(p==NULL){
|
||||
printf("int_pet: out of memory!\n");
|
||||
exit(0);
|
||||
@ -322,7 +322,7 @@ int mapif_delete_pet(int fd,int pet_id)
|
||||
int mapif_parse_CreatePet(int fd)
|
||||
{
|
||||
mapif_create_pet(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12),RFIFOW(fd,14),RFIFOW(fd,16),RFIFOL(fd,18),
|
||||
RFIFOL(fd,20),RFIFOB(fd,22),RFIFOB(fd,23),RFIFOP(fd,24));
|
||||
RFIFOL(fd,20),RFIFOB(fd,22),RFIFOB(fd,23),(char*)RFIFOP(fd,24));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -242,7 +242,7 @@ int inter_storage_init()
|
||||
}
|
||||
while(fgets(line,65535,fp)){
|
||||
sscanf(line,"%d",&tmp_int);
|
||||
s=aCalloc(sizeof(struct storage), 1);
|
||||
s = (struct storage*)aCalloc(sizeof(struct storage), 1);
|
||||
if(s==NULL){
|
||||
printf("int_storage: out of memory!\n");
|
||||
exit(0);
|
||||
@ -270,7 +270,7 @@ int inter_storage_init()
|
||||
}
|
||||
while(fgets(line,65535,fp)){
|
||||
sscanf(line,"%d",&tmp_int);
|
||||
gs=aCalloc(sizeof(struct guild_storage), 1);
|
||||
gs = (struct guild_storage*)aCalloc(sizeof(struct guild_storage), 1);
|
||||
if(gs==NULL){
|
||||
printf("int_storage: out of memory!\n");
|
||||
exit(0);
|
||||
|
@ -114,7 +114,7 @@ int inter_accreg_init() {
|
||||
while(fgets(line, sizeof(line)-1, fp)){
|
||||
line[sizeof(line)-1] = '\0';
|
||||
|
||||
reg = aCalloc(sizeof(struct accreg), 1);
|
||||
reg = (struct accreg*)aCalloc(sizeof(struct accreg), 1);
|
||||
if (reg == NULL) {
|
||||
printf("inter: accreg: out of memory!\n");
|
||||
exit(0);
|
||||
@ -325,7 +325,7 @@ int mapif_account_reg(int fd, unsigned char *src) {
|
||||
|
||||
// アカウント変数要求返信
|
||||
int mapif_account_reg_reply(int fd,int account_id) {
|
||||
struct accreg *reg = numdb_search(accreg_db,account_id);
|
||||
struct accreg *reg = (struct accreg*)numdb_search(accreg_db,account_id);
|
||||
|
||||
WFIFOW(fd,0) = 0x3804;
|
||||
WFIFOL(fd,4) = account_id;
|
||||
@ -366,7 +366,7 @@ int check_ttl_wisdata() {
|
||||
wis_delnum = 0;
|
||||
numdb_foreach(wis_db, check_ttl_wisdata_sub, tick);
|
||||
for(i = 0; i < wis_delnum; i++) {
|
||||
struct WisData *wd = numdb_search(wis_db, wis_dellist[i]);
|
||||
struct WisData *wd = (struct WisData*)numdb_search(wis_db, wis_dellist[i]);
|
||||
printf("inter: wis data id=%d time out : from %s to %s\n", wd->id, wd->src, wd->dst);
|
||||
// removed. not send information after a timeout. Just no answer for the player
|
||||
//mapif_wis_end(wd, 1); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
|
||||
@ -403,7 +403,7 @@ int mapif_parse_WisRequest(int fd) {
|
||||
}
|
||||
|
||||
// search if character exists before to ask all map-servers
|
||||
if ((index = search_character_index(RFIFOP(fd,28))) == -1) {
|
||||
if ((index = search_character_index((char*)RFIFOP(fd,28))) == -1) {
|
||||
unsigned char buf[27];
|
||||
WBUFW(buf, 0) = 0x3802;
|
||||
memcpy(WBUFP(buf, 2), RFIFOP(fd, 4), 24);
|
||||
@ -413,9 +413,9 @@ int mapif_parse_WisRequest(int fd) {
|
||||
} else {
|
||||
// to be sure of the correct name, rewrite it
|
||||
memset(RFIFOP(fd,28), 0, 24);
|
||||
strncpy(RFIFOP(fd,28), search_character_name(index), 24);
|
||||
strncpy((char*)RFIFOP(fd,28), search_character_name(index), 24);
|
||||
// if source is destination, don't ask other servers.
|
||||
if (strcmp(RFIFOP(fd,4),RFIFOP(fd,28)) == 0) {
|
||||
if (strcmp((char*)RFIFOP(fd,4),(char*)RFIFOP(fd,28)) == 0) {
|
||||
unsigned char buf[27];
|
||||
WBUFW(buf, 0) = 0x3802;
|
||||
memcpy(WBUFP(buf, 2), RFIFOP(fd, 4), 24);
|
||||
@ -450,7 +450,7 @@ int mapif_parse_WisRequest(int fd) {
|
||||
// Wisp/page transmission result
|
||||
int mapif_parse_WisReply(int fd) {
|
||||
int id = RFIFOL(fd,2), flag = RFIFOB(fd,6);
|
||||
struct WisData *wd = numdb_search(wis_db, id);
|
||||
struct WisData *wd = (struct WisData*)numdb_search(wis_db, id);
|
||||
|
||||
if (wd == NULL)
|
||||
return 0; // This wisp was probably suppress before, because it was timeout of because of target was found on another map-server
|
||||
@ -478,10 +478,10 @@ int mapif_parse_WisToGM(int fd) {
|
||||
// アカウント変数保存要求
|
||||
int mapif_parse_AccReg(int fd) {
|
||||
int j, p;
|
||||
struct accreg *reg = numdb_search(accreg_db, RFIFOL(fd,4));
|
||||
struct accreg *reg = (struct accreg*)numdb_search(accreg_db, RFIFOL(fd,4));
|
||||
|
||||
if (reg == NULL) {
|
||||
if ((reg = aCalloc(sizeof(struct accreg), 1)) == NULL) {
|
||||
if ((reg = (struct accreg*)aCalloc(sizeof(struct accreg), 1)) == NULL) {
|
||||
printf("inter: accreg: out of memory !\n");
|
||||
exit(0);
|
||||
}
|
||||
|
@ -2654,7 +2654,7 @@ int parse_char(int fd) {
|
||||
|
||||
//Divorce [Wizputer]
|
||||
if (sql_row[1] != 0) {
|
||||
char buf[64];
|
||||
unsigned char buf[64];
|
||||
sprintf(tmp_sql,"UPDATE `%s` SET `partner_id`='0' WHERE `char_id`='%d'",char_db,atoi(sql_row[1]));
|
||||
if(mysql_query(&mysql_handle, tmp_sql)) {
|
||||
printf("DB server Error - %s\n", mysql_error(&mysql_handle));
|
||||
@ -2900,7 +2900,7 @@ int mapif_send(int fd, unsigned char *buf, unsigned int len) {
|
||||
|
||||
int send_users_tologin(int tid, unsigned int tick, int id, int data) {
|
||||
int users = count_users();
|
||||
char buf[16];
|
||||
unsigned char buf[16];
|
||||
|
||||
if (login_fd > 0 && session[login_fd]) {
|
||||
// send number of user to login server
|
||||
|
@ -329,7 +329,7 @@ struct guild * inter_guild_fromsql(int guild_id)
|
||||
|
||||
if (guild_id==0) return 0;
|
||||
|
||||
g = numdb_search(guild_db_,guild_id);
|
||||
g = (struct guild*)numdb_search(guild_db_,guild_id);
|
||||
if (g != NULL)
|
||||
return g;
|
||||
|
||||
@ -527,7 +527,7 @@ int inter_guildcastle_tosql(struct guild_castle *gc)
|
||||
if (gc==NULL) return 0;
|
||||
//printf("Save to guild_castle\n");
|
||||
|
||||
gcopy = numdb_search(castle_db_,gc->castle_id);
|
||||
gcopy = (struct guild_castle*)numdb_search(castle_db_,gc->castle_id);
|
||||
if (gcopy == NULL) {
|
||||
gcopy = (struct guild_castle*)aMalloc(sizeof(struct guild_castle));
|
||||
numdb_insert(castle_db_, gc->castle_id, gcopy);
|
||||
@ -577,7 +577,7 @@ int inter_guildcastle_fromsql(int castle_id,struct guild_castle *gc)
|
||||
if (gc==NULL) return 0;
|
||||
//printf("Read from guild_castle\n");
|
||||
|
||||
gcopy = numdb_search(castle_db_, castle_id);
|
||||
gcopy = (struct guild_castle*)numdb_search(castle_db_, castle_id);
|
||||
if (gcopy == NULL) {
|
||||
gcopy = (struct guild_castle*)aMalloc(sizeof(struct guild_castle));
|
||||
numdb_insert(castle_db_, gc->castle_id, gcopy);
|
||||
@ -678,9 +678,9 @@ int inter_guild_sql_init()
|
||||
guild_castleinfoevent_db_=numdb_init();
|
||||
|
||||
printf("interserver guild memory initialize.... (%d byte)\n",sizeof(struct guild));
|
||||
guild_pt = aCalloc(sizeof(struct guild), 1);
|
||||
guild_pt2= aCalloc(sizeof(struct guild), 1);
|
||||
guildcastle_pt=aCalloc(sizeof(struct guild_castle), 1);
|
||||
guild_pt = (struct guild*)aCalloc(sizeof(struct guild), 1);
|
||||
guild_pt2= (struct guild*)aCalloc(sizeof(struct guild), 1);
|
||||
guildcastle_pt = (struct guild_castle*)aCalloc(sizeof(struct guild_castle), 1);
|
||||
|
||||
inter_guild_readdb(); // Read exp
|
||||
|
||||
@ -1094,7 +1094,7 @@ int mapif_guild_castle_alldataload(int fd) {
|
||||
gc->Ghp7 = atoi(sql_row[25]);
|
||||
memcpy(WFIFOP(fd,len), gc, sizeof(struct guild_castle));
|
||||
|
||||
gcopy = numdb_search(castle_db_,gc->castle_id);
|
||||
gcopy = (struct guild_castle*)numdb_search(castle_db_,gc->castle_id);
|
||||
if (gcopy == NULL) {
|
||||
gcopy = (struct guild_castle *) aMalloc(sizeof(struct guild_castle));
|
||||
numdb_insert(castle_db_, gc->castle_id, gcopy);
|
||||
@ -1671,21 +1671,21 @@ int mapif_parse_GuildCheck(int fd,int guild_id,int account_id,int char_id)
|
||||
int inter_guild_parse_frommap(int fd)
|
||||
{
|
||||
switch(RFIFOW(fd,0)){
|
||||
case 0x3030: mapif_parse_CreateGuild(fd,RFIFOL(fd,4),RFIFOP(fd,8),(struct guild_member *)RFIFOP(fd,32)); break;
|
||||
case 0x3030: mapif_parse_CreateGuild(fd,RFIFOL(fd,4),(char*)RFIFOP(fd,8),(struct guild_member *)RFIFOP(fd,32)); break;
|
||||
case 0x3031: mapif_parse_GuildInfo(fd,RFIFOL(fd,2)); break;
|
||||
case 0x3032: mapif_parse_GuildAddMember(fd,RFIFOL(fd,4),(struct guild_member *)RFIFOP(fd,8)); break;
|
||||
case 0x3034: mapif_parse_GuildLeave(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOP(fd,15)); break;
|
||||
case 0x3034: mapif_parse_GuildLeave(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),(const char*)RFIFOP(fd,15)); break;
|
||||
case 0x3035: mapif_parse_GuildChangeMemberInfoShort(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17)); break;
|
||||
case 0x3036: mapif_parse_BreakGuild(fd,RFIFOL(fd,2)); break;
|
||||
case 0x3037: mapif_parse_GuildMessage(fd,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOP(fd,12),RFIFOW(fd,2)-12); break;
|
||||
case 0x3037: mapif_parse_GuildMessage(fd,RFIFOL(fd,4),RFIFOL(fd,8),(char*)RFIFOP(fd,12),RFIFOW(fd,2)-12); break;
|
||||
case 0x3038: mapif_parse_GuildCheck(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10)); break;
|
||||
case 0x3039: mapif_parse_GuildBasicInfoChange(fd,RFIFOL(fd,4),RFIFOW(fd,8),RFIFOP(fd,10),RFIFOW(fd,2)-10); break;
|
||||
case 0x303A: mapif_parse_GuildMemberInfoChange(fd,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOL(fd,12),RFIFOW(fd,16),RFIFOP(fd,18),RFIFOW(fd,2)-18); break;
|
||||
case 0x3039: mapif_parse_GuildBasicInfoChange(fd,RFIFOL(fd,4),RFIFOW(fd,8),(const char*)RFIFOP(fd,10),RFIFOW(fd,2)-10); break;
|
||||
case 0x303A: mapif_parse_GuildMemberInfoChange(fd,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOL(fd,12),RFIFOW(fd,16),(const char*)RFIFOP(fd,18),RFIFOW(fd,2)-18); break;
|
||||
case 0x303B: mapif_parse_GuildPosition(fd,RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12)); break;
|
||||
case 0x303C: mapif_parse_GuildSkillUp(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10)); break;
|
||||
case 0x303D: mapif_parse_GuildAlliance(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),RFIFOB(fd,18)); break;
|
||||
case 0x303E: mapif_parse_GuildNotice(fd,RFIFOL(fd,2),RFIFOP(fd,6),RFIFOP(fd,66)); break;
|
||||
case 0x303F: mapif_parse_GuildEmblem(fd,RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOP(fd,12)); break;
|
||||
case 0x303E: mapif_parse_GuildNotice(fd,RFIFOL(fd,2),(const char*)RFIFOP(fd,6),(const char*)RFIFOP(fd,66)); break;
|
||||
case 0x303F: mapif_parse_GuildEmblem(fd,RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8),(const char*)RFIFOP(fd,12)); break;
|
||||
case 0x3040: mapif_parse_GuildCastleDataLoad(fd,RFIFOW(fd,2),RFIFOB(fd,4)); break;
|
||||
case 0x3041: mapif_parse_GuildCastleDataSave(fd,RFIFOW(fd,2),RFIFOB(fd,4),RFIFOL(fd,5)); break;
|
||||
|
||||
|
@ -207,7 +207,7 @@ int inter_party_sql_init(){
|
||||
|
||||
//memory alloc
|
||||
printf("interserver party memory initialize.... (%d byte)\n",sizeof(struct party));
|
||||
party_pt = aCalloc(sizeof(struct party), 1);
|
||||
party_pt = (struct party*)aCalloc(sizeof(struct party), 1);
|
||||
|
||||
sprintf (tmp_sql , "SELECT count(*) FROM `%s`",party_db);
|
||||
if(mysql_query(&mysql_handle, tmp_sql) ) {
|
||||
@ -727,15 +727,15 @@ int mapif_parse_PartyCheck(int fd,int party_id,int account_id,char *nick)
|
||||
int inter_party_parse_frommap(int fd)
|
||||
{
|
||||
switch(RFIFOW(fd,0)){
|
||||
case 0x3020: mapif_parse_CreateParty(fd,RFIFOL(fd,2),RFIFOP(fd,6),RFIFOP(fd,30),RFIFOP(fd,54),RFIFOW(fd,70)); break;
|
||||
case 0x3020: mapif_parse_CreateParty(fd,RFIFOL(fd,2),(char*)RFIFOP(fd,6),(char*)RFIFOP(fd,30),(char*)RFIFOP(fd,54),RFIFOW(fd,70)); break;
|
||||
case 0x3021: mapif_parse_PartyInfo(fd,RFIFOL(fd,2)); break;
|
||||
case 0x3022: mapif_parse_PartyAddMember(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOP(fd,10),RFIFOP(fd,34),RFIFOW(fd,50)); break;
|
||||
case 0x3022: mapif_parse_PartyAddMember(fd,RFIFOL(fd,2),RFIFOL(fd,6),(char*)RFIFOP(fd,10),(char*)RFIFOP(fd,34),RFIFOW(fd,50)); break;
|
||||
case 0x3023: mapif_parse_PartyChangeOption(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12)); break;
|
||||
case 0x3024: mapif_parse_PartyLeave(fd,RFIFOL(fd,2),RFIFOL(fd,6)); break;
|
||||
case 0x3025: mapif_parse_PartyChangeMap(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOP(fd,10),RFIFOB(fd,26),RFIFOW(fd,27)); break;
|
||||
case 0x3025: mapif_parse_PartyChangeMap(fd,RFIFOL(fd,2),RFIFOL(fd,6),(char*)RFIFOP(fd,10),RFIFOB(fd,26),RFIFOW(fd,27)); break;
|
||||
case 0x3026: mapif_parse_BreakParty(fd,RFIFOL(fd,2)); break;
|
||||
case 0x3027: mapif_parse_PartyMessage(fd,RFIFOL(fd,4),RFIFOL(fd,8),RFIFOP(fd,12),RFIFOW(fd,2)-12); break;
|
||||
case 0x3028: mapif_parse_PartyCheck(fd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOP(fd,10)); break;
|
||||
case 0x3027: mapif_parse_PartyMessage(fd,RFIFOL(fd,4),RFIFOL(fd,8),(char*)RFIFOP(fd,12),RFIFOW(fd,2)-12); break;
|
||||
case 0x3028: mapif_parse_PartyCheck(fd,RFIFOL(fd,2),RFIFOL(fd,6),(char*)RFIFOP(fd,10)); break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ int inter_pet_sql_init(){
|
||||
|
||||
//memory alloc
|
||||
printf("interserver pet memory initialize.... (%d byte)\n",sizeof(struct s_pet));
|
||||
pet_pt = aCalloc(sizeof(struct s_pet), 1);
|
||||
pet_pt = (struct s_pet*)aCalloc(sizeof(struct s_pet), 1);
|
||||
|
||||
sprintf (tmp_sql , "SELECT count(*) FROM `%s`", pet_db);
|
||||
if(mysql_query(&mysql_handle, tmp_sql) ) {
|
||||
@ -292,7 +292,7 @@ int mapif_delete_pet(int fd, int pet_id){
|
||||
|
||||
int mapif_parse_CreatePet(int fd){
|
||||
mapif_create_pet(fd, RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOW(fd, 10), RFIFOW(fd, 12), RFIFOW(fd, 14), RFIFOW(fd, 16), RFIFOL(fd, 18),
|
||||
RFIFOL(fd, 20), RFIFOB(fd, 22), RFIFOB(fd, 23), RFIFOP(fd, 24));
|
||||
RFIFOL(fd, 20), RFIFOB(fd, 22), RFIFOB(fd, 23), (char*)RFIFOP(fd, 24));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -191,8 +191,8 @@ int inter_storage_sql_init(){
|
||||
|
||||
//memory alloc
|
||||
printf("interserver storage memory initialize....(%d byte)\n",sizeof(struct storage));
|
||||
storage_pt=aCalloc(sizeof(struct storage), 1);
|
||||
guild_storage_pt=aCalloc(sizeof(struct guild_storage), 1);
|
||||
storage_pt = (struct storage*)aCalloc(sizeof(struct storage), 1);
|
||||
guild_storage_pt = (struct guild_storage*)aCalloc(sizeof(struct guild_storage), 1);
|
||||
memset(storage_pt,0,sizeof(struct storage));
|
||||
memset(guild_storage_pt,0,sizeof(struct guild_storage));
|
||||
|
||||
|
@ -397,7 +397,7 @@ int check_ttl_wisdata() {
|
||||
wis_delnum = 0;
|
||||
numdb_foreach(wis_db, check_ttl_wisdata_sub, tick);
|
||||
for(i = 0; i < wis_delnum; i++) {
|
||||
struct WisData *wd = numdb_search(wis_db, wis_dellist[i]);
|
||||
struct WisData *wd = (struct WisData*)numdb_search(wis_db, wis_dellist[i]);
|
||||
printf("inter: wis data id=%d time out : from %s to %s\n", wd->id, wd->src, wd->dst);
|
||||
// removed. not send information after a timeout. Just no answer for the player
|
||||
//mapif_wis_end(wd, 1); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
|
||||
@ -448,9 +448,9 @@ int mapif_parse_WisRequest(int fd) {
|
||||
} else {
|
||||
// to be sure of the correct name, rewrite it
|
||||
memset(RFIFOP(fd,28), 0, 24);
|
||||
strncpy(RFIFOP(fd,28), sql_row[0], 24);
|
||||
strncpy((char*)RFIFOP(fd,28), sql_row[0], 24);
|
||||
// if source is destination, don't ask other servers.
|
||||
if (strcmp(RFIFOP(fd,4),RFIFOP(fd,28)) == 0) {
|
||||
if (strcmp((char*)RFIFOP(fd,4),(char*)RFIFOP(fd,28)) == 0) {
|
||||
unsigned char buf[27];
|
||||
WBUFW(buf, 0) = 0x3802;
|
||||
memcpy(WBUFP(buf, 2), RFIFOP(fd, 4), 24);
|
||||
@ -482,7 +482,7 @@ int mapif_parse_WisRequest(int fd) {
|
||||
// Wisp/page transmission result
|
||||
int mapif_parse_WisReply(int fd) {
|
||||
int id = RFIFOL(fd,2), flag = RFIFOB(fd,6);
|
||||
struct WisData *wd = numdb_search(wis_db, id);
|
||||
struct WisData *wd = (struct WisData*)numdb_search(wis_db, id);
|
||||
|
||||
if (wd == NULL)
|
||||
return 0; // This wisp was probably suppress before, because it was timeout of because of target was found on another map-server
|
||||
|
@ -31,7 +31,7 @@ struct item_data* itemdb_search(int nameid)
|
||||
{
|
||||
struct item_data *id;
|
||||
|
||||
id=numdb_search(item_db,nameid);
|
||||
id = (struct item_data*)numdb_search(item_db,nameid);
|
||||
if(id) return id;
|
||||
|
||||
CREATE(id, struct item_data, 1);
|
||||
@ -212,7 +212,7 @@ static int itemdb_final(void *key,void *data,va_list ap)
|
||||
{
|
||||
struct item_data *id;
|
||||
|
||||
id=data;
|
||||
id = (struct item_data*)data;
|
||||
if(id->use_script)
|
||||
aFree(id->use_script);
|
||||
if(id->equip_script)
|
||||
|
@ -66,7 +66,7 @@ void * _bcalloc(size_t size, size_t cnt) {
|
||||
|
||||
char * _bstrdup(const char *chr) {
|
||||
int len = strlen(chr);
|
||||
char *ret = aMalloc(len + 1);
|
||||
char *ret = (char*)aMalloc(len + 1);
|
||||
strcpy(ret, chr);
|
||||
return ret;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
// string lib.
|
||||
char* jstrescape (char* pt) {
|
||||
//copy from here
|
||||
unsigned char * ptr;
|
||||
char *ptr;
|
||||
int i =0, j=0;
|
||||
|
||||
//copy string to temporary
|
||||
|
@ -226,7 +226,7 @@ void MD5_String(const char * string, char * output)
|
||||
{
|
||||
unsigned char digest[16];
|
||||
|
||||
MD5_String2binary(string,digest);
|
||||
MD5_String2binary(string,(char*)digest);
|
||||
sprintf(output,
|
||||
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
digest[ 0], digest[ 1], digest[ 2], digest[ 3],
|
||||
|
@ -971,7 +971,7 @@ int charif_sendallwos(int sfd, unsigned char *buf, unsigned int len) {
|
||||
//-----------------------------------------------------
|
||||
void send_GM_accounts() {
|
||||
int i;
|
||||
char buf[32767];
|
||||
unsigned char buf[32767];
|
||||
int len;
|
||||
|
||||
len = 4;
|
||||
@ -1239,7 +1239,7 @@ int mmo_auth(struct mmo_account* account, int fd) {
|
||||
}
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
strftime(tmpstr, 24, date_format, localtime(&(tv.tv_sec)));
|
||||
strftime(tmpstr, 24, date_format, localtime((const time_t*)&(tv.tv_sec)));
|
||||
sprintf(tmpstr + strlen(tmpstr), ".%03d", (int)tv.tv_usec / 1000);
|
||||
|
||||
account->account_id = auth_dat[i].account_id;
|
||||
@ -1463,7 +1463,7 @@ int parse_fromchar(int fd) {
|
||||
WBUFW(buf,0) = 0x2721;
|
||||
WBUFL(buf,2) = acc;
|
||||
WBUFL(buf,6) = 0;
|
||||
if (strcmp(RFIFOP(fd,8), gm_pass) == 0) {
|
||||
if (strcmp((char*)RFIFOP(fd,8), gm_pass) == 0) {
|
||||
// only non-GM can become GM
|
||||
if (isGM(acc) == 0) {
|
||||
// if we autorise creation
|
||||
@ -1473,7 +1473,7 @@ int parse_fromchar(int fd) {
|
||||
char tmpstr[24];
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
strftime(tmpstr, 23, date_format, localtime(&(tv.tv_sec)));
|
||||
strftime(tmpstr, 23, date_format, localtime((const time_t*)&(tv.tv_sec)));
|
||||
fprintf(fp, RETCODE "// %s: @GM command on account %d" RETCODE "%d %d" RETCODE, tmpstr, acc, acc, level_new_gm);
|
||||
fclose(fp);
|
||||
WBUFL(buf,6) = level_new_gm;
|
||||
@ -1801,7 +1801,7 @@ int parse_fromchar(int fd) {
|
||||
logfp = fopen(login_log_unknown_packets_filename, "a");
|
||||
if (logfp) {
|
||||
gettimeofday(&tv, NULL);
|
||||
strftime(tmpstr, 23, date_format, localtime(&(tv.tv_sec)));
|
||||
strftime(tmpstr, 23, date_format, localtime((const time_t*)&(tv.tv_sec)));
|
||||
fprintf(logfp, "%s.%03d: receiving of an unknown packet -> disconnection" RETCODE, tmpstr, (int)tv.tv_usec / 1000);
|
||||
fprintf(logfp, "parse_fromchar: connection #%d (ip: %s), packet: 0x%x (with being read: %d)." RETCODE, fd, ip, RFIFOW(fd,0), RFIFOREST(fd));
|
||||
fprintf(logfp, "Detail (in hex):" RETCODE);
|
||||
@ -1945,13 +1945,13 @@ int parse_admin(int fd) {
|
||||
return 0;
|
||||
{
|
||||
struct mmo_account ma;
|
||||
ma.userid = RFIFOP(fd, 2);
|
||||
ma.userid = (char*)RFIFOP(fd, 2);
|
||||
memcpy(ma.passwd, RFIFOP(fd, 26), 24);
|
||||
ma.passwd[24] = '\0';
|
||||
memcpy(ma.lastlogin, "-", 2);
|
||||
ma.sex = RFIFOB(fd,50);
|
||||
WFIFOW(fd,0) = 0x7931;
|
||||
WFIFOL(fd,2) = -1;
|
||||
WFIFOL(fd,2) = -1; // WTF? usigned being set to a -1???
|
||||
memcpy(WFIFOP(fd,6), RFIFOP(fd,2), 24);
|
||||
if (strlen(ma.userid) > 23 || strlen(ma.passwd) > 23) {
|
||||
login_log("'ladmin': Attempt to create an invalid account (account or pass is too long, ip: %s)" RETCODE,
|
||||
@ -1997,8 +1997,8 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 26)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7933;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF? an unsigned being set to -1
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
@ -2014,7 +2014,7 @@ int parse_admin(int fd) {
|
||||
// save deleted account in log file
|
||||
login_log("'ladmin': Account deletion (account: %s, id: %d, ip: %s) - saved in next line:" RETCODE,
|
||||
auth_dat[i].userid, auth_dat[i].account_id, ip);
|
||||
mmo_auth_tostr(buf, &auth_dat[i]);
|
||||
mmo_auth_tostr((char*)buf, &auth_dat[i]);
|
||||
login_log("%s" RETCODE, buf);
|
||||
// delete account
|
||||
memset(auth_dat[i].userid, '\0', sizeof(auth_dat[i].userid));
|
||||
@ -2033,8 +2033,8 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 50)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7935;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; /// WTF??? an unsigned being set to a -1
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
@ -2063,8 +2063,8 @@ int parse_admin(int fd) {
|
||||
char error_message[20];
|
||||
int statut;
|
||||
WFIFOW(fd,0) = 0x7937;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
statut = RFIFOL(fd,26);
|
||||
@ -2138,8 +2138,8 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 50)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x793b;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
@ -2170,8 +2170,8 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 27)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x793d;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
@ -2222,8 +2222,8 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 27)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x793f;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
@ -2250,7 +2250,7 @@ int parse_admin(int fd) {
|
||||
if ((fp2 = lock_fopen(GM_account_filename, &lock)) != NULL) {
|
||||
if ((fp = fopen(GM_account_filename, "r")) != NULL) {
|
||||
gettimeofday(&tv, NULL);
|
||||
strftime(tmpstr, 23, date_format, localtime(&(tv.tv_sec)));
|
||||
strftime(tmpstr, 23, date_format, localtime((const time_t*)&(tv.tv_sec)));
|
||||
modify_flag = 0;
|
||||
// read/write GM file
|
||||
while(fgets(line, sizeof(line)-1, fp)) {
|
||||
@ -2312,8 +2312,8 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 66)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7941;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
memcpy(WFIFOP(fd,6), account_name, 24);
|
||||
@ -2347,8 +2347,8 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 28 || RFIFOREST(fd) < (28 + RFIFOW(fd,26)))
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7943;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
@ -2382,8 +2382,8 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 26)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7945;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
@ -2409,7 +2409,7 @@ int parse_admin(int fd) {
|
||||
memset(WFIFOP(fd,6), '\0', 24);
|
||||
for(i = 0; i < auth_num; i++) {
|
||||
if (auth_dat[i].account_id == RFIFOL(fd,2)) {
|
||||
strncpy(WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
strncpy((char*)WFIFOP(fd,6), auth_dat[i].userid, 24);
|
||||
login_log("'ladmin': Request (by id) of an account name (account: %s, id: %d, ip: %s)" RETCODE,
|
||||
auth_dat[i].userid, RFIFOL(fd,2), ip);
|
||||
break;
|
||||
@ -2418,7 +2418,7 @@ int parse_admin(int fd) {
|
||||
if (i == auth_num) {
|
||||
login_log("'ladmin': Name request (by id) of an unknown account (id: %d, ip: %s)" RETCODE,
|
||||
RFIFOL(fd,2), ip);
|
||||
strncpy(WFIFOP(fd,6), "", 24);
|
||||
strncpy((char*)WFIFOP(fd,6), "", 24);
|
||||
}
|
||||
WFIFOSET(fd,30);
|
||||
RFIFOSKIP(fd,6);
|
||||
@ -2431,8 +2431,8 @@ int parse_admin(int fd) {
|
||||
time_t timestamp;
|
||||
char tmpstr[2048];
|
||||
WFIFOW(fd,0) = 0x7949;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
timestamp = (time_t)RFIFOL(fd,26);
|
||||
@ -2463,8 +2463,8 @@ int parse_admin(int fd) {
|
||||
time_t timestamp;
|
||||
char tmpstr[2048];
|
||||
WFIFOW(fd,0) = 0x794b;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
timestamp = (time_t)RFIFOL(fd,26);
|
||||
@ -2511,8 +2511,8 @@ int parse_admin(int fd) {
|
||||
struct tm *tmtime;
|
||||
char tmpstr[2048];
|
||||
WFIFOW(fd,0) = 0x794d;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
@ -2573,7 +2573,7 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 8 || RFIFOREST(fd) < (8 + RFIFOL(fd,4)))
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x794f;
|
||||
WFIFOW(fd,2) = -1;
|
||||
WFIFOW(fd,2) = -1; // WTF???
|
||||
if (RFIFOL(fd,4) < 1) {
|
||||
login_log("'ladmin': Receiving a message for broadcast, but message is void (ip: %s)" RETCODE,
|
||||
ip);
|
||||
@ -2586,7 +2586,7 @@ int parse_admin(int fd) {
|
||||
login_log("'ladmin': Receiving a message for broadcast, but no char-server is online (ip: %s)" RETCODE,
|
||||
ip);
|
||||
} else {
|
||||
char buf[32000];
|
||||
unsigned char buf[32000];
|
||||
char message[32000];
|
||||
WFIFOW(fd,2) = 0;
|
||||
memset(message, '\0', sizeof(message));
|
||||
@ -2618,8 +2618,8 @@ int parse_admin(int fd) {
|
||||
char tmpstr[2048];
|
||||
char tmpstr2[2048];
|
||||
WFIFOW(fd,0) = 0x7951;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
@ -2672,8 +2672,8 @@ int parse_admin(int fd) {
|
||||
if (RFIFOREST(fd) < 26)
|
||||
return 0;
|
||||
WFIFOW(fd,0) = 0x7953;
|
||||
WFIFOL(fd,2) = -1;
|
||||
account_name = RFIFOP(fd,2);
|
||||
WFIFOL(fd,2) = -1; // WTF???
|
||||
account_name = (char*)RFIFOP(fd,2);
|
||||
account_name[23] = '\0';
|
||||
remove_control_chars(account_name);
|
||||
i = search_account_index(account_name);
|
||||
@ -2739,7 +2739,7 @@ int parse_admin(int fd) {
|
||||
if (i == auth_num) {
|
||||
login_log("'ladmin': Attempt to obtain information (by the id) of an unknown account (id: %d, ip: %s)" RETCODE,
|
||||
RFIFOL(fd,2), ip);
|
||||
strncpy(WFIFOP(fd,7), "", 24);
|
||||
strncpy((char*)WFIFOP(fd,7), "", 24);
|
||||
WFIFOW(fd,148) = 0;
|
||||
WFIFOSET(fd,150);
|
||||
}
|
||||
@ -2762,7 +2762,7 @@ int parse_admin(int fd) {
|
||||
logfp = fopen(login_log_unknown_packets_filename, "a");
|
||||
if (logfp) {
|
||||
gettimeofday(&tv, NULL);
|
||||
strftime(tmpstr, 23, date_format, localtime(&(tv.tv_sec)));
|
||||
strftime(tmpstr, 23, date_format, localtime((const time_t*)&(tv.tv_sec)));
|
||||
fprintf(logfp, "%s.%03d: receiving of an unknown packet -> disconnection" RETCODE, tmpstr, (int)tv.tv_usec / 1000);
|
||||
fprintf(logfp, "parse_admin: connection #%d (ip: %s), packet: 0x%x (with being read: %d)." RETCODE, fd, ip, RFIFOW(fd,0), RFIFOREST(fd));
|
||||
fprintf(logfp, "Detail (in hex):" RETCODE);
|
||||
@ -2874,7 +2874,7 @@ int parse_login(int fd) {
|
||||
if (RFIFOREST(fd) < ((RFIFOW(fd,0) == 0x64) ? 55 : 47))
|
||||
return 0;
|
||||
|
||||
account.userid = RFIFOP(fd,6);
|
||||
account.userid = (char*)RFIFOP(fd,6);
|
||||
account.userid[23] = '\0';
|
||||
remove_control_chars(account.userid);
|
||||
if (RFIFOW(fd,0) == 0x64) {
|
||||
@ -3022,15 +3022,15 @@ int parse_login(int fd) {
|
||||
return 0;
|
||||
{
|
||||
int GM_value, len;
|
||||
unsigned char* server_name;
|
||||
account.userid = RFIFOP(fd,2);
|
||||
char* server_name;
|
||||
account.userid = (char*)RFIFOP(fd,2);
|
||||
account.userid[23] = '\0';
|
||||
remove_control_chars(account.userid);
|
||||
memcpy(account.passwd, RFIFOP(fd,26), 24);
|
||||
account.passwd[24] = '\0';
|
||||
remove_control_chars(account.passwd);
|
||||
account.passwdenc = 0;
|
||||
server_name = RFIFOP(fd,60);
|
||||
server_name = (char*)RFIFOP(fd,60);
|
||||
server_name[19] = '\0';
|
||||
remove_control_chars(server_name);
|
||||
login_log("Connection request of the char-server '%s' @ %d.%d.%d.%d:%d (ip: %s)" RETCODE,
|
||||
@ -3117,7 +3117,7 @@ int parse_login(int fd) {
|
||||
} else {
|
||||
struct login_session_data *ld = (struct login_session_data*)session[fd]->session_data;
|
||||
if (RFIFOW(fd,2) == 0) { // non encrypted password
|
||||
unsigned char* password="";
|
||||
char* password="";
|
||||
memcpy(password, RFIFOP(fd,4), 24);
|
||||
password[24] = '\0';
|
||||
remove_control_chars(password);
|
||||
@ -3167,7 +3167,7 @@ int parse_login(int fd) {
|
||||
logfp = fopen(login_log_unknown_packets_filename, "a");
|
||||
if (logfp) {
|
||||
gettimeofday(&tv, NULL);
|
||||
strftime(tmpstr, 23, date_format, localtime(&(tv.tv_sec)));
|
||||
strftime(tmpstr, 23, date_format, localtime((const time_t*)&(tv.tv_sec)));
|
||||
fprintf(logfp, "%s.%03d: receiving of an unknown packet -> disconnection" RETCODE, tmpstr, (int)tv.tv_usec / 1000);
|
||||
fprintf(logfp, "parse_login: connection #%d (ip: %s), packet: 0x%x (with being read: %d)." RETCODE, fd, ip, RFIFOW(fd,0), RFIFOREST(fd));
|
||||
fprintf(logfp, "Detail (in hex):" RETCODE);
|
||||
|
@ -226,7 +226,7 @@ void MD5_String(const char * string, char * output)
|
||||
{
|
||||
unsigned char digest[16];
|
||||
|
||||
MD5_String2binary(string,digest);
|
||||
MD5_String2binary(string,(char*)digest);
|
||||
sprintf(output,
|
||||
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
digest[ 0], digest[ 1], digest[ 2], digest[ 3],
|
||||
|
@ -225,7 +225,7 @@ void MD5_String(const char * string, char * output)
|
||||
{
|
||||
unsigned char digest[16];
|
||||
|
||||
MD5_String2binary(string,digest);
|
||||
MD5_String2binary(string,(char*)digest);
|
||||
sprintf(output,
|
||||
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
digest[ 0], digest[ 1], digest[ 2], digest[ 3],
|
||||
|
233
src/map/clif.c
233
src/map/clif.c
@ -202,7 +202,7 @@ int clif_countusers(void)
|
||||
struct map_session_data *sd;
|
||||
|
||||
for(i = 0; i < fd_max; i++) {
|
||||
if (session[i] && (sd = session[i]->session_data) && sd && sd->state.auth &&
|
||||
if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) && sd && sd->state.auth &&
|
||||
!(battle_config.hide_GM_session && pc_isGM(sd)))
|
||||
users++;
|
||||
}
|
||||
@ -221,7 +221,7 @@ int clif_foreachclient(int (*func)(struct map_session_data*, va_list),...)
|
||||
|
||||
va_start(ap,func);
|
||||
for(i = 0; i < fd_max; i++) {
|
||||
if (session[i] && (sd = session[i]->session_data) && sd && sd->state.auth)
|
||||
if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) && sd && sd->state.auth)
|
||||
func(sd, ap);
|
||||
}
|
||||
va_end(ap);
|
||||
@ -300,7 +300,7 @@ int clif_send(unsigned char *buf, int len, struct block_list *bl, int type) {
|
||||
switch(type) {
|
||||
case ALL_CLIENT: // 全クライアントに送信
|
||||
for(i = 0; i < fd_max; i++) {
|
||||
if (session[i] && (sd = session[i]->session_data) != NULL && sd->state.auth) {
|
||||
if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) != NULL && sd->state.auth) {
|
||||
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
|
||||
memcpy(WFIFOP(i,0), buf, len);
|
||||
WFIFOSET(i,len);
|
||||
@ -310,7 +310,7 @@ int clif_send(unsigned char *buf, int len, struct block_list *bl, int type) {
|
||||
break;
|
||||
case ALL_SAMEMAP: // 同じマップの全クライアントに送信
|
||||
for(i = 0; i < fd_max; i++) {
|
||||
if (session[i] && (sd = session[i]->session_data) != NULL && sd->state.auth && sd->bl.m == bl->m) {
|
||||
if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) != NULL && sd->state.auth && sd->bl.m == bl->m) {
|
||||
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
|
||||
memcpy(WFIFOP(i,0), buf, len);
|
||||
WFIFOSET(i,len);
|
||||
@ -391,7 +391,7 @@ int clif_send(unsigned char *buf, int len, struct block_list *bl, int type) {
|
||||
}
|
||||
}
|
||||
for (i = 0; i < fd_max; i++){
|
||||
if (session[i] && (sd = session[i]->session_data) != NULL && sd->state.auth) {
|
||||
if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) != NULL && sd->state.auth) {
|
||||
if (sd->partyspy == p->party_id) {
|
||||
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
|
||||
memcpy(WFIFOP(sd->fd,0), buf, len);
|
||||
@ -441,7 +441,7 @@ int clif_send(unsigned char *buf, int len, struct block_list *bl, int type) {
|
||||
}
|
||||
}
|
||||
for (i = 0; i < fd_max; i++){
|
||||
if (session[i] && (sd = session[i]->session_data) != NULL && sd->state.auth) {
|
||||
if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) != NULL && sd->state.auth) {
|
||||
if (sd->guildspy == g->guild_id) {
|
||||
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
|
||||
memcpy(WFIFOP(sd->fd,0), buf, len);
|
||||
@ -590,7 +590,7 @@ static int clif_set009e(struct flooritem_data *fitem,unsigned char *buf) {
|
||||
*------------------------------------------
|
||||
*/
|
||||
int clif_dropflooritem(struct flooritem_data *fitem) {
|
||||
char buf[64];
|
||||
unsigned char buf[64];
|
||||
|
||||
nullpo_retr(0, fitem);
|
||||
|
||||
@ -908,7 +908,7 @@ static int clif_set007b(struct map_session_data *sd,unsigned char *buf) {
|
||||
*/
|
||||
int clif_class_change(struct block_list *bl,int class_,int type)
|
||||
{
|
||||
char buf[16];
|
||||
unsigned char buf[16];
|
||||
|
||||
nullpo_retr(0, bl);
|
||||
|
||||
@ -927,7 +927,7 @@ int clif_class_change(struct block_list *bl,int class_,int type)
|
||||
*------------------------------------------
|
||||
*/
|
||||
int clif_mob_class_change(struct mob_data *md, int class_) {
|
||||
char buf[16];
|
||||
unsigned char buf[16];
|
||||
int view = mob_get_viewclass(class_);
|
||||
|
||||
nullpo_retr(0, md);
|
||||
@ -1539,7 +1539,7 @@ void clif_setwaitclose(int fd) {
|
||||
struct map_session_data *sd;
|
||||
|
||||
// if player is not already in the game (double connection probably)
|
||||
if ((sd = session[fd]->session_data) == NULL) {
|
||||
if ((sd = (struct map_session_data*)session[fd]->session_data) == NULL) {
|
||||
// limited timer, just to send information.
|
||||
add_timer(gettick() + 1000, clif_waitclose, fd, 0);
|
||||
} else
|
||||
@ -1595,7 +1595,7 @@ int clif_changemapserver(struct map_session_data *sd, char *mapname, int x, int
|
||||
*------------------------------------------
|
||||
*/
|
||||
int clif_fixpos(struct block_list *bl) {
|
||||
char buf[16];
|
||||
unsigned char buf[16];
|
||||
|
||||
nullpo_retr(0, bl);
|
||||
|
||||
@ -1701,7 +1701,7 @@ int clif_scriptmes(struct map_session_data *sd, int npcid, char *mes) {
|
||||
WFIFOW(fd,0)=0xb4;
|
||||
WFIFOW(fd,2)=strlen(mes)+9;
|
||||
WFIFOL(fd,4)=npcid;
|
||||
strcpy(WFIFOP(fd,8),mes);
|
||||
strcpy((char*)WFIFOP(fd,8),mes);
|
||||
WFIFOSET(fd,WFIFOW(fd,2));
|
||||
|
||||
return 0;
|
||||
@ -1754,7 +1754,7 @@ int clif_scriptmenu(struct map_session_data *sd, int npcid, char *mes) {
|
||||
WFIFOW(fd,0)=0xb7;
|
||||
WFIFOW(fd,2)=strlen(mes)+8;
|
||||
WFIFOL(fd,4)=npcid;
|
||||
strcpy(WFIFOP(fd,8),mes);
|
||||
strcpy((char*)WFIFOP(fd,8),mes);
|
||||
WFIFOSET(fd,WFIFOW(fd,2));
|
||||
|
||||
return 0;
|
||||
@ -1827,7 +1827,7 @@ int clif_cutin(struct map_session_data *sd, char *image, int type) {
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOW(fd,0)=0x1b3;
|
||||
strncpy(WFIFOP(fd,2),image,64);
|
||||
strncpy((char*)WFIFOP(fd,2),image,64);
|
||||
WFIFOB(fd,66)=type;
|
||||
WFIFOSET(fd,packet_len_table[0x1b3]);
|
||||
|
||||
@ -2841,7 +2841,7 @@ int clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok)
|
||||
*/
|
||||
int clif_misceffect(struct block_list* bl,int type)
|
||||
{
|
||||
char buf[32];
|
||||
unsigned char buf[32];
|
||||
|
||||
nullpo_retr(0, bl);
|
||||
|
||||
@ -2875,7 +2875,7 @@ int clif_misceffect2(struct block_list *bl, int type) {
|
||||
*/
|
||||
int clif_changeoption(struct block_list* bl)
|
||||
{
|
||||
char buf[32];
|
||||
unsigned char buf[32];
|
||||
short option;
|
||||
struct status_change *sc_data;
|
||||
static const int omask[]={ 0x10,0x20 };
|
||||
@ -2895,7 +2895,7 @@ int clif_changeoption(struct block_list* bl)
|
||||
WBUFB(buf,12) = 0; // ??
|
||||
|
||||
if(bl->type==BL_PC) { // disguises [Valaris]
|
||||
struct map_session_data *sd=((struct map_session_data *)bl);
|
||||
struct map_session_data *sd=(struct map_session_data *)bl;
|
||||
if(sd && sd->disguise > 23 && sd->disguise < 4001) {
|
||||
clif_send(buf,packet_len_table[0x119],bl,AREA_WOS);
|
||||
clif_spawnpc(sd);
|
||||
@ -2942,7 +2942,7 @@ int clif_useitemack(struct map_session_data *sd,int index,int amount,int ok)
|
||||
WFIFOB(fd,6)=ok;
|
||||
WFIFOSET(fd,packet_len_table[0xa8]);
|
||||
#else
|
||||
char buf[32];
|
||||
unsigned char buf[32];
|
||||
|
||||
WBUFW(buf,0)=0x1c8;
|
||||
WBUFW(buf,2)=index+2;
|
||||
@ -2984,19 +2984,19 @@ int clif_createchat(struct map_session_data *sd,int fail)
|
||||
*/
|
||||
int clif_dispchat(struct chat_data *cd,int fd)
|
||||
{
|
||||
char buf[128]; // <20>Å‘åtitle(60ƒoƒCƒg)+17
|
||||
unsigned char buf[128]; // <20>Å‘åtitle(60ƒoƒCƒg)+17
|
||||
|
||||
if(cd==NULL || *cd->owner==NULL)
|
||||
return 1;
|
||||
|
||||
WBUFW(buf,0)=0xd7;
|
||||
WBUFW(buf,2)=strlen(cd->title)+17;
|
||||
WBUFW(buf,2)=strlen((const char*)cd->title)+17;
|
||||
WBUFL(buf,4)=(*cd->owner)->id;
|
||||
WBUFL(buf,8)=cd->bl.id;
|
||||
WBUFW(buf,12)=cd->limit;
|
||||
WBUFW(buf,14)=cd->users;
|
||||
WBUFB(buf,16)=cd->pub;
|
||||
strcpy(WBUFP(buf,17),cd->title);
|
||||
strcpy((char*)WBUFP(buf,17),(const char*)cd->title);
|
||||
if(fd){
|
||||
memcpy(WFIFOP(fd,0),buf,WBUFW(buf,2));
|
||||
WFIFOSET(fd,WBUFW(buf,2));
|
||||
@ -3014,19 +3014,19 @@ int clif_dispchat(struct chat_data *cd,int fd)
|
||||
*/
|
||||
int clif_changechatstatus(struct chat_data *cd)
|
||||
{
|
||||
char buf[128]; // <20>Å‘åtitle(60ƒoƒCƒg)+17
|
||||
unsigned char buf[128]; // <20>Å‘åtitle(60ƒoƒCƒg)+17
|
||||
|
||||
if(cd==NULL || cd->usersd[0]==NULL)
|
||||
return 1;
|
||||
|
||||
WBUFW(buf,0)=0xdf;
|
||||
WBUFW(buf,2)=strlen(cd->title)+17;
|
||||
WBUFW(buf,2)=strlen((char*)cd->title)+17;
|
||||
WBUFL(buf,4)=cd->usersd[0]->bl.id;
|
||||
WBUFL(buf,8)=cd->bl.id;
|
||||
WBUFW(buf,12)=cd->limit;
|
||||
WBUFW(buf,14)=cd->users;
|
||||
WBUFB(buf,16)=cd->pub;
|
||||
strcpy(WBUFP(buf,17),cd->title);
|
||||
strcpy((char*)WBUFP(buf,17),(const char*)cd->title);
|
||||
clif_send(buf,WBUFW(buf,2),&cd->usersd[0]->bl,CHAT);
|
||||
|
||||
return 0;
|
||||
@ -3038,7 +3038,7 @@ int clif_changechatstatus(struct chat_data *cd)
|
||||
*/
|
||||
int clif_clearchat(struct chat_data *cd,int fd)
|
||||
{
|
||||
char buf[32];
|
||||
unsigned char buf[32];
|
||||
|
||||
nullpo_retr(0, cd);
|
||||
|
||||
@ -3104,7 +3104,7 @@ int clif_joinchatok(struct map_session_data *sd,struct chat_data* cd)
|
||||
*/
|
||||
int clif_addchat(struct chat_data* cd,struct map_session_data *sd)
|
||||
{
|
||||
char buf[32];
|
||||
unsigned char buf[32];
|
||||
|
||||
nullpo_retr(0, sd);
|
||||
nullpo_retr(0, cd);
|
||||
@ -3123,7 +3123,7 @@ int clif_addchat(struct chat_data* cd,struct map_session_data *sd)
|
||||
*/
|
||||
int clif_changechatowner(struct chat_data* cd,struct map_session_data *sd)
|
||||
{
|
||||
char buf[64];
|
||||
unsigned char buf[64];
|
||||
|
||||
nullpo_retr(0, sd);
|
||||
nullpo_retr(0, cd);
|
||||
@ -3146,7 +3146,7 @@ int clif_changechatowner(struct chat_data* cd,struct map_session_data *sd)
|
||||
*/
|
||||
int clif_leavechat(struct chat_data* cd,struct map_session_data *sd)
|
||||
{
|
||||
char buf[32];
|
||||
unsigned char buf[32];
|
||||
|
||||
nullpo_retr(0, sd);
|
||||
nullpo_retr(0, cd);
|
||||
@ -3173,7 +3173,7 @@ int clif_traderequest(struct map_session_data *sd,char *name)
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOW(fd,0)=0xe5;
|
||||
strcpy(WFIFOP(fd,2),name);
|
||||
strcpy((char*)WFIFOP(fd,2),name);
|
||||
WFIFOSET(fd,packet_len_table[0xe5]);
|
||||
|
||||
return 0;
|
||||
@ -3897,7 +3897,7 @@ int clif_clearchar_skillunit(struct skill_unit *unit,int fd)
|
||||
*/
|
||||
int clif_01ac(struct block_list *bl)
|
||||
{
|
||||
char buf[32];
|
||||
unsigned char buf[32];
|
||||
|
||||
nullpo_retr(0, bl);
|
||||
|
||||
@ -4579,10 +4579,10 @@ int clif_skill_warppoint(struct map_session_data *sd,int skill_num,
|
||||
fd=sd->fd;
|
||||
WFIFOW(fd,0)=0x11c;
|
||||
WFIFOW(fd,2)=skill_num;
|
||||
strncpy(WFIFOP(fd, 4),map1,16);
|
||||
strncpy(WFIFOP(fd,20),map2,16);
|
||||
strncpy(WFIFOP(fd,36),map3,16);
|
||||
strncpy(WFIFOP(fd,52),map4,16);
|
||||
strncpy((char*)WFIFOP(fd, 4),map1,16);
|
||||
strncpy((char*)WFIFOP(fd,20),map2,16);
|
||||
strncpy((char*)WFIFOP(fd,36),map3,16);
|
||||
strncpy((char*)WFIFOP(fd,52),map4,16);
|
||||
WFIFOSET(fd,packet_len_table[0x11c]);
|
||||
return 0;
|
||||
}
|
||||
@ -4824,11 +4824,12 @@ int clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type)
|
||||
WFIFOL(sd->fd,10) = pvpnum;
|
||||
WFIFOSET(sd->fd,packet_len_table[0x19a]);
|
||||
} else {
|
||||
char buf[32];
|
||||
unsigned char buf[32];
|
||||
|
||||
WBUFW(buf,0) = 0x19a;
|
||||
WBUFL(buf,2) = sd->bl.id;
|
||||
if(sd->status.option&0x46)
|
||||
// WTF? a -1 to an unsigned value...
|
||||
WBUFL(buf,6) = -1;
|
||||
else
|
||||
if(pvprank<=0)
|
||||
@ -4851,7 +4852,7 @@ int clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type)
|
||||
int clif_send0199(int map,int type)
|
||||
{
|
||||
struct block_list bl;
|
||||
char buf[16];
|
||||
unsigned char buf[16];
|
||||
|
||||
bl.m = map;
|
||||
WBUFW(buf,0)=0x199;
|
||||
@ -5117,7 +5118,7 @@ int clif_item_skill(struct map_session_data *sd,int skillid,int skilllv,const ch
|
||||
if(range < 0)
|
||||
range = battle_get_range(&sd->bl) - (range + 1);
|
||||
WFIFOW(fd,12)=range;
|
||||
strncpy(WFIFOP(fd,14),name,24);
|
||||
strncpy((char*)WFIFOP(fd,14),name,24);
|
||||
WFIFOB(fd,38)=0;
|
||||
WFIFOSET(fd,packet_len_table[0x147]);
|
||||
return 0;
|
||||
@ -5360,7 +5361,7 @@ int clif_showvendingboard(struct block_list* bl,char *message,int fd)
|
||||
|
||||
WBUFW(buf,0)=0x131;
|
||||
WBUFL(buf,2)=bl->id;
|
||||
strncpy(WBUFP(buf,6),message,80);
|
||||
strncpy((char*)WBUFP(buf,6),message,80);
|
||||
if(fd){
|
||||
memcpy(WFIFOP(fd,0),buf,packet_len_table[0x131]);
|
||||
WFIFOSET(fd,packet_len_table[0x131]);
|
||||
@ -5807,7 +5808,7 @@ int clif_hpmeter(struct map_session_data *sd)
|
||||
WBUFW(buf,8)=sd->bl.y;
|
||||
|
||||
for(i=0;i<fd_max;i++){
|
||||
if(session[i] && (md=session[i]->session_data) && md->state.auth &&
|
||||
if(session[i] && (md = (struct map_session_data*)session[i]->session_data) && md->state.auth &&
|
||||
md->bl.m == sd->bl.m && pc_isGM(md) && sd != md){
|
||||
memcpy(WFIFOP(i,0),buf,packet_len_table[0x107]);
|
||||
WFIFOSET(i,packet_len_table[0x107]);
|
||||
@ -5819,7 +5820,7 @@ int clif_hpmeter(struct map_session_data *sd)
|
||||
WBUFW(buf2,6)=(sd->status.hp > 0x7fff)? 0x7fff:sd->status.hp;
|
||||
WBUFW(buf2,8)=(sd->status.max_hp > 0x7fff)? 0x7fff:sd->status.max_hp;
|
||||
for(i=0;i<fd_max;i++){
|
||||
if(session[i] && (md=session[i]->session_data) && md->state.auth &&
|
||||
if(session[i] && (md = (struct map_session_data*)session[i]->session_data) && md->state.auth &&
|
||||
md->bl.m == sd->bl.m && pc_isGM(md) && sd != md){
|
||||
memcpy(WFIFOP(i,0),buf2,packet_len_table[0x106]);
|
||||
WFIFOSET(i,packet_len_table[0x106]);
|
||||
@ -6234,7 +6235,7 @@ int clif_bladestop(struct block_list *src,struct block_list *dst,
|
||||
int clif_changemapcell(int m,int x,int y,int cell_type,int type)
|
||||
{
|
||||
struct block_list bl;
|
||||
char buf[32];
|
||||
unsigned char buf[32];
|
||||
|
||||
bl.m = m;
|
||||
bl.x = x;
|
||||
@ -6424,32 +6425,32 @@ int clif_guild_basicinfo(struct map_session_data *sd)
|
||||
if(g->guild_id == gc->guild_id) t++;
|
||||
}
|
||||
|
||||
if (t==1) strncpy(WFIFOP(fd,94),"One Castle",20);
|
||||
else if (t==2) strncpy(WFIFOP(fd,94),"Two Castles",20);
|
||||
else if (t==3) strncpy(WFIFOP(fd,94),"Three Castles",20);
|
||||
else if (t==4) strncpy(WFIFOP(fd,94),"Four Castles",20);
|
||||
else if (t==5) strncpy(WFIFOP(fd,94),"Five Castles",20);
|
||||
else if (t==6) strncpy(WFIFOP(fd,94),"Six Castles",20);
|
||||
else if (t==7) strncpy(WFIFOP(fd,94),"Seven Castles",20);
|
||||
else if (t==8) strncpy(WFIFOP(fd,94),"Eight Castles",20);
|
||||
else if (t==9) strncpy(WFIFOP(fd,94),"Nine Castles",20);
|
||||
else if (t==10) strncpy(WFIFOP(fd,94),"Ten Castles",20);
|
||||
else if (t==11) strncpy(WFIFOP(fd,94),"Eleven Castles",20);
|
||||
else if (t==12) strncpy(WFIFOP(fd,94),"Twelve Castles",20);
|
||||
else if (t==13) strncpy(WFIFOP(fd,94),"Thirteen Castles",20);
|
||||
else if (t==14) strncpy(WFIFOP(fd,94),"Fourteen Castles",20);
|
||||
else if (t==15) strncpy(WFIFOP(fd,94),"Fifteen Castles",20);
|
||||
else if (t==16) strncpy(WFIFOP(fd,94),"Sixteen Castles",20);
|
||||
else if (t==17) strncpy(WFIFOP(fd,94),"Seventeen Castles",20);
|
||||
else if (t==18) strncpy(WFIFOP(fd,94),"Eighteen Castles",20);
|
||||
else if (t==19) strncpy(WFIFOP(fd,94),"Nineteen Castles",20);
|
||||
else if (t==20) strncpy(WFIFOP(fd,94),"Twenty Castles",20);
|
||||
else if (t==21) strncpy(WFIFOP(fd,94),"Twenty One Castles",20);
|
||||
else if (t==22) strncpy(WFIFOP(fd,94),"Twenty Two Castles",20);
|
||||
else if (t==23) strncpy(WFIFOP(fd,94),"Twenty Three Castles",20);
|
||||
else if (t==24) strncpy(WFIFOP(fd,94),"Twenty Four Castles",20);
|
||||
else if (t==MAX_GUILDCASTLE) strncpy(WFIFOP(fd,94),"Total Domination",20);
|
||||
else strncpy(WFIFOP(fd,94),"None Taken",20);
|
||||
if (t==1) strncpy((char*)WFIFOP(fd,94),"One Castle",20);
|
||||
else if (t==2) strncpy((char*)WFIFOP(fd,94),"Two Castles",20);
|
||||
else if (t==3) strncpy((char*)WFIFOP(fd,94),"Three Castles",20);
|
||||
else if (t==4) strncpy((char*)WFIFOP(fd,94),"Four Castles",20);
|
||||
else if (t==5) strncpy((char*)WFIFOP(fd,94),"Five Castles",20);
|
||||
else if (t==6) strncpy((char*)WFIFOP(fd,94),"Six Castles",20);
|
||||
else if (t==7) strncpy((char*)WFIFOP(fd,94),"Seven Castles",20);
|
||||
else if (t==8) strncpy((char*)WFIFOP(fd,94),"Eight Castles",20);
|
||||
else if (t==9) strncpy((char*)WFIFOP(fd,94),"Nine Castles",20);
|
||||
else if (t==10) strncpy((char*)WFIFOP(fd,94),"Ten Castles",20);
|
||||
else if (t==11) strncpy((char*)WFIFOP(fd,94),"Eleven Castles",20);
|
||||
else if (t==12) strncpy((char*)WFIFOP(fd,94),"Twelve Castles",20);
|
||||
else if (t==13) strncpy((char*)WFIFOP(fd,94),"Thirteen Castles",20);
|
||||
else if (t==14) strncpy((char*)WFIFOP(fd,94),"Fourteen Castles",20);
|
||||
else if (t==15) strncpy((char*)WFIFOP(fd,94),"Fifteen Castles",20);
|
||||
else if (t==16) strncpy((char*)WFIFOP(fd,94),"Sixteen Castles",20);
|
||||
else if (t==17) strncpy((char*)WFIFOP(fd,94),"Seventeen Castles",20);
|
||||
else if (t==18) strncpy((char*)WFIFOP(fd,94),"Eighteen Castles",20);
|
||||
else if (t==19) strncpy((char*)WFIFOP(fd,94),"Nineteen Castles",20);
|
||||
else if (t==20) strncpy((char*)WFIFOP(fd,94),"Twenty Castles",20);
|
||||
else if (t==21) strncpy((char*)WFIFOP(fd,94),"Twenty One Castles",20);
|
||||
else if (t==22) strncpy((char*)WFIFOP(fd,94),"Twenty Two Castles",20);
|
||||
else if (t==23) strncpy((char*)WFIFOP(fd,94),"Twenty Three Castles",20);
|
||||
else if (t==24) strncpy((char*)WFIFOP(fd,94),"Twenty Four Castles",20);
|
||||
else if (t==MAX_GUILDCASTLE) strncpy((char*)WFIFOP(fd,94),"Total Domination",20);
|
||||
else strncpy((char*)WFIFOP(fd,94),"None Taken",20);
|
||||
|
||||
WFIFOSET(fd,packet_len_table[WFIFOW(fd,0)]);
|
||||
clif_guild_emblem(sd,g); // Guild emblem vanish fix [Valaris]
|
||||
@ -7251,7 +7252,7 @@ int clif_specialeffect(struct block_list *bl, int type, int flag) {
|
||||
struct map_session_data *pl_sd;
|
||||
int i;
|
||||
for(i = 0; i < fd_max; i++) {
|
||||
if (session[i] && (pl_sd = session[i]->session_data) != NULL &&
|
||||
if (session[i] && (pl_sd = (struct map_session_data*)session[i]->session_data) != NULL &&
|
||||
pl_sd->state.auth &&
|
||||
(pc_isGM((struct map_session_data *)&bl) > pc_isGM((struct map_session_data *)&pl_sd->bl)))
|
||||
clif_specialeffect(&pl_sd->bl, type, 1);
|
||||
@ -7261,7 +7262,7 @@ int clif_specialeffect(struct block_list *bl, int type, int flag) {
|
||||
struct map_session_data *sd;
|
||||
int i;
|
||||
for(i = 0; i < fd_max; i++) {
|
||||
if (session[i] && (sd = session[i]->session_data) != NULL && sd->state.auth && sd->bl.m == bl->m)
|
||||
if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) != NULL && sd->state.auth && sd->bl.m == bl->m)
|
||||
clif_specialeffect(&sd->bl, type, 1);
|
||||
}
|
||||
}
|
||||
@ -7342,7 +7343,7 @@ void clif_parse_WantToConnection(int fd, struct map_session_data *sd)
|
||||
if (sd != 0)
|
||||
clif_setwaitclose(sd->fd); // Set session to EOF
|
||||
} else {
|
||||
sd = session[fd]->session_data = (struct map_session_data*)aCalloc(1, sizeof(struct map_session_data));
|
||||
sd = (struct map_session_data*)session[fd]->session_data = (struct map_session_data*)aCalloc(1, sizeof(struct map_session_data));
|
||||
sd->fd = fd;
|
||||
|
||||
if (IS_PACKET_DB_VER(cmd)) {
|
||||
@ -7885,27 +7886,27 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) {
|
||||
*/
|
||||
void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <len>.w <str>.?B
|
||||
char *message;
|
||||
char *buf;
|
||||
unsigned char *buf;
|
||||
|
||||
nullpo_retv(sd);
|
||||
if ((is_atcommand(fd, sd, RFIFOP(fd,4), 0) != AtCommand_None) ||
|
||||
(is_charcommand(fd, sd, RFIFOP(fd,4),0)!= CharCommand_None) ||
|
||||
if ((is_atcommand(fd, sd, (char*)RFIFOP(fd,4), 0) != AtCommand_None) ||
|
||||
(is_charcommand(fd, sd, (char*)RFIFOP(fd,4),0)!= CharCommand_None) ||
|
||||
(sd->sc_data &&
|
||||
(sd->sc_data[SC_BERSERK].timer != -1 || //バーサーク時は会話も不可
|
||||
sd->sc_data[SC_NOCHAT].timer != -1 ))) //チャット禁止
|
||||
return;
|
||||
|
||||
message = (char*)aCallocA(RFIFOW(fd,2) + 128, sizeof(char));
|
||||
buf = (char*)aCallocA(RFIFOW(fd,2) + 4, sizeof(char));
|
||||
buf = (unsigned char*)aCallocA(RFIFOW(fd,2) + 4, sizeof(char));
|
||||
|
||||
//printf("clif_parse_GlobalMessage: message: '%s'.\n", RFIFOP(fd,4));
|
||||
if (strncmp(RFIFOP(fd,4), sd->status.name, strlen(sd->status.name)) != 0) {
|
||||
if (strncmp((char*)RFIFOP(fd,4), sd->status.name, strlen(sd->status.name)) != 0) {
|
||||
printf("Hack on global message: character '%s' (account: %d), use an other name to send a (normal) message.\n", sd->status.name, sd->status.account_id);
|
||||
|
||||
// information is sended to all online GM
|
||||
sprintf(message, "Hack on global message (normal message): character '%s' (account: %d) uses another name.", sd->status.name, sd->status.account_id);
|
||||
intif_wis_message_to_gm(wisp_server_name, battle_config.hack_info_GM_level, message, strlen(message) + 1);
|
||||
if (strlen(RFIFOP(fd,4)) == 0)
|
||||
if (strlen((char*)RFIFOP(fd,4)) == 0)
|
||||
strcpy(message, " This player sends a void name and a void message.");
|
||||
else
|
||||
sprintf(message, " This player sends (name:message): '%s'.", RFIFOP(fd,4));
|
||||
@ -7946,16 +7947,16 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
|
||||
if (pc_calc_base_job2 (sd->status.class_) == 23 ) {
|
||||
int next = pc_nextbaseexp(sd)>0 ? pc_nextbaseexp(sd) : sd->status.base_exp;
|
||||
if ((sd->status.base_exp*100/next)%10 == 0) {
|
||||
estr_lower(RFIFOP(fd,4));
|
||||
if (sd->state.snovice_flag == 0 && strstr(RFIFOP(fd,4), msg_txt(540)))
|
||||
estr_lower((char*)RFIFOP(fd,4));
|
||||
if (sd->state.snovice_flag == 0 && strstr((char*)RFIFOP(fd,4), msg_txt(540)))
|
||||
sd->state.snovice_flag = 1;
|
||||
else if (sd->state.snovice_flag == 1) {
|
||||
sprintf(message, msg_txt(541), sd->status.name);
|
||||
estr_lower(message);
|
||||
if (strstr(RFIFOP(fd,4), message))
|
||||
if (strstr((char*)RFIFOP(fd,4), message))
|
||||
sd->state.snovice_flag = 2;
|
||||
}
|
||||
else if (sd->state.snovice_flag == 2 && strstr(RFIFOP(fd,4), msg_txt(542)))
|
||||
else if (sd->state.snovice_flag == 2 && strstr((char*)RFIFOP(fd,4), msg_txt(542)))
|
||||
sd->state.snovice_flag = 3;
|
||||
else if (sd->state.snovice_flag == 3) {
|
||||
int i;
|
||||
@ -8292,7 +8293,7 @@ void clif_parse_Wis(int fd, struct map_session_data *sd) { // S 0096 <len>.w <ni
|
||||
|
||||
//printf("clif_parse_Wis: message: '%s'.\n", RFIFOP(fd,28));
|
||||
|
||||
gm_command = (char*)aCallocA(strlen(RFIFOP(fd,28)) + 28, sizeof(char)); // 24+3+(RFIFOW(fd,2)-28)+1 or 24+3+(strlen(RFIFOP(fd,28))+1 (size can be wrong with hacker)
|
||||
gm_command = (char*)aCallocA(strlen((const char*)RFIFOP(fd,28)) + 28, sizeof(char)); // 24+3+(RFIFOW(fd,2)-28)+1 or 24+3+(strlen(RFIFOP(fd,28))+1 (size can be wrong with hacker)
|
||||
|
||||
sprintf(gm_command, "%s : %s", sd->status.name, RFIFOP(fd,28));
|
||||
if ((is_charcommand(fd, sd, gm_command, 0) != CharCommand_None) ||
|
||||
@ -8308,16 +8309,16 @@ void clif_parse_Wis(int fd, struct map_session_data *sd) { // S 0096 <len>.w <ni
|
||||
if(gm_command) aFree(gm_command);
|
||||
|
||||
// searching destination character
|
||||
dstsd = map_nick2sd(RFIFOP(fd,4));
|
||||
dstsd = map_nick2sd((char*)RFIFOP(fd,4));
|
||||
// player is not on this map-server
|
||||
if (dstsd == NULL ||
|
||||
// At this point, don't send wisp/page if it's not exactly the same name, because (example)
|
||||
// if there are 'Test' player on an other map-server and 'test' player on this map-server,
|
||||
// and if we ask for 'Test', we must not contact 'test' player
|
||||
// so, we send information to inter-server, which is the only one which decide (and copy correct name).
|
||||
strcmp(dstsd->status.name, RFIFOP(fd,4)) != 0) // not exactly same name
|
||||
strcmp(dstsd->status.name, (const char*)RFIFOP(fd,4)) != 0) // not exactly same name
|
||||
// send message to inter-server
|
||||
intif_wis_message(sd, RFIFOP(fd,4), RFIFOP(fd,28), RFIFOW(fd,2)-28);
|
||||
intif_wis_message(sd, (char*)RFIFOP(fd,4), (char*)RFIFOP(fd,28), RFIFOW(fd,2)-28);
|
||||
// player is on this map-server
|
||||
else {
|
||||
// if you send to your self, don't send anything to others
|
||||
@ -8336,7 +8337,7 @@ void clif_parse_Wis(int fd, struct map_session_data *sd) { // S 0096 <len>.w <ni
|
||||
}
|
||||
// if source player not found in ignore list
|
||||
if (i == MAX_IGNORE_LIST) {
|
||||
clif_wis_message(dstsd->fd, sd->status.name, RFIFOP(fd,28), RFIFOW(fd,2) - 28);
|
||||
clif_wis_message(dstsd->fd, sd->status.name, (char*)RFIFOP(fd,28), RFIFOW(fd,2) - 28);
|
||||
clif_wis_end(fd, 0); // type: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
|
||||
}
|
||||
}
|
||||
@ -8356,7 +8357,7 @@ void clif_parse_GMmessage(int fd, struct map_session_data *sd) {
|
||||
|
||||
if ((battle_config.atc_gmonly == 0 || pc_isGM(sd)) &&
|
||||
(pc_isGM(sd) >= get_atcommand_level(AtCommand_Broadcast)))
|
||||
intif_GMmessage(RFIFOP(fd,4), RFIFOW(fd,2)-4, 0);
|
||||
intif_GMmessage((char*)RFIFOP(fd,4), RFIFOW(fd,2)-4, 0);
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -8688,7 +8689,7 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
|
||||
void clif_parse_CreateChatRoom(int fd,struct map_session_data *sd)
|
||||
{
|
||||
if(battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 4){
|
||||
chat_createchat(sd,RFIFOW(fd,4),RFIFOB(fd,6),RFIFOP(fd,7),RFIFOP(fd,15),RFIFOW(fd,2)-15);
|
||||
chat_createchat(sd,RFIFOW(fd,4),RFIFOB(fd,6),(char*)RFIFOP(fd,7),(char*)RFIFOP(fd,15),RFIFOW(fd,2)-15);
|
||||
} else
|
||||
clif_skill_fail(sd,1,0,3);
|
||||
}
|
||||
@ -8699,7 +8700,7 @@ void clif_parse_CreateChatRoom(int fd,struct map_session_data *sd)
|
||||
*/
|
||||
void clif_parse_ChatAddMember(int fd,struct map_session_data *sd)
|
||||
{
|
||||
chat_joinchat(sd,RFIFOL(fd,2),RFIFOP(fd,6));
|
||||
chat_joinchat(sd,RFIFOL(fd,2),(char*)RFIFOP(fd,6));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -8708,7 +8709,7 @@ void clif_parse_ChatAddMember(int fd,struct map_session_data *sd)
|
||||
*/
|
||||
void clif_parse_ChatRoomStatusChange(int fd,struct map_session_data *sd)
|
||||
{
|
||||
chat_changechatstatus(sd,RFIFOW(fd,4),RFIFOB(fd,6),RFIFOP(fd,7),RFIFOP(fd,15),RFIFOW(fd,2)-15);
|
||||
chat_changechatstatus(sd,RFIFOW(fd,4),RFIFOB(fd,6),(char*)RFIFOP(fd,7),(char*)RFIFOP(fd,15),RFIFOW(fd,2)-15);
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -8717,7 +8718,7 @@ void clif_parse_ChatRoomStatusChange(int fd,struct map_session_data *sd)
|
||||
*/
|
||||
void clif_parse_ChangeChatOwner(int fd,struct map_session_data *sd)
|
||||
{
|
||||
chat_changechatowner(sd,RFIFOP(fd,6));
|
||||
chat_changechatowner(sd,(char*)RFIFOP(fd,6));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -8726,7 +8727,7 @@ void clif_parse_ChangeChatOwner(int fd,struct map_session_data *sd)
|
||||
*/
|
||||
void clif_parse_KickFromChat(int fd,struct map_session_data *sd)
|
||||
{
|
||||
chat_kickchat(sd,RFIFOP(fd,2));
|
||||
chat_kickchat(sd,(char*)RFIFOP(fd,2));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9196,7 +9197,7 @@ void clif_parse_UseSkillMap(int fd,struct map_session_data *sd)
|
||||
if(sd->invincible_timer != -1)
|
||||
pc_delinvincibletimer(sd);
|
||||
|
||||
skill_castend_map(sd,RFIFOW(fd,2),RFIFOP(fd,4));
|
||||
skill_castend_map(sd,RFIFOW(fd,2),(char*)RFIFOP(fd,4));
|
||||
}
|
||||
/*==========================================
|
||||
* メモ要求
|
||||
@ -9269,7 +9270,7 @@ void clif_parse_NpcStringInput(int fd,struct map_session_data *sd)
|
||||
memcpy(sd->npc_str,RFIFOP(fd,8),sizeof(sd->npc_str));
|
||||
sd->npc_str[sizeof(sd->npc_str)-1]=0;
|
||||
} else
|
||||
strcpy(sd->npc_str,RFIFOP(fd,8));
|
||||
strcpy(sd->npc_str,(char*)RFIFOP(fd,8));
|
||||
npc_scriptcont(sd,RFIFOL(fd,4));
|
||||
}
|
||||
|
||||
@ -9590,7 +9591,7 @@ void clif_parse_CloseKafra(int fd, struct map_session_data *sd) {
|
||||
*/
|
||||
void clif_parse_CreateParty(int fd, struct map_session_data *sd) {
|
||||
if (battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 7) {
|
||||
party_create(sd,RFIFOP(fd,2));
|
||||
party_create(sd,(char*)RFIFOP(fd,2));
|
||||
} else
|
||||
clif_skill_fail(sd,1,0,4);
|
||||
}
|
||||
@ -9601,7 +9602,7 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd) {
|
||||
*/
|
||||
void clif_parse_CreateParty2(int fd, struct map_session_data *sd) {
|
||||
if (battle_config.basic_skill_check == 0 || pc_checkskill(sd,NV_BASIC) >= 7){
|
||||
party_create(sd, RFIFOP(fd,2));
|
||||
party_create(sd,(char*)RFIFOP(fd,2));
|
||||
} else
|
||||
clif_skill_fail(sd,1,0,4);
|
||||
}
|
||||
@ -9640,7 +9641,7 @@ void clif_parse_LeaveParty(int fd, struct map_session_data *sd) {
|
||||
*------------------------------------------
|
||||
*/
|
||||
void clif_parse_RemovePartyMember(int fd, struct map_session_data *sd) {
|
||||
party_removemember(sd,RFIFOL(fd,2),RFIFOP(fd,6));
|
||||
party_removemember(sd,RFIFOL(fd,2),(char*)RFIFOP(fd,6));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9657,16 +9658,16 @@ void clif_parse_PartyChangeOption(int fd, struct map_session_data *sd) {
|
||||
*/
|
||||
void clif_parse_PartyMessage(int fd, struct map_session_data *sd) {
|
||||
nullpo_retv(sd);
|
||||
if (is_charcommand(fd, sd, RFIFOP(fd,4), 0) != CharCommand_None)
|
||||
if (is_charcommand(fd, sd, (char*)RFIFOP(fd,4), 0) != CharCommand_None)
|
||||
return;
|
||||
if (is_atcommand(fd, sd, RFIFOP(fd,4), 0) != AtCommand_None)
|
||||
if (is_atcommand(fd, sd, (char*)RFIFOP(fd,4), 0) != AtCommand_None)
|
||||
return;
|
||||
if(sd->sc_data &&
|
||||
(sd->sc_data[SC_BERSERK].timer!=-1 || //バーサーク時は会話も不可
|
||||
sd->sc_data[SC_NOCHAT].timer!=-1)) //チャット禁止
|
||||
return;
|
||||
|
||||
party_send_message(sd, RFIFOP(fd,4), RFIFOW(fd,2)-4);
|
||||
party_send_message(sd, (char*)RFIFOP(fd,4), RFIFOW(fd,2)-4);
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9702,7 +9703,7 @@ void clif_parse_PurchaseReq(int fd, struct map_session_data *sd) {
|
||||
*------------------------------------------
|
||||
*/
|
||||
void clif_parse_OpenVending(int fd,struct map_session_data *sd) {
|
||||
vending_openvending(sd, RFIFOW(fd,2), RFIFOP(fd,4), RFIFOB(fd,84), RFIFOP(fd,85));
|
||||
vending_openvending(sd, RFIFOW(fd,2), (char*)RFIFOP(fd,4), RFIFOB(fd,84), RFIFOP(fd,85));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9735,7 +9736,7 @@ void clif_parse_GM_Monster_Item(int fd, struct map_session_data *sd) {
|
||||
*------------------------------------------
|
||||
*/
|
||||
void clif_parse_CreateGuild(int fd,struct map_session_data *sd) {
|
||||
guild_create(sd, RFIFOP(fd,6));
|
||||
guild_create(sd, (char*)RFIFOP(fd,6));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9785,7 +9786,7 @@ void clif_parse_GuildChangePositionInfo(int fd, struct map_session_data *sd) {
|
||||
int i;
|
||||
|
||||
for(i = 4; i < RFIFOW(fd,2); i += 40 ){
|
||||
guild_change_position(sd, RFIFOL(fd,i), RFIFOL(fd,i+4), RFIFOL(fd,i+12), RFIFOP(fd,i+16));
|
||||
guild_change_position(sd, RFIFOL(fd,i), RFIFOL(fd,i+4), RFIFOL(fd,i+12), (char*)RFIFOP(fd,i+16));
|
||||
}
|
||||
}
|
||||
|
||||
@ -9819,7 +9820,7 @@ void clif_parse_GuildRequestEmblem(int fd,struct map_session_data *sd) {
|
||||
*------------------------------------------
|
||||
*/
|
||||
void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd) {
|
||||
guild_change_emblem(sd,RFIFOW(fd,2)-4,RFIFOP(fd,4));
|
||||
guild_change_emblem(sd,RFIFOW(fd,2)-4,(char*)RFIFOP(fd,4));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9827,7 +9828,7 @@ void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd) {
|
||||
*------------------------------------------
|
||||
*/
|
||||
void clif_parse_GuildChangeNotice(int fd,struct map_session_data *sd) {
|
||||
guild_change_notice(sd,RFIFOL(fd,2),RFIFOP(fd,6),RFIFOP(fd,66));
|
||||
guild_change_notice(sd,RFIFOL(fd,2),(char*)RFIFOP(fd,6),(char*)RFIFOP(fd,66));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9851,7 +9852,7 @@ void clif_parse_GuildReplyInvite(int fd,struct map_session_data *sd) {
|
||||
*------------------------------------------
|
||||
*/
|
||||
void clif_parse_GuildLeave(int fd,struct map_session_data *sd) {
|
||||
guild_leave(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOP(fd,14));
|
||||
guild_leave(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9859,7 +9860,7 @@ void clif_parse_GuildLeave(int fd,struct map_session_data *sd) {
|
||||
*------------------------------------------
|
||||
*/
|
||||
void clif_parse_GuildExplusion(int fd,struct map_session_data *sd) {
|
||||
guild_explusion(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOP(fd,14));
|
||||
guild_explusion(sd,RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),(char*)RFIFOP(fd,14));
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9868,16 +9869,16 @@ void clif_parse_GuildExplusion(int fd,struct map_session_data *sd) {
|
||||
*/
|
||||
void clif_parse_GuildMessage(int fd,struct map_session_data *sd) {
|
||||
nullpo_retv(sd);
|
||||
if (is_charcommand(fd, sd, RFIFOP(fd, 4), 0) != CharCommand_None)
|
||||
if (is_charcommand(fd, sd, (char*)RFIFOP(fd, 4), 0) != CharCommand_None)
|
||||
return;
|
||||
if (is_atcommand(fd, sd, RFIFOP(fd, 4), 0) != AtCommand_None)
|
||||
if (is_atcommand(fd, sd, (char*)RFIFOP(fd, 4), 0) != AtCommand_None)
|
||||
return;
|
||||
if(sd->sc_data &&
|
||||
(sd->sc_data[SC_BERSERK].timer!=-1 || //バーサーク時は会話も不可
|
||||
sd->sc_data[SC_NOCHAT].timer!=-1)) //チャット禁止
|
||||
return;
|
||||
|
||||
guild_send_message(sd, RFIFOP(fd,4), RFIFOW(fd,2)-4);
|
||||
guild_send_message(sd, (char*)RFIFOP(fd,4), RFIFOW(fd,2)-4);
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -9917,7 +9918,7 @@ void clif_parse_GuildOpposition(int fd, struct map_session_data *sd) {
|
||||
*------------------------------------------
|
||||
*/
|
||||
void clif_parse_GuildBreak(int fd, struct map_session_data *sd) {
|
||||
guild_break(sd,RFIFOP(fd,2));
|
||||
guild_break(sd,(char*)RFIFOP(fd,2));
|
||||
}
|
||||
|
||||
// pet
|
||||
@ -9941,7 +9942,7 @@ void clif_parse_SendEmotion(int fd, struct map_session_data *sd) {
|
||||
}
|
||||
|
||||
void clif_parse_ChangePetName(int fd, struct map_session_data *sd) {
|
||||
pet_change_name(sd,RFIFOP(fd,2));
|
||||
pet_change_name(sd,(char*)RFIFOP(fd,2));
|
||||
}
|
||||
|
||||
// Kick (right click menu for GM "(name) force to quit")
|
||||
@ -10081,7 +10082,7 @@ void clif_parse_GMReqNoChatCount(int fd, struct map_session_data *sd)
|
||||
|
||||
WFIFOW(fd,0) = 0x1e0;
|
||||
WFIFOL(fd,2) = tid;
|
||||
sprintf(WFIFOP(fd,6),"%d",tid);
|
||||
sprintf((char*)WFIFOP(fd,6),"%d",tid);
|
||||
// memcpy(WFIFOP(fd,6), "TESTNAME", 24);
|
||||
WFIFOSET(fd, packet_len_table[0x1e0]);
|
||||
|
||||
@ -10095,7 +10096,7 @@ void clif_parse_PMIgnore(int fd, struct map_session_data *sd) { // Rewritten by
|
||||
|
||||
memset(output, '\0', sizeof(output));
|
||||
|
||||
nick = RFIFOP(fd,2); // speed up
|
||||
nick = (char*)RFIFOP(fd,2); // speed up
|
||||
RFIFOB(fd,25) = '\0'; // to be sure that the player name have at maximum 23 characters
|
||||
//printf("Ignore: char '%s' state: %d\n", nick, RFIFOB(fd,26));
|
||||
|
||||
@ -10216,7 +10217,7 @@ void clif_parse_skillMessage(int fd, struct map_session_data *sd) { // Added by
|
||||
y = RFIFOB(fd,6);
|
||||
x = RFIFOB(fd,8);
|
||||
|
||||
mes = RFIFOP(fd,10);
|
||||
mes = (char*)RFIFOP(fd,10);
|
||||
|
||||
// skill 220 = graffiti
|
||||
// printf("skill: %d %d location: %3d %3d message: %s\n", skillid, skilllv, x, y, (char*)mes);
|
||||
@ -10292,7 +10293,7 @@ void clif_parse_friends_list_add(int fd, struct map_session_data *sd) {
|
||||
struct map_session_data *f_sd;
|
||||
int i;
|
||||
|
||||
f_sd = map_nick2sd(RFIFOP(fd,2));
|
||||
f_sd = map_nick2sd((char*)RFIFOP(fd,2));
|
||||
|
||||
// Friend doesn't exist (no player with this name)
|
||||
if (f_sd == NULL) {
|
||||
@ -10504,7 +10505,7 @@ static int clif_parse(int fd) {
|
||||
int packet_len = 0, cmd, packet_ver;
|
||||
struct map_session_data *sd;
|
||||
|
||||
sd = session[fd]->session_data;
|
||||
sd = (struct map_session_data*)session[fd]->session_data;
|
||||
|
||||
// 接続が切れてるので後始末
|
||||
if (!chrif_isconnect() || session[fd]->eof) { // char鯖に繋がってない間は接続禁止 (!chrif_isconnect())
|
||||
|
Loading…
x
Reference in New Issue
Block a user