Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions
cube_network.hpp File Reference
#include <enet/enet.h>
#include <stdarg.h>
#include <stddef.h>
#include <algorithm>
#include "inexor/network/legacy/buffer_types.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_vector.hpp"

Go to the source code of this file.

Classes

struct  ipmask
 structure to describe IPs More...
 

Macros

#define MAXCLIENTS   128
 
#define MAXTRANS   5000
 
#define DMF   16.0f
 network quantization scale More...
 
#define DNF   100.0f
 
#define DVELF   1.0f
 

Functions

void putint (ucharbuf &p, int n)
 
void putint (packetbuf &p, int n)
 
void putint (vector< uchar > &p, int n)
 
int getint (ucharbuf &p)
 
void putuint (ucharbuf &p, int n)
 
void putuint (packetbuf &p, int n)
 
void putuint (vector< uchar > &p, int n)
 
int getuint (ucharbuf &p)
 
void putfloat (ucharbuf &p, float f)
 
void putfloat (packetbuf &p, float f)
 
void putfloat (vector< uchar > &p, float f)
 
float getfloat (ucharbuf &p)
 
void sendstring (const char *t, ucharbuf &p)
 
void sendstring (const char *t, packetbuf &p)
 
void sendstring (const char *t, vector< uchar > &p)
 
void getstring (char *t, ucharbuf &p, size_t len)
 
template<size_t N>
static void getstring (char(&t)[N], ucharbuf &p)
 
void filtertext (char *dst, const char *src, bool whitespace, bool forcespace, size_t len)
 
template<size_t N>
static void filtertext (char(&dst)[N], const char *src, bool whitespace=true, bool forcespace=false)
 
ENetPacket * make_file_packet (stream *file, const char *format, va_list args)
 Puts a file into a ENet packet. More...
 

Macro Definition Documentation

#define DMF   16.0f
#define DNF   100.0f
#define DVELF   1.0f
#define MAXCLIENTS   128
#define MAXTRANS   5000

Function Documentation

void filtertext ( char *  dst,
const char *  src,
bool  whitespace,
bool  forcespace,
size_t  len 
)
template<size_t N>
static void filtertext ( char(&)  dst[N],
const char *  src,
bool  whitespace = true,
bool  forcespace = false 
)
inlinestatic

References filtertext().

float getfloat ( ucharbuf p)
int getint ( ucharbuf p)
void getstring ( char *  t,
ucharbuf p,
size_t  len 
)
template<size_t N>
static void getstring ( char(&)  t[N],
ucharbuf p 
)
inlinestatic
int getuint ( ucharbuf p)
ENetPacket* make_file_packet ( stream file,
const char *  format,
va_list  args 
)

Puts a file into a ENet packet.

args is just a forward of "...", see C argument forwarding.

args is just a forward of "...", meaning this function should be used like

References databuf< T >::buf, packetbuf::finalize(), loopi(), MAXTRANS, inexor::rpc::min(), putint(), stream::read(), stream::seek(), sendstring(), stream::size(), and packetbuf::subbuf().

Referenced by send_file(), and sendfile().

void putfloat ( ucharbuf p,
float  f 
)

References putfloat_().

Referenced by game::addmsg(), packvslot(), and sendf().

void putfloat ( packetbuf p,
float  f 
)

References putfloat_().

void putfloat ( vector< uchar > &  p,
float  f 
)

References putfloat_().

void putint ( ucharbuf p,
int  n 
)
void putint ( packetbuf p,
int  n 
)

References putint_().

void putint ( vector< uchar > &  p,
int  n 
)

References putint_().

void putuint ( ucharbuf p,
int  n 
)
void putuint ( packetbuf p,
int  n 
)

References putuint_().

void putuint ( vector< uchar > &  p,
int  n 
)

References putuint_().

void sendstring ( const char *  t,
ucharbuf p 
)
void sendstring ( const char *  t,
packetbuf p 
)

References sendstring_().

void sendstring ( const char *  t,
vector< uchar > &  p 
)

References sendstring_().