-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Sample code:
mage::RPC client("game", "localhost:2000");
//
// MAGE works with JSON-RPC: so
// we create variables for the request's
// parameters as well as for the response
//
Json::Value auth;
Json::Value user;
//
// When logging in, you will need to submit:
//
// 1. An engine name, provided to you by the server-side developer
// 2. A username
// 3. A password
//
auth["engineName"] = "cms";
auth["credentials"]["username"] = "username";
auth["credentials"]["password"] = "password";
//
// Login will return you a user and a session. We take the
// session and set it as our own.
//
// Note: It is possible that you need to call a different login
// method. If it is the case, you should still expect to receive
// the same data structure as with the standard ident module.
//
try {
user = client.Call("ident.login", auth);
} catch (mage::MageRPCError e) {
cerr << "Could not login, an RPC error has occurred: " << e.what() << " (code " << e.code() << ")" << endl;
// CRASH HERE EXC_BAD_ACCESS ********
return;
} catch (mage::MageErrorMessage e) {
cerr << "Login failed: " << e.code() << endl;
return;
}
I see the correct error log Could not login, an RPC error has occurred: MAGE RPC error: Client connector error: : Could not connect to http://localhost:2000/game/jsonrpc (code -32003) the straight after app crashes with EXC_BAD_ACCESS.
Metadata
Metadata
Assignees
Labels
No labels