Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy

This commit is contained in:
eehouse@eehouse.org 2010-09-26 20:25:30 -07:00 committed by Andy2
commit ac74cc36a5
3 changed files with 6 additions and 5 deletions

View file

@ -11,6 +11,7 @@ PORT=${PORT:-10997}
[ $USE_GTK = FALSE ] && CURSES_PARM="-u -0"
LOGDIR=$(basename $0)_logs
[ -d $LOGDIR ] && mv $LOGDIR /tmp/${LOGDIR}_$$
mkdir -p $LOGDIR
usage() {

View file

@ -90,7 +90,7 @@ DBMgr::AddNew( const char* cookie, const char* connName, CookieID cid,
if ( !connName ) connName = "";
const char* fmt = "INSERT INTO " GAMES_TABLE
" (cid, room, connName, nTotal, nPerDevice, lang, ispublic, ctime)"
" (cid, room, connName, nTotal, nPerDevice, lang, pub, ctime)"
" VALUES( %d, '%s', '%s', %d, ARRAY[0,0,0,0], %d, %s, 'now' )";
char buf[256];
snprintf( buf, sizeof(buf), fmt, cid/*m_nextCID++*/, cookie, connName,
@ -140,7 +140,7 @@ DBMgr::FindOpen( const char* cookie, int lang, int nPlayersT, int nPlayersH,
" AND lang = %d"
" AND nTotal = %d"
" AND %d <= nTotal-" ARRAYSUM
" AND %s = ispublic"
" AND %s = pub"
" LIMIT 1";
char query[256];
snprintf( query, sizeof(query), fmt,
@ -237,7 +237,7 @@ DBMgr::PublicRooms( int lang, int nPlayers, int* nNames, string& names )
int nTuples;
const char* fmt = "SELECT room, nTotal-" ARRAYSUM " FROM " GAMES_TABLE
" WHERE ispublic = TRUE AND lang = %d AND ntotal =% d";
" WHERE pub = TRUE AND lang = %d AND ntotal =% d";
char query[256];
snprintf( query, sizeof(query), fmt, lang, nPlayers );
@ -364,7 +364,7 @@ DBMgr::StoreMessage( const char* const connName, int hid,
{
size_t newLen;
const char* fmt = "INSERT INTO " MSGS_TABLE " (connname, hid, msg, ctime)"
" VALUES( '%s', %d, '%s', 'now' )";
" VALUES( '%s', %d, E'%s', 'now' )";
MutexLock ml( &m_dbMutex );

View file

@ -23,7 +23,7 @@ CREATE TABLE games (
cid integer,
room VARCHAR(32),
lang INTEGER,
isPublic BOOLEAN,
pub BOOLEAN,
connName VARCHAR(64) UNIQUE PRIMARY KEY,
nTotal INTEGER,
nPerDevice INTEGER[],