Index: mythgame/mythgame/gamehandler.cpp =================================================================== --- mythgame/mythgame/gamehandler.cpp (Revision 7282) +++ mythgame/mythgame/gamehandler.cpp (Arbeitskopie) @@ -46,7 +46,15 @@ } MSqlQuery query(MSqlQuery::InitCon()); - query.exec("SELECT DISTINCT playername FROM gameplayers WHERE playername <> '';"); + + QString thequery = QString("SELECT DISTINCT playername FROM gameplayers WHERE " + "playername <> '' AND ( hostname = '*' OR hostname = '%1' ) ;") + .arg(gContext->GetHostName()); + query.exec(thequery); + + +// query.exec("SELECT DISTINCT playername FROM gameplayers WHERE playername <> '' AND ( hostname = '*' OR hostname = '' ) ;"); + while (query.next()) { QString name = query.value(0).toString(); Index: mythgame/mythgame/dbcheck.cpp =================================================================== --- mythgame/mythgame/dbcheck.cpp (Revision 7282) +++ mythgame/mythgame/dbcheck.cpp (Arbeitskopie) @@ -10,7 +10,7 @@ #include "gamesettings.h" -const QString currentDatabaseVersion = "1008"; +const QString currentDatabaseVersion = "1009"; static bool UpdateDBVersionNumber(const QString &newnumber) { @@ -1104,6 +1104,16 @@ return false; } + if (dbver == "1008") + { + const QString updates[] = { +"ALTER TABLE gameplayers ADD COLUMN hostname varchar(255) NOT NULL default '*'; ", +"" +}; + if (!performActualUpdate(updates, "1009", dbver)) + return false; + } + return true; } Index: mythgame/mythgame/gamesettings.cpp =================================================================== --- mythgame/mythgame/gamesettings.cpp (Revision 7282) +++ mythgame/mythgame/gamesettings.cpp (Arbeitskopie) @@ -172,6 +172,19 @@ }; }; +class PlayerHostName: public ComboBoxSetting, public MGSetting { +public: + PlayerHostName(const MythGamePlayerSettings& parent): + MGSetting(parent, "hostname") { + setLabel(QObject::tr("Hostname")); + addSelection("all Clients", "*"); + addSelection("current Client", gContext->GetHostName()); + //addSelection("not on current Client", gContext->GetHostName()); + setValue(0); + setHelpText(QObject::tr("Name of the Client Workstation on wich this Emulator works. If not set, it works on all!")); + }; +}; + MythGamePlayerSettings::MythGamePlayerSettings() { // must be first @@ -187,6 +200,7 @@ group->addChild(new WorkingDirPath(*this)); group->addChild(new Extensions(*this)); group->addChild(new AllowMultipleRoms(*this)); + group->addChild(new PlayerHostName(*this)); addChild(group); };