SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
Namespaces | Macros | Functions | Variables
Components
Collaboration diagram for Components:

Namespaces

 SEGSEvents
 

Macros

#define BITS_PER_BYTE   8
 
#define BITS_PER_UINT32   (BITS_PER_BYTE * uint32_t(sizeof(uint32_t)))
 
#define BIT_MASK(x)   ((uint32_t)((1ULL << (x)) - 1))
 
#define BITS_TO_BYTES(x)   (((x) + 7) >> 3)
 
#define BITS_LEFT(x)   (BITS_PER_BYTE - (x))
 
#define BYTE_ALIGN(x)   (((x) + 7) & ~7)
 
#define SEGS_LOGGING_CATEGORY(name, string)
 

Functions

bool parseAddress (const QString &src, ACE_INET_Addr &tgt)
 
void setLoggingFilter ()
 
void toggleLogging (QString &category)
 
void dumpLogging ()
 
void settingsDump ()
 
void settingsDump (QSettings *s)
 
int64_t getSecsSince2000Epoch ()
 
 BitStream::BitStream (size_t size)
 
 BitStream::BitStream (const BitStream &bs)
 
 BitStream::BitStream (uint8_t *from, size_t bitsize)
 
BitStreamBitStream::operator= (const BitStream &bs)
 
 BitStream::~BitStream ()
 
void BitStream::StoreBits (uint32_t nBits, uint32_t dataBits)
 
void BitStream::uStoreBits (uint32_t nBits, uint32_t dataBits)
 
void BitStream::StorePackedBits (uint32_t nBits, uint32_t dataBits)
 
void BitStream::StoreBitArray (const uint8_t *array, size_t nBits)
 BitStream::StoreBitArray Stores an array of bits in the bit stream buffer. The main difference between StoreBitArray and StoreBits, is that StoreBitArray can accept more than 32 bits at a time. More...
 
void BitStream::StoreString (const char *str)
 
void BitStream::StoreString (const QByteArray &str)
 
void BitStream::StoreString (const QString &str)
 
int32_t BitStream::GetBits (uint32_t nBits)
 
int32_t BitStream::uGetBits (uint32_t nBits)
 
int32_t BitStream::GetPackedBits (uint32_t minbits)
 
void BitStream::GetBitArray (uint8_t *array, uint32_t nBits)
 
void BitStream::GetString (QString &str)
 Retrieves a null-terminated C-style string from the bit stream. More...
 
int64_t BitStream::Get64Bits ()
 Read upto 8 bytes from input stream and return them as 64bit integer. More...
 
uint32_t BitStream::GetAvailSize () const
 
float BitStream::GetFloat ()
 
void BitStream::StoreFloat (float val)
 
void BitStream::ResetOffsets ()
 
void BitStream::UseByteAlignedMode (bool toggle)
 
void BitStream::ByteAlign (bool read_part=true, bool write_part=true)
 
void BitStream::CompressAndStoreString (const char *str)
 
void BitStream::GetAndDecompressString (QString &tgt)
 
 GrowingBuffer::GrowingBuffer (uint8_t *buf, uint32_t size, bool become_owner)
 
 GrowingBuffer::GrowingBuffer (uint32_t max_size, uint8_t safe_area, uint32_t current_size)
 
 GrowingBuffer::GrowingBuffer (const GrowingBuffer &)
 
 GrowingBuffer::GrowingBuffer (GrowingBuffer &&) noexcept
 
 GrowingBuffer::~GrowingBuffer ()
 
void GrowingBuffer::PutString (const char *t)
 
void GrowingBuffer::uPutString (const char *t)
 
void GrowingBuffer::PutBytes (const uint8_t *t, uint32_t len)
 
void GrowingBuffer::uPutBytes (const uint8_t *t, uint32_t len)
 
void GrowingBuffer::GetString (char *t)
 
void GrowingBuffer::uGetString (char *t)
 
bool GrowingBuffer::GetBytes (uint8_t *t, uint32_t len)
 
void GrowingBuffer::uGetBytes (uint8_t *t, uint32_t len)
 
void GrowingBuffer::PopFront (uint32_t count)
 
int GrowingBuffer::resize (uint32_t accommodate_size)
 
int EventProcessor::open (void *args=nullptr) override
 
int EventProcessor::handle_timeout (const ACE_Time_Value &current_time, const void *act) override final
 
int EventProcessor::process_single_event ()
 This is mostly used by unit testing and debugging functions. More...
 
virtual int EventProcessor::putq (SEGSEvents::Event *ev, ACE_Time_Value *timeout=nullptr)
 
 PasswordHasher::PasswordHasher ()
 
QString PasswordHasher::getRandomString (int length) const
 
QByteArray PasswordHasher::generateSalt ()
 Generates a random salt of length 16. More...
 
QByteArray PasswordHasher::hashPassword (const QByteArray &pass, const QByteArray &salt)
 Hashes a password with the given salt using the Sha256 algorithm. More...
 
virtual const char * SEGSEvents::Event::info ()
 
 SEGSTimer::SEGSTimer (EventProcessor *m_processor, uint64_t data, const ACE_Time_Value &fire_delta_time, bool one_shot=true)
 
 SEGSTimer::~SEGSTimer ()
 
void SEGSTimer::schedule ()
 
void SEGSTimer::cancel ()
 
void SEGSTimer::reset ()
 
void SEGSTimer::reschedule (const ACE_Time_Value &new_time)
 
void SEGSTimer::schedule_repeatable ()
 
static void Settings::setSettingsPath (const QString path)
 
static QString Settings::getSettingsPath ()
 
void Settings::createSettingsFile ()
 
void Settings::setDefaultSettings ()
 

Variables

static FinishSEGSEvents::Finish::s_instance
 

Detailed Description

Macro Definition Documentation

◆ BIT_MASK

#define BIT_MASK (   x)    ((uint32_t)((1ULL << (x)) - 1))

◆ BITS_LEFT

#define BITS_LEFT (   x)    (BITS_PER_BYTE - (x))

◆ BITS_PER_BYTE

#define BITS_PER_BYTE   8

◆ BITS_PER_UINT32

#define BITS_PER_UINT32   (BITS_PER_BYTE * uint32_t(sizeof(uint32_t)))

◆ BITS_TO_BYTES

#define BITS_TO_BYTES (   x)    (((x) + 7) >> 3)

◆ BYTE_ALIGN

#define BYTE_ALIGN (   x)    (((x) + 7) & ~7)

◆ SEGS_LOGGING_CATEGORY

#define SEGS_LOGGING_CATEGORY (   name,
  string 
)
Value:
QLoggingCategory &name() \
{ \
static QLoggingCategory category(string); \
return category; \
}

Function Documentation

◆ BitStream() [1/3]

BitStream::BitStream ( size_t  size)
explicit
Here is the call graph for this function:

◆ BitStream() [2/3]

BitStream::BitStream ( uint8_t *  from,
size_t  bitsize 
)

◆ BitStream() [3/3]

BitStream::BitStream ( const BitStream bs)

◆ ByteAlign()

void BitStream::ByteAlign ( bool  read_part = true,
bool  write_part = true 
)
Here is the caller graph for this function:

◆ cancel()

void SEGSTimer::cancel ( )
Here is the caller graph for this function:

◆ CompressAndStoreString()

void BitStream::CompressAndStoreString ( const char *  str)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSettingsFile()

void Settings::createSettingsFile ( )

◆ dumpLogging()

void dumpLogging ( )
Here is the caller graph for this function:

◆ generateSalt()

QByteArray PasswordHasher::generateSalt ( )

Generates a random salt of length 16.

Returns
A QByteArray of length 16 containing the generated salt.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Get64Bits()

int64_t BitStream::Get64Bits ( )

Read upto 8 bytes from input stream and return them as 64bit integer.

Returns
received 64 bit value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAndDecompressString()

void BitStream::GetAndDecompressString ( QString &  tgt)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAvailSize()

uint32_t BitStream::GetAvailSize ( ) const
Here is the caller graph for this function:

◆ GetBitArray()

void BitStream::GetBitArray ( uint8_t *  array,
uint32_t  nBits 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBits()

int32_t BitStream::GetBits ( uint32_t  nBits)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBytes()

bool GrowingBuffer::GetBytes ( uint8_t *  t,
uint32_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFloat()

float BitStream::GetFloat ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPackedBits()

int32_t BitStream::GetPackedBits ( uint32_t  minbits)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRandomString()

QString PasswordHasher::getRandomString ( int  length) const
protected
Here is the caller graph for this function:

◆ getSecsSince2000Epoch()

int64_t getSecsSince2000Epoch ( )
Here is the caller graph for this function:

◆ getSettingsPath()

QString Settings::getSettingsPath ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetString() [1/2]

void GrowingBuffer::GetString ( char *  t)
Here is the call graph for this function:

◆ GetString() [2/2]

void BitStream::GetString ( QString &  str)

Retrieves a null-terminated C-style string from the bit stream.

Note
will set stream error status in case of stream exhaustion
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GrowingBuffer() [1/4]

GrowingBuffer::GrowingBuffer ( const GrowingBuffer from)
explicit

◆ GrowingBuffer() [2/4]

GrowingBuffer::GrowingBuffer ( GrowingBuffer &&  from)
explicitnoexcept

◆ GrowingBuffer() [3/4]

GrowingBuffer::GrowingBuffer ( uint8_t *  buf,
uint32_t  size,
bool  become_owner 
)
Here is the call graph for this function:

◆ GrowingBuffer() [4/4]

GrowingBuffer::GrowingBuffer ( uint32_t  max_size,
uint8_t  safe_area,
uint32_t  current_size 
)
Here is the call graph for this function:

◆ handle_timeout()

int EventProcessor::handle_timeout ( const ACE_Time_Value &  current_time,
const void *  act 
)
finaloverride
Here is the call graph for this function:

◆ hashPassword()

QByteArray PasswordHasher::hashPassword ( const QByteArray &  pass,
const QByteArray &  salt 
)

Hashes a password with the given salt using the Sha256 algorithm.

Parameters
passThe password to be hashed.
saltThe salt to be appended to the password.
Returns
A QByteArray containing the salted and hashed password.
Here is the caller graph for this function:

◆ info()

const char * Event::info ( )
virtual

Reimplemented in SEGSEvents::EntitiesResponse.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ open()

int EventProcessor::open ( void *  args = nullptr)
override

◆ operator=()

BitStream & BitStream::operator= ( const BitStream bs)
Here is the caller graph for this function:

◆ parseAddress()

bool parseAddress ( const QString &  src,
ACE_INET_Addr &  tgt 
)
Here is the caller graph for this function:

◆ PasswordHasher()

PasswordHasher::PasswordHasher ( )

◆ PopFront()

void GrowingBuffer::PopFront ( uint32_t  count)
Here is the caller graph for this function:

◆ process_single_event()

int EventProcessor::process_single_event ( )

This is mostly used by unit testing and debugging functions.

Returns
0 if no more events on queue, -1 if finish event was encountered., 1 if everything went ok.
Here is the call graph for this function:

◆ PutBytes()

void GrowingBuffer::PutBytes ( const uint8_t *  t,
uint32_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ putq()

int EventProcessor::putq ( SEGSEvents::Event ev,
ACE_Time_Value *  timeout = nullptr 
)
virtual
Here is the caller graph for this function:

◆ PutString()

void GrowingBuffer::PutString ( const char *  t)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reschedule()

void SEGSTimer::reschedule ( const ACE_Time_Value &  new_time)
Here is the call graph for this function:

◆ reset()

void SEGSTimer::reset ( )
Here is the call graph for this function:

◆ ResetOffsets()

void BitStream::ResetOffsets ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize()

int GrowingBuffer::resize ( uint32_t  accommodate_size)
protected

this method will try to resize GrowingBuffer to accommodate_size elements (in reality it preallocates a 'few' more ) if the new size is 0, then internal buffer object is deleted, freeing all memory Warning: when buffer is growing, only it's part that contains any valid data is copied (i.e. from start, to write_off ) returns -2 if there were problems allocating new block of memory for the internal storage returns -1 if new size exceeds maximum size allowed for this buffer returns 0 if everything went ok

Here is the caller graph for this function:

◆ schedule()

void SEGSTimer::schedule ( )
Here is the caller graph for this function:

◆ schedule_repeatable()

void SEGSTimer::schedule_repeatable ( )
Here is the caller graph for this function:

◆ SEGSTimer()

SEGSTimer::SEGSTimer ( EventProcessor m_processor,
uint64_t  data,
const ACE_Time_Value &  fire_delta_time,
bool  one_shot = true 
)
Here is the call graph for this function:

◆ setDefaultSettings()

void Settings::setDefaultSettings ( )
Here is the call graph for this function:

◆ setLoggingFilter()

void setLoggingFilter ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSettingsPath()

void Settings::setSettingsPath ( const QString  path)
static
Here is the caller graph for this function:

◆ settingsDump() [1/2]

void settingsDump ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ settingsDump() [2/2]

void settingsDump ( QSettings *  s)

◆ StoreBitArray()

void BitStream::StoreBitArray ( const uint8_t *  src,
size_t  nBits 
)

BitStream::StoreBitArray Stores an array of bits in the bit stream buffer. The main difference between StoreBitArray and StoreBits, is that StoreBitArray can accept more than 32 bits at a time.

Parameters
src
nBits
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StoreBits()

void BitStream::StoreBits ( uint32_t  nBits,
uint32_t  dataBits 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StoreFloat()

void BitStream::StoreFloat ( float  val)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StorePackedBits()

void BitStream::StorePackedBits ( uint32_t  nBits,
uint32_t  dataBits 
)
Here is the call graph for this function:

◆ StoreString() [1/3]

void BitStream::StoreString ( const char *  str)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StoreString() [2/3]

void BitStream::StoreString ( const QByteArray &  str)
Here is the call graph for this function:

◆ StoreString() [3/3]

void BitStream::StoreString ( const QString &  str)
Here is the call graph for this function:

◆ toggleLogging()

void toggleLogging ( QString &  category)
Here is the call graph for this function:

◆ uGetBits()

int32_t BitStream::uGetBits ( uint32_t  nBits)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uGetBytes()

void GrowingBuffer::uGetBytes ( uint8_t *  t,
uint32_t  len 
)
Here is the caller graph for this function:

◆ uGetString()

void GrowingBuffer::uGetString ( char *  t)
inline
Here is the call graph for this function:

◆ uPutBytes()

void GrowingBuffer::uPutBytes ( const uint8_t *  t,
uint32_t  len 
)
Here is the caller graph for this function:

◆ uPutString()

void GrowingBuffer::uPutString ( const char *  t)
inline
Here is the call graph for this function:

◆ UseByteAlignedMode()

void BitStream::UseByteAlignedMode ( bool  toggle)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ uStoreBits()

void BitStream::uStoreBits ( uint32_t  nBits,
uint32_t  dataBits 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~BitStream()

BitStream::~BitStream ( )
Here is the caller graph for this function:

◆ ~GrowingBuffer()

GrowingBuffer::~GrowingBuffer ( )

◆ ~SEGSTimer()

SEGSTimer::~SEGSTimer ( )
Here is the call graph for this function:

Variable Documentation

◆ s_instance

Finish * Finish::s_instance
static