当前位置: 首页>>代码示例>>C++>>正文


C++ NetBuffer::addClientState方法代码示例

本文整理汇总了C++中NetBuffer::addClientState方法的典型用法代码示例。如果您正苦于以下问题:C++ NetBuffer::addClientState方法的具体用法?C++ NetBuffer::addClientState怎么用?C++ NetBuffer::addClientState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NetBuffer的用法示例。


在下文中一共展示了NetBuffer::addClientState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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 );
}
开发者ID:vegastrike,项目名称:Vega-Strike-Engine-Source,代码行数:34,代码来源:unit_factory_generic.cpp

示例2: 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 );
}
开发者ID:vegastrike,项目名称:Vega-Strike-Engine-Source,代码行数:29,代码来源:unit_factory_generic.cpp


注:本文中的NetBuffer::addClientState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。