46 lines
739 B
C++
46 lines
739 B
C++
/*
|
|
ZNetEvent.hpp
|
|
Author: Patrick Baggett <ptbaggett@762studios.com>
|
|
Created: 6/5/2013
|
|
|
|
Purpose:
|
|
|
|
ZNet event structure
|
|
|
|
License:
|
|
|
|
Copyright 2013, 762 Studios
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#ifndef _ZNETEVENT_HPP
|
|
#define _ZNETEVENT_HPP
|
|
|
|
class ZNetPeer;
|
|
struct ZNetPacket;
|
|
|
|
enum ZNetEventType
|
|
{
|
|
ZNETEVENT_NONE, //No event
|
|
ZNETEVENT_CONNECT, //A new incoming connection was made
|
|
ZNETEVENT_DISCONNECT, //A graceful disconnection occurred
|
|
ZNETEVENT_TIMEOUT, //A timeout occurred
|
|
ZNETEVENT_DATA //Data was received
|
|
};
|
|
|
|
//Event when connected
|
|
struct ZNetEvent
|
|
{
|
|
ZNetPeer* remote; //The remote host
|
|
ZNetPacket* packet; //The packet data
|
|
uint32_t userdata; //The user data (if applicable)
|
|
ZNetEventType type; //The type
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|