diff options
author | shennetsind <ind@henn.et> | 2013-06-28 18:45:38 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-06-28 18:45:38 -0300 |
commit | 918b1123963ac2f91a4d074b092ceef1db71b4e8 (patch) | |
tree | 15eda3833d2fab779b02ef22573c21812b1c3aec /src/map/clif.c | |
parent | 203e44e51c8cb133bf3fb20b372d16ea92be7667 (diff) | |
download | hercules-918b1123963ac2f91a4d074b092ceef1db71b4e8.tar.gz hercules-918b1123963ac2f91a4d074b092ceef1db71b4e8.tar.bz2 hercules-918b1123963ac2f91a4d074b092ceef1db71b4e8.tar.xz hercules-918b1123963ac2f91a4d074b092ceef1db71b4e8.zip |
BG Queue Testing
http://hercules.ws/board/topic/1302-bg-queue-debug/
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index e5132a938..373d510ba 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -545,8 +545,24 @@ int clif_send(const void* buf, int len, struct block_list* bl, enum send_target } break; + case BG_QUEUE: + if( sd && sd->bg_queue.arena ) { + struct hQueue *queue = &script->hq[sd->bg_queue.arena->queue_id]; + + for( i = 0; i < queue->items; i++ ) { + struct map_session_data * sd = NULL; + + if( ( sd = iMap->id2sd(queue->item[i]) ) ) { + WFIFOHEAD(sd->fd,len); + memcpy(WFIFOP(sd->fd,0), buf, len); + WFIFOSET(sd->fd,len); + } + } + } + break; + default: - ShowError("clif->send: Unrecognized type %d\n",type); + ShowError("clif_send: Unrecognized type %d\n",type); return -1; } @@ -17317,7 +17333,6 @@ void clif_status_change_end(struct block_list *bl, int tid, enum send_target tar } void clif_bgqueue_ack(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK response, unsigned char arena_id) { - switch (response) { case BGQA_FAIL_COOLDOWN: case BGQA_FAIL_DESERTER: @@ -17348,15 +17363,16 @@ void clif_bgqueue_notice_delete(struct map_session_data *sd, enum BATTLEGROUNDS_ } void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) { - struct packet_bgqueue_register *p = P2PTR(fd, bgqueue_registerType); + struct packet_bgqueue_register *p = P2PTR(fd); struct bg_arena *arena = NULL; - if( !bg->queue_on ) return; /* temp, until feature is complete */ if( !(arena = bg->name2arena(p->bg_name)) ) { clif->bgqueue_ack(sd,BGQA_FAIL_BGNAME_INVALID,0); return; } + //debug + safestrncpy(arena->name, p->bg_name, sizeof(arena->name)); switch( (enum bg_queue_types)p->type ) { case BGQT_INDIVIDUAL: @@ -17387,7 +17403,6 @@ void clif_parse_bgqueue_checkstate(int fd, struct map_session_data *sd) { //struct packet_bgqueue_checkstate *p = P2PTR(fd, bgqueue_checkstateType); /* TODO: bgqueue_notice_delete should use this p->bg_name */ if( !bg->queue_on ) return; /* temp, until feature is complete */ if ( sd->bg_queue.arena && sd->bg_queue.type ) { - sd->bg_queue.client_has_bg_data = true; clif->bgqueue_update_info(sd,sd->bg_queue.arena->id,bg->id2pos(sd->bg_queue.arena->queue_id,sd->status.account_id)); } else clif->bgqueue_notice_delete(sd, BGQND_FAIL_NOT_QUEUING,0);/* TODO: wrong response, should respond with p->bg_name not id 0 */ @@ -17400,10 +17415,10 @@ void clif_parse_bgqueue_revoke_req(int fd, struct map_session_data *sd) { } void clif_parse_bgqueue_battlebegin_ack(int fd, struct map_session_data *sd) { - struct packet_bgqueue_battlebegin_ack *p = P2PTR(fd, bgqueue_checkstateType); + struct packet_bgqueue_battlebegin_ack *p = P2PTR(fd); struct bg_arena *arena; if( !bg->queue_on ) return; /* temp, until feature is complete */ - if( ( arena = bg->name2arena(p->bg_name) ) ) { + if( ( arena = bg->name2arena(p->bg_name) ) ) { bg->queue_ready_ack(arena,sd, ( p->result == 1 ) ? true : false); } else { clif->bgqueue_ack(sd,BGQA_FAIL_BGNAME_INVALID, 0); |