Ejemplo n.º 1
0
void EntitiesResponse::serializeto_internal( BitStream &tgt ) const
{
    EntityManager &ent_manager=m_client->current_map()->m_entities;


    tgt.StorePackedBits(1,m_incremental ? 2 : 3); // opcode  3 - full update.

    tgt.StoreBits(1,entReceiveUpdate); // passed to Entity::EntReceive as a parameter

    sendCommands(tgt);

    tgt.StoreBits(32,abs_time);
    //tgt.StoreBits(32,db_time);

    tgt.StoreBits(1,unkn2);
    if(unkn2)
    {
        //g_debug_info 0
        //interpolation level 2
        //g_bitcount_rel 1
    }
    else
    {
        tgt.StoreBits(1,debug_info);
        tgt.StoreBits(1,m_interpolating);
        if(m_interpolating==1)
        {
            tgt.StoreBits(2,m_interpolation_level);
            tgt.StoreBits(2,m_interpolation_bits);
        }
    }

    //else debug_info = false;
    ent_manager.sendEntities(tgt);
    if(debug_info&&!unkn2)
    {
        ent_manager.sendDebuggedEntities(tgt); // while loop, sending entity id's and debug info for each
        ent_manager.sendGlobalEntDebugInfo(tgt);
    }
    sendServerPhysicsPositions(tgt); // These are not client specific ?
    sendControlState(tgt);// These are not client specific ?
    ent_manager.sendDeletes(tgt);
    // Client specific part
    sendClientData(tgt);
    //FIXME: Most Server messages must follow entity update.
}
Ejemplo n.º 2
0
int sendMemcacheResponse(struct conn *c, struct slice *s)
{
    wheatLog(WHEAT_DEBUG, "send data %s len %lld", s->data, s->len);
    return sendClientData(c, s);
}