Conreality Software Development Kit (SDK) for C++

The Conreality SDK for C++ is currently at a planning stage at: https://github.com/conreality/conreality-sdk

Note

Pending the release of a Conreality SDK for C++, you can integrate C++ software with Conreality games by issuing SQL commands over the PostgreSQL network protocol (via the libpq and/or libpqxx libraries). Refer to the documentation for the Conreality SDK for SQL.

Prerequisites

  • C++11 compiler and standard library (recent releases of Clang or GCC will work fine)
  • libpq
  • libpqxx

Examples

Connecting to the Master

// c++ -o connect connect.cc `pkg-config --cflags --libs libpqxx libpq`

#include <pqxx/pqxx>
#include <cstdlib>   /* for EXIT_*, std::getenv() */
#include <string>    /* for std::string */

int main(int, char**) {
  std::string connstring("dbname=");
  connstring.append(std::getenv("USER"));

  pqxx::connection connection(connstring);

  pqxx::work transaction(connection);

  try {
    // TODO: do something useful
    transaction.exec("SELECT 1");

    transaction.commit();

    return EXIT_SUCCESS;
  }
  catch (const std::exception& e) {
    // TODO: handle the error

    transaction.abort();

    return EXIT_FAILURE;
  }
}

Installation

Reference

#include <conreality.h>
#include <conreality.h>

using namespace conreality;
class conreality::client
class conreality::event
class conreality::message

Frequently Asked Questions (FAQ)

How can I help contribute to the development of the C++ SDK?

See https://github.com/conreality/conreality-sdk

Does the C++ SDK also support C++98 or C++03 compilers?

No, the Conreality SDK for C++ targets exclusively C++11 (which was released in 2011) and newer standards of C++.

In case you cannot migrate to C++11, we suggest integrating your legacy C++ software with Conreality games by issuing SQL commands over the PostgreSQL network protocol (via the libpq and/or libpqxx libraries). Refer to the documentation for the Conreality SDK for SQL.