Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: nyetwurk/mumble
base: 73d134b33d
...
head fork: nyetwurk/mumble
compare: fa6c37d675
  • 18 commits
  • 31 files changed
  • 0 commit comments
  • 5 contributors
Showing with 385 additions and 193 deletions.
  1. +2 −2 installer/Plugins.wxs
  2. +1 −1  opus-src
  3. +5 −5 plugins/bf3/bf3.cpp
  4. +15 −14 plugins/gw/gw.cpp
  5. +0 −2  plugins/gw/gw.pro
  6. +67 −47 plugins/wolfet/wolfet.cpp
  7. +6 −0 src/Connection.cpp
  8. +70 −0 src/SignalCurry.h
  9. +9 −0 src/mumble/AudioConfigDialog.cpp
  10. +1 −0  src/mumble/AudioConfigDialog.h
  11. +0 −1  src/mumble/AudioInput.cpp
  12. +55 −25 src/mumble/AudioInput.ui
  13. +2 −4 src/mumble/AudioOutputSpeech.cpp
  14. +1 −1  src/mumble/CustomElements.cpp
  15. +2 −0  src/mumble/LookConfig.cpp
  16. +69 −62 src/mumble/LookConfig.ui
  17. +35 −13 src/mumble/MainWindow.cpp
  18. +3 −0  src/mumble/MainWindow.h
  19. +4 −0 src/mumble/Messages.cpp
  20. +0 −4 src/mumble/Overlay.ui
  21. +6 −0 src/mumble/Settings.cpp
  22. +2 −0  src/mumble/Settings.h
  23. +10 −5 src/mumble/mumble.pro
  24. +0 −1  src/murmur/Messages.cpp
  25. +0 −1  src/murmur/Meta.cpp
  26. +2 −2 src/murmur/MurmurIce.cpp
  27. +6 −1 src/murmur/RPC.cpp
  28. +0 −1  src/murmur/Server.cpp
  29. +1 −1  src/murmur/Server.h
  30. +10 −0 src/murmur/ServerDB.cpp
  31. +1 −0  src/murmur/main.cpp
4 installer/Plugins.wxs
View
@@ -74,7 +74,7 @@
<Component Id="gtaiv.dll">
<File Source="$(var.SourceDir)\release\plugins\gtaiv.dll" KeyPath="yes" />
</Component>
- <Component Id="gw.dll">
+ <Component Id="gw.dll">
<File Source="$(var.SourceDir)\release\plugins\gw.dll" KeyPath="yes" />
</Component>
<Component Id="hl2dm.dll">
@@ -145,7 +145,7 @@
<ComponentRef Id="etqw.dll" />
<ComponentRef Id="gmod.dll" />
<ComponentRef Id="gtaiv.dll" />
- <ComponentRef Id="gw.dll" />
+ <ComponentRef Id="gw.dll" />
<ComponentRef Id="hl2dm.dll" />
<ComponentRef Id="insurgency.dll" />
<ComponentRef Id="l4d.dll" />
2  opus-src
@@ -1 +1 @@
-Subproject commit 17c5966045b463fde45418000b03c95eb5cd7e09
+Subproject commit 9ce27c564efe9a8074ab6e285051790807a74b9e
10 plugins/bf3/bf3.cpp
View
@@ -40,7 +40,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
char state;
bool ok;
- ok = peekProc((BYTE *) 0x0238CC2C, &state, 1); // State value
+ ok = peekProc((BYTE *) 0x023C7A9C, &state, 1); // State value
if (! ok)
return false;
@@ -65,9 +65,9 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
if ( state != 2 )
return true; // This results in all vectors being zero which tells Mumble to ignore them.
- ok = peekProc((BYTE *) 0x0238CBC0, avatar_pos, 12) &&
- peekProc((BYTE *) 0x0238CBF0, avatar_front, 12) &&
- peekProc((BYTE *) 0x0238CBE0, avatar_top, 12);
+ ok = peekProc((BYTE *) 0x023C7A30, avatar_pos, 12) &&
+ peekProc((BYTE *) 0x023C7A60, avatar_front, 12) &&
+ peekProc((BYTE *) 0x023C7A50, avatar_top, 12);
if (! ok)
return false;
@@ -112,7 +112,7 @@ static const std::wstring longdesc() {
return std::wstring(L"Supports Battlefield 3. No identity or context support.");
}
-static std::wstring description(L"Battlefield 3 v936211");
+static std::wstring description(L"Battlefield 3 v944019");
static std::wstring shortname(L"Battlefield 3");
static int trylock1() {
29 plugins/gw/gw.cpp
View
@@ -26,9 +26,9 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+*/
-#include "../mumble_plugin_win32.h"
+#include "../mumble_plugin_win32.h"
static BYTE *posptr;
static BYTE *camptr;
@@ -40,7 +40,6 @@ static BYTE *areaptr;
static BYTE *characternameptr;
static bool calcout(float *pos, float *front, float *cam, float *camfront, float *opos, float *ofront, float *ocam, float *ocamfront) {
-
// Seems Guild Wars is in... inches, yeah :) ---> same as in GW2, proof here: http://www.guildwars2guru.com/topic/21519-reddit-ama-all-questions-answers (question #31)
// coordinate Y is swapped with Z
// Y is negative (looks like somewhere underground is 0.00 and land is for example -120. When we climb up a hill, it goes down (e.g. -130), and when we walk downhill, it goes up (e.g. -100)
@@ -48,7 +47,7 @@ static bool calcout(float *pos, float *front, float *cam, float *camfront, float
opos[0] = pos[0] / 39.37f;
opos[1] = -pos[2] / 39.37f;
opos[2] = pos[1] / 39.37f;
-
+
ocam[0] = cam[0] / 39.37f;
ocam[1] = -cam[2] / 39.37f;
ocam[2] = cam[1] / 39.37f;
@@ -69,7 +68,7 @@ static bool refreshPointers(void)
// We can find all vectors (camera position, camera front, avatar position, avatar front) in just one place, yay!
camfrontptr = camptr = posptr = frontptr = magicptr = characternameptr = areaptr = NULL;
-
+
camptr = (BYTE *) 0xd551b8;
posptr = (BYTE *) 0xd551c4; // camptr + 0xC
camfrontptr = (BYTE *) 0xd551d0; // posptr + 0xC
@@ -96,11 +95,11 @@ static bool refreshPointers(void)
}
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &context, std::wstring &identity) {
- for (int i=0;i<3;i++)
+ for (int i = 0; i < 3; i++)
avatar_pos[i] = avatar_front[i] = avatar_top[i] = camera_pos[i] = camera_front[i] = camera_top[i] = 0.0f;
bool ok;
- float cam[3],pos[3],front[3],camfront[3];
+ float cam[3], pos[3], front[3], camfront[3];
char state;
int areaid;
wchar_t charactername [20];
@@ -116,8 +115,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
if (!ok)
return false;
- if (state == 0 || state == 1 || areaid == 0) // Player not in world
- {
+ if (state == 0 || state == 1 || areaid == 0) { // Player not in world
context.clear();
identity.clear();
return true;
@@ -130,7 +128,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
camera_top[1] = avatar_top[1] = 1; // This isn't FPS, you can't tilt your head :)
std::ostringstream _context;
_context << "{\"areaid\": " << areaid << ","
- << "\"magic\": " << int(state) << "}";
+ << "\"magic\": " << int(state) << "}";
context = _context.str();
charactername[sizeof(charactername)-1]=0; // make sure string is null-terminated
@@ -140,13 +138,16 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
}
static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
-
if (! initialize(pids, L"Gw.exe"))
return false;
- if (!refreshPointers()) { generic_unlock(); return false; }// unlink plugin if this fails
+ // unlink plugin if this fails
+ if (!refreshPointers()) {
+ generic_unlock();
+ return false;
+ }
- float cam[3],pos[3],front[3],camfront[3],top[3],camtop[3];
+ float cam[3], pos[3], front[3], camfront[3], top[3], camtop[3];
std::string context;
std::wstring identity;
@@ -170,7 +171,7 @@ static int trylock1() {
}
static MumblePlugin gwplug = {
- MUMBLE_PLUGIN_MAGIC,
+ MUMBLE_PLUGIN_MAGIC ^ MUMBLE_PLUGIN_MAGIC,
description,
shortname,
NULL,
2  plugins/gw/gw.pro
View
@@ -3,5 +3,3 @@ include(../plugins.pri)
TARGET = gw
SOURCES = gw.cpp
LIBS += -luser32
-
-
114 plugins/wolfet/wolfet.cpp
View
@@ -1,5 +1,6 @@
/* Copyright (C) 2009-2012, Stefan Hacker <dD0t@users.sourceforge.net>
Copyright (C) 2005-2012, Thorvald Natvig <thorvald@natvig.com>
+ Copyright (C) 2012, Jan Klass <kissaki@kcode.de>
All rights reserved.
@@ -29,70 +30,80 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+ This plugin scans the following address locations:
+
+ Address Type Description
+ ===================================
+ 0x013E8CF4 float X-Coordinate
+ 0x013E8CF8 float Y-Coordinate
+ 0x013E8CFC float Z-Coordinate
+ // The XYZ coordinates repeat at 0x013F79C8, 0x013F79CC, 0x013F79D0
+ // and seem to always hold the same values. It is not the camera vs
+ // character, as with third person they still hold the same values.
+ 0x013F9E20 float Horizontal view in degree
+ 0x013F9E1C float Vertical view in degree
+ 0x013E8DFC byte Team; 0: not in-game (in menu etc), 1: allies, 2: axis, 3: spectator
+ 0x009FFD30 char[40] last connected to host IP
+ 0x010B4908 char[32] map shortname only
+
+ As reference, as help for future manual mem scanning:
+ 0x010B48C8 char[32] map fullpath (relative to gamedir)
+ 0x03A54C9C char[16] last download host IP (wwwdownload)
+ There seem to be a ton of memory addresses valid for the team value.
+
+ For position coordinates:
+ X-Value is increasing when heading east
+ decreasing when heading west
+ Y-Value is increasing when heading north
+ decreasing when heading south
+ Z-Value is increasing when going up
+ decreasing when going down
+ 1 unit = 1 meter (not confirmed)
+
+ For the view angle values:
+ Vertical view 0 when centered
+ -90 when looking up
+ +90 when looking down
+ Increasing when looking down.
+
+ Horizontal is 90 when facing north
+ 0 when facing east
+ -90 when facing south
+ +/-180 when facing west
+ Increasing when turning left.
+*/
+
#include "../mumble_plugin_win32.h"
-static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &, std::wstring &) {
+static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &context, std::wstring &) {
float viewHor, viewVer;
- char state;
+ char team;
for (int i=0;i<3;i++)
avatar_pos[i] = avatar_front[i] = avatar_top[i] = camera_pos[i] = camera_front[i] = camera_top[i] = 0.0f;
bool ok;
-
- /*
- This plugin uses the following Variables:
-
- Address Type Description
- ===================================
- 0x013F79CC float Y-Coordinate
- 0x013E8CF4 float X-Coordinate
- 0x013E8CF8 float Z-Coordinate
- 0x013F9E20 float Horizontal view
- 0x013F9E1C float Vertical view
- 0x013E8D18 byte Magic value (32 ingame / 0 spectating)
- */
- ok = peekProc((BYTE *) 0x013E8D18, &state, 1);
- if (! ok)
+ ok = peekProc((BYTE *) 0x013E8DFC, &team, 1);
+ if (!ok)
return false;
- if (state != 32)
- return true; // If this magic value is !=32 we are spectating, so switch off PA
+ // We dont use pos-audio in menus
+ if (team == 0 || team == 3)
+ return true;
- ok = peekProc((BYTE *) 0x013F79CC, avatar_pos+1, 4) && //Y
- peekProc((BYTE *) 0x013E8CF4, avatar_pos, 4) && //X
- peekProc((BYTE *) 0x013E8CF8, avatar_pos+2, 4) && //Z
- peekProc((BYTE *) 0x013F9E20, &viewHor, 4) && //Hor
- peekProc((BYTE *) 0x013F9E1C, &viewVer, 4); //Ver
+ ok = peekProc((BYTE *) 0x013E8CF4, avatar_pos, 4) && // X
+ peekProc((BYTE *) 0x013E8CF8, avatar_pos+1, 4) && // Y
+ peekProc((BYTE *) 0x013E8CFC, avatar_pos+2, 4) && // Z
+ peekProc((BYTE *) 0x013F9E20, &viewHor, 4) && // Hor-Angle
+ peekProc((BYTE *) 0x013F9E1C, &viewVer, 4); // Ver-Angle
- if (! ok)
+ if (!ok)
return false;
avatar_top[2] = -1; // Head movement is in front vector
- /*
- Z-Value is increasing when heading north
- decreasing when heading south
- X-Value is increasing when heading east
- decreasing when heading west
- Y-Value is increasing when going up
- decreasing when going down
- 1 unit = 1 meter (not confirmed)
- */
-
// Calculate view unit vector
- /*
- Vertical view 0 when centered
- -90 when looking up
- +90 when looking down
- Increasing when looking down.
-
- Horizontal is 90 when facing north
- 0 when facing east
- -90 when facing south
- +/-180 when facing west
- Increasing when turning left.
- */
viewVer *= static_cast<float>(M_PI / 180.0f);
viewHor *= static_cast<float>(M_PI / 180.0f);
@@ -106,6 +117,15 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
camera_top[i] = avatar_top[i];
}
+ // Context - concatenated server-ip mapname and team value
+ char hostip[32];
+ char mapname[40];
+ ok = peekProc((BYTE *) 0x009FFD30, hostip, sizeof(hostip)) &&
+ peekProc((BYTE *) 0x010B4908, mapname, sizeof(hostip));
+ hostip[sizeof(hostip)] = '\0';
+ mapname[sizeof(mapname)] = '\0';
+ context = std::string(hostip) + mapname + (char)(team + 0x30);
+
return true;
}
6 src/Connection.cpp
View
@@ -147,6 +147,12 @@ void Connection::socketRead() {
if ((iPacketLength == -1) || (iAvailable < iPacketLength))
return;
+ if (iPacketLength > 0x7fffff) {
+ qWarning() << "Host tried to send huge packet";
+ disconnectSocket(true);
+ return;
+ }
+
QByteArray qbaBuffer = qtsSocket->read(iPacketLength);
iPacketLength = -1;
iAvailable -= iPacketLength;
70 src/SignalCurry.h
View
@@ -0,0 +1,70 @@
+/* Copyright (C) 2012, Stefan Hacker <dd0t@users.sourceforge.net>
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ - Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ - Neither the name of the Mumble Developers nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef SIGNAL_CURRY_H_
+#define SIGNAL_CURRY_H_
+
+#include <QObject>
+#include <QVariant>
+
+/**
+ * \brief Small class for binding a QVariant parameter to a parameterless signal.
+ * Static usage:
+ * SignalCurry::curry(sender, SIGNAL(emitted()), receiver, SLOT(called(QVariant)), curryParameter);
+ */
+class SignalCurry : public QObject {
+ Q_OBJECT
+ Q_DISABLE_COPY(SignalCurry)
+private:
+ bool bDeleteAfterFirstUse;
+ QVariant qvData;
+public:
+ SignalCurry(QVariant data, bool deleteAfterFirstUse = false, QObject *parent = 0) :
+ QObject(parent),
+ bDeleteAfterFirstUse(deleteAfterFirstUse),
+ qvData(data) {}
+
+ static void curry(QObject *sender, const char *signal, QObject *receiver, const char *slot, QVariant data) {
+ SignalCurry *c = new SignalCurry(data);
+ connect(receiver, slot, c, SIGNAL(called(QVariant)));
+ connect(sender, signal, c, SLOT(call));
+ }
+
+signals:
+ void called(QVariant data);
+public slots:
+ void call() {
+ emit called(qvData);
+ if (bDeleteAfterFirstUse) deleteLater();
+ }
+};
+
+
+#endif
9 src/mumble/AudioConfigDialog.cpp
View
@@ -117,6 +117,7 @@ void AudioInputDialog::load(const Settings &r) {
loadSlider(qsTransmitMax, iroundf(r.fVADmax * 32767.0f + 0.5f));
loadSlider(qsFrames, (r.iFramesPerPacket == 1) ? 1 : (r.iFramesPerPacket/2 + 1));
loadSlider(qsDoublePush, iroundf(static_cast<float>(r.uiDoublePush) / 1000.f + 0.5f));
+ loadSlider(qsPTTHold, r.uiPTTHold);
if (r.vsVAD == Settings::Amplitude)
qrbAmplitude->setChecked(true);
@@ -152,6 +153,7 @@ void AudioInputDialog::save() const {
s.iFramesPerPacket = qsFrames->value();
s.iFramesPerPacket = (s.iFramesPerPacket == 1) ? 1 : ((s.iFramesPerPacket-1) * 2);
s.uiDoublePush = qsDoublePush->value() * 1000;
+ s.uiPTTHold = qsPTTHold->value();
s.atTransmit = static_cast<Settings::AudioTransmit>(qcbTransmit->currentIndex());
s.iIdleTime = qsIdle->value();
@@ -199,6 +201,13 @@ void AudioInputDialog::on_qsDoublePush_valueChanged(int v) {
qlDoublePush->setText(tr("%1 ms").arg(v));
}
+void AudioInputDialog::on_qsPTTHold_valueChanged(int v) {
+ if (v == 0)
+ qlPTTHold->setText(tr("Off"));
+ else
+ qlPTTHold->setText(tr("%1 ms").arg(v));
+}
+
void AudioInputDialog::on_qsTransmitHold_valueChanged(int v) {
float val = static_cast<float>(v * 10);
val = val / 1000.0f;
1  src/mumble/AudioConfigDialog.h
View
@@ -68,6 +68,7 @@ class AudioInputDialog : public ConfigWidget, public Ui::AudioInput {
void on_qsQuality_valueChanged(int v);
void on_qsAmp_valueChanged(int v);
void on_qsDoublePush_valueChanged(int v);
+ void on_qsPTTHold_valueChanged(int v);
void on_qsNoise_valueChanged(int v);
void on_qsIdle_valueChanged(int v);
void on_qcbTransmit_currentIndexChanged(int v);
1  src/mumble/AudioInput.cpp
View
@@ -670,7 +670,6 @@ bool AudioInput::selectCodec() {
return true;
}
-// FIXME: we should be able to encode |iAudioFrames| * |iFrameSize| per Opus call.
int AudioInput::encodeOpusFrame(short *source, int size, unsigned char *buffer) {
int len = 0;
#ifdef USE_OPUS
80 src/mumble/AudioInput.ui
View
@@ -197,6 +197,42 @@
</property>
</widget>
</item>
+ <item row="0" column="3">
+ <widget class="QLabel" name="qlDoublePush">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string notr="true">TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="qcbPushWindow">
+ <property name="toolTip">
+ <string>Displays an always on top window with a push to talk button in it</string>
+ </property>
+ <property name="text">
+ <string>Display push to talk window</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
<item row="0" column="1" colspan="2">
<widget class="QSlider" name="qsDoublePush">
<property name="toolTip">
@@ -219,39 +255,33 @@
</property>
</widget>
</item>
- <item row="0" column="3">
- <widget class="QLabel" name="qlDoublePush">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
+ <item row="1" column="0">
+ <widget class="QLabel" name="qliPTTHold">
<property name="text">
- <string notr="true">TextLabel</string>
+ <string>Hold Time</string>
</property>
</widget>
</item>
- <item row="2" column="1">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
+ <item row="1" column="3">
+ <widget class="QLabel" name="qlPTTHold">
+ <property name="text">
+ <string>TextLabel</string>
</property>
- </spacer>
+ </widget>
</item>
<item row="1" column="1">
- <widget class="QCheckBox" name="qcbPushWindow">
+ <widget class="QSlider" name="qsPTTHold">
<property name="toolTip">
- <string>Displays an always on top window with a push to talk button in it</string>
+ <string>Time the microphone stays open after the PTT key is released</string>
</property>
- <property name="text">
- <string>Display push to talk window</string>
+ <property name="maximum">
+ <number>5000</number>
+ </property>
+ <property name="singleStep">
+ <number>10</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
@@ -649,7 +679,7 @@
<property name="title">
<string>Misc</string>
</property>
- <layout class="QGridLayout" name="gridLayout">
+ <layout class="QGridLayout" name="_2">
<item row="1" column="0">
<widget class="QCheckBox" name="qcbPushClick">
<property name="toolTip">
6 src/mumble/AudioOutputSpeech.cpp
View
@@ -326,8 +326,6 @@ bool AudioOutputSpeech::needSamples(unsigned int snum) {
} else if (umtType == MessageHandler::UDPVoiceOpus) {
#ifdef USE_OPUS
decodedSamples = opus_decode_float(opusState, qba.isEmpty() ? NULL : reinterpret_cast<const unsigned char *>(qba.constData()), qba.size(), pOut, iAudioBufferSize, 0);
- iOutputSize = static_cast<unsigned int>(ceilf(static_cast<float>(decodedSamples * iMixerFreq) / static_cast<float>(iSampleRate)));
- resizeBuffer(iBufferFilled + iOutputSize);
#endif
} else {
if (qba.isEmpty()) {
@@ -376,7 +374,7 @@ bool AudioOutputSpeech::needSamples(unsigned int snum) {
memset(pOut, 0, sizeof(float) * iFrameSize);
} else if (umtType == MessageHandler::UDPVoiceOpus) {
#ifdef USE_OPUS
- opus_decode_float(opusState, NULL, 0, pOut, iFrameSize, 0);
+ decodedSamples = opus_decode_float(opusState, NULL, 0, pOut, iFrameSize, 0);
#endif
} else {
speex_decode(dsSpeex, NULL, pOut);
@@ -399,7 +397,7 @@ bool AudioOutputSpeech::needSamples(unsigned int snum) {
}
nextframe:
spx_uint32_t inlen = decodedSamples;
- spx_uint32_t outlen = iOutputSize;
+ spx_uint32_t outlen = static_cast<unsigned int>(ceilf(static_cast<float>(decodedSamples * iMixerFreq) / static_cast<float>(iSampleRate)));
if (srs && bLastAlive)
speex_resampler_process_float(srs, 0, fResamplerBuffer, &inlen, pfBuffer + iBufferFilled, &outlen);
iBufferFilled += outlen;
2  src/mumble/CustomElements.cpp
View
@@ -105,7 +105,7 @@ void ChatbarTextEdit::inFocus(bool focus) {
void ChatbarTextEdit::contextMenuEvent(QContextMenuEvent *qcme) {
QMenu *menu = createStandardContextMenu();
- QAction *action = new QAction(tr("Paste and send") + QLatin1Char('\t'), menu);
+ QAction *action = new QAction(tr("Paste and &Send") + QLatin1Char('\t'), menu);
action->setEnabled(!QApplication::clipboard()->text().isEmpty());
connect(action, SIGNAL(triggered()), this, SLOT(pasteAndSend_triggered()));
if (menu->actions().count() > 6)
2  src/mumble/LookConfig.cpp
View
@@ -133,6 +133,7 @@ void LookConfig::load(const Settings &r) {
loadCheckBox(qcbShowUserCount, r.bShowUserCount);
loadCheckBox(qcbShowContextMenuInMenuBar, r.bShowContextMenuInMenuBar);
loadCheckBox(qcbHighContrast, r.bHighContrast);
+ loadCheckBox(qcbChatBarUseSelection, r.bChatBarUseSelection);
}
void LookConfig::save() const {
@@ -172,6 +173,7 @@ void LookConfig::save() const {
s.bShowUserCount = qcbShowUserCount->isChecked();
s.bShowContextMenuInMenuBar = qcbShowContextMenuInMenuBar->isChecked();
s.bHighContrast = qcbHighContrast->isChecked();
+ s.bChatBarUseSelection = qcbChatBarUseSelection->isChecked();
}
void LookConfig::accept() const {
131 src/mumble/LookConfig.ui
View
@@ -244,6 +244,67 @@
</layout>
</widget>
</item>
+ <item row="2" column="1">
+ <widget class="QGroupBox" name="qgbTray">
+ <property name="title">
+ <string>Tray Icon</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QCheckBox" name="qcbHideTray">
+ <property name="toolTip">
+ <string>Hide the main Mumble window in the tray when it is minimized.</string>
+ </property>
+ <property name="whatsThis">
+ <string>&lt;b&gt;If set, minimizing the Mumble main window will cause it to be hidden and accessible only from the tray. Otherwise, it will be minimized as a window normally would.&lt;/b&gt;</string>
+ </property>
+ <property name="text">
+ <string>Hide in tray when minimized</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="qcbStateInTray">
+ <property name="toolTip">
+ <string>Displays talking status in system tray</string>
+ </property>
+ <property name="whatsThis">
+ <string/>
+ </property>
+ <property name="text">
+ <string>Show talking status in tray icon</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="1">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
<item row="1" column="1">
<widget class="QGroupBox" name="qgbApplication">
<property name="title">
@@ -313,47 +374,12 @@
</layout>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QGroupBox" name="qgbTray">
- <property name="title">
- <string>Tray Icon</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QCheckBox" name="qcbHideTray">
- <property name="toolTip">
- <string>Hide the main Mumble window in the tray when it is minimized.</string>
- </property>
- <property name="whatsThis">
- <string>&lt;b&gt;If set, minimizing the Mumble main window will cause it to be hidden and accessible only from the tray. Otherwise, it will be minimized as a window normally would.&lt;/b&gt;</string>
- </property>
- <property name="text">
- <string>Hide in tray when minimized</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="qcbStateInTray">
- <property name="toolTip">
- <string>Displays talking status in system tray</string>
- </property>
- <property name="whatsThis">
- <string/>
- </property>
- <property name="text">
- <string>Show talking status in tray icon</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
<item row="3" column="1">
<widget class="QGroupBox" name="qgbChannel">
<property name="title">
<string>Channel Tree</string>
</property>
- <layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1">
+ <layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0">
<item row="0" column="0">
<widget class="QLabel" name="qliChannelDrag">
<property name="text">
@@ -411,35 +437,16 @@
</property>
</widget>
</item>
+ <item row="4" column="0" colspan="2">
+ <widget class="QCheckBox" name="qcbChatBarUseSelection">
+ <property name="text">
+ <string>Use selected item as the chat bar target</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
- <item row="5" column="1">
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="1">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
</layout>
</widget>
<resources/>
48 src/mumble/MainWindow.cpp
View
@@ -63,6 +63,7 @@
#include "VersionCheck.h"
#include "ViewCert.h"
#include "VoiceRecorderDialog.h"
+#include "../SignalCurry.h"
#ifdef Q_OS_WIN
#include "TaskList.h"
@@ -313,8 +314,6 @@ void MainWindow::setupGui() {
qtvUsers->setRowHidden(0, QModelIndex(), true);
qtvUsers->ensurePolished();
- qaServerConnect->setShortcuts(QKeySequence::Open);
- qaServerDisconnect->setShortcuts(QKeySequence::Close);
qaAudioMute->setChecked(g.s.bMute);
qaAudioDeaf->setChecked(g.s.bDeaf);
qaAudioTTS->setChecked(g.s.bTTS);
@@ -427,7 +426,8 @@ void MainWindow::closeEvent(QCloseEvent *e) {
mb.setEscapeButton(qpbMinimize);
mb.exec();
if (mb.clickedButton() != qpbClose) {
- e->accept();
+ showMinimized();
+ e->ignore();
return;
}
}
@@ -1506,9 +1506,9 @@ void MainWindow::sendChatbarMessage(QString qsText) {
qsText = Qt::escape(qsText);
qsText = TextMessage::autoFormat(qsText);
- if (p == NULL || p->uiSession == g.uiSession) {
+ if (!g.s.bChatBarUseSelection || p == NULL || p->uiSession == g.uiSession) {
// Channel message
- if (c == NULL) // If no channel selected fallback to current one
+ if (!g.s.bChatBarUseSelection || c == NULL) // If no channel selected fallback to current one
c = ClientUser::get(g.uiSession)->cChannel;
g.sh->sendChannelTextMessage(c->iId, qsText, false);
@@ -2061,7 +2061,13 @@ void MainWindow::on_PushToTalk_triggered(bool down, QVariant) {
if (down) {
g.uiDoublePush = g.tDoublePush.restart();
g.iPushToTalk++;
- } else if (g.iPushToTalk) {
+ } else if (g.iPushToTalk > 0) {
+ QTimer::singleShot(g.s.uiPTTHold, this, SLOT(pttReleased()));
+ }
+}
+
+void MainWindow::pttReleased() {
+ if (g.iPushToTalk > 0) {
g.iPushToTalk--;
}
}
@@ -2242,14 +2248,25 @@ void MainWindow::on_gsWhisper_triggered(bool down, QVariant scdata) {
updateTarget();
g.iPushToTalk++;
- } else if (g.iPushToTalk) {
- g.iPushToTalk--;
-
- qsCurrentTargets.remove(st);
- updateTarget();
+ } else if (g.iPushToTalk > 0) {
+ SignalCurry *fwd = new SignalCurry(scdata, true, this);
+ connect(fwd, SIGNAL(called(QVariant)), SLOT(whisperReleased(QVariant)));
+ QTimer::singleShot(g.s.uiPTTHold, fwd, SLOT(call()));
}
}
+void MainWindow::whisperReleased(QVariant scdata) {
+ if (g.iPushToTalk <= 0)
+ return;
+
+ ShortcutTarget st = scdata.value<ShortcutTarget>();
+
+ g.iPushToTalk--;
+
+ qsCurrentTargets.remove(st);
+ updateTarget();
+}
+
void MainWindow::viewCertificate(bool) {
ViewCert vc(g.sh->qscCert, this);
vc.exec();
@@ -2571,14 +2588,18 @@ void MainWindow::on_Icon_activated(QSystemTrayIcon::ActivationReason reason) {
}
void MainWindow::qtvUserCurrentChanged(const QModelIndex &, const QModelIndex &) {
+ updateChatBar();
+}
+
+void MainWindow::updateChatBar() {
User *p = pmModel->getUser(qtvUsers->currentIndex());
Channel *c = pmModel->getChannel(qtvUsers->currentIndex());
if (g.uiSession == 0) {
qteChat->setDefaultText(tr("<center>Not connected</center>"), true);
- } else if (p == NULL || p->uiSession == g.uiSession) {
+ } else if (!g.s.bChatBarUseSelection || p == NULL || p->uiSession == g.uiSession) {
// Channel tree target
- if (c == NULL) // If no channel selected fallback to current one
+ if (!g.s.bChatBarUseSelection || c == NULL) // If no channel selected fallback to current one
c = ClientUser::get(g.uiSession)->cChannel;
qteChat->setDefaultText(tr("<center>Type message to channel '%1' here</center>").arg(c->qsName));
@@ -2733,3 +2754,4 @@ void MainWindow::destroyUserInformation() {
}
}
}
+
3  src/mumble/MainWindow.h
View
@@ -116,6 +116,7 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
QPair<QByteArray, QImage> openImageFile();
static const QString defaultStyleSheet;
+ void updateChatBar();
void openTextMessageDialog(ClientUser *p);
#ifdef Q_OS_WIN
@@ -241,6 +242,8 @@ class MainWindow : public QMainWindow, public MessageHandler, public Ui::MainWin
void destroyUserInformation();
void trayAboutToShow();
void sendChatbarMessage(QString msg);
+ void pttReleased();
+ void whisperReleased(QVariant scdata);
public:
MainWindow(QWidget *parent);
~MainWindow();
4 src/mumble/Messages.cpp
View
@@ -433,6 +433,10 @@ void MainWindow::msgUserState(const MumbleProto::UserState &msg) {
pmModel->moveUser(pDst, c);
+ if (pDst == pSelf) {
+ g.mw->updateChatBar();
+ }
+
if (log && (pDst != pSelf) && (pDst->cChannel == pSelf->cChannel)) {
if (pDst == pSrc)
g.l->log(Log::ChannelJoin, tr("%1 entered channel.").arg(Log::formatClientUser(pDst, Log::Target)));
4 src/mumble/Overlay.ui
View
@@ -386,10 +386,6 @@
</layout>
</item>
</layout>
- <zorder></zorder>
- <zorder>qswBlackWhiteList</zorder>
- <zorder>horizontalSpacer</zorder>
- <zorder></zorder>
</widget>
</widget>
</item>
6 src/mumble/Settings.cpp
View
@@ -282,6 +282,7 @@ Settings::Settings() {
bWhisperFriends = false;
uiDoublePush = 0;
+ uiPTTHold = 0;
bExpert = false;
#ifdef NO_UPDATE_CHECK
@@ -309,6 +310,7 @@ Settings::Settings() {
bStateInTray = true;
bUsage = true;
bShowUserCount = false;
+ bChatBarUseSelection = false;
wlWindowLayout = LayoutClassic;
bShowContextMenuInMenuBar = false;
@@ -528,6 +530,7 @@ void Settings::load(QSettings* settings_ptr) {
SAVELOAD(bDeaf, "audio/deaf");
LOADENUM(atTransmit, "audio/transmit");
SAVELOAD(uiDoublePush, "audio/doublepush");
+ SAVELOAD(uiPTTHold, "audio/ptthold");
SAVELOAD(bTxAudioCue, "audio/pushclick");
SAVELOAD(qsTxAudioCueOn, "audio/pushclickon");
SAVELOAD(qsTxAudioCueOff, "audio/pushclickoff");
@@ -638,6 +641,7 @@ void Settings::load(QSettings* settings_ptr) {
SAVELOAD(bStateInTray, "ui/stateintray");
SAVELOAD(bUsage, "ui/usage");
SAVELOAD(bShowUserCount, "ui/showusercount");
+ SAVELOAD(bChatBarUseSelection, "ui/chatbaruseselection");
SAVELOAD(qsImagePath, "ui/imagepath");
SAVELOAD(bShowContextMenuInMenuBar, "ui/showcontextmenuinmenubar");
SAVELOAD(qbaConnectDialogGeometry, "ui/connect/geometry");
@@ -804,6 +808,7 @@ void Settings::save() {
SAVELOAD(bDeaf, "audio/deaf");
SAVELOAD(atTransmit, "audio/transmit");
SAVELOAD(uiDoublePush, "audio/doublepush");
+ SAVELOAD(uiPTTHold, "audio/ptthold");
SAVELOAD(bTxAudioCue, "audio/pushclick");
SAVELOAD(qsTxAudioCueOn, "audio/pushclickon");
SAVELOAD(qsTxAudioCueOff, "audio/pushclickoff");
@@ -911,6 +916,7 @@ void Settings::save() {
SAVELOAD(bStateInTray, "ui/stateintray");
SAVELOAD(bUsage, "ui/usage");
SAVELOAD(bShowUserCount, "ui/showusercount");
+ SAVELOAD(bChatBarUseSelection, "ui/chatbaruseselection");
SAVELOAD(qsImagePath, "ui/imagepath");
SAVELOAD(bShowContextMenuInMenuBar, "ui/showcontextmenuinmenubar");
SAVELOAD(qbaConnectDialogGeometry, "ui/connect/geometry");
2  src/mumble/Settings.h
View
@@ -168,6 +168,7 @@ struct Settings {
AudioTransmit atTransmit;
quint64 uiDoublePush;
+ quint64 uiPTTHold;
bool bExpert;
@@ -248,6 +249,7 @@ struct Settings {
bool bStateInTray;
bool bUsage;
bool bShowUserCount;
+ bool bChatBarUseSelection;
QByteArray qbaConnectDialogHeader, qbaConnectDialogGeometry;
bool bShowContextMenuInMenuBar;
15 src/mumble/mumble.pro
View
@@ -4,7 +4,7 @@ DEFINES *= MUMBLE
TEMPLATE = app
QT *= network sql xml svg
TARGET = mumble
-HEADERS *= BanEditor.h ACLEditor.h ConfigWidget.h Log.h AudioConfigDialog.h AudioStats.h AudioInput.h AudioOutput.h AudioOutputSample.h AudioOutputSpeech.h AudioOutputUser.h CustomElements.h MainWindow.h ServerHandler.h About.h ConnectDialog.h GlobalShortcut.h TextToSpeech.h Settings.h Database.h VersionCheck.h Global.h UserModel.h Audio.h ConfigDialog.h Plugins.h PTTButtonWidget.h LookConfig.h Overlay.h OverlayText.h SharedMemory.h AudioWizard.h ViewCert.h TextMessage.h NetworkConfig.h LCD.h Usage.h Cert.h ClientUser.h UserEdit.h Tokens.h UserView.h RichTextEditor.h UserInformation.h FileEngine.h SocketRPC.h VoiceRecorder.h VoiceRecorderDialog.h WebFetch.h
+HEADERS *= BanEditor.h ACLEditor.h ConfigWidget.h Log.h AudioConfigDialog.h AudioStats.h AudioInput.h AudioOutput.h AudioOutputSample.h AudioOutputSpeech.h AudioOutputUser.h CustomElements.h MainWindow.h ServerHandler.h About.h ConnectDialog.h GlobalShortcut.h TextToSpeech.h Settings.h Database.h VersionCheck.h Global.h UserModel.h Audio.h ConfigDialog.h Plugins.h PTTButtonWidget.h LookConfig.h Overlay.h OverlayText.h SharedMemory.h AudioWizard.h ViewCert.h TextMessage.h NetworkConfig.h LCD.h Usage.h Cert.h ClientUser.h UserEdit.h Tokens.h UserView.h RichTextEditor.h UserInformation.h FileEngine.h SocketRPC.h VoiceRecorder.h VoiceRecorderDialog.h WebFetch.h ../SignalCurry.h
SOURCES *= BanEditor.cpp ACLEditor.cpp ConfigWidget.cpp Log.cpp AudioConfigDialog.cpp AudioStats.cpp AudioInput.cpp AudioOutput.cpp AudioOutputSample.cpp AudioOutputSpeech.cpp AudioOutputUser.cpp main.cpp CustomElements.cpp MainWindow.cpp ServerHandler.cpp About.cpp ConnectDialog.cpp Settings.cpp Database.cpp VersionCheck.cpp Global.cpp UserModel.cpp Audio.cpp ConfigDialog.cpp Plugins.cpp PTTButtonWidget.cpp LookConfig.cpp OverlayClient.cpp OverlayConfig.cpp OverlayEditor.cpp OverlayEditorScene.cpp OverlayUser.cpp OverlayUserGroup.cpp Overlay.cpp OverlayText.cpp SharedMemory.cpp AudioWizard.cpp ViewCert.cpp Messages.cpp TextMessage.cpp GlobalShortcut.cpp NetworkConfig.cpp LCD.cpp Usage.cpp Cert.cpp ClientUser.cpp UserEdit.cpp Tokens.cpp UserView.cpp RichTextEditor.cpp UserInformation.cpp FileEngine.cpp SocketRPC.cpp VoiceRecorder.cpp VoiceRecorderDialog.cpp WebFetch.cpp
SOURCES *= smallft.cpp
DIST *= ../../icons/mumble.ico licenses.h smallft.h ../../icons/mumble.xpm murmur_pch.h mumble.plist
@@ -77,10 +77,15 @@ CONFIG(no-vorbis-recording) {
DEFINES *= NO_VORBIS_RECORDING
}
-CONFIG(opus) {
- INCLUDEPATH *= ../../opus-src/celt ../../opus-src/include ../../opus-src/src ../../opus-build/src
- DEFINES *= USE_OPUS
- LIBS *= -lopus
+unix:system(pkg-config --exists opus) {
+ PKGCONFIG *= opus
+ DEFINES *= USE_OPUS
+} else {
+ CONFIG(opus) {
+ INCLUDEPATH *= ../../opus-src/celt ../../opus-src/include ../../opus-src/src ../../opus-build/src
+ DEFINES *= USE_OPUS
+ LIBS *= -lopus
+ }
}
win32 {
1  src/murmur/Messages.cpp
View
@@ -40,7 +40,6 @@
#include "Connection.h"
#include "Server.h"
#include "ServerUser.h"
-#include "DBus.h"
#include "Version.h"
#define MSG_SETUP(st) \
1  src/murmur/Meta.cpp
View
@@ -33,7 +33,6 @@
#include "Meta.h"
#include "Connection.h"
-#include "DBus.h"
#include "Net.h"
#include "ServerDB.h"
#include "Server.h"
4 src/murmur/MurmurIce.cpp
View
@@ -1179,7 +1179,7 @@ static void impl_Server_setState(const ::Murmur::AMD_Server_setStatePtr cb, int
NEED_PLAYER;
NEED_CHANNEL_VAR(channel, state.channel);
- server->setUserState(user, channel, state.mute, state.deaf, state.suppress, state.prioritySpeaker, u8(state.comment));
+ server->setUserState(user, channel, state.mute, state.deaf, state.suppress, state.prioritySpeaker, u8(state.name), u8(state.comment));
cb->ice_response();
}
@@ -1423,7 +1423,7 @@ static void impl_Server_updateRegistration(const ::Murmur::AMD_Server_updateRegi
if (info.contains(ServerDB::User_Comment)) {
foreach(ServerUser *u, server->qhUsers) {
if (u->iId == id)
- server->setUserState(u, u->cChannel, u->bMute, u->bDeaf, u->bSuppress, u->bPrioritySpeaker, info.value(ServerDB::User_Comment));
+ server->setUserState(u, u->cChannel, u->bMute, u->bDeaf, u->bSuppress, u->bPrioritySpeaker, u->qsName, info.value(ServerDB::User_Comment));
}
}
7 src/murmur/RPC.cpp
View
@@ -52,7 +52,7 @@
If recursion is activated all temporary memberships in related channels will also be cleared.
*/
-void Server::setUserState(User *pUser, Channel *cChannel, bool mute, bool deaf, bool suppressed, bool prioritySpeaker, const QString &comment) {
+void Server::setUserState(User *pUser, Channel *cChannel, bool mute, bool deaf, bool suppressed, bool prioritySpeaker, const QString& name, const QString &comment) {
bool changed = false;
if (deaf)
@@ -87,11 +87,16 @@ void Server::setUserState(User *pUser, Channel *cChannel, bool mute, bool deaf,
setInfo(pUser->iId, info);
}
}
+ if (name != pUser->qsName) {
+ changed = true;
+ mpus.set_name(u8(name));
+ }
pUser->bDeaf = deaf;
pUser->bMute = mute;
pUser->bSuppress = suppressed;
pUser->bPrioritySpeaker = prioritySpeaker;
+ pUser->qsName = name;
hashAssign(pUser->qsComment, pUser->qbaCommentHash, comment);
if (cChannel != pUser->cChannel) {
1  src/murmur/Server.cpp
View
@@ -35,7 +35,6 @@
#include "ACL.h"
#include "Connection.h"
-#include "DBus.h"
#include "Group.h"
#include "User.h"
#include "Channel.h"
2  src/murmur/Server.h
View
@@ -304,7 +304,7 @@ class Server : public QThread {
void contextAction(const User *, const QString &, unsigned int, int);
public:
- void setUserState(User *p, Channel *parent, bool mute, bool deaf, bool suppressed, bool prioritySpeaker, const QString &comment = QString());
+ void setUserState(User *p, Channel *parent, bool mute, bool deaf, bool suppressed, bool prioritySpeaker, const QString& name = QString(), const QString &comment = QString());
bool setChannelState(Channel *c, Channel *parent, const QString &qsName, const QSet<Channel *> &links, const QString &desc = QString(), const int position = 0);
void sendTextMessage(Channel *cChannel, ServerUser *pUser, bool tree, const QString &text);
10 src/murmur/ServerDB.cpp
View
@@ -571,6 +571,16 @@ void Server::initialize() {
query.addBindValue(iServerNum);
query.addBindValue(QLatin1String("SuperUser"));
SQLEXEC();
+
+ int length = qrand() % 8 + 8;
+ QString pw;
+ pw.reserve(length);
+
+ while (length--)
+ pw.append(QChar(qrand() % 94 + 33));
+
+ ServerDB::setSUPW(iServerNum, pw);
+ log(QString("Password for 'SuperUser' set to '%2'").arg(pw));
}
SQLPREP("SELECT COUNT(*) FROM `%1acl` WHERE `server_id`=?");
1  src/murmur/main.cpp
View
@@ -200,6 +200,7 @@ int main(int argc, char **argv) {
bool readPw = false;
#endif
+ qsrand(QDateTime::currentDateTime().toTime_t());
qInstallMsgHandler(murmurMessageOutput);
#ifdef Q_OS_WIN

No commit comments for this range

Something went wrong with that request. Please try again.