9#ifndef __NETWORK_NODE_H__
10#define __NETWORK_NODE_H__
13#include "EventKeyboard.h"
14#include "EventMouse.h"
15#include "EventNetwork.h"
21enum class MessageType {
101 unsigned int attr=0,
int sock_index=-1);
113 Mouse::Button button,
Vector mouse_position,
119 int sendMessage(MessageType msg_type,
int num_bytes,
const void *bytes,
Definition: EventNetwork.h:24
Definition: NetworkNode.h:60
int prepMessageHeader(MessageType msg_type, int msg_size)
Prepare message buffer and header.
int sendMessage(MessageType msg_type, EventKeyboardAction action, Keyboard::Key key, int sock_index=-1)
Send message from Client to Server.
virtual int handleConnect(const EventNetwork *p_e)
Handle connect network event (base class does nothing).
int sendMessage(MessageType msg_type, Object *p_obj, unsigned int attr=0, int sock_index=-1)
Send message from Server to Client.
virtual int handleData(const EventNetwork *p_e)
Handle data network event using data in m_p_buff.
int sendMessage(MessageType msg_type, int num_bytes, const void *bytes, int sock_index=-1)
Send message from Client to Server.
virtual int handleAccept(const EventNetwork *p_e)
Handle accept network event (base class does nothing).
virtual int handleClose(const EventNetwork *p_e)
Handle closed socket (base class does nothing).
int sendMessage(MessageType msg_type, EventMouseAction action, Mouse::Button button, Vector mouse_position, int sock_index=-1)
Send message from Client to Server.
int sendMessage(MessageType msg_type, int sock_index=-1)
Send message (supporting various message types).
virtual Object * createObject(std::string object_type)
Create Object of given type.
int sizeBuffer(int msg_size)
Increase size of network message buffer (if needed).
virtual int eventHandler(const Event *p_e) override
Handle network event.
Key
Keys Dragonfly recognizes.
Definition: EventKeyboard.h:25
An animation for a sprite.
Definition: Animation.h:15
EventKeyboardAction
Types of keyboard actions Dragonfly recognizes.
Definition: EventKeyboard.h:15
EventMouseAction
Set of mouse actions recognized by Dragonfly.
Definition: EventMouse.h:16