#include <global.h>Go to the source code of this file.
Functions | |
| static void | player_shop_send_items (player *pl, player *seller) |
| static void | player_shop_close_interface (player *pl) |
| static void | player_shop_free_structure (player *pl, int send_close) |
| static int | shop_player_in_range (object *op, object *seller) |
| void | player_shop_open (char *data, player *pl) |
| void | player_shop_close (player *pl) |
| void | player_shop_load (char *data, player *pl) |
| void | player_shop_examine (char *data, player *pl) |
| void | player_shop_buy (char *data, player *pl) |
Controls player shop related functions.
Definition in file player_shop.c.
| void player_shop_buy | ( | char * | data, | |
| player * | pl | |||
| ) |
Buy a player shop item.
| data | The data buffer. Includes seller's name, the object's tag ID we're buying, and the nrof of objects to buy. | |
| pl | The player buying the item |
Definition at line 485 of file player_shop.c.
| void player_shop_close | ( | player * | pl | ) |
Close a player shop. If the player has shop items (is selling), free them, but do not send close command to the client, as the client should take care of that.
| pl | The player to close the shop for |
Definition at line 366 of file player_shop.c.
| static void player_shop_close_interface | ( | player * | pl | ) | [static] |
Send a player shop socket command to the player's client to close a shop interface.
| pl | The player to send the command to |
Definition at line 175 of file player_shop.c.
| void player_shop_examine | ( | char * | data, | |
| player * | pl | |||
| ) |
Examine a player shop item.
| data | The data buffer sent from the client. Contains the seller name and the object's tag ID. | |
| pl | The player examining the item |
Definition at line 423 of file player_shop.c.
| static void player_shop_free_structure | ( | player * | pl, | |
| int | send_close | |||
| ) | [static] |
Free a shop structure from player.
| pl | The player | |
| send_close | If nonzero, send a close command to the client. |
Definition at line 188 of file player_shop.c.
| void player_shop_load | ( | char * | data, | |
| player * | pl | |||
| ) |
Load a player shop of other player.
| data | The player name of the shop owner to open | |
| pl | The player to load the shop for |
Definition at line 383 of file player_shop.c.
| void player_shop_open | ( | char * | data, | |
| player * | pl | |||
| ) |
Open a player shop.
The data passed includes the items, ie, their tags, nrof, price, etc.
Format:
item_tag:nrof:price|item_tag:nrof:price|...
Example:
25984:10:10000|28549:1:20200|27859:3:10010
| data | Data, with the shop items in it separated by | characters. | |
| pl | The player opening the shop |
Definition at line 250 of file player_shop.c.
Loop through seller's items on sale, and send the item tags to buyer's shop inventory so they can be displayed and animated properly.
Will also send all the data about the shop items to the buyer.
| pl | The player to send the items to | |
| seller | The selling player |
Definition at line 44 of file player_shop.c.
Check if player that wants to buy from someones player shop is in range to actually initiate the shop interface.
Uses get_rangevector() to calculate the distance.
| op | Pointer to the buying player's object | |
| seller | Pointer to the selling player's object |
Definition at line 225 of file player_shop.c.
1.7.1