Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial release of the cash shop sales #1825

Merged
merged 14 commits into from Feb 15, 2017
Merged

Conversation

Lemongrass3110
Copy link
Member

@Lemongrass3110 Lemongrass3110 commented Dec 24, 2016

Fixes #1229

Merry christmas guys! :-)

@admkakaroto
Copy link
Contributor

@admkakaroto admkakaroto commented Dec 24, 2016

How to use this? '-'

@Atemo
Copy link
Contributor

@Atemo Atemo commented Dec 24, 2016

@admkakaroto
Copy link
Contributor

@admkakaroto admkakaroto commented Dec 24, 2016

@Atemo tnx!

@@ -143,6 +143,7 @@ mob_skill_db_re_db: mob_skill_db_re
mob_skill_db2_db: mob_skill_db2
//mob_skill_db2_db: mob_skill_db2_re
mapreg_table: mapreg
sales_tabe: sales
Copy link
Member

@secretdataz secretdataz Dec 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabe -> table

@anacondaq
Copy link

@anacondaq anacondaq commented Dec 24, 2016

best of the best =) Thank you a lot for release!

@Angelic234
Copy link

@Angelic234 Angelic234 commented Dec 25, 2016

Step 1: Set up an item to item_cash_db.txt (ex 8,512,99;)
2: start server
3: use SQL add step.1 item to sell
4. reloaditemdb
5. buy all Quantity of Step 3 item you set up
6. waitting for Endtime
7. Map Crash

Also fixes the bug mentioned by @Angelic234.
Thanks for reporting.
@Angelic234
Copy link

@Angelic234 Angelic234 commented Dec 26, 2016

Step 1: Set up an item to item_cash_db.txt (ex 8,512,99;)
2: start server
3: use SQL add step.1 item to sell
4. reloaditemdb
5. waitting for item sell
6. then reloaditemdb again
7. Map-server => [Error]: Memory manager: freed-data is changed.
8. reloaditemdb again
9. Map-server crash

@Angelic234
Copy link

@Angelic234 Angelic234 commented Dec 28, 2016

A question
We have a SQL table [price] , but never use it ?

@Lemongrass3110
Copy link
Member Author

@Lemongrass3110 Lemongrass3110 commented Dec 28, 2016

@Angelic234 removed the column just now. This one was a leftover from development. :-)

@Angelic234
Copy link

@Angelic234 Angelic234 commented Dec 28, 2016

  1. Set up multiples items to sell (ex. five items)
  2. Buy all Quantity of first item
  3. Logout and login
  4. Player only can see item of 3 4 5.
  5. reloaditemdb
  6. Player can see item of 2 3 4 5.

Lemongrass3110 and others added 2 commits Dec 28, 2016

if( SQL_ERROR == Sql_Query( mmysql_handle, "SELECT `nameid`, UNIX_TIMESTAMP(`start`), UNIX_TIMESTAMP(`end`), `amount` FROM `%s` WHERE `end` > now()", sales_table ) ){
Sql_ShowDebug(mmysql_handle);
return;
Copy link
Member

@lighta lighta Jan 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remenber but you don't need FreeResult ?? here

clif_sale_end( sale_item, NULL, ALL_CLIENT );

// Remove the timer so the sale end is not sent out again
delete_timer( sale_item->timer_end, sale_end_timer );
Copy link
Member

@lighta lighta Jan 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd delete the timer, before sending to all_client. It just look more secure. If you have tons of client or the broadcast is too slow you could have this rescheduled before the delete. (a strech I know but still)

@@ -236,6 +567,7 @@ bool cashshop_buylist( struct map_session_data* sd, uint32 kafrapoints, int n, u
for( i = 0; i < n; ++i ){
unsigned short nameid = *( item_list + i * 5 );
uint32 quantity = *( item_list + i * 5 + 2 );
uint16 tab = *(item_list + i * 5 + 4);
Copy link
Member

@lighta lighta Jan 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this be out of range for older client ?

Copy link
Member Author

@Lemongrass3110 Lemongrass3110 Jan 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it was always there to begin with(i * 5). Only mistake here is that I used uint16 instead of uint8

@Lemongrass3110 Lemongrass3110 merged commit aaa4ea9 into master Feb 15, 2017
4 checks passed
@Lemongrass3110 Lemongrass3110 deleted the feature/cashshop-sale branch Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants