Sfoglia il codice sorgente

Server Fertig implementiert

Kolja Strohm 4 anni fa
parent
commit
c0f88d10b3

+ 221 - 0
StickmanWorldOnline/Klient.cpp

@@ -0,0 +1,221 @@
+#include "Spieler.h"
+#include "SSKlient.h"
+#include <Text.h>
+
+// Inhalt der Klient Klasse aus Klient.h
+// Konstruktor
+Klient::Klient( SSKlientV *klient )
+{
+    this->klient = klient;
+    ref = 1;
+}
+
+// Destruktor
+Klient::~Klient()
+{
+    if( klient )
+        klient->release();
+}
+
+// nicht constant
+void Klient::offline()
+{
+    klient = (SSKlientV *)klient->release();
+}
+
+void Klient::online( SSKlientV *zKlient )
+{
+    if( klient )
+        klient = (SSKlientV *)klient->release();
+    klient = (SSKlientV *)zKlient->getThis();
+}
+
+void Klient::sendeInit( RCArray< Spieler > *zSpieler )
+{
+    if( !klient )
+        return;
+    short len = (short)( 2 + zSpieler->getEintragAnzahl() * 8 );
+    char *bytes = new char[ len ];
+    *(char *)( bytes ) = 0x1;
+    *(char *)( bytes + 1 ) = (char)zSpieler->getEintragAnzahl();
+    for( int i = 0; i < zSpieler->getEintragAnzahl(); i++ )
+    {
+        *(int *)( bytes + 2 + i * 8 ) = zSpieler->z( i )->getSpielerNummer();
+        *(int *)( bytes + 6 + i * 8 ) = zSpieler->z( i )->getAccountId();
+    }
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeSpielerNummer( int sNum )
+{
+    if( !klient )
+        return;
+    short len = 5;
+    char *bytes = new char[ len ];
+    *(char *)( bytes ) = 0x2;
+    *(int *)( bytes + 1 ) = sNum;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeStart()
+{
+    if( !klient )
+        return;
+    char b = 0x3;
+    klient->spielNachricht( 1, &b );
+}
+
+void Klient::sendeTastaturStatus( int spielerId, char taste, bool aktiv )
+{
+    if( !klient )
+        return;
+    short len = 7;
+    char *bytes = new char[ len ];
+    *(char *)( bytes ) = 0x4;
+    *(char *)( bytes + 1 ) = taste;
+    *(char *)( bytes + 2 ) = (char)aktiv;
+    *(int *)( bytes + 3 ) = spielerId;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeSpielEnde( char gewonnen )
+{
+    if( !klient )
+        return;
+    short len = 2;
+    char *bytes = new char[ len ];
+    *(char *)( bytes ) = 0x5;
+    *(char *)( bytes + 1 ) = gewonnen;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeTick()
+{
+    if( !klient )
+        return;
+    char b = 0x6;
+    klient->spielNachricht( 1, &b );
+}
+
+void Klient::sendeChatNachricht( char *txt )
+{
+    if( !klient )
+        return;
+    short len = (short)( 1 + textLength( txt ) );
+    char *bytes = new char[ len ];
+    *(char *)( bytes ) = 0x7;
+    for( int i = 1; i < len; i++ )
+        bytes[ i ] = txt[ i - 1 ];
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeStatistikChatNachricht( int vonAccount, char *txt )
+{
+    if( !klient )
+        return;
+    short len = (short)( 5 + textLength( txt ) );
+    char *bytes = new char[ len ];
+    *(char *)( bytes ) = 3;
+    *(int *)( bytes + 1 ) = vonAccount;
+    for( int i = 5; i < len; i++ )
+        bytes[ i ] = txt[ i - 5 ];
+    klient->statistikNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeStatistikSpielerOffline( int account )
+{
+    if( !klient )
+        return;
+    char *bytes = new char[ 5 ];
+    *(char *)( bytes ) = 4;
+    *(int *)( bytes + 1 ) = account;
+    klient->statistikNachricht( 5, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeSpielerStatistik( Spieler *zS )
+{
+    if( !zS || !klient )
+        return;
+    char snl = (char)textLength( zS->getName() );
+    char tnl = (char)zS->zTeam()->getName().getLength();
+    int len = 55 + snl + tnl;
+    char *bytes = new char[ len ];
+    bytes[ 0 ] = 0;
+    *(int *)( bytes + 1 ) = zS->getSpielerNummer();
+    *(char *)( bytes + 5 ) = snl;
+    for( int i = 0; i < snl; i++ )
+        bytes[ i + 6 ] = zS->getName()[ i ];
+    *(char *)( bytes + 6 + snl ) = tnl;
+    for( int i = 0; i < tnl; i++ )
+        bytes[ i + 7 + snl ] = zS->zTeam()->getName()[ i ];
+    *(int *)( bytes + 7 + snl + tnl ) = zS->getFarbe();
+    *(int *)( bytes + 11 + snl + tnl ) = zS->zTeam()->getFarbe();
+    *(int *)( bytes + 15 + snl + tnl ) = (int)zS->getErlittenerSchaden();
+    *(int *)( bytes + 19 + snl + tnl ) = (int)zS->getGemachterSchaden();
+    *(int *)( bytes + 23 + snl + tnl ) = (int)zS->getGeheiltesLeben();
+    *(int *)( bytes + 27 + snl + tnl ) = zS->getGeschossen();
+    *(int *)( bytes + 31 + snl + tnl ) = zS->getTreffer();
+    *(int *)( bytes + 35 + snl + tnl ) = zS->getPunkte();
+    *(int *)( bytes + 39 + snl + tnl ) = zS->getKills();
+    *(int *)( bytes + 43 + snl + tnl ) = zS->getTode();
+    *(int *)( bytes + 47 + snl + tnl ) = zS->getItemsAufgehoben();
+    *(int *)( bytes + 51 + snl + tnl ) = zS->getItemsVerwendet();
+    klient->statistikNachricht( (short)len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeTeamStatistik( Team *zS )
+{
+    if( !zS || !klient )
+        return;
+    char tnl = (char)zS->getName().getLength();
+    int len = 22 + tnl;
+    char *bytes = new char[ len ];
+    bytes[ 0 ] = 1;
+    *(int *)( bytes + 1 ) = zS->getTeamNummer();
+    *(char *)( bytes + 5 ) = tnl;
+    for( int i = 0; i < tnl; i++ )
+        bytes[ i + 6 ] = zS->getName()[ i ];
+    *(int *)( bytes + 6 + tnl ) = zS->getFarbe();
+    *(int *)( bytes + 10 + tnl ) = zS->getPunkte();
+    *(int *)( bytes + 14 + tnl ) = zS->getKills();
+    *(int *)( bytes + 18 + tnl ) = zS->getTode();
+    klient->statistikNachricht( (short)len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeStatistikLadenFertig()
+{
+    if( !klient )
+        return;
+    char byte = 2;
+    klient->statistikNachricht( 1, &byte );
+}
+
+// constant
+bool Klient::istOnline() const
+{
+    return klient != 0;
+}
+
+// reference Counting
+Klient *Klient::getThis()
+{
+    ref++;
+    return this;
+}
+
+Klient *Klient::release()
+{
+    ref--;
+    if( !ref )
+        delete this;
+    return 0;
+}

+ 414 - 0
StickmanWorldOnline/SSKlient.cpp

@@ -0,0 +1,414 @@
+#include "Spieler.h"
+#include "SSKlient.h"
+#include <Text.h>
+
+// Inhalt der Klient Klasse aus Klient.h
+// Konstruktor
+Klient::Klient( SSKlientV *klient )
+{
+    this->klient = klient;
+    ref = 1;
+}
+
+// Destruktor
+Klient::~Klient()
+{
+    if( klient )
+        klient->release();
+}
+
+// nicht constant
+void Klient::offline()
+{
+    klient = (SSKlientV *)klient->release();
+}
+
+void Klient::online( SSKlientV *zKlient )
+{
+    if( klient )
+        klient = (SSKlientV *)klient->release();
+    klient = (SSKlientV *)zKlient->getThis();
+}
+
+void Klient::sendeInit( RCArray< Spieler > *zSpieler, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = (short)( 6 + zSpieler->getEintragAnzahl() * 8 );
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 6;
+    *(char *)( bytes + 5 ) = (char)zSpieler->getEintragAnzahl();
+    for( int i = 0; i < zSpieler->getEintragAnzahl(); i++ )
+    {
+        *(int *)( bytes + 6 + i * 8 ) = zSpieler->z( i )->getSpielerNummer();
+        *(int *)( bytes + 10 + i * 8 ) = zSpieler->z( i )->getAccountId();
+    }
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeSpielerNummer( int sNum, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 9;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 9;
+    *(int *)( bytes + 5 ) = sNum;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeStart( int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 5;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0xA;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeTastaturStatus( int spielerId, TastaturStatus ts, bool aktiv, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 9;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = (char)( (char)ts * 2 + (char)!aktiv );
+    *(int *)( bytes + 5 ) = spielerId;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeSkillNachricht( int sNum, char art, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 10;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0xC;
+    *(int *)( bytes + 5 ) = sNum;
+    *(char *)( bytes + 9 ) = art;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeUseSkillNachricht( int sNum, char id, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 10;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0x15;
+    *(int *)( bytes + 5 ) = sNum;
+    *(char *)( bytes + 9 ) = id;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeAsteroid( int id, Vertex pos, Vertex speed, float rot, float rotS, int index, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 37;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0x11;
+    *(int *)( bytes + 5 ) = id;
+    *(float *)( bytes + 9 ) = pos.x;
+    *(float *)( bytes + 13 ) = pos.y;
+    *(float *)( bytes + 17 ) = speed.x;
+    *(float *)( bytes + 21 ) = speed.y;
+    *(float *)( bytes + 25 ) = rot;
+    *(float *)( bytes + 29 ) = rotS;
+    *(int *)( bytes + 33 ) = index;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeSchuss( int id, int sNum, Vertex pos, Vertex speed, double intensity, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 37;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0xD;
+    *(int *)( bytes + 5 ) = id;
+    *(int *)( bytes + 9 ) = sNum;
+    *(float *)( bytes + 13 ) = pos.x;
+    *(float *)( bytes + 17 ) = pos.y;
+    *(float *)( bytes + 21 ) = speed.x;
+    *(float *)( bytes + 25 ) = speed.y;
+    *(double *)( bytes + 29 ) = intensity;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendePixel( int asteroid, int pixelId, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 13;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0x13;
+    *(int *)( bytes + 5 ) = asteroid;
+    *(int *)( bytes + 9 ) = pixelId;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeEp( int pixelId, int spielerId, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 13;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0x14;
+    *(int *)( bytes + 5 ) = pixelId;
+    *(int *)( bytes + 9 ) = spielerId;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeTreffer( int id, int sNum, int spielZeit, float ep, int skillP )
+{
+    if( !klient )
+        return;
+    short len = 21;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0xE;
+    *(int *)( bytes + 5 ) = id;
+    *(int *)( bytes + 9 ) = sNum;
+    *(float *)( bytes + 13 ) = ep;
+    *(int *)( bytes + 17 ) = skillP;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeObjektTreffer( int id, int oId, int spielZeit, float ep, int skillP )
+{
+    if( !klient )
+        return;
+    short len = 21;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0x16;
+    *(int *)( bytes + 5 ) = id;
+    *(int *)( bytes + 9 ) = oId;
+    *(float *)( bytes + 13 ) = ep;
+    *(int *)( bytes + 17 ) = skillP;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeObjektTod( int oId, int killSNum, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 13;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0x17;
+    *(int *)( bytes + 5 ) = oId;
+    *(int *)( bytes + 9 ) = killSNum;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeAsteroidTreffer( int asteroidId, int newAsteroidId, int schussId, Vertex pos, __int64 seed, int spielZeit, float ep, int skillP )
+{
+    if( !klient )
+        return;
+    short len = 41;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0x12;
+    *(int *)( bytes + 5 ) = schussId;
+    *(int *)( bytes + 9 ) = asteroidId;
+    *(float *)( bytes + 13 ) = pos.x;
+    *(float *)( bytes + 17 ) = pos.y;
+    *(__int64 *)( bytes + 21 ) = seed;
+    *(int *)( bytes + 29 ) = newAsteroidId;
+    *(float *)( bytes + 33 ) = ep;
+    *(int *)( bytes + 37 ) = skillP;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeWiederbelebung( int sNum, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 9;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0xF;
+    *(int *)( bytes + 5 ) = sNum;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeTod( int sNum, int killSNum, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 13;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0x10;
+    *(int *)( bytes + 5 ) = sNum;
+    *(int *)( bytes + 9 ) = killSNum;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeSpielEnde( char gewonnen, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = 6;
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0xB;
+    *(char *)( bytes + 5 ) = gewonnen;
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeChatNachricht( char *txt, int spielZeit )
+{
+    if( !klient )
+        return;
+    short len = (short)( 5 + textLength( txt ) );
+    char *bytes = new char[ len ];
+    *(int *)bytes = spielZeit;
+    *(char *)( bytes + 4 ) = 0x8;
+    for( int i = 5; i < len; i++ )
+        bytes[ i ] = txt[ i - 5 ];
+    klient->spielNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeStatistikChatNachricht( int vonAccount, char *txt )
+{
+    if( !klient )
+        return;
+    short len = (short)( 5 + textLength( txt ) );
+    char *bytes = new char[ len ];
+    *(char *)( bytes ) = 3;
+    *(int *)( bytes + 1 ) = vonAccount;
+    for( int i = 5; i < len; i++ )
+        bytes[ i ] = txt[ i - 5 ];
+    klient->statistikNachricht( len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeStatistikSpielerOffline( int account )
+{
+    if( !klient )
+        return;
+    char *bytes = new char[ 5 ];
+    *(char *)( bytes ) = 4;
+    *(int *)( bytes + 1 ) = account;
+    klient->statistikNachricht( 5, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeSpielerStatistik( SpielerStatistik *zS )
+{
+    if( !zS || !klient )
+        return;
+    char snl = (char)zS->zSpielerName()->getLength();
+    char tnl = (char)zS->zTeamName()->getLength();
+    int len = 55 + snl + tnl;
+    char *bytes = new char[ len ];
+    bytes[ 0 ] = 0;
+    *(int *)( bytes + 1 ) = zS->getSpielerNummer();
+    *(char *)( bytes + 5 ) = (char)zS->zSpielerName()->getLength();
+    for( int i = 0; i < snl; i++ )
+        bytes[ i + 6 ] = zS->zSpielerName()->getText()[ i ];
+    *(char *)( bytes + 6 + snl ) = tnl;
+    for( int i = 0; i < tnl; i++ )
+        bytes[ i + 7 + snl ] = zS->zTeamName()->getText()[ i ];
+    *(int *)( bytes + 7 + snl + tnl ) = zS->getSpielerFarbe();
+    *(int *)( bytes + 11 + snl + tnl ) = zS->getTeamFarbe();
+    *(int *)( bytes + 15 + snl + tnl ) = zS->getSchadenBekommen();
+    *(int *)( bytes + 19 + snl + tnl ) = zS->getSchadenGemacht();
+    *(int *)( bytes + 23 + snl + tnl ) = zS->getTreibstoffVerbraucht();
+    *(int *)( bytes + 27 + snl + tnl ) = zS->getShots();
+    *(int *)( bytes + 31 + snl + tnl ) = zS->getTreffer();
+    *(int *)( bytes + 35 + snl + tnl ) = zS->getPunkte();
+    *(int *)( bytes + 39 + snl + tnl ) = zS->getKills();
+    *(int *)( bytes + 43 + snl + tnl ) = zS->getTode();
+    *(int *)( bytes + 47 + snl + tnl ) = zS->getZeitAmLeben();
+    *(int *)( bytes + 51 + snl + tnl ) = zS->getZeitTod();
+    klient->statistikNachricht( (short)len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeTeamStatistik( TeamStatistik *zS )
+{
+    if( !zS || !klient )
+        return;
+    char tnl = (char)zS->zTeamName()->getLength();
+    int len = 43 + tnl;
+    char *bytes = new char[ len ];
+    bytes[ 0 ] = 1;
+    *(int *)( bytes + 1 ) = zS->getTeamNummer();
+    *(char *)( bytes + 5 ) = tnl;
+    for( int i = 0; i < tnl; i++ )
+        bytes[ i + 6 ] = zS->zTeamName()->getText()[ i ];
+    *(int *)( bytes + 6 + tnl ) = zS->getTeamFarbe();
+    *(int *)( bytes + 10 + tnl ) = zS->getSchadenBekommen();
+    *(int *)( bytes + 14 + tnl ) = zS->getSchadenGemacht();
+    *(int *)( bytes + 18 + tnl ) = zS->getTreibstoffVerbraucht();
+    *(int *)( bytes + 22 + tnl ) = zS->getShots();
+    *(int *)( bytes + 26 + tnl ) = zS->getTreffer();
+    *(int *)( bytes + 30 + tnl ) = zS->getPunkte();
+    *(int *)( bytes + 34 + tnl ) = zS->getKills();
+    *(int *)( bytes + 38 + tnl ) = zS->getTode();
+    *( bytes + 42 + tnl ) = (char)zS->hatGewonnen();
+    klient->statistikNachricht( (short)len, bytes );
+    delete[] bytes;
+}
+
+void Klient::sendeStatistikLadenFertig()
+{
+    if( !klient )
+        return;
+    char byte = 2;
+    klient->statistikNachricht( 1, &byte );
+}
+
+// constant
+bool Klient::istOnline() const
+{
+    return klient != 0;
+}
+
+// reference Counting
+Klient *Klient::getThis()
+{
+    ref++;
+    return this;
+}
+
+Klient *Klient::release()
+{
+    ref--;
+    if( !ref )
+        delete this;
+    return 0;
+}

+ 6 - 6
StickmanWorldOnline/SSKlient.h

@@ -21,13 +21,13 @@ public:
     // nicht constant
     void offline();
     void online( SSKlientV *zKlient );
-    void sendeInit( RCArray< Spieler > *zSpieler, int spielZeit );
-    void sendeSpielerNummer( int sNum, int spielZeit );
-    void sendeStart( int spielZeit );
-    void sendeTastaturStatus( int spielerId, char taste, bool aktiv, int spielZeit );
-    void sendeSpielEnde( char gewonnen, int spielZeit );
+    void sendeInit( RCArray< Spieler > *zSpieler );
+    void sendeSpielerNummer( int sNum );
+    void sendeStart();
+    void sendeTastaturStatus( int spielerId, char taste, bool aktiv );
+    void sendeSpielEnde( char gewonnen );
     void sendeTick();
-    void sendeChatNachricht( char *txt, int spielZeit );
+    void sendeChatNachricht( char *txt );
     void sendeStatistikChatNachricht( int vonAccount, char *txt );
     void sendeStatistikSpielerOffline( int account );
     void sendeSpielerStatistik( Spieler *zS );

+ 12 - 10
StickmanWorldOnline/Spiel.cpp

@@ -203,11 +203,11 @@ void Spiel::run()
         Spieler *tmp = spieler.z( i );
         if( tmp && tmp->zKlient() )
         {
-            tmp->zKlient()->sendeInit( &spieler, -1 );
+            tmp->zKlient()->sendeInit( &spieler );
             log->schreibe( (char *)& i, 4 );
             int sNum = tmp->getSpielerNummer();
             log->schreibe( (char *)& sNum, 4 );
-            tmp->zKlient()->sendeSpielerNummer( sNum, -1 );
+            tmp->zKlient()->sendeSpielerNummer( sNum );
             Text *name = psqldb->getAccountRufName( tmp->getAccountId() );
             char len = (char)( name ? name->getLength() : 0 );
             log->schreibe( &len, 1 );
@@ -234,7 +234,7 @@ void Spiel::run()
     {
         Spieler *tmp = spieler.z( i );
         if( tmp && tmp->zKlient() )
-            tmp->zKlient()->sendeStart( gameTicks );
+            tmp->zKlient()->sendeStart();
     }
     throwEvent( new Ereignis( INITIALISIERUNG ) );
     double rZeit = 0;
@@ -267,17 +267,17 @@ void Spiel::run()
             if( !zWinner )
             {
                 spielerStatus.set( 5, i ); // Datenbank Unentschieden
-                spieler.z( i )->zKlient()->sendeSpielEnde( 2, 0 );
+                spieler.z( i )->zKlient()->sendeSpielEnde( 2 );
             }
             else if( zWinner != spieler.z( i )->zTeam() )
             {
                 spielerStatus.set( 1, i ); // Datenbank Verloren
-                spieler.z( i )->zKlient()->sendeSpielEnde( 0, 0 );
+                spieler.z( i )->zKlient()->sendeSpielEnde( 0 );
             }
             else
             {
                 spielerStatus.set( 2, i ); // Datenbank Gewonnen
-                spieler.z( i )->zKlient()->sendeSpielEnde( 1, 0 );
+                spieler.z( i )->zKlient()->sendeSpielEnde( 1 );
             }
         }
         if( spieler.z( i ) && ( !spieler.z( i )->zKlient() || !spieler.z( i )->zKlient()->istOnline() ) )
@@ -317,7 +317,7 @@ void Spiel::klientOnline( int accountId, SSKlientV *zKlient )
             Spieler *s = spieler.z( i );
             Klient *tmp = s->zKlient();
             tmp->online( zKlient );
-            tmp->sendeSpielerNummer( s->getSpielerNummer(), 0 );
+            tmp->sendeSpielerNummer( s->getSpielerNummer() );
             //--------------------------
             c.unlock();
         }
@@ -363,7 +363,7 @@ void Spiel::nachricht( int accountId, int len, char *bytes )
                 {
                     Spieler *s = spieler.z( j );
                     if( s && s->zKlient() )
-                        s->zKlient()->sendeTastaturStatus( tmp->getSpielerNummer(), *bytes, 1, gameTicks );
+                        s->zKlient()->sendeTastaturStatus( tmp->getSpielerNummer(), *bytes, 1 );
                 }
                 break;
             }
@@ -391,7 +391,7 @@ void Spiel::nachricht( int accountId, int len, char *bytes )
                 {
                     Spieler *s = spieler.z( j );
                     if( s && s->zKlient() )
-                        s->zKlient()->sendeTastaturStatus( tmp->getSpielerNummer(), *bytes, 0, gameTicks );
+                        s->zKlient()->sendeTastaturStatus( tmp->getSpielerNummer(), *bytes, 0 );
                 }
                 break;
             }
@@ -408,7 +408,7 @@ void Spiel::nachricht( int accountId, int len, char *bytes )
             {
                 Spieler *tmp = spieler.z( i );
                 if( tmp && tmp->zKlient() )
-                    tmp->zKlient()->sendeChatNachricht( txt->getText(), gameTicks );
+                    tmp->zKlient()->sendeChatNachricht( txt->getText() );
             }
             txt->release();
             len = 0;
@@ -460,6 +460,8 @@ void Spiel::tick( double zeit )
     // spieler bewegungen
     for( auto s = spieler.getIterator(); s; s++ )
     {
+        if( s->zKlient() )
+            s->zKlient()->sendeTick();
         s->move( zeit );
         if( s->getX() < 0 || s->getY() < 0 || s->getX() + s->getWidth() >= mapSize.x || s->getY() + s->getHeight() >= mapSize.y )
             s->move( -zeit );

+ 1 - 0
StickmanWorldOnline/StickmanWorldOnline.vcxproj

@@ -102,6 +102,7 @@
     <ClCompile Include="Schuh.cpp" />
     <ClCompile Include="Spiel.cpp" />
     <ClCompile Include="Spieler.cpp" />
+    <ClCompile Include="Klient.cpp" />
     <ClCompile Include="Statistik.cpp" />
     <ClCompile Include="StrengthRune.cpp" />
     <ClCompile Include="Sturm.cpp" />

+ 3 - 0
StickmanWorldOnline/StickmanWorldOnline.vcxproj.filters

@@ -138,6 +138,9 @@
     <ClCompile Include="Statistik.cpp">
       <Filter>Statistik</Filter>
     </ClCompile>
+    <ClCompile Include="Klient.cpp">
+      <Filter>Netzwerk</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="SpielKlasse.h">