Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
cube_network.cpp File Reference
#include <boost/algorithm/clamp.hpp>
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <enet/enet.h>
#include "inexor/io/legacy/stream.hpp"
#include "inexor/network/legacy/buffer_types.hpp"
#include "inexor/network/legacy/cube_network.hpp"
#include "inexor/shared/cube_endian.hpp"
#include "inexor/shared/cube_loops.hpp"
#include "inexor/shared/cube_unicode.hpp"
#include "inexor/shared/cube_vector.hpp"

Functions

template<class T >
static void putint_ (T &p, int n)
 
void putint (ucharbuf &p, int n)
 
void putint (packetbuf &p, int n)
 
void putint (vector< uchar > &p, int n)
 
int getint (ucharbuf &p)
 
template<class T >
static void putuint_ (T &p, int n)
 
void putuint (ucharbuf &p, int n)
 
void putuint (packetbuf &p, int n)
 
void putuint (vector< uchar > &p, int n)
 
int getuint (ucharbuf &p)
 
template<class T >
static void putfloat_ (T &p, float f)
 
void putfloat (ucharbuf &p, float f)
 
void putfloat (packetbuf &p, float f)
 
void putfloat (vector< uchar > &p, float f)
 
float getfloat (ucharbuf &p)
 
template<class T >
static void sendstring_ (const char *t, T &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 *text, ucharbuf &p, size_t len)
 
void filtertext (char *dst, const char *src, bool whitespace, bool forcespace, size_t len)
 
ENetPacket * make_file_packet (stream *file, const char *format, va_list args)
 Puts a file into a ENet packet. More...
 

Function Documentation

void filtertext ( char *  dst,
const char *  src,
bool  whitespace,
bool  forcespace,
size_t  len 
)
float getfloat ( ucharbuf p)
int getint ( ucharbuf p)
void getstring ( char *  text,
ucharbuf p,
size_t  len 
)
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 "...", 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_().

template<class T >
static void putfloat_ ( T &  p,
float  f 
)
inlinestatic

References lilswap().

Referenced by putfloat().

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

References putint_().

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

References putint_().

template<class T >
static void putint_ ( T &  p,
int  n 
)
inlinestatic

Referenced by putint().

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

References putuint_().

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

References putuint_().

template<class T >
static void putuint_ ( T &  p,
int  n 
)
inlinestatic

Referenced by 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_().

template<class T >
static void sendstring_ ( const char *  t,
T &  p 
)
inlinestatic

References putint().

Referenced by sendstring().