本文整理汇总了C++中NetBuffer::addChar方法的典型用法代码示例。如果您正苦于以下问题:C++ NetBuffer::addChar方法的具体用法?C++ NetBuffer::addChar怎么用?C++ NetBuffer::addChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetBuffer
的用法示例。
在下文中一共展示了NetBuffer::addChar方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addUnitBuffer
void UnitFactory::addUnitBuffer( NetBuffer &netbuf,
const string &filename,
const string &name,
const string &fullname,
bool SubUnit,
int faction,
std::string customizedUnit,
const ClientState &curr_state,
Flightgroup *flightgroup,
int fg_subnumber,
string *netxml,
ObjSerial netcreate )
{
netbuf.addChar( ZoneMgr::AddUnit );
assert( netcreate != 0 ); //crash if we are doing something stupid :)
netbuf.addSerial( netcreate );
netbuf.addString( filename );
netbuf.addString( name );
netbuf.addString( fullname );
netbuf.addChar( SubUnit );
netbuf.addInt32( faction );
netbuf.addString( flightgroup != NULL ? flightgroup->name : std::string( "Object" ) );
netbuf.addString( customizedUnit );
netbuf.addInt32( fg_subnumber );
if (netbuf.version() <= 4951)
netbuf.addTransformation( curr_state.getTransformation() );
else
netbuf.addClientState( curr_state );
}
示例2: addPlanetBuffer
void UnitFactory::addPlanetBuffer( NetBuffer &netbuf,
QVector x,
QVector y,
float vely,
const Vector &rotvel,
float pos,
float gravity,
float radius,
const char *filename,
BLENDFUNC sr,
BLENDFUNC ds,
const vector< string > &dest,
const QVector &orbitcent,
Unit *parent,
const GFXMaterial &ourmat,
const std::vector< GFXLightLocal > &ligh,
int faction,
string fullname,
bool inside_out,
ObjSerial netcreate )
{
netbuf.addChar( ZoneMgr::AddPlanet );
netbuf.addSerial( netcreate );
netbuf.addQVector( x );
netbuf.addQVector( y );
netbuf.addFloat( vely );
netbuf.addVector( Vector( rotvel ) );
netbuf.addFloat( pos );
netbuf.addFloat( gravity );
netbuf.addFloat( radius );
netbuf.addString( string( filename ) );
netbuf.addChar( sr );
netbuf.addChar( ds );
netbuf.addShort( dest.size() );
for (unsigned int i = 0; i < dest.size(); i++)
netbuf.addString( dest[i] );
netbuf.addQVector( QVector( orbitcent ) );
netbuf.addSerial( parent->GetSerial() );
netbuf.addGFXMaterial( ourmat );
netbuf.addShort( ligh.size() );
for (unsigned int j = 0; j < ligh.size(); j++)
netbuf.addGFXLightLocal( ligh[j] );
netbuf.addInt32( faction );
netbuf.addString( fullname );
netbuf.addChar( inside_out );
}
示例3: addMissileBuffer
void UnitFactory::addMissileBuffer( NetBuffer &netbuf,
const string &filename,
const string &name,
const string &fullname,
int faction,
const string &modifications,
const ClientState &curr_state,
const float damage,
float phasedamage,
float time,
float radialeffect,
float radmult,
float detonation_radius,
ObjSerial netcreate )
{
netbuf.addChar( ZoneMgr::AddMissile );
netbuf.addSerial( netcreate );
netbuf.addString( filename );
netbuf.addString( name );
netbuf.addString( fullname );
netbuf.addInt32( faction );
netbuf.addString( modifications );
netbuf.addFloat( damage );
netbuf.addFloat( phasedamage );
netbuf.addFloat( time );
netbuf.addFloat( radialeffect );
netbuf.addFloat( radmult );
netbuf.addFloat( detonation_radius );
if (netbuf.version() <= 4951)
netbuf.addTransformation( curr_state.getTransformation() );
else
netbuf.addClientState( curr_state );
}
示例4: addNebulaBuffer
void UnitFactory::addNebulaBuffer( NetBuffer &netbuf,
const char *unitfile,
bool SubU,
int faction,
Flightgroup *fg,
int fg_snumber,
ObjSerial netcreate )
{
netbuf.addChar( ZoneMgr::AddNebula );
netbuf.addSerial( netcreate );
netbuf.addString( string( unitfile ) );
netbuf.addChar( SubU );
netbuf.addInt32( faction );
netbuf.addString( fg->name );
netbuf.addInt32( fg_snumber );
}
示例5: addAsteroidBuffer
void UnitFactory::addAsteroidBuffer( NetBuffer &netbuf,
const char *filename,
int faction,
Flightgroup *fg,
int fg_snumber,
float difficulty,
ObjSerial netcreate )
{
netbuf.addChar( ZoneMgr::AddAsteroid );
netbuf.addSerial( netcreate );
netbuf.addString( string( filename ) );
netbuf.addInt32( faction );
netbuf.addString( fg->name );
netbuf.addInt32( fg_snumber );
netbuf.addFloat( difficulty );
}
示例6: endBuffer
void UnitFactory::endBuffer( NetBuffer &netbuf )
{
netbuf.addChar( ZoneMgr::End );
}