finish prototype of player handler updates

This commit is contained in:
Protryon 2019-04-25 09:38:53 -07:00
parent dcc1eb360b
commit bb80d45890
3 changed files with 491 additions and 445 deletions

View File

@ -49,6 +49,8 @@ struct inventory {
struct slot** slots;
size_t slot_count;
int window;
struct mempool* drag_pool;
struct llist* drag_slot;
struct hashmap* watching_players;
struct tile_entity* tile;
pthread_mutex_t mutex;

View File

@ -31,6 +31,9 @@ struct inventory* inventory_new(struct mempool* pool, int type, int id, size_t s
inv->type = type;
inv->window = id;
inv->watching_players = hashmap_thread_new(8, inv->pool);
inv->drag_pool = mempool_new();
pchild(inv->pool, inv->drag_pool);
inv->drag_slot = llist_new(inv->drag_pool);
pthread_mutex_init(&inv->mutex, NULL);
phook(inv->pool, (void (*)(void*)) pthread_mutex_destroy, &inv->mutex);
return inv;

File diff suppressed because it is too large Load Diff