2011-07-02 14:45:12 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
* PokerTH - The open source texas holdem engine *
|
2012-12-25 15:06:23 +01:00
|
|
|
* Copyright (C) 2006-2012 Felix Hammer, Florian Thauer, Lothar May *
|
2011-07-02 14:45:12 +00:00
|
|
|
* *
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU Affero General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
2012-12-25 15:06:23 +01:00
|
|
|
* *
|
|
|
|
|
* *
|
|
|
|
|
* Additional permission under GNU AGPL version 3 section 7 *
|
|
|
|
|
* *
|
|
|
|
|
* If you modify this program, or any covered work, by linking or *
|
|
|
|
|
* combining it with the OpenSSL project's OpenSSL library (or a *
|
|
|
|
|
* modified version of that library), containing parts covered by the *
|
|
|
|
|
* terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
|
|
|
|
|
* (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
|
|
|
|
|
* permission to convey the resulting work. *
|
|
|
|
|
* Corresponding Source for a non-source form of such a combination *
|
|
|
|
|
* shall include the source code for the parts of OpenSSL used as well *
|
|
|
|
|
* as that of the covered work. *
|
2011-07-02 14:45:12 +00:00
|
|
|
*****************************************************************************/
|
2011-01-14 21:33:36 +00:00
|
|
|
|
|
|
|
|
// Connectivity test program for PokerTH
|
|
|
|
|
|
|
|
|
|
#include <boost/asio.hpp>
|
2013-01-05 14:24:45 +01:00
|
|
|
#include <third_party/protobuf/pokerth.pb.h>
|
|
|
|
|
#include <net/netpacket.h>
|
|
|
|
|
#include <boost/program_options.hpp>
|
2012-01-04 11:59:40 +00:00
|
|
|
#include <boost/array.hpp>
|
2011-01-14 21:33:36 +00:00
|
|
|
#include <third_party/boost/timers.hpp>
|
2011-01-14 22:42:46 +00:00
|
|
|
#include <gsasl.h>
|
2011-01-14 21:33:36 +00:00
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
using boost::asio::ip::tcp;
|
|
|
|
|
namespace po = boost::program_options;
|
|
|
|
|
|
2011-01-17 10:44:47 +00:00
|
|
|
#define BUF_SIZE 1024
|
2011-01-14 21:33:36 +00:00
|
|
|
// Global receive buffer
|
2011-01-17 10:44:47 +00:00
|
|
|
boost::array<char, BUF_SIZE> recBuf;
|
2011-01-14 21:33:36 +00:00
|
|
|
size_t recBufPos = 0;
|
2011-01-17 10:44:47 +00:00
|
|
|
boost::array<char, BUF_SIZE> sendBuf;
|
2011-01-14 21:33:36 +00:00
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
net_packet_print_to_string(const void *buffer, size_t size, void *packetStr)
|
|
|
|
|
{
|
|
|
|
|
string *tmpString = (string *)packetStr;
|
|
|
|
|
*tmpString += string((const char *)buffer, size);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-05 14:24:45 +01:00
|
|
|
boost::shared_ptr<NetPacket>
|
2011-01-17 10:44:47 +00:00
|
|
|
receiveMessage(tcp::socket &socket)
|
2011-01-14 21:33:36 +00:00
|
|
|
{
|
2013-01-05 14:24:45 +01:00
|
|
|
boost::shared_ptr<NetPacket> tmpPacket;
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
do {
|
2013-01-05 14:24:45 +01:00
|
|
|
// This is necessary, because we use TCP.
|
|
|
|
|
// Packets may be received in multiple chunks or
|
|
|
|
|
// several packets may be received at once.
|
|
|
|
|
if (recBufPos >= NET_HEADER_SIZE) {
|
|
|
|
|
// Read the size of the packet (first 4 bytes in network byte order).
|
|
|
|
|
uint32_t nativeVal;
|
|
|
|
|
memcpy(&nativeVal, recBuf.c_array(), sizeof(uint32_t));
|
|
|
|
|
size_t packetSize = ntohl(nativeVal);
|
|
|
|
|
if (packetSize > MAX_PACKET_SIZE) {
|
2011-01-17 10:44:47 +00:00
|
|
|
recBufPos = 0;
|
2013-01-05 14:24:45 +01:00
|
|
|
cout << "Packet too large" << endl;
|
|
|
|
|
return boost::shared_ptr<NetPacket>();
|
|
|
|
|
} else if (recBufPos >= packetSize + NET_HEADER_SIZE) {
|
|
|
|
|
try {
|
|
|
|
|
tmpPacket = NetPacket::Create(&recBuf.c_array()[NET_HEADER_SIZE], packetSize);
|
|
|
|
|
if (tmpPacket) {
|
|
|
|
|
recBufPos -= (packetSize + NET_HEADER_SIZE);
|
|
|
|
|
if (recBufPos) {
|
|
|
|
|
memmove(recBuf.c_array(), recBuf.c_array() + packetSize + NET_HEADER_SIZE, recBufPos);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (const exception &) {
|
|
|
|
|
// Reset buffer on error.
|
|
|
|
|
recBufPos = 0;
|
|
|
|
|
cout << "Packet creation failed" << endl;
|
|
|
|
|
return boost::shared_ptr<NetPacket>();
|
|
|
|
|
}
|
2011-01-17 10:44:47 +00:00
|
|
|
}
|
2011-01-14 21:33:36 +00:00
|
|
|
}
|
2013-01-05 14:24:45 +01:00
|
|
|
|
|
|
|
|
if (!tmpPacket) {
|
|
|
|
|
recBufPos += socket.receive(boost::asio::buffer(recBuf.c_array() + recBufPos, BUF_SIZE - recBufPos));
|
|
|
|
|
if (recBufPos == 0) {
|
|
|
|
|
cout << "Receive failed" << endl;
|
|
|
|
|
return boost::shared_ptr<NetPacket>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} while (!tmpPacket);
|
|
|
|
|
|
|
|
|
|
return tmpPacket;
|
2011-01-14 21:33:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
2013-01-05 14:24:45 +01:00
|
|
|
sendMessage(tcp::socket &socket, boost::shared_ptr<NetPacket> packet)
|
2011-01-14 21:33:36 +00:00
|
|
|
{
|
|
|
|
|
bool retVal = false;
|
2013-01-05 14:24:45 +01:00
|
|
|
if (packet) {
|
|
|
|
|
uint32_t packetSize = packet->GetMsg()->ByteSize();
|
|
|
|
|
google::protobuf::uint8 *buf = new google::protobuf::uint8[packetSize + NET_HEADER_SIZE];
|
|
|
|
|
*((uint32_t *)buf) = htonl(packetSize);
|
|
|
|
|
packet->GetMsg()->SerializeWithCachedSizesToArray(&buf[NET_HEADER_SIZE]);
|
|
|
|
|
retVal = socket.send(boost::asio::buffer(buf, packetSize + NET_HEADER_SIZE)) != 0;
|
|
|
|
|
delete[] buf;
|
2011-01-14 21:33:36 +00:00
|
|
|
}
|
|
|
|
|
return retVal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
try {
|
2011-01-17 10:44:47 +00:00
|
|
|
// Check command line options.
|
|
|
|
|
po::options_description desc("Allowed options");
|
|
|
|
|
desc.add_options()
|
2011-02-11 20:02:08 +00:00
|
|
|
("help,h", "produce help message")
|
|
|
|
|
("server,s", po::value<string>(), "PokerTH server name")
|
|
|
|
|
("port,P", po::value<string>(), "PokerTH server port")
|
|
|
|
|
("mode,m", po::value<int>(), "set mode (0=connection test, 1=lag test)")
|
|
|
|
|
("username,u", po::value<string>(), "user name used for test")
|
|
|
|
|
("password,p", po::value<string>(), "password used for test")
|
|
|
|
|
;
|
2011-01-14 21:33:36 +00:00
|
|
|
|
2011-01-17 10:44:47 +00:00
|
|
|
po::variables_map vm;
|
|
|
|
|
po::store(po::parse_command_line(argc, argv, desc), vm);
|
|
|
|
|
po::notify(vm);
|
2011-01-14 21:33:36 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
if (vm.count("help")) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << desc << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-02-11 20:02:08 +00:00
|
|
|
if (!vm.count("server") || !vm.count("port") || !vm.count("mode") || !vm.count("username")) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Missing option!" << endl << desc << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-01-14 21:33:36 +00:00
|
|
|
|
2011-01-17 10:44:47 +00:00
|
|
|
string server(vm["server"].as<string>());
|
|
|
|
|
string port = vm["port"].as<string>();
|
|
|
|
|
int mode = vm["mode"].as<int>();
|
|
|
|
|
string username(vm["username"].as<string>());
|
|
|
|
|
string password;
|
2011-02-11 20:02:08 +00:00
|
|
|
if (vm.count("password")) {
|
2011-01-17 10:44:47 +00:00
|
|
|
password = vm["password"].as<string>();
|
|
|
|
|
}
|
|
|
|
|
// Initialise gsasl.
|
|
|
|
|
Gsasl *authContext;
|
|
|
|
|
Gsasl_session *authSession;
|
|
|
|
|
int res = gsasl_init(&authContext);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (res != GSASL_OK) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "gsasl init failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-01-14 22:42:46 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
if (!gsasl_client_support_p(authContext, "SCRAM-SHA-1")) {
|
2011-01-17 10:44:47 +00:00
|
|
|
gsasl_done(authContext);
|
|
|
|
|
cout << "This version of gsasl does not support SCRAM-SHA-1" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-01-14 21:33:36 +00:00
|
|
|
|
2011-01-17 10:44:47 +00:00
|
|
|
// Connect to the PokerTH server.
|
|
|
|
|
boost::timers::portable::microsec_timer perfTimer;
|
|
|
|
|
boost::asio::io_service io_service;
|
|
|
|
|
tcp::resolver resolver(io_service);
|
|
|
|
|
tcp::resolver::query query(server, port);
|
|
|
|
|
tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
|
|
|
|
|
tcp::resolver::iterator end;
|
|
|
|
|
tcp::socket socket(io_service);
|
|
|
|
|
boost::system::error_code error = boost::asio::error::host_not_found;
|
2011-02-11 20:02:08 +00:00
|
|
|
while (error && endpoint_iterator != end) {
|
2011-01-17 10:44:47 +00:00
|
|
|
socket.close();
|
|
|
|
|
socket.connect(*endpoint_iterator++, error);
|
|
|
|
|
}
|
2011-02-11 20:02:08 +00:00
|
|
|
if (error) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Connect failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-02-11 20:02:08 +00:00
|
|
|
if (mode == 1) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Connect.value " << perfTimer.elapsed().total_milliseconds() << endl;
|
|
|
|
|
}
|
|
|
|
|
perfTimer.restart();
|
2011-01-14 21:33:36 +00:00
|
|
|
|
2011-01-17 10:44:47 +00:00
|
|
|
// Receive server information
|
2013-01-05 14:24:45 +01:00
|
|
|
boost::shared_ptr<NetPacket> msg = receiveMessage(socket);
|
|
|
|
|
if (!msg || msg->GetMsg()->messagetype() != PokerTHMessage_PokerTHMessageType_Type_AnnounceMessage) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Announce failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-01-14 21:33:36 +00:00
|
|
|
|
2011-01-17 10:44:47 +00:00
|
|
|
// Send init
|
2013-01-05 14:24:45 +01:00
|
|
|
msg.reset(new NetPacket);
|
|
|
|
|
msg->GetMsg()->set_messagetype(PokerTHMessage_PokerTHMessageType_Type_InitMessage);
|
|
|
|
|
InitMessage *netInit = msg->GetMsg()->mutable_initmessage();
|
|
|
|
|
netInit->mutable_requestedversion()->set_majorversion(NET_VERSION_MAJOR);
|
|
|
|
|
netInit->mutable_requestedversion()->set_minorversion(NET_VERSION_MINOR);
|
|
|
|
|
netInit->set_buildid(0);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (password.empty()) {
|
2013-01-05 14:24:45 +01:00
|
|
|
netInit->set_login(InitMessage_LoginType_guestLogin);
|
|
|
|
|
netInit->set_nickname(username);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (!sendMessage(socket, msg)) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Init guest failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2011-02-11 20:02:08 +00:00
|
|
|
} else {
|
2011-01-17 10:44:47 +00:00
|
|
|
int errorCode = gsasl_client_start(authContext, "SCRAM-SHA-1", &authSession);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (errorCode == GSASL_OK) {
|
2011-01-17 10:44:47 +00:00
|
|
|
gsasl_property_set(authSession, GSASL_AUTHID, username.c_str());
|
|
|
|
|
gsasl_property_set(authSession, GSASL_PASSWORD, password.c_str());
|
|
|
|
|
|
2013-01-05 14:24:45 +01:00
|
|
|
netInit->set_login(InitMessage_LoginType_authenticatedLogin);
|
2011-01-17 10:44:47 +00:00
|
|
|
|
|
|
|
|
char *tmpOut;
|
|
|
|
|
size_t tmpOutSize;
|
|
|
|
|
string nextGsaslMsg;
|
|
|
|
|
errorCode = gsasl_step(authSession, NULL, 0, &tmpOut, &tmpOutSize);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (errorCode == GSASL_NEEDS_MORE) {
|
2011-01-17 10:44:47 +00:00
|
|
|
nextGsaslMsg = string(tmpOut, tmpOutSize);
|
2011-02-11 20:02:08 +00:00
|
|
|
} else {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "gsasl step 1 failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
gsasl_free(tmpOut);
|
|
|
|
|
|
2013-01-05 14:24:45 +01:00
|
|
|
netInit->set_clientuserdata(nextGsaslMsg);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (!sendMessage(socket, msg)) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Init auth request failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
msg = receiveMessage(socket);
|
2013-01-05 14:24:45 +01:00
|
|
|
if (!msg || msg->GetMsg()->messagetype() != PokerTHMessage_PokerTHMessageType_Type_AuthServerChallengeMessage) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Auth request failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-05 14:24:45 +01:00
|
|
|
const AuthServerChallengeMessage &netAuth = msg->GetMsg()->authserverchallengemessage();
|
|
|
|
|
string challengeStr(netAuth.serverchallenge());
|
2011-01-17 10:44:47 +00:00
|
|
|
errorCode = gsasl_step(authSession, challengeStr.c_str(), challengeStr.size(), &tmpOut, &tmpOutSize);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (errorCode == GSASL_NEEDS_MORE) {
|
2011-01-17 10:44:47 +00:00
|
|
|
nextGsaslMsg = string(tmpOut, tmpOutSize);
|
2011-02-11 20:02:08 +00:00
|
|
|
} else {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "gsasl step 2 failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
gsasl_free(tmpOut);
|
2013-01-05 14:24:45 +01:00
|
|
|
msg.reset(new NetPacket);
|
|
|
|
|
msg->GetMsg()->set_messagetype(PokerTHMessage_PokerTHMessageType_Type_AuthClientResponseMessage);
|
|
|
|
|
AuthClientResponseMessage *outAuth = msg->GetMsg()->mutable_authclientresponsemessage();
|
|
|
|
|
outAuth->set_clientresponse(nextGsaslMsg);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (!sendMessage(socket, msg)) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Init auth response failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
msg = receiveMessage(socket);
|
2013-01-05 14:24:45 +01:00
|
|
|
if (!msg || msg->GetMsg()->messagetype() != PokerTHMessage_PokerTHMessageType_Type_AuthServerVerificationMessage) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Auth response failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Receive init ack
|
|
|
|
|
msg = receiveMessage(socket);
|
2013-01-05 14:24:45 +01:00
|
|
|
if (!msg || msg->GetMsg()->messagetype() != PokerTHMessage_PokerTHMessageType_Type_InitAckMessage) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Init ack failed" << endl;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
if (mode == 1) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Init.value " << perfTimer.elapsed().total_milliseconds() << endl;
|
|
|
|
|
}
|
|
|
|
|
perfTimer.restart();
|
|
|
|
|
|
|
|
|
|
// Send create game
|
2013-01-05 14:24:45 +01:00
|
|
|
msg.reset(new NetPacket);
|
|
|
|
|
msg->GetMsg()->set_messagetype(PokerTHMessage_PokerTHMessageType_Type_JoinNewGameMessage);
|
|
|
|
|
JoinNewGameMessage *joinNew = msg->GetMsg()->mutable_joinnewgamemessage();
|
|
|
|
|
joinNew->set_autoleave(false);
|
|
|
|
|
NetGameInfo *tmpGameInfo = joinNew->mutable_gameinfo();
|
2011-01-17 10:44:47 +00:00
|
|
|
string tmpGameName("_perftest_do_not_join_" + username);
|
2013-01-05 14:24:45 +01:00
|
|
|
tmpGameInfo->set_netgametype(NetGameInfo_NetGameType_normalGame);
|
|
|
|
|
tmpGameInfo->set_maxnumplayers(10);
|
|
|
|
|
tmpGameInfo->set_raiseintervalmode(NetGameInfo_RaiseIntervalMode_raiseOnHandNum);
|
|
|
|
|
tmpGameInfo->set_raiseeveryhands(5);
|
|
|
|
|
tmpGameInfo->set_endraisemode(NetGameInfo_EndRaiseMode_keepLastBlind);
|
|
|
|
|
tmpGameInfo->set_proposedguispeed(5);
|
|
|
|
|
tmpGameInfo->set_delaybetweenhands(6);
|
|
|
|
|
tmpGameInfo->set_playeractiontimeout(10);
|
|
|
|
|
tmpGameInfo->set_endraisesmallblindvalue(0);
|
|
|
|
|
tmpGameInfo->set_firstsmallblind(50);
|
|
|
|
|
tmpGameInfo->set_startmoney(2000);
|
|
|
|
|
tmpGameInfo->set_gamename(tmpGameName);
|
2012-01-04 11:59:40 +00:00
|
|
|
string tmpGamePassword("blah123");
|
2013-01-05 14:24:45 +01:00
|
|
|
joinNew->set_password(tmpGamePassword);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (!sendMessage(socket, msg)) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Create game failed" << endl;
|
2011-01-14 22:42:46 +00:00
|
|
|
return 1;
|
|
|
|
|
}
|
2011-01-17 10:44:47 +00:00
|
|
|
// Receive join game ack
|
2011-02-11 20:02:08 +00:00
|
|
|
do {
|
2011-01-14 22:42:46 +00:00
|
|
|
msg = receiveMessage(socket);
|
2011-02-11 20:02:08 +00:00
|
|
|
if (!msg) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Receive in lobby failed" << endl;
|
2011-01-14 22:42:46 +00:00
|
|
|
return 1;
|
|
|
|
|
}
|
2013-01-05 14:24:45 +01:00
|
|
|
if (msg->GetMsg()->messagetype() == PokerTHMessage_PokerTHMessageType_Type_ErrorMessage) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Received error" << endl;
|
|
|
|
|
return 1;
|
2013-01-05 14:24:45 +01:00
|
|
|
} else if (msg->GetMsg()->messagetype() == PokerTHMessage_PokerTHMessageType_Type_JoinGameFailedMessage) {
|
|
|
|
|
cout << "Join game ack failed" << endl;
|
|
|
|
|
return 1;
|
2011-01-17 10:44:47 +00:00
|
|
|
}
|
2013-01-05 14:24:45 +01:00
|
|
|
} while (msg->GetMsg()->messagetype() != PokerTHMessage_PokerTHMessageType_Type_JoinGameAckMessage);
|
2011-01-17 10:44:47 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
if (mode == 1) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "CreateGame.value " << perfTimer.elapsed().total_milliseconds() << endl;
|
2011-02-11 20:02:08 +00:00
|
|
|
} else {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Success" << endl;
|
2011-01-14 21:33:36 +00:00
|
|
|
}
|
2011-01-17 10:44:47 +00:00
|
|
|
perfTimer.restart();
|
|
|
|
|
gsasl_done(authContext);
|
2011-02-11 20:02:08 +00:00
|
|
|
} catch (...) {
|
2011-01-17 10:44:47 +00:00
|
|
|
cout << "Exception caught" << endl;
|
2011-01-14 21:33:36 +00:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|