mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy
This commit is contained in:
commit
ac74cc36a5
3 changed files with 6 additions and 5 deletions
|
@ -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() {
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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[],
|
||||
|
|
Loading…
Add table
Reference in a new issue