本文整理汇总了C++中NetBuffer::read_float方法的典型用法代码示例。如果您正苦于以下问题:C++ NetBuffer::read_float方法的具体用法?C++ NetBuffer::read_float怎么用?C++ NetBuffer::read_float使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetBuffer
的用法示例。
在下文中一共展示了NetBuffer::read_float方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read_client_move
void Server::read_client_move(Client *client) {
NetBuffer *msg = client->m_netconnection->m_receiveMessage;
usercmd_t *move = &client->m_cmd;
int i;
vec3_t angle;
int bits;
// read ping time
client->m_ping_times[client->m_num_pings%NUM_PING_TIMES]
= m_time - msg->read_float();
client->m_num_pings++;
// read current angles
for (i = 0; i<3; i++)
angle[i] = msg->read_angle();
VectorCopy(angle, client->m_edict->v.v_angle);
// read movement
move->forwardmove = msg->read_short();
move->sidemove = msg->read_short();
move->upmove = msg->read_short();
// read buttons
bits = msg->read_byte();
client->m_edict->v.button0 = (bits & 1);
client->m_edict->v.button2 = (bits & 2) >> 1;
i = msg->read_byte();
if (i)
client->m_edict->v.impulse = i;
}