Sanasol 27 Posted April 24, 2014 few updates https://github.com/S-anasol/sanasol/tree/master/merchant_db_hercules_flux Quote Share this post Link to post Share on other sites
Hadeszeus 15 Posted April 24, 2014 Today we found critical issue, please update asap your code. https://github.com/S-anasol/sanasol/commit/d3155a1287d5a876575df715c543ab1bfb97f106 thanks any news on the new structure? Sorry to interrupt but this makes me LOL. hahahaha Quote Share this post Link to post Share on other sites
Javanese 1 Posted May 13, 2014 hi,,, i got 'mmysql_handle' undeclared how to fix this master? thank you~ Quote Share this post Link to post Share on other sites
OverLord 4 Posted July 15, 2014 It is compatible with rAthena or just the Hercules? Quote Share this post Link to post Share on other sites
Sanasol 27 Posted July 15, 2014 It is compatible with rAthena or just the Hercules? http://rathena.org/board/topic/86685-critical-updateweb-vending-database-standalone-and-fluxcp-addon/ Quote Share this post Link to post Share on other sites
thanna 11 Posted October 6, 2014 (edited) Hi mate, this work on my flux cp but the thing is it can only show the vender when on the auto trade, how can I make it to show even those who are not using auto trade? Edited October 6, 2014 by thanna Quote Share this post Link to post Share on other sites
xcethx 0 Posted August 24, 2015 Hi, sansol do you have a tutorial on Yommy's src? I tried to used your src but after compiling the server map_server doesnt work. thank you Quote Share this post Link to post Share on other sites
Sanasol 27 Posted August 24, 2015 Hi, sansol do you have a tutorial on Yommy's src? I tried to used your src but after compiling the server map_server doesnt work. thank you nope, i havent Quote Share this post Link to post Share on other sites
xcethx 0 Posted August 24, 2015 (edited) Hi, sansol do you have a tutorial on Yommy's src? I tried to used your src but after compiling the server map_server doesnt work. thank you nope, i havent anway thank you. I'm having problem with your src after editing unit.c and vending.c then compiling them. Map_server stop working, i followed your guide. and btw how do i apply the .patch. ? manually or using app? Edited August 24, 2015 by xcethx Quote Share this post Link to post Share on other sites
Sephus 203 Posted August 29, 2015 Brilliant addition, if it supported an item and character based vend history it would be like a private server ragial. Quote Share this post Link to post Share on other sites
deadzero 1 Posted December 28, 2015 My flux don't show the item images, someone knows what? Quote Share this post Link to post Share on other sites
Lavenblade 1 Posted March 3, 2016 What's the difference between yours and Yommy's version? Quote Share this post Link to post Share on other sites
Sanasol 27 Posted March 3, 2016 (edited) What's the difference between yours and Yommy's version? just different src. yommy's src plugin for herc my src for herc/rathena. and not as plugin better use yommy plugin(easier) and my addon for site it also support yommy's src Yommy src versions: Standalone or FluxCP Edited March 3, 2016 by Sanasol 2 Lavenblade and evilpuncker reacted to this Quote Share this post Link to post Share on other sites
Lavenblade 1 Posted March 4, 2016 (edited) Thank you very much for that information. EDIT: What's the difference between your add-on and Yommy's? xD Edited March 4, 2016 by Lavenblade Quote Share this post Link to post Share on other sites
Sanasol 27 Posted March 4, 2016 Thank you very much for that information. EDIT: What's the difference between your add-on and Yommy's? xD Yommy have addon for web site? I have no information about it. Quote Share this post Link to post Share on other sites
Lavenblade 1 Posted March 4, 2016 (edited) Thank you very much for that information. EDIT: What's the difference between your add-on and Yommy's? xD Yommy have addon for web site? I have no information about it. I thought that's what this is: I assumed you and Yommy both had your own source, standalone, and fluxcp plugin. Maybe I am just misunderstanding. =( EDIT: They all point to different repos on GitHub. Edited March 4, 2016 by Lavenblade Quote Share this post Link to post Share on other sites
Sanasol 27 Posted March 4, 2016 Thank you very much for that information. EDIT: What's the difference between your add-on and Yommy's? xD Yommy have addon for web site? I have no information about it. I thought that's what this is: I assumed you and Yommy both had your own source, standalone, and fluxcp plugin. Maybe I am just misunderstanding. =( EDIT: They all point to different repos on GitHub. yes, you get confused I have my variant of source code for server. And fluxcp addon which work with my sources. Yommy coded other variant of source, which work different but doing same function. Then i modified my fluxcp addon for compatibility with Yommy sources. So, yommy's src easier to install coz plugin. Thats why i strongly commend install it(yommy's plugin) and install my fluxcp addon(if you need it on site ofc) I hope now its clear, coz english not my native 1 Lavenblade reacted to this Quote Share this post Link to post Share on other sites
Lavenblade 1 Posted March 4, 2016 Yes, that makes sense I think. So your FlucCP Add-on works backwards compatible with your source patch and Yommy's plugin.Yommys FluxCP Add-on only works for her plugin, and not your source patch.So you recommend using your FluxCP Add-on just incase I decide to switch from plugin to patch since it's backwards compatible? Quote Share this post Link to post Share on other sites
Sanasol 27 Posted March 4, 2016 Yes, that makes sense I think. So your FlucCP Add-on works backwards compatible with your source patch and Yommy's plugin. Yommys FluxCP Add-on only works for her plugin, and not your source patch. So you recommend using your FluxCP Add-on just incase I decide to switch from plugin to patch since it's backwards compatible? no you wiil need get other addon version. Quote Share this post Link to post Share on other sites
Lavenblade 1 Posted March 4, 2016 I guess I just don't understand the differences between your Add-on and Yommy's. They have two different links on Github but seem to be the same. Quote Share this post Link to post Share on other sites
canditw 0 Posted April 19, 2016 (edited) How do I add the icons for the images? The one for Flux hercules or vending_he EDIT: Ignore this, I Found it. Edited April 19, 2016 by canditw Quote Share this post Link to post Share on other sites
joaolipinski 2 Posted October 7, 2016 excuse revive the topic but I am an error and could not solve ERROR vending.c: In function ‘vending_closevending’:vending.c:63: error: ‘SQL_ERROR’ undeclared (first use in this function) vending.c:63: error: (Each undeclared identifier is reported only once vending.c:63: error: for each function it appears in.) vending.c:63: error: ‘SQL’ undeclared (first use in this function) vending.c:64: warning: implicit declaration of function ‘Sql_ShowDebug’ vending.c:64: warning: nested extern declaration of ‘Sql_ShowDebug’ vending.c: In function ‘vending_purchasereq’: vending.c:205: error: too few arguments to function ‘clif->vendingreport’ vending.c:209: error: ‘SQL_ERROR’ undeclared (first use in this function) vending.c:209: error: ‘SQL’ undeclared (first use in this function) vending.c: In function ‘vending_openvending’: vending.c:336: error: ‘SQL_ERROR’ undeclared (first use in this function) vending.c:336: error: ‘SQL’ undeclared (first use in this function) I applied in this source diff --git a/src/map/unit.c b/src/map/unit.cindex 22c7165..9b0aa6a 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2135,6 +2135,9 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, chat->leavechat(sd,0); if(sd->trade_partner) trade->cancel(sd); + //vending to db [Sanasol] + vending->close(sd); + //vending to db [Sanasol] buyingstore->close(sd); searchstore->close(sd); if(sd->state.storage_flag == 1) diff --git a/src/map/vending.c b/src/map/vending.c index 2784d46..0f213a2 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -37,6 +37,10 @@ void vending_closevending(struct map_session_data* sd) { if( sd->state.vending ) { sd->state.vending = false; clif->closevendingboard(&sd->bl, 0); + //vending to db [Sanasol] + if( SQL_ERROR == SQL->Query(map->mysql_handle,"delete from `vending` where `char_id`='%d'", sd->status.char_id) ) + Sql_ShowDebug(map->mysql_handle); + //vending to db [Sanasol] idb_remove(vending->db, sd->status.char_id); } } @@ -174,7 +178,18 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, vsd->vending[vend_list[i]].amount -= amount; pc->cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING); clif->vendingreport(vsd, idx, amount); - + //vending to db [Sanasol] + if(vsd->vending[vend_list[i]].amount >= 1) + { + if( SQL_ERROR == SQL->Query(map->mysql_handle,"update `vending` set `amount`='%d' where `char_id`='%d' and `index`='%d'", vsd->vending[vend_list[i]].amount, vsd->status.char_id, vend_list[i]) ) + Sql_ShowDebug(map->mysql_handle); + } + else + { + if( SQL_ERROR == SQL->Query(map->mysql_handle,"delete from `vending` where `char_id`='%d' and `index`='%d'", vsd->status.char_id, vend_list[i]) ) + Sql_ShowDebug(map->mysql_handle); + } + //vending to db [Sanasol] //print buyer's name if( battle_config.buyer_name ) { char temp[256]; @@ -281,6 +296,19 @@ void vending_openvending(struct map_session_data* sd, const char* message, const safestrncpy(sd->message, message, MESSAGE_SIZE); clif->openvending(sd,sd->bl.id,sd->vending); + //vending to db [Sanasol] + for( j = 0; j < count; j++ ) + { + int index = sd->vending[j].index; + struct item_data* data = itemdb->search(sd->status.cart[index].nameid); + int nameid = ( data->view_id > 0 ) ? data->view_id : sd->status.cart[index].nameid; + int amount = sd->vending[j].amount; + int price = cap_value(sd->vending[j].value, 0, (unsigned int)battle_config.vending_max_value); + + if( SQL_ERROR == SQL->Query(map->mysql_handle,"INSERT INTO `vending` (`char_id`,`name`,`index`,`nameid`,`amount`,`price`,`refine`,`card0`,`card1`,`card2`,`card3`) VALUES (%d, '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", sd->status.char_id, message, j, nameid, amount, price, sd->status.cart[index].refine, sd->status.cart[index].card[0], sd->status.cart[index].card[1], sd->status.cart[index].card[2], sd->status.cart[index].card[3]) ) + Sql_ShowDebug(map->mysql_handle); + } + //vending to db [Sanasol] clif->showvendingboard(&sd->bl,message,0); idb_put(vending->db, sd->vender_id, sd); Quote Share this post Link to post Share on other sites
astralprojection 35 Posted December 28, 2016 excuse revive the topic but I am an error and could not solve ERROR vending.c: In function ‘vending_closevending’:vending.c:63: error: ‘SQL_ERROR’ undeclared (first use in this function) vending.c:63: error: (Each undeclared identifier is reported only once vending.c:63: error: for each function it appears in.) vending.c:63: error: ‘SQL’ undeclared (first use in this function) vending.c:64: warning: implicit declaration of function ‘Sql_ShowDebug’ vending.c:64: warning: nested extern declaration of ‘Sql_ShowDebug’ vending.c: In function ‘vending_purchasereq’: vending.c:205: error: too few arguments to function ‘clif->vendingreport’ vending.c:209: error: ‘SQL_ERROR’ undeclared (first use in this function) vending.c:209: error: ‘SQL’ undeclared (first use in this function) vending.c: In function ‘vending_openvending’: vending.c:336: error: ‘SQL_ERROR’ undeclared (first use in this function) vending.c:336: error: ‘SQL’ undeclared (first use in this function) I applied in this source diff --git a/src/map/unit.c b/src/map/unit.cindex 22c7165..9b0aa6a 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2135,6 +2135,9 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file, chat->leavechat(sd,0); if(sd->trade_partner) trade->cancel(sd); + //vending to db [Sanasol] + vending->close(sd); + //vending to db [Sanasol] buyingstore->close(sd); searchstore->close(sd); if(sd->state.storage_flag == 1) diff --git a/src/map/vending.c b/src/map/vending.c index 2784d46..0f213a2 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -37,6 +37,10 @@ void vending_closevending(struct map_session_data* sd) { if( sd->state.vending ) { sd->state.vending = false; clif->closevendingboard(&sd->bl, 0); + //vending to db [Sanasol] + if( SQL_ERROR == SQL->Query(map->mysql_handle,"delete from `vending` where `char_id`='%d'", sd->status.char_id) ) + Sql_ShowDebug(map->mysql_handle); + //vending to db [Sanasol] idb_remove(vending->db, sd->status.char_id); } } @@ -174,7 +178,18 @@ void vending_purchasereq(struct map_session_data* sd, int aid, unsigned int uid, vsd->vending[vend_list[i]].amount -= amount; pc->cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING); clif->vendingreport(vsd, idx, amount); - + //vending to db [Sanasol] + if(vsd->vending[vend_list[i]].amount >= 1) + { + if( SQL_ERROR == SQL->Query(map->mysql_handle,"update `vending` set `amount`='%d' where `char_id`='%d' and `index`='%d'", vsd->vending[vend_list[i]].amount, vsd->status.char_id, vend_list[i]) ) + Sql_ShowDebug(map->mysql_handle); + } + else + { + if( SQL_ERROR == SQL->Query(map->mysql_handle,"delete from `vending` where `char_id`='%d' and `index`='%d'", vsd->status.char_id, vend_list[i]) ) + Sql_ShowDebug(map->mysql_handle); + } + //vending to db [Sanasol] //print buyer's name if( battle_config.buyer_name ) { char temp[256]; @@ -281,6 +296,19 @@ void vending_openvending(struct map_session_data* sd, const char* message, const safestrncpy(sd->message, message, MESSAGE_SIZE); clif->openvending(sd,sd->bl.id,sd->vending); + //vending to db [Sanasol] + for( j = 0; j < count; j++ ) + { + int index = sd->vending[j].index; + struct item_data* data = itemdb->search(sd->status.cart[index].nameid); + int nameid = ( data->view_id > 0 ) ? data->view_id : sd->status.cart[index].nameid; + int amount = sd->vending[j].amount; + int price = cap_value(sd->vending[j].value, 0, (unsigned int)battle_config.vending_max_value); + + if( SQL_ERROR == SQL->Query(map->mysql_handle,"INSERT INTO `vending` (`char_id`,`name`,`index`,`nameid`,`amount`,`price`,`refine`,`card0`,`card1`,`card2`,`card3`) VALUES (%d, '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", sd->status.char_id, message, j, nameid, amount, price, sd->status.cart[index].refine, sd->status.cart[index].card[0], sd->status.cart[index].card[1], sd->status.cart[index].card[2], sd->status.cart[index].card[3]) ) + Sql_ShowDebug(map->mysql_handle); + } + //vending to db [Sanasol] clif->showvendingboard(&sd->bl,message,0); idb_put(vending->db, sd->vender_id, sd); add: #include "common/sql.h" Quote Share this post Link to post Share on other sites
DevLong 1 Posted December 28, 2016 I'm having the same error when compiling, I already added #include "common/sql.h" to vending.c Quote Share this post Link to post Share on other sites