Example #1
0
void Client::SendCameraOrientation(kNet::DataSerializer ds, kNet::NetworkMessage *msg)
{
    Ptr(kNet::MessageConnection) connection = GetConnection();

    if (ds.BytesFilled() > 0)
        connection->EndAndQueueMessage(msg, ds.BytesFilled());

    else
        connection->FreeMessage(msg);
}
void UserConnection::Send(const kNet::DataSerializer &data)
{
    if (webSocketConnection.expired())
        return;
    if (data.BytesFilled() == 0)
        return;
    
    webSocketConnection.lock()->send(static_cast<void*>(data.GetData()), static_cast<uint64_t>(data.BytesFilled()));
}