Jump to content

Autotrade Persistence & Live Vendor Data


Euphy

Recommended Posts


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  1096
  • Reputation:   344
  • Joined:  02/26/12
  • Last Seen:  

@Cydh

 

I have idea for look & feel perfect when create shop

			// Make him look perfect
			unit_setdir(&sd->bl,battle_config.feature_autotrade_direction);

			if( battle_config.feature_autotrade_sit )
				pc_setsit(sd);

i think allter table "action" store value for this (&dir, &head_dir, &sit)

	if (dir || head_dir)
	{
		pc_setdir(sd, dir, head_dir);
		clif_changed_dir(&sd->bl, AREA);
	}

	if( battle_config.feature_autotrade_sit )
		pc_setsit(sd);

use function input value

sprintf(value, "%d,%d,%d", sd->ud.dir, sd->head_dir, pc_issit(sd));
sscanf(sd->autotrade.action, "%d,%d,%d", &dir, &head_dir, &sit); 

I Suggest it  thank you sir

 

@Cydh

 

I Suggest for gm command when very need remove player with autotrade

 

or click right gm menu

 

void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd)
{
	int fd = tsd->fd;

	if( fd > 0 )
		clif_authfail_fd(fd, 15);
	else {
		if( tsd->state.vending && tsd->state.autotrade ){
			if( Sql_Query( mmysql_handle, "UPDATE `%s` SET `autotrade` = 0 WHERE `id` = %d;", vendings_db, tsd->vender_id ) != SQL_SUCCESS ){
				Sql_ShowDebug( mmysql_handle );
			}
		}else if( tsd->state.buyingstore && tsd->state.autotrade ){
			if( Sql_Query( mmysql_handle, "UPDATE `%s` SET `autotrade` = 0 WHERE `id` = %d;", buyingstore_db, tsd->buyer_id ) != SQL_SUCCESS ){
				Sql_ShowDebug( mmysql_handle );
			}
		}
		map_quit(tsd);
	}

	if( sd )
		clif_GM_kickack(sd,tsd->status.account_id);
}

thank you

 

You are awesome!:):P

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

@Stingor, Napster, there 7fd6776

 

also import this sql-files/upgrades/upgrade_20140723.sql

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  196
  • Reputation:   72
  • Joined:  12/12/11
  • Last Seen:  

thank you for update @Cydh

i report this some problem

1. when restart server and use autotrade config around 15 sec, and player with autotrade state & sitting

#define pc_setsit(sd)         ( (sd)->state.dead_sit = (sd)->vd.dead_sit = 2 )

but set state only, i think add to this , bcz real player login before player with autotrade not update display sitting

			if( autotraders[i]->sit ) {
				skill_sit(sd, 1);
				pc_setsit(sd);
				clif_sitting(&sd->bl);
			}

2. issues autotrade delay , i think can't protect over load from SQL

maybe add delay login to server for player with autotrade config

 

ex. if autotrader data upto 100 user when restart ,100 user come together

 

thank you again

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   1
  • Joined:  03/02/12
  • Last Seen:  

Thanks @Cydh

Edited by Stingor
Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Developer
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  2285
  • Reputation:   745
  • Joined:  06/16/12
  • Last Seen:  

thank you for update @Cydh

i report this some problem

1. when restart server and use autotrade config around 15 sec, and player with autotrade state & sitting

#define pc_setsit(sd)         ( (sd)->state.dead_sit = (sd)->vd.dead_sit = 2 )

but set state only, i think add to this , bcz real player login before player with autotrade not update display sitting

			if( autotraders[i]->sit ) {
				skill_sit(sd, 1);
				pc_setsit(sd);
				clif_sitting(&sd->bl);
			}

Thank you, here 8a81940 but only the sit issue.

 

For the delay, if u want to make like a queue, you can make something like, add in pc.h:map_session_data, unsigned int autotrade_delay.

and when init the autotrader, before the pc_setnew() line there, you can put the at->sd->autotrade_delay = i*500; (the delay will be 0.5 sec for each autotrader)

and change the tick add add_timer in the pc_reg_received() to gettick()+sd->autotrade_delay.

yes, u can make something like that first. :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   7
  • Joined:  03/16/12
  • Last Seen:  

[SQL]: DB error - Unknown column 'body_direction' in 'field list'
[Debug]: at buyingstore.c:667 - SELECT `id`, `account_id`, `char_id`, `sex`, `ti                                                                              tle`, `limit`, `body_direction`, `head_direction`, `sit` FROM `buyingstores` WHE                                                                              RE `autotrade` = 1 AND `limit` > 0 AND (SELECT COUNT(`buyingstore_id`) FROM `buy                                                                              ingstore_items` WHERE `buyingstore_id` = `id`) > 0 ORDER BY `id`;
[SQL]: DB error - Unknown column 'body_direction' in 'field list'
[Debug]: at vending.c:581 - SELECT `id`, `account_id`, `char_id`, `sex`, `title`                                                                              , `body_direction`, `head_direction`, `sit` FROM `vendings` WHERE `autotrade` =                                                                               1 AND (SELECT COUNT(`vending_id`) FROM `vending_items` WHERE `vending_id` = `id`                                                                              ) > 0 ORDER BY `id`;

it is appearing here :/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...