From 646f7e2f4ea4bd6b07e66d2949817ebdc18f3484 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 10 Oct 2013 18:59:10 -0300 Subject: Added code to disable auction for clients it is no longer stable Regarding http://hercules.ws/board/topic/414-auction-feature-all-screwed-up Signed-off-by: shennetsind --- conf/battle/feature.conf | 6 +++++- conf/messages.conf | 3 +++ src/map/atcommand.c | 8 ++++++-- src/map/battle.c | 10 ++++++++++ src/map/battle.h | 1 + src/map/clif.c | 16 ++++++++++++++++ 6 files changed, 41 insertions(+), 3 deletions(-) diff --git a/conf/battle/feature.conf b/conf/battle/feature.conf index 2f60f1fff..352163c8e 100644 --- a/conf/battle/feature.conf +++ b/conf/battle/feature.conf @@ -21,4 +21,8 @@ feature.atcommand_suggestions: off // Banking (Note 1) // Requires: 2013-07-24aRagexe or later -feature.banking: on \ No newline at end of file +feature.banking: on + +// Auction (Note 1) +// Feature became unstable on clients 2012 onwards (exact date not known) +feature.auction: off \ No newline at end of file diff --git a/conf/messages.conf b/conf/messages.conf index 4b0549bf6..4a08c0893 100644 --- a/conf/messages.conf +++ b/conf/messages.conf @@ -1523,5 +1523,8 @@ 1482: You can't withdraw that much money 1483: Banking is disabled +//src/map/atcommand.c::ACMD(auction) +1484: Auction is disabled + //Custom translations import: conf/import/msg_conf.txt diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 4933256a2..10c96e317 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7956,10 +7956,14 @@ ACMD(feelreset) /*========================================== * AUCTION SYSTEM *------------------------------------------*/ -ACMD(auction) -{ +ACMD(auction) { nullpo_ret(sd); + if( !battle_config.feature_auction ) { + clif->colormes(sd->fd,COLOR_RED,msg_txt(1484)); + return false; + } + clif->auction_openwindow(sd); return true; diff --git a/src/map/battle.c b/src/map/battle.c index a0e4e7ebc..91cb98d14 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6475,6 +6475,8 @@ static const struct _battle_data { { "snovice_call_type", &battle_config.snovice_call_type, 0, 0, 1, }, { "guild_notice_changemap", &battle_config.guild_notice_changemap, 2, 0, 2, }, { "feature.banking", &battle_config.feature_banking, 1, 0, 1, }, + { "feature.auction", &battle_config.feature_auction, 0, 0, 2, }, + }; #ifndef STATS_OPT_OUT @@ -6705,6 +6707,14 @@ void battle_adjust_conf(void) { } #endif +#if PACKETVER > 20120000 /* exact date not known */ + if( battle_config.feature_auction == 1 ) { + ShowWarning("conf/battle/feature.conf:feature.auction is enabled but it is not stable on PACKETVER "EXPAND_AND_QUOTE(PACKETVER)", disabling...\n"); + ShowWarning("conf/battle/feature.conf:feature.auction change value to '2' to silence this warning and maintain it enabled\n"); + battle_config.feature_auction = 0; + } +#endif + #ifndef CELL_NOSTACK if (battle_config.cell_stack_limit != 1) diff --git a/src/map/battle.h b/src/map/battle.h index f1fa6ddc1..533fa40b0 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -462,6 +462,7 @@ struct Battle_Config { int guild_notice_changemap; int feature_banking; + int feature_auction; } battle_config; // Dammage delayed info diff --git a/src/map/clif.c b/src/map/clif.c index 0c21c796c..d1f416146 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -14988,6 +14988,9 @@ void clif_Auction_openwindow(struct map_session_data *sd) if( sd->state.storage_flag || sd->state.vending || sd->state.buyingstore || sd->state.trading ) return; + if( !battle_config.feature_auction ) + return; + WFIFOHEAD(fd,packet_len(0x25f)); WFIFOW(fd,0) = 0x25f; WFIFOL(fd,2) = 0; @@ -15077,6 +15080,9 @@ void clif_parse_Auction_setitem(int fd, struct map_session_data *sd) int amount = RFIFOL(fd,4); // Always 1 struct item_data *item; + if( !battle_config.feature_auction ) + return; + if( sd->auction.amount > 0 ) sd->auction.amount = 0; @@ -15152,6 +15158,9 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd) struct auction_data auction; struct item_data *item; + if( !battle_config.feature_auction ) + return; + auction.price = RFIFOL(fd,2); auction.buynow = RFIFOL(fd,6); auction.hours = RFIFOW(fd,10); @@ -15283,6 +15292,9 @@ void clif_parse_Auction_search(int fd, struct map_session_data* sd) short type = RFIFOW(fd,2), page = RFIFOW(fd,32); int price = RFIFOL(fd,4); // FIXME: bug #5071 + if( !battle_config.feature_auction ) + return; + clif->pAuction_cancelreg(fd, sd); safestrncpy(search_text, (char*)RFIFOP(fd,8), sizeof(search_text)); @@ -15298,6 +15310,10 @@ void clif_parse_Auction_search(int fd, struct map_session_data* sd) void clif_parse_Auction_buysell(int fd, struct map_session_data* sd) { short type = RFIFOW(fd,2) + 6; + + if( !battle_config.feature_auction ) + return; + clif->pAuction_cancelreg(fd, sd); intif->Auction_requestlist(sd->status.char_id, type, 0, "", 1); -- cgit v1.2.3-60-g2f50