Ticket #357: patch.txt

File patch.txt, 2.7 KB (added by jochen, 19 years ago)

Version 1.0 of the Patch.

Line 
1Index: mythgame/mythgame/gamehandler.cpp
2===================================================================
3--- mythgame/mythgame/gamehandler.cpp   (Revision 7282)
4+++ mythgame/mythgame/gamehandler.cpp   (Arbeitskopie)
5@@ -46,7 +46,15 @@
6     }
7 
8     MSqlQuery query(MSqlQuery::InitCon());
9-    query.exec("SELECT DISTINCT playername FROM gameplayers WHERE playername <> '';");
10+
11+    QString thequery = QString("SELECT DISTINCT playername FROM gameplayers WHERE "
12+                              "playername <> '' AND ( hostname = '*' OR hostname = '%1' ) ;")
13+                               .arg(gContext->GetHostName());
14+    query.exec(thequery);
15+
16+
17+//    query.exec("SELECT DISTINCT playername FROM gameplayers WHERE playername <> '' AND ( hostname = '*' OR hostname = '' ) ;");
18+
19     while (query.next())
20     {   
21         QString name = query.value(0).toString();
22Index: mythgame/mythgame/dbcheck.cpp
23===================================================================
24--- mythgame/mythgame/dbcheck.cpp       (Revision 7282)
25+++ mythgame/mythgame/dbcheck.cpp       (Arbeitskopie)
26@@ -10,7 +10,7 @@
27 
28 #include "gamesettings.h"
29 
30-const QString currentDatabaseVersion = "1008";
31+const QString currentDatabaseVersion = "1009";
32 
33 static bool UpdateDBVersionNumber(const QString &newnumber)
34 {
35@@ -1104,6 +1104,16 @@
36             return false;
37     }
38 
39+    if (dbver == "1008")
40+    {
41+        const QString updates[] = {
42+"ALTER TABLE gameplayers ADD COLUMN hostname varchar(255) NOT NULL default '*'; ",
43+""
44+};
45 
46+        if (!performActualUpdate(updates, "1009", dbver))
47+            return false;
48+    }
49+
50     return true;
51 }
52Index: mythgame/mythgame/gamesettings.cpp
53===================================================================
54--- mythgame/mythgame/gamesettings.cpp  (Revision 7282)
55+++ mythgame/mythgame/gamesettings.cpp  (Arbeitskopie)
56@@ -172,6 +172,19 @@
57     };
58 };
59 
60+class PlayerHostName: public ComboBoxSetting, public MGSetting {
61+public:
62+    PlayerHostName(const MythGamePlayerSettings& parent):
63+        MGSetting(parent, "hostname") {
64+        setLabel(QObject::tr("Hostname"));
65+        addSelection("all Clients", "*");
66+        addSelection("current Client", gContext->GetHostName());
67+        //addSelection("not on current Client", gContext->GetHostName());
68+        setValue(0);
69+        setHelpText(QObject::tr("Name of the Client Workstation on wich this Emulator works. If not set, it works on all!"));
70+    };
71+};
72+
73 MythGamePlayerSettings::MythGamePlayerSettings()
74 {
75     // must be first
76@@ -187,6 +200,7 @@
77     group->addChild(new WorkingDirPath(*this));
78     group->addChild(new Extensions(*this));
79     group->addChild(new AllowMultipleRoms(*this));
80+    group->addChild(new PlayerHostName(*this));
81     addChild(group);
82 };
83