diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/item.h | 6 | ||||
| -rw-r--r-- | include/proto.h | 18 | ||||
| -rw-r--r-- | include/widget_textfield.h | 2 |
3 files changed, 20 insertions, 6 deletions
diff --git a/include/item.h b/include/item.h index fdc6cd5..a3fa02c 100644 --- a/include/item.h +++ b/include/item.h @@ -12,6 +12,7 @@ typedef struct item_struct { + int id; int type; // typ veci int x; // poloha veci @@ -54,6 +55,7 @@ typedef struct item_struct extern bool_t isItemInicialized(); extern void initItem(); extern item_t* newItem(int x, int y, int type, tux_t *author); +extern item_t* getItemID(list_t *listItem, int id); extern void addNewItem(list_t *listItem, tux_t *author); #ifndef BUBLIC_SERVER extern void drawItem(item_t *p); @@ -62,7 +64,9 @@ extern void drawListItem(list_t *listItem); extern void eventListItem(list_t *listItem); extern void eventConflictShotWithItem(list_t *listItem, list_t *listShot); extern int isConflictWithListItem(list_t *listItem, int x, int y, int w, int h); -extern void eventGiveTuxItem(tux_t *tux, list_t *listItem); +extern void mineExplosion(list_t *listItem, item_t *item); +extern int eventGiveTuxItem(tux_t *tux, list_t *listItem, item_t *item); +extern void eventGiveTuxListItem(tux_t *tux, list_t *listItem); extern void destroyItem(item_t *p); extern void quitItem(); diff --git a/include/proto.h b/include/proto.h index f7422ec..aba3fda 100644 --- a/include/proto.h +++ b/include/proto.h @@ -9,10 +9,6 @@ #include "item.h" #include "shot.h" -#define PROTO_SEND_ONE 0 -#define PROTO_SEND_ALL 1 -#define PROTO_SEND_BUT 2 - #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -41,6 +37,18 @@ #include "publicServer.h" #endif +#define PROTO_SEND_ONE 0 +#define PROTO_SEND_ALL 1 +#define PROTO_SEND_BUT 2 + +#define PROTO_ERROR_CODE_UNKNOWN 0 +#define PROTO_ERROR_CODE_BAD_VERSION 1 +#define PROTO_ERROR_CODE_BAD_NAME 2 +#define PROTO_ERROR_CODE_BAD_COMMAND 3 +#define PROTO_ERROR_CODE_TIMEOUT 4 + +extern void proto_send_error_server(int type, client_t *client, int errorcode); +extern void proto_recv_error_client(char *msg); extern void proto_send_hello_client(char *name); extern void proto_recv_hello_server(client_t *client, char *msg); extern void proto_send_status_server(int type, client_t *client); @@ -61,6 +69,8 @@ extern void proto_send_deltux_server(int type, client_t *client, client_t *clien extern void proto_recv_deltux_client(char *msg); extern void proto_send_additem_server(int type, client_t *client, item_t *p); extern void proto_recv_additem_client(char *msg); +extern void proto_send_item_server(int type, client_t *client, tux_t *tux, item_t *item); +extern void proto_recv_item_client(char *msg); extern void proto_send_shot_server(int type, client_t *client, shot_t *p); extern void proto_recv_shot_client(char *msg); extern void proto_send_ping_client(); diff --git a/include/widget_textfield.h b/include/widget_textfield.h index 6f756b2..860eae4 100644 --- a/include/widget_textfield.h +++ b/include/widget_textfield.h @@ -10,7 +10,7 @@ #define WIDGET_TEXTFIELD_TEXT_OFFSET_X 10 -#define WIDGET_TEXTFIELD_TIME_READ_KEY 5 +#define WIDGET_TEXTFIELD_TIME_READ_KEY 2 #define WIDGET_TEXTFIELD_TIME_BLICK_CURSOR 20 typedef struct widget_textfield |