10#ifndef __NETWORK_NODE_H__
11#define __NETWORK_NODE_H__
14#include "EventKeyboard.h"
15#include "EventMouse.h"
16#include "EventNetwork.h"
22enum class MessageType {
62std::string toString(MessageType message);
115 unsigned int attr=0,
int sock=-1);
127 Mouse::Button button,
Vector mouse_position,
133 int sendMessage(MessageType msg_type,
int num_bytes,
const void *bytes,
Definition: EventNetwork.h:28
Definition: NetworkNode.h:64
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=-1)
Send message from Client to Server.
int sendMessage(MessageType msg_type, EventMouseAction action, Mouse::Button button, Vector mouse_position, int sock=-1)
Send message from Client to Server.
virtual int handleData(const EventNetwork *p_e)
Handle and generate events based on type.
virtual int handleClose(const df::EventNetwork *p_e)
Handle Network CLOSE events.
virtual Object * createObject(std::string object_type)
Create (new) Object of given type.
int sendMessage(MessageType msg_type, int num_bytes, const void *bytes, int sock=-1)
Send message from either Client to Server or Server to Client.
int sizeBuffer(int msg_size)
Increase size of network message buffer (if needed).
int sendMessage(MessageType msg_type, int sock=-1)
Send message (supporting various message types).
virtual int eventHandler(const Event *p_e) override
Handle network and step events.
virtual int handleConnect(const df::EventNetwork *p_e)
Handle Network CONNECT events.
int sendMessage(MessageType msg_type, Object *p_obj, unsigned int attr=0, int sock=-1)
Send message from Server to Client.
virtual int handleAccept(const df::EventNetwork *p_e)
Handle Network ACCEPT events.
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