# HG changeset patch # User unc0rr # Date 1136647425 0 # Node ID 416d54ce0c340bbe5dd86dd504542266a0441b9e # Parent b78e7185ed13bca3a10f6912e24eeb410c6e6101 - More binds - Caching buffer fixes diff -r b78e7185ed13 -r 416d54ce0c34 QTfrontend/binds.h --- a/QTfrontend/binds.h Sat Jan 07 15:21:44 2006 +0000 +++ b/QTfrontend/binds.h Sat Jan 07 15:23:45 2006 +0000 @@ -36,7 +36,7 @@ #include -#define BINDS_NUMBER 18 +#define BINDS_NUMBER 24 struct BindAction { @@ -55,6 +55,7 @@ {"ljump", "return", QT_TR_NOOP("jump"), false}, {"hjump", "backspace", QT_TR_NOOP("jump"), false}, {"+attack", "space", QT_TR_NOOP("attack"), false}, + {"put", "mousel", QT_TR_NOOP("put"), false}, {"switch", "tab", QT_TR_NOOP("switch"), true}, {"slot 1", "f1", QT_TR_NOOP("slot 1"), false}, {"slot 2", "f2", QT_TR_NOOP("slot 2"), false}, @@ -64,6 +65,11 @@ {"slot 6", "f6", QT_TR_NOOP("slot 6"), false}, {"slot 7", "f7", QT_TR_NOOP("slot 7"), false}, {"slot 8", "f8", QT_TR_NOOP("slot 8"), true}, + {"timer 1", "1", QT_TR_NOOP("timer 1 sec"), false}, + {"timer 2", "2", QT_TR_NOOP("timer 2 sec"), false}, + {"timer 3", "3", QT_TR_NOOP("timer 3 sec"), false}, + {"timer 4", "4", QT_TR_NOOP("timer 4 sec"), false}, + {"timer 5", "5", QT_TR_NOOP("timer 5 sec"), true}, {"capture", "f11", QT_TR_NOOP("capture"), false}, {"quit", "f10", QT_TR_NOOP("quit"), false} }; diff -r b78e7185ed13 -r 416d54ce0c34 QTfrontend/game.cpp --- a/QTfrontend/game.cpp Sat Jan 07 15:21:44 2006 +0000 +++ b/QTfrontend/game.cpp Sat Jan 07 15:23:45 2006 +0000 @@ -45,15 +45,14 @@ { vid_Resolution = Resolution; vid_Fullscreen = Fullscreen; - IPCServer = new QTcpServer(this); - IPCServer->setMaxPendingConnections(1); - if (!IPCServer->listen(QHostAddress("127.0.0.1"), IPC_PORT)) + IPCServer.setMaxPendingConnections(1); + if (!IPCServer.listen(QHostAddress::LocalHost, IPC_PORT)) { QMessageBox::critical(0, tr("Error"), tr("Unable to start the server: %1.") - .arg(IPCServer->errorString())); + .arg(IPCServer.errorString())); } - connect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection())); + connect(&IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection())); IPCSocket = 0; TeamCount = 0; seed = ""; @@ -63,7 +62,7 @@ void HWGame::NewConnection() { - QTcpSocket * client = IPCServer->nextPendingConnection(); + QTcpSocket * client = IPCServer.nextPendingConnection(); if(!IPCSocket) { IPCSocket = client; @@ -97,7 +96,6 @@ // SENDIPC("e$gmflags 0"); SENDIPC("eaddteam"); SendTeamConfig(0); -// if () SENDIPC("rdriven"); SENDIPC("ecolor 65535"); SENDIPC("eadd hh0 0"); SENDIPC("eadd hh1 0"); @@ -169,14 +167,8 @@ void HWGame::SendIPC(const QByteArray & buf) { if (buf.size() > MAXMSGCHARS) return; - if (!IPCSocket) - { - toSendBuf += buf; - } else - { - quint8 len = buf.size(); - RawSendIPC(QByteArray::fromRawData((char *)&len, 1) + buf); - } + quint8 len = buf.size(); + RawSendIPC(QByteArray::fromRawData((char *)&len, 1) + buf); } void HWGame::RawSendIPC(const QByteArray & buf) @@ -190,6 +182,7 @@ { IPCSocket->write(toSendBuf); demo->append(toSendBuf); + toSendBuf.clear(); } IPCSocket->write(buf); demo->append(buf); diff -r b78e7185ed13 -r 416d54ce0c34 QTfrontend/game.h --- a/QTfrontend/game.h Sat Jan 07 15:21:44 2006 +0000 +++ b/QTfrontend/game.h Sat Jan 07 15:23:45 2006 +0000 @@ -70,7 +70,7 @@ gtDemo = 2, gtNet = 3 }; - QTcpServer * IPCServer; + QTcpServer IPCServer; QTcpSocket * IPCSocket; char msgbuf[MAXMSGCHARS]; quint8 msgbufsize; diff -r b78e7185ed13 -r 416d54ce0c34 QTfrontend/hwform.ui --- a/QTfrontend/hwform.ui Sat Jan 07 15:21:44 2006 +0000 +++ b/QTfrontend/hwform.ui Sat Jan 07 15:23:45 2006 +0000 @@ -50,9 +50,9 @@ - 7 + 8 - + @@ -114,7 +114,7 @@ - + @@ -374,31 +374,36 @@ 0 - + 0 0 - 181 - 270 + 163 + 221 Actions - + Weapons - + + + Weapon properties + + + 0 0 - 99 - 29 + 163 + 221 @@ -408,7 +413,7 @@ - + @@ -671,7 +676,7 @@ - + @@ -743,7 +748,7 @@ - + @@ -805,7 +810,7 @@ - + @@ -907,7 +912,7 @@ - +