Browse Source

Flexiblere Nachrichten Leiste mit integrierter Update GUI

Kolja Strohm 5 years ago
parent
commit
63e8c7f6f6
33 changed files with 1101 additions and 1004 deletions
  1. 2 2
      KSGClient/Aktionen/AktionsThread.cpp
  2. 1 1
      KSGClient/Global/Variablen.h
  3. 2 2
      KSGClient/KSGClient.vcxproj
  4. 6 6
      KSGClient/KSGClient.vcxproj.filters
  5. 6 6
      KSGClient/NachLogin/Chat/ChatLeiste.cpp
  6. 11 13
      KSGClient/NachLogin/Chat/FreundesListe.cpp
  7. 455 377
      KSGClient/NachLogin/Chat/NachrichtenListe.cpp
  8. 64 47
      KSGClient/NachLogin/Chat/NachrichtenListe.h
  9. 2 2
      KSGClient/NachLogin/Editor/Karte/Beschreibung/KEBEditor.cpp
  10. 2 2
      KSGClient/NachLogin/Editor/Karte/Beschreibung/KEBVorschau.cpp
  11. 3 3
      KSGClient/NachLogin/Editor/Karte/KartenEditor.cpp
  12. 2 2
      KSGClient/NachLogin/Editor/Karte/ShopSeite/KESSEditor.cpp
  13. 13 13
      KSGClient/NachLogin/Editor/Karte/ShopSeite/KESSVorschau.cpp
  14. 9 18
      KSGClient/NachLogin/MiniGames/Minigames.cpp
  15. 16 16
      KSGClient/NachLogin/Shop/Karten/KartenKaufen.cpp
  16. 16 16
      KSGClient/NachLogin/Shop/Spiele/SpieleKaufen.cpp
  17. 2 5
      KSGClient/NachLogin/Spiele/Angemeldet/Angemeldet.cpp
  18. 36 36
      KSGClient/NachLogin/Spiele/Gruppe/Gruppe.cpp
  19. 6 6
      KSGClient/NachLogin/Spiele/Karte Auswahl/KarteAuswahl.cpp
  20. 14 26
      KSGClient/NachLogin/Spiele/Spiel Auswahl/SpielAuswahl.cpp
  21. 4 4
      KSGClient/NachLogin/Spiele/Statistik/SpielStatistik.cpp
  22. 2 2
      KSGClient/NachLogin/Spiele/Statistik/SpielStatistik.h
  23. 2 2
      KSGClient/NachLogin/Spiele/Team Auswahl/TeamAuswahl.cpp
  24. 14 2
      KSGClient/NachLogin/Titel/TitelLeiste.cpp
  25. 184 0
      KSGClient/NachLogin/Update/Update.cpp
  26. 62 0
      KSGClient/NachLogin/Update/Update.h
  27. 0 296
      KSGClient/NachLogin/UpdateGUI/UpdateGUI.cpp
  28. 0 73
      KSGClient/NachLogin/UpdateGUI/UpdateGUI.h
  29. 135 18
      KSGClient/Netzwerk/ChatMessageProcessor.cpp
  30. 1 0
      KSGClient/Netzwerk/ChatMessageProcessor.h
  31. 6 3
      KSGClient/Netzwerk/Patcher.cpp
  32. 3 3
      KSGClient/Netzwerk/SpielMessageProcessor.cpp
  33. 20 2
      build.bat

+ 2 - 2
KSGClient/Aktionen/AktionsThread.cpp

@@ -204,7 +204,7 @@ void AktionsThread::thread()
                 if( !loginClient->verbinde() )
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Das Ausloggen konnte nicht erfolgreich abgeschlossen werden." ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                     ladeAnimation->setSichtbar( 0 );
                     hauptScreen->setOnTop( 0 );
                     break;
@@ -233,7 +233,7 @@ void AktionsThread::thread()
                 else
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Das Ausloggen konnte nicht erfolgreich abgeschlossen werden." ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                     ladeAnimation->setSichtbar( 0 );
                     hauptScreen->setOnTop( 0 );
                     break;

+ 1 - 1
KSGClient/Global/Variablen.h

@@ -10,7 +10,7 @@
 #include "..\VorLogin\Login\Login.h"
 #include "..\VorLogin\VorLogin.h"
 #include "..\NachLogin\NachLogin.h"
-#include "..\NachLogin\UpdateGUI\UpdateGUI.h"
+#include "..\NachLogin\Update\Update.h"
 #include "Bilder.h"
 #include "DLLDateien.h"
 #include <Animation.h>

+ 2 - 2
KSGClient/KSGClient.vcxproj

@@ -235,7 +235,7 @@ copy "..\..\KSGNetwork\x64\Debug\KSGNetwork.dll" "data\bin\KSGNetwork.dll"</Comm
     <ClCompile Include="NachLogin\Spiele\Statistik\SpielStatistik.cpp" />
     <ClCompile Include="NachLogin\Spiele\Team Auswahl\TeamAuswahl.cpp" />
     <ClCompile Include="NachLogin\Titel\TitelLeiste.cpp" />
-    <ClCompile Include="NachLogin\UpdateGUI\UpdateGUI.cpp" />
+    <ClCompile Include="NachLogin\Update\Update.cpp" />
     <ClCompile Include="Netzwerk\ChatMessageProcessor.cpp" />
     <ClCompile Include="Netzwerk\KeepAlive.cpp" />
     <ClCompile Include="Netzwerk\KSGServer.cpp" />
@@ -305,7 +305,7 @@ copy "..\..\KSGNetwork\x64\Debug\KSGNetwork.dll" "data\bin\KSGNetwork.dll"</Comm
     <ClInclude Include="NachLogin\Spiele\Statistik\SpielStatistik.h" />
     <ClInclude Include="NachLogin\Spiele\Team Auswahl\TeamAuswahl.h" />
     <ClInclude Include="NachLogin\Titel\TitelLeiste.h" />
-    <ClInclude Include="NachLogin\UpdateGUI\UpdateGUI.h" />
+    <ClInclude Include="NachLogin\Update\Update.h" />
     <ClInclude Include="Netzwerk\ChatMessageProcessor.h" />
     <ClInclude Include="Netzwerk\KeepAlive.h" />
     <ClInclude Include="Netzwerk\KSGServer.h" />

+ 6 - 6
KSGClient/KSGClient.vcxproj.filters

@@ -198,9 +198,6 @@
     <ClCompile Include="NachLogin\Titel\TitelLeiste.cpp">
       <Filter>Quelldateien</Filter>
     </ClCompile>
-    <ClCompile Include="NachLogin\UpdateGUI\UpdateGUI.cpp">
-      <Filter>Quelldateien</Filter>
-    </ClCompile>
     <ClCompile Include="NachLogin\NachLogin.cpp">
       <Filter>Quelldateien</Filter>
     </ClCompile>
@@ -219,6 +216,9 @@
     <ClCompile Include="Netzwerk\SpielMessageProcessor.cpp">
       <Filter>Quelldateien</Filter>
     </ClCompile>
+    <ClCompile Include="NachLogin\Update\Update.cpp">
+      <Filter>Quelldateien</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="Global\Variablen.h">
@@ -401,9 +401,6 @@
     <ClInclude Include="NachLogin\Titel\TitelLeiste.h">
       <Filter>Headerdateien</Filter>
     </ClInclude>
-    <ClInclude Include="NachLogin\UpdateGUI\UpdateGUI.h">
-      <Filter>Headerdateien</Filter>
-    </ClInclude>
     <ClInclude Include="NachLogin\NachLogin.h">
       <Filter>Headerdateien</Filter>
     </ClInclude>
@@ -422,5 +419,8 @@
     <ClInclude Include="Netzwerk\SpielMessageProcessor.h">
       <Filter>Headerdateien</Filter>
     </ClInclude>
+    <ClInclude Include="NachLogin\Update\Update.h">
+      <Filter>Headerdateien</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>

+ 6 - 6
KSGClient/NachLogin/Chat/ChatLeiste.cpp

@@ -775,7 +775,7 @@ void ChatroomFenster::doMausEreignis( MausEreignis &me )
 				if( chatClient->chatroomEinladung( accountId, chatroomId ) )
 				{
 					nachLogin->zNachrichtenListe()->addNachricht( new Text( "Chatroom Einladung" ), new Text( "Es wurde eine Chatroom Einladung an den Spieler gesendet." ),
-																  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+																  new Text( "Ok" ), 0 );
 					spielerName->setText( "" );
 					spielerName->setAuswahl( 0, 0 );
 					rend = 1;
@@ -784,7 +784,7 @@ void ChatroomFenster::doMausEreignis( MausEreignis &me )
 			else
 			{
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Der Spieler wurde nicht gefunden." ),
-															  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+															  new Text( "Ok" ), 0 );
 			}
 		}
 		break;
@@ -832,7 +832,7 @@ void ChatroomFenster::doTastaturEreignis( TastaturEreignis &te )
 				if( chatClient->chatroomEinladung( accountId, chatroomId ) )
 				{
 					nachLogin->zNachrichtenListe()->addNachricht( new Text( "Chatroom Einladung" ), new Text( "Es wurde eine Chatroom Einladung an den Spieler gesendet." ),
-																  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+																  new Text( "Ok" ), 0 );
 					spielerName->setText( "" );
 					spielerName->setAuswahl( 0, 0 );
 					rend = 1;
@@ -841,7 +841,7 @@ void ChatroomFenster::doTastaturEreignis( TastaturEreignis &te )
 			else
 			{
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Der Spieler wurde nicht gefunden." ),
-															  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+															  new Text( "Ok" ), 0 );
 			}
 		}
 		break;
@@ -885,7 +885,7 @@ bool ChatroomFenster::druckFreund( void *obj, MausEreignis &me )
 			if( chatClient->freundesAnfrage( accountId ) )
 			{
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Freundes Einladung" ), new Text( "Es wurde eine Freundesanfrage an den Spieler gesendet." ),
-															  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+															  new Text( "Ok" ), 0 );
 			}
 		}
 		return 0;
@@ -904,7 +904,7 @@ bool ChatroomFenster::druckEntfernen( void *obj, MausEreignis &me )
 			if( chatClient->chatroomKick( chatroomId, accountId ) )
 			{
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Kick" ), new Text( "Der Spieler musste das Chatroom verlassen." ),
-															  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+															  new Text( "Ok" ), 0 );
 			}
 		}
 		return 0;

+ 11 - 13
KSGClient/NachLogin/Chat/FreundesListe.cpp

@@ -232,13 +232,15 @@ void FreundData::doMausEreignis( MausEreignis &me )
 			// freund entfernen
 			if( me.id == ME_RLinks )
 			{
-				int *id = new int;
-				*id = accountId;
+				int id = accountId;
 				Text *nachricht = new Text( "Möchtest du deine Freundschaft mit " );
 				nachricht->append( name->zText()->getText() );
 				nachricht->append( " wirklich beenden?" );
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Bist du dir Sicher?" ), nachricht, new Text( "ja" ),
-															  new Text( "abbrechen" ), NachrichtType::freundEntfernen, id );
+                                                              new Text( "abbrechen" ), [ id ]()
+                {
+                    chatClient->freundschaftBeenden( id );
+                } );
 			}
 			break;
 		case 4: // In Gruppe einladen
@@ -249,21 +251,21 @@ void FreundData::doMausEreignis( MausEreignis &me )
                 if( !anmeldungClient )
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
                 if( anmeldungClient && anmeldungClient->verbinde() )
                 {
                     if( !anmeldungClient->gruppeSpielerEinladen( accountId, nachLogin->zSpielenFenster()->getGruppeId() ) )
                     {
                         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                                      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                      new Text( "Ok" ), 0 );
                     }
                     anmeldungClient->trenne( 0 );
                 }
                 else
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
 			}
 		default:
@@ -891,8 +893,6 @@ void FreundesListe::thread()
 		nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 													   new Text( "Dein Accountname konnte nicht ermittelt werden." ),
 													   new Text( "Ok" ),
-													   0,
-													   NachrichtType::nachricht,
 													   0 );
 	}
 	err = 0;
@@ -901,8 +901,6 @@ void FreundesListe::thread()
 		nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 													   new Text( "Deine Freunde konnten nicht geladen werden." ),
 													   new Text( "Ok" ),
-													   0,
-													   NachrichtType::nachricht,
 													   0 );
 	}
 	run = 0;
@@ -1109,13 +1107,13 @@ bool FreundesListe::druckNeuerFreundFertig( MausEreignis &me )
 				if( chatClient->freundesAnfrage( accountId ) )
 				{
 					nachLogin->zNachrichtenListe()->addNachricht( new Text( "Freundesanfrage" ), new Text( "Es wurde eine Anfrage an den Spieler gesendet." ),
-																  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+																  new Text( "Ok" ), 0 );
 					neuerFreundSichtbar = 0;
 				}
 			}
 			else
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Der Spieler wurde nicht gefunden." ),
-				new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+				new Text( "Ok" ), 0 );
 		}
 	}
 	return 1;
@@ -1149,7 +1147,7 @@ bool FreundesListe::druckNeuerChatFertig( MausEreignis &me )
 			}
 			else
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Der Spieler wurde nicht gefunden." ),
-				new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+				new Text( "Ok" ), 0 );
 		}
 	}
 	return 1;

+ 455 - 377
KSGClient/NachLogin/Chat/NachrichtenListe.cpp

@@ -13,149 +13,445 @@
 
 typedef GSL::GSLDateiV *( *GetGSLDatei )( );
 
+NLNachricht::NLNachricht( Schrift *zSchrift, Text *titel )
+{
+    rahmen = new LRahmen();
+    rahmen->setRamenBreite( 1 );
+    rahmen->setFarbe( 0xFFFFFFFF );
+    this->titel = initTextFeld( 1, 1, 208, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, titel->getText() );
+    titel = titel->release();
+    close = initKnopf( 208, 1, 20, 20, 0, 0, "" );
+    close->setStyle( Knopf::Style::Sichtbar | Knopf::Style::Erlaubt | Knopf::Style::Hintergrund | Knopf::Style::HBild | Knopf::Style::HAlpha | Knopf::Style::KlickBuffer );
+    Bild *closeBild = bilder->get( "chat.ltdb/entfernen.png" );
+    if( !closeBild )
+    {
+        LTDBDatei *datei = new LTDBDatei();
+        datei->setDatei( new Text( "data/client/bilder/chat.ltdb" ) );
+        datei->leseDaten( 0 );
+        closeBild = datei->laden( 0, new Text( "entfernen.png" ) );
+        datei->release();
+        bilder->add( "chat.ltdb/entfernen.png", closeBild->getThis() );
+    }
+    close->setHintergrundBildZ( closeBild );
+    initToolTip( close, "Nachricht ignorieren.", zSchrift->getThis(), hauptScreen );
+    maxHöhe = 20;
+    ref = 1;
+    animation = 1;
+    ausgewählt = 0;
+    tickVal = 0;
+    rend = 0;
+    höhe = 0;
+}
+
+NLNachricht::~NLNachricht()
+{
+    titel = titel->release();
+    close = close->release();
+    rahmen = rahmen->release();
+}
+
+
+void NLNachricht::entfernen()
+{
+    animation = 3;
+}
+
+void NLNachricht::setAusgewählt( bool ausgewählt )
+{
+    if( animation != 3 )
+    {
+        this->ausgewählt = ausgewählt;
+        if( ausgewählt )
+            animation = 2;
+        else
+            animation = 1;
+    }
+}
+
+void NLNachricht::doMausEreignis( MausEreignis &me )
+{
+    if( animation != 3 )
+    {
+        bool tmp = 0;
+        if( me.my > höhe || !ausgewählt )
+        {
+            tmp = me.verarbeitet;
+            me.verarbeitet = 1;
+        }
+        char aktion = me.verarbeitet ? 2 : 0;
+        close->doMausEreignis( me );
+        if( !aktion )
+            aktion = me.verarbeitet ? 1 : 0;
+        if( me.my > höhe || !ausgewählt )
+        {
+            me.verarbeitet = tmp;
+            return;
+        }
+        if( me.id != ME_RLinks )
+            return;
+        if( aktion == 1 )
+            entfernen();
+    }
+}
+
+bool NLNachricht::tick( double tickVal )
+{
+    rend |= close->tick( tickVal );
+    if( !animation )
+    {
+        bool ret = rend;
+        rend = 0;
+        return ret;
+    }
+    this->tickVal += tickVal * 100;
+    int val = (int)this->tickVal;
+    if( val < 1 )
+    {
+        bool ret = rend;
+        rend = 0;
+        return ret;
+    }
+    if( val > 4 )
+        val = 4;
+    this->tickVal -= val;
+    switch( animation )
+    {
+    case 1:
+        if( höhe != 20 )
+        {
+            if( höhe > 20 )
+            {
+                höhe -= val;
+                if( höhe < 20 )
+                    höhe = 20;
+            }
+            else
+            {
+                höhe += val;
+                if( höhe > 20 )
+                    höhe = 20;
+            }
+            rend = 1;
+        }
+        else
+            animation = 0;
+        break;
+    case 2:
+        if( höhe != maxHöhe )
+        {
+            höhe += val;
+            if( höhe > maxHöhe )
+                höhe = maxHöhe;
+            rend = 1;
+        }
+        else
+            animation = 0;
+        break;
+    case 3:
+        höhe -= val;
+        if( höhe <= 0 )
+        {
+            nachLogin->zNachrichtenListe()->removeNachricht( this ); // delete this
+            return 1;
+        }
+        rend = 1;
+        break;
+    }
+    bool ret = rend;
+    rend = 0;
+    return ret;
+}
+
+void NLNachricht::render( int y, Bild &zRObj )
+{
+    int br = 228;
+    int hö = höhe;
+    if( !zRObj.setDrawOptions( 0, y, br, hö ) )
+        return;
+    rahmen->setSize( br, hö );
+    rahmen->render( zRObj );
+    int rbr = rahmen->getRBreite();
+    if( !zRObj.setDrawOptions( rbr, rbr, br - rbr * 2, hö - rbr * 2 ) )
+    {
+        zRObj.releaseDrawOptions();
+        return;
+    }
+    titel->render( zRObj );
+    close->render( zRObj );
+    zRObj.releaseDrawOptions();
+    zRObj.releaseDrawOptions();
+}
+
+// contant
+bool NLNachricht::istAusgewählt() const
+{
+    return ausgewählt;
+}
+
+int NLNachricht::getHeight() const
+{
+    return höhe;
+}
+
+Text *NLNachricht::zTitel() const
+{
+    return titel->zText();
+}
+
+// Reference Counting
+NLNachricht *NLNachricht::getThis()
+{
+    ref++;
+    return this;
+}
+
+NLNachricht *NLNachricht::release()
+{
+    ref--;
+    if( !ref )
+        delete this;
+    return 0;
+}
+
+SpielUpdateNachricht::SpielUpdateNachricht( Schrift *zSchrift, Text *titel, Text *nachricht, int dgID, std::function<void()> posAk, std::function<void()> negAk )
+    : NLNachricht( zSchrift, titel )
+{
+    Text *result = new Text( nachricht->getText() );
+    int län = nachricht->getLength();
+    char *txt = nachricht->getText();
+    int x = 0;
+    int y = 0;
+    zSchrift->lock();
+    zSchrift->setSchriftSize( 12 );
+    Alphabet *tmp = zSchrift->getAlphabet( 12 );
+    int zeilenHöhe = tmp->getZeilenHeight() + tmp->getZeilenAbstand();
+    int lastPos = -1;
+    for( int i = 0; i < län; i++ )
+    {
+        char c = txt[ i ];
+        if( c == ' ' )
+        {
+            lastPos = i;
+            x += 6;
+            continue;
+        }
+        if( c == '\n' )
+        {
+            x = 0;
+            y += zeilenHöhe;
+            lastPos = -1;
+            continue;
+        }
+        Buchstabe *b = tmp->getBuchstabe( (unsigned)c );
+        if( b )
+        {
+            x += b->getBreite();
+            if( x > 228 && lastPos > -1 )
+            {
+                result->ersetzen( lastPos, lastPos + 1, "\n" );
+                x = 0;
+                y += zeilenHöhe;
+                i = lastPos;
+                lastPos = -1;
+            }
+            b = b->release();
+        }
+    }
+    y += zeilenHöhe;
+    tmp = tmp->release();
+    zSchrift->unlock();
+    nachricht = nachricht->release();
+    text = initTextFeld( 1, 22, 228, y, zSchrift, TextFeld::Style::Text, result->getText() );
+    result = result->release();
+    fortschritt = initFBalken( 5, y + 20, 215, 20, zSchrift, FBalken::Style::normal );
+    herunterladen = initKnopf( 10, 45 + y, 120, 20, zSchrift, Knopf::Style::Sichtbar, "herunterladen" );
+    abbrechen = initKnopf( 140, 45 + y, 80, 20, zSchrift, Knopf::Style::Sichtbar, "abbrechen" );
+    this->posAk = posAk;
+    this->negAk = negAk;
+    maxHöhe = 75 + y;
+    update = new Update( zSchrift, fortschritt->getThis(), dgID, [this]( bool ok )
+    {
+        this->animation = 3;
+        if( ok )
+            this->posAk();
+        else
+            this->negAk();
+    } );
+    if( !updateH->add( update->getThis() ) )
+        entfernen();
+}
+
+SpielUpdateNachricht::~SpielUpdateNachricht()
+{
+    text->release();
+    herunterladen->release();
+    abbrechen->release();
+    fortschritt->release();
+    updateH->remove( update->getDateiGruppe() );
+    update->release();
+}
+
+// nicht constant
+void SpielUpdateNachricht::entfernen()
+{
+    __super::entfernen();
+    negAk();
+}
+
+void SpielUpdateNachricht::doMausEreignis( MausEreignis &me )
+{
+    __super::doMausEreignis( me );
+    if( animation != 3 )
+    {
+        bool tmp = 0;
+        if( me.my > höhe || !ausgewählt )
+        {
+            tmp = me.verarbeitet;
+            me.verarbeitet = 1;
+        }
+        char aktion = me.verarbeitet ? 3 : 0;
+        herunterladen->doMausEreignis( me );
+        if( !aktion )
+            aktion = me.verarbeitet ? 1 : 0;
+        abbrechen->doMausEreignis( me );
+        if( !aktion )
+            aktion = me.verarbeitet ? 2 : 0;
+        if( me.my > höhe || !ausgewählt )
+        {
+            me.verarbeitet = tmp;
+            return;
+        }
+        if( me.id != ME_RLinks )
+            return;
+        switch( aktion )
+        {
+        case 1:
+            // positiv
+            update->herunterladen();
+            herunterladen->removeStyle( Knopf::Style::Erlaubt | Knopf::Style::Sichtbar );
+            break;
+        case 2:
+            // negativ
+            update->abbrechen();
+            abbrechen->removeStyle( Knopf::Style::Erlaubt | Knopf::Style::Sichtbar );
+            break;
+        }
+    }
+}
+
+bool SpielUpdateNachricht::tick( double tickVal )
+{
+    rend |= herunterladen->tick( tickVal );
+    rend |= fortschritt->tick( tickVal );
+    rend |= abbrechen->tick( tickVal );
+    rend |= text->tick( tickVal );
+    return __super::tick( tickVal );
+}
+
+void SpielUpdateNachricht::render( int y, Bild &zRObj )
+{
+    __super::render( y, zRObj );
+    int rbr = rahmen->getRBreite();
+    if( !zRObj.setDrawOptions( rbr, y + rbr, rahmen->getBreite() - rbr * 2, rahmen->getHeight() - rbr * 2 ) )
+        return;
+    text->render( zRObj );
+    fortschritt->render( zRObj );
+    herunterladen->render( zRObj );
+    abbrechen->render( zRObj );
+    zRObj.releaseDrawOptions();
+}
+
 // Inhalt der Nachricht Klasse aus NachrichtListe.h
 // Konstruktor
-Nachricht::Nachricht( Schrift *zSchrift, Text *titel, Text *nachricht, Text *positiv, Text *negativ, char type, void *param )
-{
-	rahmen = new LRahmen();
-	rahmen->setRamenBreite( 1 );
-	rahmen->setFarbe( 0xFFFFFFFF );
-	this->titel = initTextFeld( 1, 1, 208, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::Center, titel->getText() );
-	titel = titel->release();
-	close = initKnopf( 208, 1, 20, 20, 0, 0, "" );
-	close->setStyle( Knopf::Style::Sichtbar | Knopf::Style::Erlaubt | Knopf::Style::Hintergrund | Knopf::Style::HBild | Knopf::Style::HAlpha | Knopf::Style::KlickBuffer );
-	Bild *closeBild = bilder->get( "chat.ltdb/entfernen.png" );
-	if( !closeBild )
-	{
-		LTDBDatei *datei = new LTDBDatei();
-		datei->setDatei( new Text( "data/client/bilder/chat.ltdb" ) );
-		datei->leseDaten( 0 );
-		closeBild = datei->laden( 0, new Text( "entfernen.png" ) );
-		datei->release();
-		bilder->add( "chat.ltdb/entfernen.png", closeBild->getThis() );
-	}
-	close->setHintergrundBildZ( closeBild );
-	initToolTip( close, "Nachricht ignorieren.", zSchrift->getThis(), hauptScreen );
-	Text *result = new Text( nachricht->getText() );
-	int län = nachricht->getLength();
-	char *txt = nachricht->getText();
-	int x = 0;
-	int y = 0;
-	zSchrift->lock();
-	zSchrift->setSchriftSize( 12 );
-	Alphabet *tmp = zSchrift->getAlphabet( 12 );
-	int zeilenHöhe = tmp->getZeilenHeight() + tmp->getZeilenAbstand();
-	int lastPos = -1;
-	for( int i = 0; i < län; i++ )
-	{
-		char c = txt[ i ];
-		if( c == ' ' )
-		{
-			lastPos = i;
-			x += 6;
-			continue;
-		}
-		if( c == '\n' )
-		{
-			x = 0;
-			y += zeilenHöhe;
-			lastPos = -1;
-			continue;
-		}
-		Buchstabe *b = tmp->getBuchstabe( (unsigned)c );
-		if( b )
-		{
-			x += b->getBreite();
-			if( x > 228 && lastPos > -1 )
-			{
-				result->ersetzen( lastPos, lastPos + 1, "\n" );
-				x = 0;
-				y += zeilenHöhe;
-				i = lastPos;
-				lastPos = -1;
-			}
-			b = b->release();
-		}
-	}
-	y += zeilenHöhe;
-	tmp = tmp->release();
-	zSchrift->unlock();
-	nachricht = nachricht->release();
-	text = initTextFeld( 1, 22, 228, y, zSchrift, TextFeld::Style::Text, result->getText() );
-	result = result->release();
-	if( positiv )
-	{
-		this->positiv = initKnopf( 10, 20 + y, 100, 20, zSchrift, Knopf::Style::Sichtbar, positiv->getText() );
-		positiv = positiv->release();
-	}
-	else
-		this->positiv = 0;
-	if( negativ )
-	{
-		this->negativ = initKnopf( 120, 20 + y, 100, 20, zSchrift, Knopf::Style::Sichtbar, negativ->getText() );
-		negativ = negativ->release();
-	}
-	else
-		this->negativ = 0;
-	typ = type;
-	this->param = param;
-	maxHöhe = 50 + y;
-	ref = 1;
-	animation = 1;
-	ausgewählt = 0;
-	tickVal = 0;
-	rend = 0;
-	höhe = 0;
+Nachricht::Nachricht( Schrift *zSchrift, Text *titel, Text *nachricht, Text *positiv, Text *negativ, std::function<void()> posAk, std::function<void()> negAk )
+    : NLNachricht( zSchrift, titel )
+{
+    
+    Text *result = new Text( nachricht->getText() );
+    int län = nachricht->getLength();
+    char *txt = nachricht->getText();
+    int x = 0;
+    int y = 0;
+    zSchrift->lock();
+    zSchrift->setSchriftSize( 12 );
+    Alphabet *tmp = zSchrift->getAlphabet( 12 );
+    int zeilenHöhe = tmp->getZeilenHeight() + tmp->getZeilenAbstand();
+    int lastPos = -1;
+    for( int i = 0; i < län; i++ )
+    {
+        char c = txt[ i ];
+        if( c == ' ' )
+        {
+            lastPos = i;
+            x += 6;
+            continue;
+        }
+        if( c == '\n' )
+        {
+            x = 0;
+            y += zeilenHöhe;
+            lastPos = -1;
+            continue;
+        }
+        Buchstabe *b = tmp->getBuchstabe( (unsigned)c );
+        if( b )
+        {
+            x += b->getBreite();
+            if( x > 228 && lastPos > -1 )
+            {
+                result->ersetzen( lastPos, lastPos + 1, "\n" );
+                x = 0;
+                y += zeilenHöhe;
+                i = lastPos;
+                lastPos = -1;
+            }
+            b = b->release();
+        }
+    }
+    y += zeilenHöhe;
+    tmp = tmp->release();
+    zSchrift->unlock();
+    nachricht = nachricht->release();
+    text = initTextFeld( 1, 22, 228, y, zSchrift, TextFeld::Style::Text, result->getText() );
+    result = result->release();
+    if( positiv )
+    {
+        this->positiv = initKnopf( 10, 20 + y, 100, 20, zSchrift, Knopf::Style::Sichtbar, positiv->getText() );
+        positiv = positiv->release();
+    }
+    else
+        this->positiv = 0;
+    if( negativ )
+    {
+        this->negativ = initKnopf( 120, 20 + y, 100, 20, zSchrift, Knopf::Style::Sichtbar, negativ->getText() );
+        negativ = negativ->release();
+    }
+    else
+        this->negativ = 0;
+    this->posAk = posAk;
+    this->negAk = negAk;
+    maxHöhe = 50 + y;
 }
 
 // Destruktor
 Nachricht::~Nachricht()
 {
-	switch( typ )
-	{
-	case 1:
-		delete ( (int*)param );
-		break;
-	case 2:
-		delete ( (int*)param );
-		break;
-	case 3:
-		delete ( (SpielEinladungParam*)param );
-		break;
-	case 4:
-		delete ( (ChatroomEinladungParam*)param );
-		break;
-	}
-	titel = titel->release();
 	text = text->release();
-	close = close->release();
 	if( positiv )
 		positiv = positiv->release();
 	if( negativ )
 		negativ = negativ->release();
-	rahmen = rahmen->release();
 }
 
-// nicht constant
 void Nachricht::entfernen()
 {
-	animation = 3;
-}
-
-void Nachricht::setAusgewählt( bool ausw )
-{
-	if( animation != 3 )
-	{
-		ausgewählt = ausw;
-		if( ausw )
-			animation = 2;
-		else
-			animation = 1;
-	}
+    __super::entfernen();
+    negAk();
 }
 
 void Nachricht::doMausEreignis( MausEreignis &me )
 {
+    __super::doMausEreignis( me );
 	if( animation != 3 )
 	{
 		bool tmp = 0;
@@ -164,17 +460,15 @@ void Nachricht::doMausEreignis( MausEreignis &me )
 			tmp = me.verarbeitet;
 			me.verarbeitet = 1;
 		}
-		char aktion = 0;
+		char aktion = me.verarbeitet ? 3 : 0;
 		if( positiv )
 			positiv->doMausEreignis( me );
-		aktion = me.verarbeitet ? 1 : 0;
+        if( !aktion )
+            aktion = me.verarbeitet ? 1 : 0;
 		if( negativ )
 			negativ->doMausEreignis( me );
 		if( !aktion )
 			aktion = me.verarbeitet ? 2 : 0;
-		close->doMausEreignis( me );
-		if( !aktion )
-			aktion = me.verarbeitet ? 3 : 0;
 		if( me.my > höhe || !ausgewählt )
 		{
 			me.verarbeitet = tmp;
@@ -182,146 +476,17 @@ void Nachricht::doMausEreignis( MausEreignis &me )
 		}
 		if( me.id != ME_RLinks )
 			return;
-		if( aktion )
-			animation = 3;
+        if( aktion )
+            entfernen();
 		switch( aktion )
 		{
 		case 1:
-			// positiv
-			switch( typ )
-			{
-			case 1: // freund entfernen
-				chatClient->freundschaftBeenden( *( (int*)param ) );
-				break;
-			case 2: // freund einladung
-				chatClient->freundesAnfrageBeantworten( *( (int*)param ), 1 );
-				break;
-			case 3: // spiel einladung
-				if( 1 )
-				{
-					int karteId = infoClient->getGruppenKarteId( ( (SpielEinladungParam*)param )->gruppeId );
-					int spielArt = infoClient->getSpielId( karteId );
-					KSGTDatei *dgt = new KSGTDatei( "data/dg.ksgt" );
-					dgt->laden();
-					bool sak = 0;
-					int dgSId = infoClient->getDateiGruppeIdVonSpiel( spielArt );
-					bool sgf = 0;
-					for( int i = 0; i < dgt->getZeilenAnzahl(); i++ )
-					{
-						if( dgt->zFeld( i, 0 ) && TextZuInt( dgt->zFeld( i, 0 )->getText(), 10 ) == dgSId )
-						{
-							sgf = 1;
-							int lv = dgt->zFeld( i, 2 ) ? TextZuInt( dgt->zFeld( i, 2 )->getText(), 10 ) : 0;
-							int ov = infoClient->getSpielVersion( spielArt );
-                            if( lv == ov )
-                            {
-                                sak = 1;
-                                break;
-                            }
-						}
-					}
-					dgt->release();
-					if( !sak )
-					{
-                        if( !anmeldungClient )
-                            anmeldungClient = mainClient->createAnmeldungServerClient();
-                        if( anmeldungClient && anmeldungClient->verbinde() )
-                        {
-                            anmeldungClient->gruppeEinladungAblehnen( ( (SpielEinladungParam*)param )->gruppeId );
-                            anmeldungClient->trenne( 0 );
-                        }
-                        nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Deine Spiel Version ist nicht aktuell. Sie wird beim nächsten Spielstart aktualisiert." ), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
-						if( !sgf )
-						{
-							Text *pfad = infoClient->getDateiGruppePfad( dgSId );
-							Text *idT = new Text();
-							idT->append( dgSId );
-							if( pfad )
-							{
-								KSGTDatei *dg = new KSGTDatei( "data/dg.ksgt" );
-								dg->laden();
-								RCArray< Text > *zeile = new RCArray< Text >();
-								zeile->add( idT );
-								zeile->add( pfad );
-								zeile->add( new Text( "0" ) );
-								zeile->add( new Text( "0" ) );
-								dg->addZeile( 4, zeile );
-								zeile->release();
-								dg->speichern();
-								dg->release();
-							}
-							else
-								idT->release();
-						}
-					}
-                    else
-                    {
-                        MausEreignis me;
-                        me.verarbeitet = 0;
-                        me.id = ME_RLinks;
-                        nachLogin->zTitelLeiste()->druckSpielen( me );
-                        Array< int > *spieler = new Array< int >();
-                        int anzahl = 0;
-                        if( !anmeldungClient )
-                            anmeldungClient = mainClient->createAnmeldungServerClient();
-                        if( !anmeldungClient )
-                            nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
-                        if( anmeldungClient && anmeldungClient->verbinde() )
-                        {
-                            if( anmeldungClient->gruppeBetreten( ( (SpielEinladungParam*)param )->gruppeId, spieler, &anzahl ) )
-                            {
-                                nachLogin->zSpielenFenster()->gruppeBetreten( ( (SpielEinladungParam*)param )->gruppeId );
-                                for( int i = 0; i < anzahl; i++ )
-                                    nachLogin->zSpielenFenster()->spielerBetrittGruppe( ( (SpielEinladungParam*)param )->gruppeId, spieler->hat( i ) ? spieler->get( i ) : 0 );
-                            }
-                            else
-                                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
-                            anmeldungClient->trenne( 0 );
-                        } else if( anmeldungClient )
-                            nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
-                    }
-				}
-				break;
-			case 4: // chatroom einladung
-				nachLogin->zChatLeiste()->addChat( 0, ( (ChatroomEinladungParam*)param )->chatroomId );
-				chatClient->chatroomBetreten( ( (ChatroomEinladungParam*)param )->chatroomId );
-				break;
-			case 5: // logout
-				::aktion = 3;
-				break;
-			case 6: // close
-				nachLogin->zChatLeiste()->removeAll();
-                if( loginClient && loginClient->verbinde() )
-                {
-                    loginClient->logout();
-                    loginClient->trenne( 1 );
-                }
-				PostQuitMessage( 0 );
-				break;
-			}
+            // positiv
+            posAk();
 			break;
 		case 2:
-			// schließn
-		case 3:
 			// negativ
-			switch( typ )
-			{
-			case 2:
-				chatClient->freundesAnfrageBeantworten( *( (int*)param ), 0 );
-				break;
-			case 3: // spiel einladung
-                if( !anmeldungClient )
-                    anmeldungClient = mainClient->createAnmeldungServerClient();
-                if( anmeldungClient && anmeldungClient->verbinde() )
-                {
-                    anmeldungClient->gruppeEinladungAblehnen( ( (SpielEinladungParam*)param )->gruppeId );
-                    anmeldungClient->trenne( 0 );
-                }
-                break;
-			case 4:
-				chatClient->chatroomEinladungAblehnen( ( (ChatroomEinladungParam*)param )->vonAccount, ( (ChatroomEinladungParam*)param )->chatroomId );
-				break;
-			}
+            negAk();
 			break;
 		}
 	}
@@ -329,133 +494,33 @@ void Nachricht::doMausEreignis( MausEreignis &me )
 
 bool Nachricht::tick( double tickVal )
 {
-	rend |= close->tick( tickVal );
 	rend |= positiv ? positiv->tick( tickVal ) : 0;
 	rend |= negativ ? negativ->tick( tickVal ) : 0;
 	rend |= text->tick( tickVal );
-	if( !animation )
-	{
-		bool ret = rend;
-		rend = 0;
-		return ret;
-	}
-	this->tickVal += tickVal * 100;
-	int val = ( int )this->tickVal;
-	if( val < 1 )
-	{
-		bool ret = rend;
-		rend = 0;
-		return ret;
-	}
-	if( val > 4 )
-		val = 4;
-	this->tickVal -= val;
-	switch( animation )
-	{
-	case 1:
-		if( höhe != 20 )
-		{
-			if( höhe > 20 )
-			{
-				höhe -= val;
-				if( höhe < 20 )
-					höhe = 20;
-			}
-			else
-			{
-				höhe += val;
-				if( höhe > 20 )
-					höhe = 20;
-			}
-			rend = 1;
-		}
-		else
-			animation = 0;
-		break;
-	case 2:
-		if( höhe != maxHöhe )
-		{
-			höhe += val;
-			if( höhe > maxHöhe )
-				höhe = maxHöhe;
-			rend = 1;
-		}
-		else
-			animation = 0;
-		break;
-	case 3:
-		höhe -= val;
-		if( höhe <= 0 )
-		{
-			nachLogin->zNachrichtenListe()->removeNachricht( this ); // delete this
-			return 1;
-		}
-		rend = 1;
-		break;
-	}
-	bool ret = rend;
-	rend = 0;
-	return ret;
+	return __super::tick( tickVal );
 }
 
 void Nachricht::render( int yPos, Bild &zRObj )
 {
-	int y = yPos;
-	int br = 228;
-	int hö = höhe;
-	if( !zRObj.setDrawOptions( 0, y, br, hö ) )
-		return;
-	rahmen->setSize( br, hö );
-	rahmen->render( zRObj );
+    __super::render( yPos, zRObj );
 	int rbr = rahmen->getRBreite();
-	if( !zRObj.setDrawOptions( rbr, rbr, br - rbr * 2, hö - rbr * 2 ) )
-	{
-		zRObj.releaseDrawOptions();
+	if( !zRObj.setDrawOptions( rbr, yPos + rbr, rahmen->getBreite() - rbr * 2, rahmen->getHeight() - rbr * 2 ) )
 		return;
-	}
-	titel->render( zRObj );
 	text->render( zRObj );
-	close->render( zRObj );
 	if( positiv )
 		positiv->render( zRObj );
 	if( negativ )
 		negativ->render( zRObj );
 	zRObj.releaseDrawOptions();
-	zRObj.releaseDrawOptions();
 }
 
-// contant
-bool Nachricht::istAusgewählt() const
-{
-	return ausgewählt;
-}
-
-int Nachricht::getHeight() const
-{
-	return höhe;
-}
-
-// Reference Counting
-Nachricht *Nachricht::getThis()
-{
-	ref++;
-	return this;
-}
-
-Nachricht *Nachricht::release()
-{
-	ref--;
-	if( !ref )
-		delete this;
-	return 0;
-}
 
 // Inhalt der NachrichtenListeObj Klasse aus NachrichtListe.h
 // Konstruktor
 NachrichtenListeObj::NachrichtenListeObj( Schrift *zSchrift )
 : Zeichnung()
 {
-	members = new RCArray< Nachricht >();
+	members = new RCArray< NLNachricht >();
 	schrift = zSchrift->getThis();
 	vsb = new VScrollBar();
 	vsb->setKlickScroll( 10 );
@@ -475,15 +540,14 @@ NachrichtenListeObj::~NachrichtenListeObj()
 }
 
 // nicht constant
-void NachrichtenListeObj::addNachricht( Text *titel, Text *nachricht, Text *positiv, Text *negativ, char type, void *param )
+void NachrichtenListeObj::addNachricht( NLNachricht *nachricht )
 {
-	Nachricht *tmp = new Nachricht( schrift, titel, nachricht, positiv, negativ, type, param );
-	members->add( tmp, anzahl );
+	members->add( nachricht, anzahl );
 	anzahl++;
 	rend = 1;
 }
 
-void NachrichtenListeObj::removeNachricht( Nachricht *zNachricht )
+void NachrichtenListeObj::removeNachricht( NLNachricht *zNachricht )
 {
 	for( int i = 0; i < anzahl; i++ )
 	{
@@ -513,7 +577,7 @@ bool NachrichtenListeObj::tick( double tickVal )
 	rend |= nachLogin->zNachrichtenListe()->tick( tickVal );
 	for( int i = 0; i < anzahl; i++ )
 	{
-		Nachricht *tmp = members->z( i );
+		NLNachricht *tmp = members->z( i );
 		if( tmp )
 			rend |= tmp->tick( tickVal );
 	}
@@ -533,7 +597,7 @@ void NachrichtenListeObj::doMausEreignis( MausEreignis &me )
 		me.my += vsb->getScroll();
 		for( int i = 0; i < anzahl; i++ )
 		{
-			Nachricht *tmp = members->z( i );
+			NLNachricht *tmp = members->z( i );
 			if( tmp )
 			{
 				if( me.my > 0 && me.my < tmp->getHeight() )
@@ -551,7 +615,7 @@ void NachrichtenListeObj::doMausEreignis( MausEreignis &me )
 		me.my += vsb->getScroll();
 		for( int i = 0; i < anzahl; i++ )
 		{
-			Nachricht *tmp = members->z( i );
+			NLNachricht *tmp = members->z( i );
 			if( tmp )
 			{
 				tmp->setAusgewählt( 0 );
@@ -581,7 +645,7 @@ void NachrichtenListeObj::render( Bild &zrObj )
 	int höhe = 0;
 	for( int i = 0; i < anzahl; i++ )
 	{
-		Nachricht *tmp = members->z( i );
+		NLNachricht *tmp = members->z( i );
 		tmp->render( höhe - ( vsb ? vsb->getScroll() : 0 ), zrObj );
 		höhe += tmp->getHeight();
 	}
@@ -615,6 +679,7 @@ NachrichtenListeObj *NachrichtenListeObj::release()
 // Konstruktor
 NachrichtenListe::NachrichtenListe( Schrift *zSchrift, Fenster *zNachLoginFenster )
 {
+    schrift = zSchrift->getThis();
 	minimierenBild = bilder->get( "chat.ltdb/minimieren.png" );
 	if( !minimierenBild )
 	{
@@ -704,19 +769,28 @@ NachrichtenListe::~NachrichtenListe()
 	nachrichtenListe = nachrichtenListe->release();
 	minimierenBild = minimierenBild->release();
 	maximierenBild = maximierenBild->release();
+    schrift->release();
 }
 
 // nicht constant
-void NachrichtenListe::addNachricht( Text *titel, Text *nachricht, Text *positiv, Text *negativ, char type, void *param )
+void NachrichtenListe::addNachricht( Text *titel, Text *nachricht, Text *positiv, Text *negativ, std::function<void()> posAk, std::function<void()> negAk )
 {
 	if( titel && titel->hat( "Fehler" ) && errSound )
 		errSound->playSound();
 	else if( msgSound )
 		msgSound->playSound();
-	nachrichtenListe->addNachricht( titel, nachricht, positiv, negativ, type, param );
+	nachrichtenListe->addNachricht( new Nachricht( schrift, titel, nachricht, positiv, negativ, posAk, negAk ) );
+}
+void NachrichtenListe::addNachricht( NLNachricht *nachricht )
+{
+    if( nachricht->zTitel() && nachricht->zTitel()->hat( "Fehler" ) && errSound )
+        errSound->playSound();
+    else if( msgSound )
+        msgSound->playSound();
+    nachrichtenListe->addNachricht( nachricht );
 }
 
-void NachrichtenListe::removeNachricht( Nachricht *zNachricht )
+void NachrichtenListe::removeNachricht( NLNachricht *zNachricht )
 {
 	nachrichtenListe->removeNachricht( zNachricht );
 }
@@ -818,6 +892,10 @@ bool NachrichtenListe::tick( double tickVal )
 }
 
 // contant
+Schrift *NachrichtenListe::zSchrift() const
+{
+    return schrift;
+}
 
 // Reference Counting
 NachrichtenListe *NachrichtenListe::getThis()

+ 64 - 47
KSGClient/NachLogin/Chat/NachrichtenListe.h

@@ -6,76 +6,91 @@
 #include <Fenster.h>
 #include <Knopf.h>
 #include <GSLSoundV.h>
+#include <functional>
+#include <Fortschritt.h>
+#include "../Update/Update.h"
 #include "..\..\Aktionen\AktionsThread.h"
 
 using namespace Framework;
 using namespace Network;
 
-namespace NachrichtType
+class NLNachricht
 {
-	const char nachricht         = 0;
-	const char freundEntfernen   = 1;
-	const char freundEinladung   = 2;
-	const char spielEinladung    = 3;
-	const char chatroomEinladung = 4;
-	const char logout            = 5;
-	const char close         = 6;
-}
+protected:
+    TextFeld *titel;
+    Knopf *close;
+    LRahmen *rahmen;
+    int höhe;
+    int maxHöhe;
+    bool ausgewählt;
+    int animation;
+    double tickVal;
+    bool rend;
+    int ref;
 
-struct SpielEinladungParam
-{
-	int vonAccount;
-	int gruppeId;
+    NLNachricht( Schrift *zSchrift, Text *titel );
+    virtual ~NLNachricht();
+public:
+    virtual void entfernen();
+    void setAusgewählt( bool ausgewählt );
+    virtual void doMausEreignis( MausEreignis &me );
+    virtual bool tick( double tickVal );
+    virtual void render( int y, Bild &zRObj );
+    // contant
+    bool istAusgewählt() const;
+    int getHeight() const;
+    Text *zTitel() const;
+    // Reference Counting
+    NLNachricht *getThis();
+    NLNachricht *release();
 };
 
-struct ChatroomEinladungParam
+class SpielUpdateNachricht : public NLNachricht
 {
-	int vonAccount;
-	int chatroomId;
+private:
+    TextFeld *text;
+    Knopf *herunterladen;
+    Knopf *abbrechen;
+    std::function<void()> posAk;
+    std::function<void()> negAk;
+    FBalken *fortschritt;
+    Update *update;
+
+public:
+    SpielUpdateNachricht( Schrift *zSchrift, Text *titel, Text *nachricht, int dgID, std::function<void()> posAk = []() {}, std::function<void()> negAk = []() {} );
+    ~SpielUpdateNachricht();
+    // nicht constant
+    void entfernen() override;
+    void doMausEreignis( MausEreignis &me ) override;
+    bool tick( double tickVal ) override;
+    void render( int y, Bild &zRObj ) override;
 };
 
-class Nachricht
+class Nachricht : public NLNachricht
 {
 private:
-	TextFeld *titel;
 	TextFeld *text;
-	Knopf *close;
 	Knopf *positiv;
 	Knopf *negativ;
-	LRahmen *rahmen;
-	int höhe;
-	int maxHöhe;
-	bool ausgewählt;
-	int animation;
-	double tickVal;
-	char typ;
-	void *param;
-	bool rend;
-	int ref;
+    std::function<void()> posAk;
+    std::function<void()> negAk;
 
 public:
 	// Konstruktor
-	Nachricht( Schrift *zSchrift, Text *titel, Text *nachricht, Text *positiv, Text *negativ, char type, void *param );
+    Nachricht( Schrift *zSchrift, Text *titel, Text *nachricht, Text *positiv, Text *negativ, std::function<void()> posAk = []() {}, std::function<void()> negAk = []() {} );
 	// Destruktor
 	~Nachricht();
 	// nicht constant
-	void entfernen();
-	void setAusgewählt( bool ausgewählt );
-	void doMausEreignis( MausEreignis &me );
-	bool tick( double tickVal );
-	void render( int y, Bild &zRObj );
-	// contant
-	bool istAusgewählt() const;
-	int getHeight() const;
-	// Reference Counting
-	Nachricht *getThis();
-	Nachricht *release();
+    void entfernen() override;
+	void doMausEreignis( MausEreignis &me ) override;
+	bool tick( double tickVal ) override;
+	void render( int y, Bild &zRObj ) override;
 };
 
 class NachrichtenListeObj : public Zeichnung
 {
 private:
-	RCArray< Nachricht > *members;
+	RCArray< NLNachricht > *members;
 	VScrollBar *vsb;
 	Schrift *schrift;
 	Punkt bildschirmGröße;
@@ -88,8 +103,8 @@ public:
 	// Destruktor
 	~NachrichtenListeObj();
 	// nicht constant
-	void addNachricht( Text *titel, Text *nachricht, Text *positiv, Text *negativ, char type, void *param );
-	void removeNachricht( Nachricht *zNachricht );
+	void addNachricht( NLNachricht *nachricht );
+	void removeNachricht( NLNachricht *zNachricht );
 	void removeAll();
 	bool tick( double tickVal ) override;
 	void doMausEreignis( MausEreignis &me ) override;
@@ -104,6 +119,7 @@ public:
 class NachrichtenListe
 {
 private:
+    Schrift *schrift;
 	Fenster *fenster;
 	Knopf *minMax;
 	NachrichtenListeObj *nachrichtenListe;
@@ -124,13 +140,14 @@ public:
 	// Destruktor
 	~NachrichtenListe();
 	// nicht constant
-	void addNachricht( Text *titel, Text *nachricht, Text *positiv = 0, Text *negativ = 0, char type = NachrichtType::nachricht, void *param = 0 );
-	void removeNachricht( Nachricht *zNachricht );
+	void addNachricht( Text *titel, Text *nachricht, Text *positiv = 0, Text *negativ = 0, std::function<void()> posAk = []() {}, std::function<void()> negAk = []() {} );
+    void addNachricht( NLNachricht *nachricht );
+	void removeNachricht( NLNachricht *zNachricht );
 	void removeAll();
 	bool druckMinMax( MausEreignis &me );
 	bool tick( double tickVal );
 	// contant
-
+    Schrift *zSchrift() const;
 	// Reference Counting
 	NachrichtenListe *getThis();
 	NachrichtenListe *release();

+ 2 - 2
KSGClient/NachLogin/Editor/Karte/Beschreibung/KEBEditor.cpp

@@ -59,7 +59,7 @@ KEBEditor::KEBEditor( Schrift *zSchrift, KEBeschreibung *zKeb )
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                 new Text( "Der Einstiegspunkt '" KSGS_EDITOR_FUNKTION "' in der DLL-Datei "
                     "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                new Text( "Ok" ), 0 );
         }
     }
     else
@@ -67,7 +67,7 @@ KEBEditor::KEBEditor( Schrift *zSchrift, KEBeschreibung *zKeb )
         text = 0;
         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
             new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-            new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+            new Text( "Ok" ), 0 );
     }
     if( ksgsS )
         ksgsS->release();

+ 2 - 2
KSGClient/NachLogin/Editor/Karte/Beschreibung/KEBVorschau.cpp

@@ -34,7 +34,7 @@ KEBVorschauKarteScript::KEBVorschauKarteScript( Schrift *zSchrift, TextFeld *zLo
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_START_FUNKTION "' in der DLL-Datei "
                                                                     "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
     }
     else
@@ -42,7 +42,7 @@ KEBVorschauKarteScript::KEBVorschauKarteScript( Schrift *zSchrift, TextFeld *zLo
         fenster = 0;
         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                       new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-                                                      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                      new Text( "Ok" ), 0 );
     }
     ram = new LRahmen();
     ram->setSize( 578, 428 );

+ 3 - 3
KSGClient/NachLogin/Editor/Karte/KartenEditor.cpp

@@ -153,7 +153,7 @@ void KartenEditor::setKarte( int id )
     dgt->release();
     if( !sak )
     {
-        nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Deine Spiel Version ist nicht aktuell. Sie wird beim nächsten Spielstart aktualisiert. Bis dahin sind nicht alle Editorfunktionen verfügbar." ), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+        nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Deine Spiel Version ist nicht aktuell. Sie wird beim nächsten Spielstart aktualisiert. Bis dahin sind nicht alle Editorfunktionen verfügbar." ), new Text( "Ok" ), 0 );
         if( !sgf )
         {
             Text *pfad = infoClient->getDateiGruppePfad( dgSId );
@@ -193,7 +193,7 @@ void KartenEditor::setKarte( int id )
             Text *err = new Text( "Fehler beim laden der Dll Datei '" );
             err->append( pfad.getText() );
             err->append( "'. Es stehen nicht alle Editorfunktionen zur verfügung." );
-            nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), err, new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+            nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), err, new Text( "Ok" ), 0 );
         }
         else
         {
@@ -204,7 +204,7 @@ void KartenEditor::setKarte( int id )
                 Text *err = new Text( "Der Einstiegspunkt 'getEditor' wurde in der Dll Datei '" );
                 err->append( pfad.getText() );
                 err->append( "' nicht gefunden. Es stehen nicht alle Editorfunktionen zur verfügung." );
-                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), err, new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), err, new Text( "Ok" ), 0 );
             }
             else
             {

+ 2 - 2
KSGClient/NachLogin/Editor/Karte/ShopSeite/KESSEditor.cpp

@@ -40,7 +40,7 @@ KESSTextSeite::KESSTextSeite( Schrift *zSchrift, Knopf *zNeueDatei, Knopf *zDate
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                 new Text( "Der Einstiegspunkt '" KSGS_EDITOR_FUNKTION "' in der DLL-Datei "
                     "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                new Text( "Ok" ), 0 );
         }
     }
     else
@@ -48,7 +48,7 @@ KESSTextSeite::KESSTextSeite( Schrift *zSchrift, Knopf *zNeueDatei, Knopf *zDate
         text = 0;
         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
             new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-            new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+            new Text( "Ok" ), 0 );
     }
     if( ksgsS )
         ksgsS->release();

+ 13 - 13
KSGClient/NachLogin/Editor/Karte/ShopSeite/KESSVorschau.cpp

@@ -34,7 +34,7 @@ KESSVorschauKarteScript::KESSVorschauKarteScript( Schrift *zSchrift, TextFeld *z
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_START_FUNKTION "' in der DLL-Datei "
                                                           "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
     }
     else
@@ -42,7 +42,7 @@ KESSVorschauKarteScript::KESSVorschauKarteScript( Schrift *zSchrift, TextFeld *z
         fenster = 0;
         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                       new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-                                                      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                      new Text( "Ok" ), 0 );
     }
     ram = new LRahmen();
     ram->setSize( 555, 380 );
@@ -142,7 +142,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                           "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         b->release();
         return;
@@ -155,7 +155,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
                                                           "Sie könnte eventuell nicht richtig funktionieren." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         else
         {
@@ -172,7 +172,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                               "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
         }
         b->release();
@@ -191,7 +191,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                           "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         b->release();
         return;
@@ -210,7 +210,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                           "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         b->release();
         return;
@@ -228,7 +228,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                           "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         b->release();
         return;
@@ -241,7 +241,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
                                                           "Sie könnte eventuell nicht richtig funktionieren." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         b->release();
         return;
@@ -255,7 +255,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
                                                           "Sie könnte eventuell nicht richtig funktionieren." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         else
         {
@@ -266,7 +266,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
                                                               "Sie könnte eventuell nicht richtig funktionieren." ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             else
             {
@@ -299,7 +299,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
                             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                           new Text( "Der Einstiegspunkt '" KSGS_SET_BILD_FUNKTION "' in der DLL-Datei "
                                                                           "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                          new Text( "Ok" ), 0 );
                             b->release();
                         }
                         else
@@ -312,7 +312,7 @@ void KESSVorschauKarteScript::ksgsAktion( RCArray< KSGSVariable > *parameter, KS
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                   new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                                   "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
             }
             if( pf )

+ 9 - 18
KSGClient/NachLogin/MiniGames/Minigames.cpp

@@ -271,8 +271,6 @@ void MiniGames::addMiniGame( MiniGame *mg )
 		int i = games->getEintragAnzahl() - 1;
 		games->z( i )->setPosition( 10 + 10 * ( i % 3 ) + 250 * ( i % 3 ), 50 + 10 * ( i / 3 ) + 100 * ( i / 3 ) );
 	}
-	if( dg && updateH->hat( 0, dg ) )
-		updateH->remove( 0, dg );
 }
 
 void MiniGames::setAktuell( bool aktuell, int dg )
@@ -282,10 +280,15 @@ void MiniGames::setAktuell( bool aktuell, int dg )
 		new MGSuchen( getThis() );
 	if( !this->dg )
 		this->dg = dg;
-	if( !aktuell && !updateH->hat( 0, this->dg ) )
-		updateH->erstellen( schrift, 0, this->dg );
-	if( !aktuell )
-		updateH->setSichtbar( 0, 1, this->dg );
+    if( !aktuell && !updateH->hat( dg ) )
+    {
+        nachLogin->zNachrichtenListe()->addNachricht( new SpielUpdateNachricht( schrift, new Text( "Update" ), new Text( "Die minigames müssen aktualisiert werden." ), dg,
+                                                                                []()
+        {
+            if( nachLogin && nachLogin->zMGFenster() )
+                nachLogin->zMGFenster()->setAktuell( 1 );
+        } ) );
+    }
 }
 
 void MiniGames::filter()
@@ -330,14 +333,6 @@ void MiniGames::doMausEreignis( MausEreignis &me )
 		return;
 	me.mx -= pos.x;
 	me.my -= pos.y;
-	if( !aktuell )
-	{
-		me.mx -= 200;
-		me.my -= 400;
-		updateH->doMausEreignis( 0, me, dg );
-		me.mx += 200;
-		me.my += 400;
-	}
 	if( alpha2 )
 	{
 		suchName->doMausEreignis( me );
@@ -382,8 +377,6 @@ void MiniGames::doTastaturEreignis( TastaturEreignis &te )
 
 bool MiniGames::tick( double z )
 {
-	if( !aktuell )
-		rend |= updateH->tick( 0, z, dg );
 	if( laden->istSichtbar() && mgl && mgl->fertig() )
 	{
 		if( !mgl->zGame() )
@@ -507,8 +500,6 @@ void MiniGames::render( Bild &zRObj )
 	int anz = games->getEintragAnzahl();
 	for( int i = 0; i < anz; i++ )
 		games->z( i )->render( zRObj );
-	if( !aktuell )
-		updateH->render( 0, 200, 400, zRObj, dg );
 	zRObj.releaseAlpha();
 	laden->render( zRObj );
 	if( mgl && mgl->fertig() && mgl->zGame() )

+ 16 - 16
KSGClient/NachLogin/Shop/Karten/KartenKaufen.cpp

@@ -38,7 +38,7 @@ KartenKaufenAuswahl::KartenKaufenAuswahl( Schrift *zSchrift )
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_START_FUNKTION "' in der DLL-Datei "
                                                                     "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
     }
     else
@@ -46,7 +46,7 @@ KartenKaufenAuswahl::KartenKaufenAuswahl( Schrift *zSchrift )
         fenster = 0;
         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                       new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-                                                      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                      new Text( "Ok" ), 0 );
     }
     ram = new LRahmen();
     ram->setSize( 555, 380 );
@@ -164,7 +164,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                                     "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         b->release();
         return;
@@ -177,7 +177,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
                                                                     "Sie könnte eventuell nicht richtig funktionieren." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         else
         {
@@ -201,7 +201,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                                         "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
         }
         b->release();
@@ -228,7 +228,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                                     "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         b->release();
         return;
@@ -254,7 +254,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                                     "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         b->release();
         return;
@@ -273,7 +273,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                                     "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         b->release();
         return;
@@ -286,7 +286,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
                                                                     "Sie könnte eventuell nicht richtig funktionieren." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         else
         {
@@ -299,7 +299,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                   new Text( shopClient->getLetzterFehler() ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
                 shopClient->trenne( 0 );
             }
@@ -307,13 +307,13 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( shopClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             else
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( mainClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             if( run )
                 warteAufThread( 2000 );
@@ -337,7 +337,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
                                                                     "Sie könnte eventuell nicht richtig funktionieren." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         else
         {
@@ -348,7 +348,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
                                                                         "Sie könnte eventuell nicht richtig funktionieren." ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             else
             {
@@ -381,7 +381,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
                             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                           new Text( "Der Einstiegspunkt '" KSGS_SET_BILD_FUNKTION "' in der DLL-Datei "
                                                                                     "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                          new Text( "Ok" ), 0 );
                             b->release();
                         }
                         else
@@ -394,7 +394,7 @@ void KartenKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                   new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
                                                                             "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
             }
             if( pf )

+ 16 - 16
KSGClient/NachLogin/Shop/Spiele/SpieleKaufen.cpp

@@ -39,7 +39,7 @@ SpieleKaufenAuswahl::SpieleKaufenAuswahl( Schrift *zSchrift )
 			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 														  new Text( "Der Einstiegspunkt '" KSGS_START_FUNKTION "' in der DLL-Datei "
 																	"'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-														  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														  new Text( "Ok" ), 0 );
 		}
 	}
 	else
@@ -47,7 +47,7 @@ SpieleKaufenAuswahl::SpieleKaufenAuswahl( Schrift *zSchrift )
 		fenster = 0;
 		nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 													  new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-													  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+													  new Text( "Ok" ), 0 );
 	}
 	ram = new LRahmen();
 	ram->setSize( 555, 380 );
@@ -165,7 +165,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 														  new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
 																	"'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-														  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														  new Text( "Ok" ), 0 );
 		}
 		b->release();
 		return;
@@ -178,7 +178,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 														  new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
 																	"Sie könnte eventuell nicht richtig funktionieren." ),
-														  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														  new Text( "Ok" ), 0 );
 		}
 		else
 		{
@@ -202,7 +202,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 															  new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
 																		"'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-															  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+															  new Text( "Ok" ), 0 );
 			}
 		}
 		b->release();
@@ -229,7 +229,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 														  new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
 																	"'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-														  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														  new Text( "Ok" ), 0 );
 		}
 		b->release();
 		return;
@@ -255,7 +255,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 														  new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
 																	"'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-														  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														  new Text( "Ok" ), 0 );
 		}
 		b->release();
 		return;
@@ -274,7 +274,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 														  new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
 																	"'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-														  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														  new Text( "Ok" ), 0 );
 		}
 		b->release();
 		return;
@@ -287,7 +287,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 														  new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
 																	"Sie könnte eventuell nicht richtig funktionieren." ),
-														  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														  new Text( "Ok" ), 0 );
 		}
 		else
 		{
@@ -300,7 +300,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                   new Text( shopClient->getLetzterFehler() ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
                 else
                 {
@@ -355,13 +355,13 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( shopClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             else
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( mainClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
 			if( run )
 				warteAufThread( 2000 );
@@ -385,7 +385,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 														  new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
 																	"Sie könnte eventuell nicht richtig funktionieren." ),
-														  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														  new Text( "Ok" ), 0 );
 		}
 		else
 		{
@@ -396,7 +396,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 															  new Text( "Auf dieser Seite befindet sich ein Fehler im KSG-Script. "
 																		"Sie könnte eventuell nicht richtig funktionieren." ),
-															  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+															  new Text( "Ok" ), 0 );
 			}
 			else
 			{
@@ -429,7 +429,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 							nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 																		  new Text( "Der Einstiegspunkt '" KSGS_SET_BILD_FUNKTION "' in der DLL-Datei "
 																		  "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-																		  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+																		  new Text( "Ok" ), 0 );
 							b->release();
 						}
 						else
@@ -442,7 +442,7 @@ void SpieleKaufenAuswahl::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVa
 					nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
 																  new Text( "Der Einstiegspunkt '" KSGS_VARIABLE_FUNKTION "' in der DLL-Datei "
 																			"'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-																  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+																  new Text( "Ok" ), 0 );
 				}
 			}
 			if( pf )

+ 2 - 5
KSGClient/NachLogin/Spiele/Angemeldet/Angemeldet.cpp

@@ -79,10 +79,7 @@ bool AngemeldetFenster::setKarteId( int karteId )
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                             new Text( anmeldungClient->getLetzterFehler() ),
                                                             new Text( "Ok" ),
-                                                            0,
-                                                            NachrichtType::nachricht,
-                                                            0
-                                                            );
+                                                            0 );
         }
         return 0;
     }
@@ -330,7 +327,7 @@ void AngemeldetFenster::doMausEreignis( MausEreignis &me )
                 rend = 1;
             }
             else if( nachLogin && nachLogin->zSpielenFenster() )
-                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( spielClient->getLetzterFehler() ), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( spielClient->getLetzterFehler() ), new Text( "Ok" ), 0 );
             break;
         case 3: // Zurück
             if( nachLogin && nachLogin->zSpielenFenster() )

+ 36 - 36
KSGClient/NachLogin/Spiele/Gruppe/Gruppe.cpp

@@ -310,19 +310,19 @@ void GruppeEinladungAccount::doMausEreignis( MausEreignis &me )
         if( !anmeldungClient )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
 		if( !anmeldungClient->verbinde() )
 		{
 			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-														  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														  new Text( "Ok" ), 0 );
 		}
         else
         {
             if( !anmeldungClient->gruppeSpielerEinladen( accountId, gruppeId ) )
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             anmeldungClient->trenne( 0 );
         }
@@ -333,19 +333,19 @@ void GruppeEinladungAccount::doMausEreignis( MausEreignis &me )
         if( !anmeldungClient )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         if( !anmeldungClient->verbinde() )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         else
         {
 		    if( !anmeldungClient->gruppeEinladungAbbrechen( accountId, gruppeId ) )
 		    {
 			    nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-														      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+														      new Text( "Ok" ), 0 );
 		    }
             anmeldungClient->trenne( 0 );
         }
@@ -628,19 +628,19 @@ void GruppeEinladungListe::doMausEreignis( MausEreignis &me )
                         if( !anmeldungClient )
                         {
                             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                          new Text( "Ok" ), 0 );
                         }
                         if( !anmeldungClient->verbinde() )
                         {
                             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                          new Text( "Ok" ), 0 );
                         }
                         else
                         {
                             if( !anmeldungClient->gruppeSpielerEinladen( accountId, gruppeId ) )
                             {
                                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                              new Text( "Ok" ), 0 );
                             }
                             else
                             {
@@ -654,7 +654,7 @@ void GruppeEinladungListe::doMausEreignis( MausEreignis &me )
 					else
 					{
 						nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Der Account wurde nicht gefunden." ),
-																	  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+																	  new Text( "Ok" ), 0 );
 					}
 				}
 			}
@@ -698,19 +698,19 @@ void GruppeEinladungListe::doTastaturEreignis( TastaturEreignis &te )
                 if( !anmeldungClient )
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
                 if( !anmeldungClient->verbinde() )
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
                 else
                 {
                     if( !anmeldungClient->gruppeSpielerEinladen( accountId, gruppeId ) )
                     {
                         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                                      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                      new Text( "Ok" ), 0 );
                     }
                     else
                     {
@@ -724,7 +724,7 @@ void GruppeEinladungListe::doTastaturEreignis( TastaturEreignis &te )
 			else
 			{
 				nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( "Der Account wurde nicht gefunden." ),
-															  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+															  new Text( "Ok" ), 0 );
 			}
 		}
 	}
@@ -1130,19 +1130,19 @@ void GruppeAccountDaten::doMausEreignis( MausEreignis &me )
         if( !anmeldungClient )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         if( !anmeldungClient->verbinde() )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         else
         {
             if( !anmeldungClient->kickSpielerAusGruppe( accountId, gruppeId ) )
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             anmeldungClient->trenne( 0 );
         }
@@ -1479,12 +1479,12 @@ void GruppeChat::doMausEreignis( MausEreignis &me )
         if( !anmeldungClient )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         if( !anmeldungClient->verbinde() )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         else
         {
@@ -1497,7 +1497,7 @@ void GruppeChat::doMausEreignis( MausEreignis &me )
             else
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             anmeldungClient->trenne( 0 );
         }
@@ -1517,12 +1517,12 @@ void GruppeChat::doTastaturEreignis( TastaturEreignis &te )
         if( !anmeldungClient )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         if( !anmeldungClient->verbinde() )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
         else
         {
@@ -1535,7 +1535,7 @@ void GruppeChat::doTastaturEreignis( TastaturEreignis &te )
             else
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             anmeldungClient->trenne( 0 );
         }
@@ -1729,14 +1729,14 @@ void GruppeAnmeldung::doMausEreignis( MausEreignis &me )
         if( !anmeldungClient )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
             spielerHinzufügen->setStyle( KontrollKnopf::Style::Selected, spielerHinzufügen->hatStyleNicht( KontrollKnopf::Style::Selected ) );
             rend = 1;
         }
         if( !anmeldungClient->verbinde() )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
             spielerHinzufügen->setStyle( KontrollKnopf::Style::Selected, spielerHinzufügen->hatStyleNicht( KontrollKnopf::Style::Selected ) );
             rend = 1;
         }
@@ -1747,7 +1747,7 @@ void GruppeAnmeldung::doMausEreignis( MausEreignis &me )
                 spielerHinzufügen->setStyle( KontrollKnopf::Style::Selected, spielerHinzufügen->hatStyleNicht( KontrollKnopf::Style::Selected ) );
                 rend = 1;
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             anmeldungClient->trenne( 0 );
         }
@@ -1758,14 +1758,14 @@ void GruppeAnmeldung::doMausEreignis( MausEreignis &me )
         if( !anmeldungClient )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
             angemeldet->setStyle( KontrollKnopf::Style::Selected, angemeldet->hatStyleNicht( KontrollKnopf::Style::Selected ) );
             rend = 1;
         }
         if( !anmeldungClient->verbinde() )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
             angemeldet->setStyle( KontrollKnopf::Style::Selected, angemeldet->hatStyleNicht( KontrollKnopf::Style::Selected ) );
             rend = 1;
         }
@@ -1778,7 +1778,7 @@ void GruppeAnmeldung::doMausEreignis( MausEreignis &me )
 				    angemeldet->setStyle( KontrollKnopf::Style::Selected, angemeldet->hatStyleNicht( KontrollKnopf::Style::Selected ) );
 				    rend = 1;
 				    nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-															      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+															      new Text( "Ok" ), 0 );
 			    }
 		    }
 		    else
@@ -1788,7 +1788,7 @@ void GruppeAnmeldung::doMausEreignis( MausEreignis &me )
 				    angemeldet->setStyle( KontrollKnopf::Style::Selected, angemeldet->hatStyleNicht( KontrollKnopf::Style::Selected ) );
 				    rend = 1;
 				    nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-															      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+															      new Text( "Ok" ), 0 );
 			    }
 		    }
             anmeldungClient->trenne( 0 );
@@ -1800,13 +1800,13 @@ void GruppeAnmeldung::doMausEreignis( MausEreignis &me )
         if( !anmeldungClient )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
             rend = 1;
         }
         if( !anmeldungClient->verbinde() )
         {
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
             rend = 1;
         }
         else
@@ -1816,7 +1816,7 @@ void GruppeAnmeldung::doMausEreignis( MausEreignis &me )
             else
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             anmeldungClient->trenne( 0 );
         }
@@ -1893,14 +1893,14 @@ GruppeKarte::GruppeKarte( Schrift *zSchrift )
             nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                           new Text( "Der Einstiegspunkt '" KSGS_START_FUNKTION "' in der DLL-Datei "
                                                           "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                          new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                          new Text( "Ok" ), 0 );
         }
     }
     else
     {
         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                       new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-                                                      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                      new Text( "Ok" ), 0 );
     }
 	hintergrund = 0;
 	fehler = 0;
@@ -2312,7 +2312,7 @@ void GruppeSpielGefunden::doMausEreignis( MausEreignis &me )
 			rend = 1;
 		}
 		else if( nachLogin && nachLogin->zSpielenFenster() )
-			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( spielClient->getLetzterFehler() ), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( spielClient->getLetzterFehler() ), new Text( "Ok" ), 0 );
 	}
 	me.mx += pos.x;
 	me.my += pos.y;

+ 6 - 6
KSGClient/NachLogin/Spiele/Karte Auswahl/KarteAuswahl.cpp

@@ -91,14 +91,14 @@ void KarteDaten::Loader::thread()
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                   new Text( "Der Einstiegspunkt '" KSGS_START_FUNKTION "' in der DLL-Datei "
                                                                             "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
             }
             else
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             if( kd->beschreibung )
             {
@@ -234,13 +234,13 @@ void KarteDaten::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVariable **
             if( !anmeldungClient )
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
                 rend = 1;
             }
             if( !anmeldungClient->verbinde() )
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
                 rend = 1;
             }
             else
@@ -249,7 +249,7 @@ void KarteDaten::ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVariable **
                 if( !ret && nachLogin )
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
                 else if( nachLogin )
                     nachLogin->zSpielenFenster()->gruppeBetreten( ret );
@@ -590,7 +590,7 @@ void KarteAuswahlFenster::thread()
     if( !liste )
     {
         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( infoClient->getLetzterFehler() ),
-                                                      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                      new Text( "Ok" ), 0 );
         run = 0;
         return;
     }

+ 14 - 26
KSGClient/NachLogin/Spiele/Spiel Auswahl/SpielAuswahl.cpp

@@ -147,14 +147,14 @@ void SpielDaten::Loader::thread()
                         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                       new Text( "Der Einstiegspunkt '" KSGS_START_FUNKTION "' in der DLL-Datei "
                                                                                 "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                                      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                      new Text( "Ok" ), 0 );
                     }
                 }
                 else
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                   new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
                 if( sd->beschreibung )
                     sd->geladen = 2;
@@ -297,14 +297,14 @@ void SpielDaten::Loader::thread()
                     nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                                   new Text( "Der Einstiegspunkt '" KSGS_START_FUNKTION "' in der DLL-Datei "
                                                                             "'data/bin/KSGScript.dll' konnte nicht gefunden werden." ),
-                                                                  new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                                  new Text( "Ok" ), 0 );
                 }
             }
             else
             {
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( "Die DLL-Datei 'data/bin/KSGScript.dll' konnte nicht geladen werden." ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
             }
             pf->release();
             if( sd->beschreibung )
@@ -409,8 +409,6 @@ void SpielDaten::setSichtbar( bool sichtbar )
         setAuswahl( 0 );
         auswahl->setFarbe( auswahl->getFarbe() & 0xFFFFFF );
     }
-    if( !erlaubt && sichtbar && ausgewählt )
-        updateH->setSichtbar( spielId, 1 );
     hauptScreen->lock();
     if( loader->getAktion() == (sichtbar ? 2 : 0) )
     {
@@ -434,8 +432,6 @@ void SpielDaten::setSichtbar()
         animation |= 0x4;
         beschreibung->setPosition( beschreibung->getX(), 0 );
     }
-    if( !erlaubt && ausgewählt )
-        updateH->setSichtbar( spielId, 1 );
     hauptScreen->lock();
     if( geladen != 2 && loader->getAktion() != 2 )
     {
@@ -462,10 +458,6 @@ void SpielDaten::setAuswahl( bool auswahl )
     }
     else
         animation &= ~0x4;
-    if( !erlaubt && ausgewählt )
-        updateH->setSichtbar( spielId, 1 );
-    if( !erlaubt && !ausgewählt )
-        updateH->setSichtbar( spielId, 0 );
     rend = 1;
 }
 
@@ -490,14 +482,17 @@ void SpielDaten::updateErlaubt()
     }
     dgt->release();
     erlaubt = ak && infoClient->istSpielErlaubt( spielId );
-    if( !erlaubt && !updateH->hat( spielId ) )
+    if( !erlaubt && !ak && !updateH->hat( dgId ) )
     {
-        updateH->erstellen( schrift, spielId );
-        if( ausgewählt )
-            updateH->setSichtbar( spielId, 1 );
+        Text msg = "Das Spiel '";
+        msg += name->getText();
+        msg += "' muss aktualisiert werden.";
+        nachLogin->zNachrichtenListe()->addNachricht( new SpielUpdateNachricht( schrift, new Text( "Update" ), msg.getThis(), dgId, []()
+        {
+            if( nachLogin && nachLogin->zSpielenFenster() )
+                nachLogin->zSpielenFenster()->updateErlaubt();
+        } ) );
     }
-    if( erlaubt && updateH->hat( spielId ) )
-        updateH->remove( spielId, 0 );
 }
 
 void SpielDaten::setPosition( int lPos )
@@ -510,8 +505,6 @@ bool SpielDaten::tick( double tickVal )
 {
     if( beschreibung )
         rend |= beschreibung->tick( tickVal );
-    if( !erlaubt )
-        rend |= updateH->tick( spielId, tickVal );
     this->tickVal += tickVal * 500;
     int val = ( int ) this->tickVal;
     if( val < 1 )
@@ -632,9 +625,6 @@ void SpielDaten::doMausEreignis( MausEreignis &me )
     if( !erlaubt && ausgewählt )
     {
         me.mx -= gr.x + 90;
-        me.my -= 350;
-        updateH->doMausEreignis( spielId, me );
-        me.my += 350;
         me.mx += 90;
         if( beschreibung )
             beschreibung->doMausEreignis( me );
@@ -680,8 +670,6 @@ void SpielDaten::render( Bild &zRObj )
         beschreibung->render( zRObj );
         zRObj.releaseAlpha();
     }
-    if( !erlaubt )
-        updateH->render( spielId, 90, 350, zRObj );
     if( ausgewählt && geladen != 2 && ladeAnimation->zAnimationData() )
     {
         ladenBild++;
@@ -815,7 +803,7 @@ void SpielAuswahlFenster::thread()
     if( !liste )
     {
         nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( infoClient->getLetzterFehler() ),
-                                                      new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                      new Text( "Ok" ), 0 );
         run = 0;
         return;
     }

+ 4 - 4
KSGClient/NachLogin/Spiele/Statistik/SpielStatistik.cpp

@@ -177,9 +177,9 @@ void SpielStatistik::render( Bild &zRObj )
 	zRObj.releaseDrawOptions();
 }
 
-void SpielStatistik::addNachrichtF( Text *t, Text *n, Text *rp, Text *rn, char a, void *ü )
+void SpielStatistik::addNachrichtF( Text *t, Text *n, Text *rp, Text *rn )
 {
-	nachLogin->zNachrichtenListe()->addNachricht( t, n, rp, rn, a, ü );
+	nachLogin->zNachrichtenListe()->addNachricht( t, n, rp, rn );
 }
 
 void SpielStatistik::addChatF( int acc )
@@ -237,10 +237,10 @@ SpielStatistik *SpielStatistik::release()
 }
 
 // Rückruf Funktionen
-void spielStatistikAddNachrichtF( void *p, Text *t, Text *n, Text *rp, Text *rn, char a, void *ü )
+void spielStatistikAddNachrichtF( void *p, Text *t, Text *n, Text *rp, Text *rn )
 {
 	if( p )
-		( (SpielStatistik*)p )->addNachrichtF( t, n, rp, rn, a, ü );
+		( (SpielStatistik*)p )->addNachrichtF( t, n, rp, rn );
 }
 
 void spielStatistikAddChatF( void *p, int acc )

+ 2 - 2
KSGClient/NachLogin/Spiele/Statistik/SpielStatistik.h

@@ -33,7 +33,7 @@ public:
 	void doTastaturEreignis( TastaturEreignis &te );
 	bool tick( double zeit );
 	void render( Bild &zRObj );
-	void addNachrichtF( Text *t, Text *n, Text *rp, Text *rn, char a, void *ü );
+	void addNachrichtF( Text *t, Text *n, Text *rp, Text *rn );
 	void addChatF( int acc );
 	void addFreundF( int acc );
 	void accountAnsehenF( int acc );
@@ -47,7 +47,7 @@ public:
 };
 
 // Rückruf Funktionen
-void spielStatistikAddNachrichtF( void *p, Text *t, Text *n, Text *rp, Text *rn, char a, void *ü );
+void spielStatistikAddNachrichtF( void *p, Text *t, Text *n, Text *rp, Text *rn );
 void spielStatistikAddChatF( void *p, int acc );
 void spielStatistikAddFreundF( void *p, int acc );
 void spielStatistikAccountAnsehenF( void *p, int acc );

+ 2 - 2
KSGClient/NachLogin/Spiele/Team Auswahl/TeamAuswahl.cpp

@@ -849,7 +849,7 @@ void TeamAuswahlChat::doMausEreignis( MausEreignis &me )
 			rend = 1;
 		}
 		else
-			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( spielClient->getLetzterFehler() ), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( spielClient->getLetzterFehler() ), new Text( "Ok" ), 0 );
 	}
 }
 
@@ -867,7 +867,7 @@ void TeamAuswahlChat::doTastaturEreignis( TastaturEreignis &te )
 			rend = 1;
 		}
 		else
-			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( spielClient->getLetzterFehler() ), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( spielClient->getLetzterFehler() ), new Text( "Ok" ), 0 );
 	}
 }
 

+ 14 - 2
KSGClient/NachLogin/Titel/TitelLeiste.cpp

@@ -256,7 +256,16 @@ bool TitelLeiste::druckSchlie
 	if( me.id == ME_RLinks )
 	{
 		nachLogin->zNachrichtenListe()->addNachricht( new Text( "Schließen" ), new Text( "Möchtest du den Client wirklich beenden?" ),
-													  new Text( "Ja" ), new Text( "Nein" ), NachrichtType::close, 0 );
+                                                      new Text( "Ja" ), new Text( "Nein" ), []()
+        {
+            nachLogin->zChatLeiste()->removeAll();
+            if( loginClient && loginClient->verbinde() )
+            {
+                loginClient->logout();
+                loginClient->trenne( 1 );
+            }
+            PostQuitMessage( 0 );
+        } );
 	}
 	return 1;
 }
@@ -273,7 +282,10 @@ bool TitelLeiste::druckLogout( MausEreignis &me ) // Logout wurde gedr
 	if( me.id == ME_RLinks )
 	{
 		nachLogin->zNachrichtenListe()->addNachricht( new Text( "Logout" ), new Text( "Möchtest du dich wirklich ausloggen?" ),
-													  new Text( "Ja" ), new Text( "Nein" ), NachrichtType::logout, 0 );
+                                                      new Text( "Ja" ), new Text( "Nein" ), []()
+        {
+            ::aktion = 3;
+        } );
 	}
 	return 1;
 }

+ 184 - 0
KSGClient/NachLogin/Update/Update.cpp

@@ -0,0 +1,184 @@
+#include "../../Global/Initialisierung.h"
+#include <MausEreignis.h>
+#include "../../Global/Variablen.h"
+
+// Inhalt der UpdateGUI klasse aus UpdateGUI.h
+// Konstruktor
+Update::Update( Schrift *zSchrift, FBalken *fb, int dg, std::function< void(bool) > after )
+	: Thread()
+{
+	p = 0;
+    this->fb = fb;
+    updateAbbrechen = 0;
+	this->dg = dg;
+    this->after = after;
+	ref = 1;
+}
+
+// Destruktor
+Update::~Update()
+{
+	if( isRunning() )
+	{
+		updateAbbrechen = 1;
+		warteAufThread( 5000 );
+        if( isRunning() )
+        {
+            ende();
+            after( 0 );
+        }
+	}
+    if( fb )
+        fb->release();
+	if( p )
+		p->release();
+}
+
+// nicht constant
+void Update::setPatcher( Patcher *p )
+{
+    this->p = p;
+}
+
+void Update::abbrechen()
+{
+    updateAbbrechen = 1;
+}
+
+void Update::herunterladen()
+{
+    if( isRunning() || !p )
+        return;
+    start();
+}
+
+void Update::thread()
+{
+	int dgId = dg;
+	Text err;
+	if( !p->update( dgId, &updateAbbrechen, fb->getThis(), 0, &err ) )
+	{
+        updateAbbrechen = 1;
+		if( nachLogin && nachLogin->zNachrichtenListe() )
+			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), err.getThis(), new Text( "Ok" ) );
+	}
+	run = 0;
+}
+
+void Update::threadEnd()
+{
+    after( !updateAbbrechen );
+}
+
+// constant
+int Update::getDateiGruppe() const
+{
+    return dg;
+}
+
+// Reference Counting
+Update *Update::getThis()
+{
+	ref++;
+	return this;
+}
+
+Update *Update::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}
+
+
+// inhalt der UpdateHandler Klasse aus UpdateGUI.h
+// Konstruktor
+UpdateHandler::UpdateHandler()
+{
+	patcher = new Patcher();
+	updates = new RCArray< Update >();
+	ref = 1;
+}
+
+// Destruktor
+UpdateHandler::~UpdateHandler()
+{
+	updates->release();
+	patcher->release();
+}
+
+// privat
+void UpdateHandler::lock()
+{
+    cs.lock();
+}
+
+void UpdateHandler::unlock()
+{
+    cs.unlock();
+}
+
+// nicht constant
+bool UpdateHandler::add( Update *update )
+{
+    lock();
+    if( hat( update->getDateiGruppe() ) )
+    {
+        update->release();
+        unlock();
+        return 0;
+    }
+    int anz = updates->getEintragAnzahl();
+    update->setPatcher( patcher->getThis() );
+    updates->add( update );
+    unlock();
+    return 1;
+}
+
+void UpdateHandler::remove( int dg )
+{
+	lock();
+	int anz = updates->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( updates->z( i )->getDateiGruppe() == dg )
+		{
+			updates->remove( i );
+			break;
+		}
+	}
+	unlock();
+}
+
+bool UpdateHandler::hat( int dg )
+{
+	lock();
+	bool ret = 0;
+	int anz = updates->getEintragAnzahl();
+	for( int i = 0; i < anz; i++ )
+	{
+		if( updates->z( i )->getDateiGruppe() == dg )
+		{
+			ret = 1;
+			break;
+		}
+	}
+	unlock();
+	return ret;
+}
+
+// Reference Counting
+UpdateHandler *UpdateHandler::getThis()
+{
+	ref++;
+	return this;
+}
+
+UpdateHandler *UpdateHandler::release()
+{
+	ref--;
+	if( !ref )
+		delete this;
+	return 0;
+}

+ 62 - 0
KSGClient/NachLogin/Update/Update.h

@@ -0,0 +1,62 @@
+#pragma once
+
+#include "../../Netzwerk/Patcher.h"
+#include <Fortschritt.h>
+#include <Knopf.h>
+#include <Array.h>
+#include <Thread.h>
+
+using namespace Framework;
+
+class Update : private Thread
+{
+private:
+	Patcher *p;
+    FBalken *fb;
+	bool updateAbbrechen;
+	int dg;
+	int ref;
+    std::function< void(bool) > after;
+
+public:
+	// Konstruktor
+    Update( Schrift *zSchrift, FBalken *fb, int dg, std::function< void(bool) > after = [](bool b){} );
+	// Destruktor
+	~Update();
+	// nicht constant
+    void setPatcher( Patcher *p );
+    void abbrechen();
+    void herunterladen();
+	void thread() override;
+    void threadEnd() override;
+	// constant
+    int getDateiGruppe() const;
+	// Reference Counting
+	Update *getThis();
+	Update *release();
+};
+
+class UpdateHandler
+{
+private:
+	Patcher *patcher;
+	RCArray< Update > *updates;
+	Critical cs;
+	int ref;
+	// privat
+	void lock();
+	void unlock();
+
+public:
+	// Konstruktor
+	UpdateHandler();
+	// Destruktor
+	~UpdateHandler();
+	// nicht constant
+	bool add( Update *update );
+	void remove( int dg = 0 );
+	bool hat( int dg = 0 );
+	// Reference Counting
+	UpdateHandler *getThis();
+	UpdateHandler *release();
+};

+ 0 - 296
KSGClient/NachLogin/UpdateGUI/UpdateGUI.cpp

@@ -1,296 +0,0 @@
-#include "../../Global/Initialisierung.h"
-#include <MausEreignis.h>
-#include "../../Global/Variablen.h"
-
-// Inhalt der UpdateGUI klasse aus UpdateGUI.h
-// Konstruktor
-UpdateGUI::UpdateGUI( Schrift *zSchrift, int spielId, int dg )
-	: Thread()
-{
-	p = 0;
-	updateStatus = initTextFeld( 0, 0, 302, 20, zSchrift, TextFeld::Style::Text | TextFeld::Style::VCenter, "Neuste Version Herunterladen" );
-	updateStarten = initKnopf( 302, 0, 100, 20, zSchrift, Knopf::Style::Sichtbar, "Herunterladen" );
-	updateFortschritt = initFBalken( 0, 25, 402, 22, zSchrift, FBalken::Style::Sichtbar | FBalken::Style::Hintergrund | FBalken::Style::HBild |
-									 FBalken::Style::FBild | FBalken::Style::Rahmen | FBalken::Style::Prozent | FBalken::Style::L_R );
-	updateAbbrechen = 1;
-	sichtbar = 0;
-	alpha = 0;
-	this->spielId = spielId;
-	this->dg = dg;
-	ref = 1;
-}
-
-// Destruktor
-UpdateGUI::~UpdateGUI()
-{
-	if( isRunning() )
-	{
-		updateAbbrechen = 1;
-		warteAufThread( 5000 );
-		if( isRunning() )
-			ende();
-	}
-	updateStatus->release();
-	updateStarten->release();
-	updateFortschritt->release();
-	if( p )
-		p->release();
-}
-
-// nicht constant
-void UpdateGUI::setSichtbar( bool sichtbar )
-{
-	this->sichtbar = sichtbar;
-}
-
-void UpdateGUI::doMausEreignis( MausEreignis &me, Patcher *zP )
-{
-	bool vera = me.verarbeitet;
-	updateStarten->doMausEreignis( me );
-	if( !vera && me.verarbeitet && me.id == ME_RLinks )
-	{
-		if( updateAbbrechen )
-		{
-			updateAbbrechen = 0;
-			if( !p )
-				p = zP->getThis();
-			updateStarten->setText( "Abbrechen" );
-			start();
-		}
-		else
-		{
-			updateAbbrechen = 1;
-			if( isRunning() )
-				warteAufThread( 5000 );
-			if( isRunning() )
-				ende();
-			updateStatus->setText( "Neuste Version Herunterladen" );
-			updateStarten->setText( "Herunterladen" );
-			updateFortschritt->reset();
-		}
-	}
-}
-
-bool UpdateGUI::tick( double zeit )
-{
-	bool ret = updateStatus->tick( zeit );
-	ret |= updateStarten->tick( zeit );
-	ret |= updateFortschritt->tick( zeit );
-	if( !alpha )
-		ret = 0;
-	if( sichtbar && alpha != 255 )
-	{
-		alpha += (int)( zeit * 150 );
-		if( alpha > 255 )
-			alpha = 255;
-		ret = 1;
-	}
-	if( !sichtbar && alpha )
-	{
-		alpha -= (int)( zeit * 150 );
-		if( alpha < 0 )
-			alpha = 0;
-		ret = 1;
-	}
-	return ret;
-}
-
-void UpdateGUI::render( int xOff, int yOff, Bild &zRObj )
-{
-	if( !zRObj.setDrawOptions( xOff, yOff, 402, 50 ) )
-		return;
-	zRObj.setAlpha( (unsigned char)alpha );
-	updateStatus->render( zRObj );
-	updateStarten->render( zRObj );
-	updateFortschritt->render( zRObj );
-	zRObj.releaseAlpha();
-	zRObj.releaseDrawOptions();
-}
-
-void UpdateGUI::thread()
-{
-	int dgId = dg;
-	if( spielId )
-		dgId = infoClient->getDateiGruppeIdVonSpiel( spielId );
-	Text err;
-	if( !p->update( dgId, &updateAbbrechen, updateFortschritt->getThis(), updateStatus->getThis(), &err ) )
-	{
-		if( nachLogin && nachLogin->zNachrichtenListe() )
-			nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), err.getThis(), new Text( "Ok" ) );
-	}
-	updateStatus->setText( "Neuste Version Herunterladen" );
-	updateStarten->setText( "Herunterladen" );
-	updateFortschritt->reset();
-	updateAbbrechen = 1;
-	run = 0;
-	if( nachLogin && nachLogin->zSpielenFenster() && spielId )
-		nachLogin->zSpielenFenster()->updateErlaubt();
-	if( nachLogin && nachLogin->zMGFenster() && dg )
-		nachLogin->zMGFenster()->setAktuell( 1 );
-}
-
-// constant
-bool UpdateGUI::istGleich( int spielId, int dg )
-{
-	return this->spielId == spielId && this->dg == dg;
-}
-
-// Reference Counting
-UpdateGUI *UpdateGUI::getThis()
-{
-	ref++;
-	return this;
-}
-
-UpdateGUI *UpdateGUI::release()
-{
-	ref--;
-	if( !ref )
-		delete this;
-	return 0;
-}
-
-
-// inhalt der UpdateHandler Klasse aus UpdateGUI.h
-// Konstruktor
-UpdateHandler::UpdateHandler()
-{
-	patcher = new Patcher();
-	updates = new RCArray< UpdateGUI >();
-	ref = 1;
-}
-
-// Destruktor
-UpdateHandler::~UpdateHandler()
-{
-	updates->release();
-	patcher->release();
-}
-
-// privat
-void UpdateHandler::lock()
-{
-    cs.lock();
-}
-
-void UpdateHandler::unlock()
-{
-    cs.unlock();
-}
-
-// nicht constant
-void UpdateHandler::erstellen( Schrift *zSchrift, int spiel, int dg )
-{
-	lock();
-	updates->add( new UpdateGUI( zSchrift, spiel, dg ) );
-	unlock();
-}
-
-void UpdateHandler::setSichtbar( int spiel, bool sichtbar, int dg )
-{
-	lock();
-	int anz = updates->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-	{
-		if( updates->z( i )->istGleich( spiel, dg ) )
-		{
-			updates->z( i )->setSichtbar( sichtbar );
-			break;
-		}
-	}
-	unlock();
-}
-
-void UpdateHandler::doMausEreignis( int spiel, MausEreignis &me, int dg )
-{
-	lock();
-	int anz = updates->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-	{
-		if( updates->z( i )->istGleich( spiel, dg ) )
-		{
-			updates->z( i )->doMausEreignis( me, patcher );
-			break;
-		}
-	}
-	unlock();
-}
-
-bool UpdateHandler::tick( int spiel, double zeit, int dg )
-{
-	lock();
-	bool ret = 0;
-	int anz = updates->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-	{
-		if( updates->z( i )->istGleich( spiel, dg ) )
-		{
-			ret = updates->z( i )->tick( zeit );
-			break;
-		}
-	}
-	unlock();
-	return ret;
-}
-
-void UpdateHandler::render( int spiel, int xOff, int yOff, Bild &zRObj, int dg )
-{
-	lock();
-	int anz = updates->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-	{
-		if( updates->z( i )->istGleich( spiel, dg ) )
-		{
-			updates->z( i )->render( xOff, yOff, zRObj );
-			break;
-		}
-	}
-	unlock();
-}
-
-void UpdateHandler::remove( int spiel, int dg )
-{
-	lock();
-	int anz = updates->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-	{
-		if( updates->z( i )->istGleich( spiel, dg ) )
-		{
-			updates->remove( i );
-			break;
-		}
-	}
-	unlock();
-}
-
-bool UpdateHandler::hat( int spiel, int dg )
-{
-	lock();
-	bool ret = 0;
-	int anz = updates->getEintragAnzahl();
-	for( int i = 0; i < anz; i++ )
-	{
-		if( updates->z( i )->istGleich( spiel, dg ) )
-		{
-			ret = 1;
-			break;
-		}
-	}
-	unlock();
-	return ret;
-}
-
-// Reference Counting
-UpdateHandler *UpdateHandler::getThis()
-{
-	ref++;
-	return this;
-}
-
-UpdateHandler *UpdateHandler::release()
-{
-	ref--;
-	if( !ref )
-		delete this;
-	return 0;
-}

+ 0 - 73
KSGClient/NachLogin/UpdateGUI/UpdateGUI.h

@@ -1,73 +0,0 @@
-#ifndef UpdateGUI_H
-#define UpdateGUI_H
-
-#include "../../Netzwerk/Patcher.h"
-#include <Fortschritt.h>
-#include <Knopf.h>
-#include <Array.h>
-#include <Thread.h>
-
-using namespace Framework;
-
-class UpdateGUI : private Thread
-{
-private:
-	Patcher *p;
-	TextFeld *updateStatus;
-	Knopf *updateStarten;
-	FBalken *updateFortschritt;
-	bool updateAbbrechen;
-	bool sichtbar;
-	int alpha;
-	int spielId;
-	int dg;
-	int ref;
-
-public:
-	// Konstruktor
-	UpdateGUI( Schrift *zSchrift, int spielId, int dg = 0 );
-	// Destruktor
-	~UpdateGUI();
-	// nicht constant
-	void setSichtbar( bool sichtbar );
-	void doMausEreignis( MausEreignis &me, Patcher *zP );
-	bool tick( double zeit );
-	void render( int xOff, int yOff, Bild &zRObj );
-	void thread();
-	// constant
-	bool istGleich( int spielId, int dg = 0 );
-	// Reference Counting
-	UpdateGUI *getThis();
-	UpdateGUI *release();
-};
-
-class UpdateHandler
-{
-private:
-	Patcher *patcher;
-	RCArray< UpdateGUI > *updates;
-	Critical cs;
-	int ref;
-	// privat
-	void lock();
-	void unlock();
-
-public:
-	// Konstruktor
-	UpdateHandler();
-	// Destruktor
-	~UpdateHandler();
-	// nicht constant
-	void erstellen( Schrift *zSchrift, int spiel, int dg = 0 );
-	void setSichtbar( int spiel, bool sichtbar, int dg = 0 );
-	void doMausEreignis( int spiel, MausEreignis &me, int dg = 0 );
-	bool tick( int spiel, double zeit, int dg = 0 );
-	void render( int spiel, int xOff, int yOff, Bild &zRObj, int dg = 0 );
-	void remove( int spiel, int dg = 0 );
-	bool hat( int spiel, int dg = 0 );
-	// Reference Counting
-	UpdateHandler *getThis();
-	UpdateHandler *release();
-};
-
-#endif

+ 135 - 18
KSGClient/Netzwerk/ChatMessageProcessor.cpp

@@ -1,5 +1,6 @@
 #include "ChatMessageProcessor.h"
 #include "../Global/Variablen.h"
+#include <KSGTDatei.h>
 
 ChatMessageProcessor::ChatMessageProcessor()
     : Thread()
@@ -31,14 +32,14 @@ void ChatMessageProcessor::thread()
                 hauptScreen->lock();
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Server Ausgelastet" ),
                                                               new Text( "Der Chat Server ist derzeit ausgelastet. Es wird versucht auf einen anderen Server auszuweichen." ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
                 hauptScreen->unlock();
             }
             break;
         case 3: // Fehler
             hauptScreen->lock();
             if( nachLogin && nachLogin->zNachrichtenListe() )
-                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), msg.message.getThis(), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), msg.message.getThis(), new Text( "Ok" ), 0 );
             hauptScreen->unlock();
             break;
         case 4: // Chat Nachricht
@@ -64,11 +65,115 @@ void ChatMessageProcessor::thread()
                 nachricht->append( spiel );
                 nachricht->append( "\nKarte: " );
                 nachricht->append( karte );
-                SpielEinladungParam *param = new SpielEinladungParam();
-                param->gruppeId = msg.gruppe;
-                param->vonAccount = msg.account;
+                int gruppeId = msg.gruppe;
+                int vonAccount = msg.account;
                 hauptScreen->lock();
-                nachLogin->zNachrichtenListe()->addNachricht( titel, nachricht, new Text( "annehmen" ), new Text( "ablehnen" ), NachrichtType::spielEinladung, param );
+                nachLogin->zNachrichtenListe()->addNachricht( titel, nachricht, new Text( "annehmen" ), new Text( "ablehnen" ), [ gruppeId, vonAccount ]()
+                {
+                    if( 1 )
+                    {
+                        int karteId = infoClient->getGruppenKarteId( gruppeId );
+                        int spielArt = infoClient->getSpielId( karteId );
+                        KSGTDatei *dgt = new KSGTDatei( "data/dg.ksgt" );
+                        dgt->laden();
+                        bool sak = 0;
+                        int dgSId = infoClient->getDateiGruppeIdVonSpiel( spielArt );
+                        bool sgf = 0;
+                        for( int i = 0; i < dgt->getZeilenAnzahl(); i++ )
+                        {
+                            if( dgt->zFeld( i, 0 ) && TextZuInt( dgt->zFeld( i, 0 )->getText(), 10 ) == dgSId )
+                            {
+                                sgf = 1;
+                                int lv = dgt->zFeld( i, 2 ) ? TextZuInt( dgt->zFeld( i, 2 )->getText(), 10 ) : 0;
+                                int ov = infoClient->getSpielVersion( spielArt );
+                                if( lv == ov )
+                                {
+                                    sak = 1;
+                                    break;
+                                }
+                            }
+                        }
+                        dgt->release();
+                        std::function< void() > ja = [ gruppeId ]()
+                        {
+                            MausEreignis me;
+                            me.verarbeitet = 0;
+                            me.id = ME_RLinks;
+                            nachLogin->zTitelLeiste()->druckSpielen( me );
+                            Array< int > *spieler = new Array< int >();
+                            int anzahl = 0;
+                            if( !anmeldungClient )
+                                anmeldungClient = mainClient->createAnmeldungServerClient();
+                            if( !anmeldungClient )
+                                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( mainClient->getLetzterFehler() ), new Text( "Ok" ), 0 );
+                            if( anmeldungClient && anmeldungClient->verbinde() )
+                            {
+                                if( anmeldungClient->gruppeBetreten( gruppeId, spieler, &anzahl ) )
+                                {
+                                    nachLogin->zSpielenFenster()->gruppeBetreten( gruppeId );
+                                    for( int i = 0; i < anzahl; i++ )
+                                        nachLogin->zSpielenFenster()->spielerBetrittGruppe( gruppeId, spieler->hat( i ) ? spieler->get( i ) : 0 );
+                                }
+                                else
+                                    nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ), new Text( "Ok" ), 0 );
+                                anmeldungClient->trenne( 0 );
+                            }
+                            else if( anmeldungClient )
+                                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), new Text( anmeldungClient->getLetzterFehler() ), new Text( "Ok" ), 0 );
+                        };
+                        if( !sak )
+                        {
+                            if( !sgf )
+                            {
+                                Text *pfad = infoClient->getDateiGruppePfad( dgSId );
+                                Text *idT = new Text();
+                                idT->append( dgSId );
+                                if( pfad )
+                                {
+                                    KSGTDatei *dg = new KSGTDatei( "data/dg.ksgt" );
+                                    dg->laden();
+                                    RCArray< Text > *zeile = new RCArray< Text >();
+                                    zeile->add( idT );
+                                    zeile->add( pfad );
+                                    zeile->add( new Text( "0" ) );
+                                    zeile->add( new Text( "0" ) );
+                                    dg->addZeile( 4, zeile );
+                                    zeile->release();
+                                    dg->speichern();
+                                    dg->release();
+                                }
+                                else
+                                    idT->release();
+                            }
+                            Text msg = "Das Spiel '";
+                            msg.append( infoClient->getSpielName( spielArt ) );
+                            msg += "' muss aktualisiert werden.";
+                            nachLogin->zNachrichtenListe()->addNachricht( new SpielUpdateNachricht( nachLogin->zNachrichtenListe()->zSchrift(), new Text( "Update" ), msg.getThis(), dgSId, ja, [ gruppeId ]()
+                            {
+                                if( !anmeldungClient )
+                                    anmeldungClient = mainClient->createAnmeldungServerClient();
+                                if( anmeldungClient && anmeldungClient->verbinde() )
+                                {
+                                    anmeldungClient->gruppeEinladungAblehnen( gruppeId );
+                                    anmeldungClient->trenne( 0 );
+                                }
+                            } ) );
+                        }
+                        else
+                        {
+                            ja();
+                        }
+                    }
+                }, [ gruppeId ]()
+                {
+                    if( !anmeldungClient )
+                        anmeldungClient = mainClient->createAnmeldungServerClient();
+                    if( anmeldungClient && anmeldungClient->verbinde() )
+                    {
+                        anmeldungClient->gruppeEinladungAblehnen( gruppeId );
+                        anmeldungClient->trenne( 0 );
+                    }
+                } );
                 hauptScreen->unlock();
             }
             break;
@@ -97,13 +202,18 @@ void ChatMessageProcessor::thread()
                 Text *nachricht = new Text( "" );
                 nachricht->append( infoClient->getSpielerName( msg.account ) );
                 nachricht->append( " möchte sich mit dir befreunden." );
-                int *accountId = new int;
-                *accountId = msg.account;
+                int accountId = msg.account;
                 hauptScreen->lock();
                 if( nachLogin && nachLogin->zNachrichtenListe() )
                 {
                     nachLogin->zNachrichtenListe()->addNachricht( titel, nachricht, new Text( "annehmen" ), new Text( "ablehnen" ),
-                                                                  NachrichtType::freundEinladung, (void*)accountId );
+                                                                  [ accountId ]()
+                    {
+                        chatClient->freundesAnfrageBeantworten( accountId, 1 );
+                    }, [ accountId ]()
+                    {
+                        chatClient->freundesAnfrageBeantworten( accountId, 0 );
+                    } );
                 }
                 hauptScreen->unlock();
             }
@@ -122,7 +232,7 @@ void ChatMessageProcessor::thread()
                 nachricht->append( infoClient->getSpielerName( msg.account ) );
                 nachricht->append( " hat deine Freundesanfrage abgelehnt." );
                 hauptScreen->lock();
-                nachLogin->zNachrichtenListe()->addNachricht( titel, nachricht, new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                nachLogin->zNachrichtenListe()->addNachricht( titel, nachricht, new Text( "Ok" ), 0 );
                 hauptScreen->unlock();
             }
             break;
@@ -135,10 +245,17 @@ void ChatMessageProcessor::thread()
                 nachricht->append( " lädt dich dazu ein das Chatroom '" );
                 nachricht->append( infoClient->getChatroomName( msg.chatroom ) );
                 nachricht->append( "' zu betreten." );
-                ChatroomEinladungParam *param = new ChatroomEinladungParam();
-                param->chatroomId = msg.chatroom;
-                param->vonAccount = msg.account;
-                nachLogin->zNachrichtenListe()->addNachricht( titel, nachricht, new Text( "betreten" ), new Text( "ablehnen" ), NachrichtType::chatroomEinladung, param );
+                int chatroomId = msg.chatroom;
+                int vonAccount = msg.account;
+                nachLogin->zNachrichtenListe()->addNachricht( titel, nachricht, new Text( "betreten" ), new Text( "ablehnen" ),
+                                                              [ chatroomId, vonAccount ]()
+                {
+                    nachLogin->zChatLeiste()->addChat( 0, chatroomId );
+                    chatClient->chatroomBetreten( chatroomId );
+                }, [ chatroomId, vonAccount ]()
+                {
+                    chatClient->chatroomEinladungAblehnen( vonAccount, chatroomId );
+                } );
             }
             break;
         case 0xD: // Einladung zum Chatroom abgelehnt
@@ -151,7 +268,7 @@ void ChatMessageProcessor::thread()
                 nachricht->append( infoClient->getChatroomName( msg.chatroom ) );
                 nachricht->append( "' nicht beitreten." );
                 hauptScreen->lock();
-                nachLogin->zNachrichtenListe()->addNachricht( titel, nachricht, new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                nachLogin->zNachrichtenListe()->addNachricht( titel, nachricht, new Text( "Ok" ), 0 );
                 hauptScreen->unlock();
             }
             break;
@@ -260,8 +377,8 @@ void ChatMessageProcessor::thread()
                 nachLogin->zSpielenFenster()->setGruppeAdmin( msg.gruppe, msg.account );
             break;
         case 0x1F: // gruppe Einladung abgelehnt
-                if( nachLogin && nachLogin->zSpielenFenster() )
-                    nachLogin->zSpielenFenster()->gruppeEinadungAbgelehnt( msg.gruppe, msg.account );
+            if( nachLogin && nachLogin->zSpielenFenster() )
+                nachLogin->zSpielenFenster()->gruppeEinadungAbgelehnt( msg.gruppe, msg.account );
             break;
         case 0x20: // SpielServer Verbindungs Anfrage
             if( smProcessor )
@@ -286,7 +403,7 @@ void ChatMessageProcessor::thread()
                 hauptScreen->lock();
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( "Unbekannte Nachricht vom Server. Eventuel ist der Client nicht mehr Aktuell." ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
                 hauptScreen->unlock();
             }
             break;

+ 1 - 0
KSGClient/Netzwerk/ChatMessageProcessor.h

@@ -8,6 +8,7 @@ class ChatMessageProcessor : public Thread
 {
 private:
     int ref;
+
 public:
     ChatMessageProcessor();
     void thread() override;

+ 6 - 3
KSGClient/Netzwerk/Patcher.cpp

@@ -30,7 +30,8 @@ bool Patcher::update( int dateiGruppe, bool *abbruch, FBalken *fortschritt, Text
     {
         zError->setText( "Es kann nur ein Update zur Zeit herruntergeladen werden." );
         fortschritt->release();
-        status->release();
+        if( status )
+            status->release();
         return 0;
     }
     läuft = 1;
@@ -67,7 +68,8 @@ bool Patcher::update( int dateiGruppe, bool *abbruch, FBalken *fortschritt, Text
     if( !updater )
     {
         fortschritt->release();
-        status->release();
+        if( status )
+            status->release();
         läuft = 0;
         return 0;
     }
@@ -78,7 +80,8 @@ bool Patcher::update( int dateiGruppe, bool *abbruch, FBalken *fortschritt, Text
     p.zStatus = status;
     int ret = updater->update( &p );
     fortschritt->release();
-    status->release();
+    if( status )
+        status->release();
     if( ret == 1 )
         zError->setText( updater->getError() );
     läuft = 0;

+ 3 - 3
KSGClient/Netzwerk/SpielMessageProcessor.cpp

@@ -25,14 +25,14 @@ void SpielMessageProcessor::thread()
             break;
         case 2: // SpielErstellt abbruch
             if( nachLogin && nachLogin->zNachrichtenListe() )
-                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Spiel Abgebrochen" ), msg.message.getThis(), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Spiel Abgebrochen" ), msg.message.getThis(), new Text( "Ok" ), 0 );
             if( nachLogin && nachLogin->zSpielenFenster() )
                 nachLogin->zSpielenFenster()->spielGefundenAbbruch();
             break;
         case 3: // Fehler
             hauptScreen->lock();
             if( nachLogin && nachLogin->zNachrichtenListe() )
-                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), msg.message.getThis(), new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ), msg.message.getThis(), new Text( "Ok" ), 0 );
             hauptScreen->unlock();
             break;
         case 4: // zurück in Warteschlange
@@ -105,7 +105,7 @@ void SpielMessageProcessor::thread()
                 hauptScreen->lock();
                 nachLogin->zNachrichtenListe()->addNachricht( new Text( "Fehler" ),
                                                               new Text( "Unbekannte Nachricht vom Server. Eventuel ist der Client nicht mehr Aktuell." ),
-                                                              new Text( "Ok" ), 0, NachrichtType::nachricht, 0 );
+                                                              new Text( "Ok" ), 0 );
                 hauptScreen->unlock();
             }
             break;

+ 20 - 2
build.bat

@@ -1,3 +1,21 @@
-"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "KSGClient.sln" /p:configuration=release /p:platform=win32
+:DebugWin64
+SET RETURN=DebugWin64
+SET NEXT=ReleaseWin64
+"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "KSGClient.sln" /p:configuration=debug /p:platform=x64
+if errorlevel 1 GOTO Error
+:ReleaseWin64
+SET RETURN=ReleaseWin64
+SET NEXT=ReleaseWin32
 "D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "KSGClient.sln" /p:configuration=release /p:platform=x64
-"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "KSGClient.sln" /p:configuration=debug /p:platform=x64
+if errorlevel 1 GOTO Error
+:ReleaseWin32
+SET RETURN=ReleaseWin32
+SET NEXT=END
+"D:\Visual Studio 2017\MSBuild\15.0\Bin\MSBuild.exe" "KSGClient.sln" /p:configuration=release /p:platform=win32
+if errorlevel 1 GOTO Error
+GOTO End
+:Error
+SET /p redo=Nochmal versuchen?(j/n):
+IF /I '%redo%' equ 'j' GOTO %RETURN%
+GOTO %NEXT%
+:End