|
@@ -23,16 +23,15 @@ private:
|
|
int sample;
|
|
int sample;
|
|
__int64 len;
|
|
__int64 len;
|
|
SKlient *k;
|
|
SKlient *k;
|
|
- int ref;
|
|
|
|
bool ok;
|
|
bool ok;
|
|
|
|
|
|
public:
|
|
public:
|
|
// Konstruktor
|
|
// Konstruktor
|
|
DownloadSound( SKlient *zK )
|
|
DownloadSound( SKlient *zK )
|
|
|
|
+ : ReferenceCounter()
|
|
{
|
|
{
|
|
k = zK;
|
|
k = zK;
|
|
ok = 0;
|
|
ok = 0;
|
|
- ref = 1;
|
|
|
|
}
|
|
}
|
|
// nicht constant
|
|
// nicht constant
|
|
// GSL
|
|
// GSL
|
|
@@ -56,13 +55,13 @@ public:
|
|
k->getNachrichtEncrypted( &m, 1 );
|
|
k->getNachrichtEncrypted( &m, 1 );
|
|
istM = ( m == 1 );
|
|
istM = ( m == 1 );
|
|
sample = 0;
|
|
sample = 0;
|
|
- k->getNachrichtEncrypted( (char*)&sample, 4 );
|
|
|
|
|
|
+ k->getNachrichtEncrypted( (char *)&sample, 4 );
|
|
len = 0;
|
|
len = 0;
|
|
- k->getNachrichtEncrypted( (char*)&len, 8 );
|
|
|
|
|
|
+ k->getNachrichtEncrypted( (char *)&len, 8 );
|
|
}
|
|
}
|
|
int getDaten( char *buffer, int len ) override
|
|
int getDaten( char *buffer, int len ) override
|
|
{
|
|
{
|
|
- int l = len < this->len ? len : ( int )this->len;
|
|
|
|
|
|
+ int l = len < this->len ? len : (int)this->len;
|
|
if( !l )
|
|
if( !l )
|
|
return -1;
|
|
return -1;
|
|
k->getNachricht( buffer, l );
|
|
k->getNachricht( buffer, l );
|
|
@@ -87,31 +86,18 @@ public:
|
|
{
|
|
{
|
|
return ok;
|
|
return ok;
|
|
}
|
|
}
|
|
- // Reference Counting
|
|
|
|
- GSL::GSLSoundV *getThis() override
|
|
|
|
- {
|
|
|
|
- ref++;
|
|
|
|
- return this;
|
|
|
|
- }
|
|
|
|
- GSL::GSLSoundV *release() override
|
|
|
|
- {
|
|
|
|
- ref--;
|
|
|
|
- if( !ref )
|
|
|
|
- delete this;
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
};
|
|
};
|
|
|
|
|
|
// Inhalt der DateienEditor Klasse aus DateienEditor.h
|
|
// Inhalt der DateienEditor Klasse aus DateienEditor.h
|
|
// Konstruktor
|
|
// Konstruktor
|
|
DateienEditor::DateienEditor( char *pf, InitDatei *zIni )
|
|
DateienEditor::DateienEditor( char *pf, InitDatei *zIni )
|
|
|
|
+ : ReferenceCounter()
|
|
{
|
|
{
|
|
- this->ini = zIni->getThis();
|
|
|
|
|
|
+ this->ini = dynamic_cast<InitDatei *>( zIni->getThis() );
|
|
pfad = pf;
|
|
pfad = pf;
|
|
pfad += "/live/map/client/map/files";
|
|
pfad += "/live/map/client/map/files";
|
|
workPfad = "";
|
|
workPfad = "";
|
|
fehler = "";
|
|
fehler = "";
|
|
- ref = 1;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
// Destruktor
|
|
// Destruktor
|
|
@@ -133,7 +119,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
char typ = 0;
|
|
char typ = 0;
|
|
zKlient->getNachrichtEncrypted( &typ, 1 );
|
|
zKlient->getNachrichtEncrypted( &typ, 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
if( len )
|
|
if( len )
|
|
zKlient->getNachrichtEncrypted( name, len );
|
|
zKlient->getNachrichtEncrypted( name, len );
|
|
@@ -222,7 +208,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -272,12 +258,12 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *dName = new char[ len + 1 ];
|
|
char *dName = new char[ len + 1 ];
|
|
dName[ (int)len ] = 0;
|
|
dName[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
zKlient->getNachrichtEncrypted( dName, len );
|
|
zKlient->getNachrichtEncrypted( dName, len );
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *bName = new char[ len + 1 ];
|
|
char *bName = new char[ len + 1 ];
|
|
bName[ (int)len ] = 0;
|
|
bName[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -301,7 +287,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
LTDBDatei dat;
|
|
LTDBDatei dat;
|
|
- dat.setDatei( p.getThis() );
|
|
|
|
|
|
+ dat.setDatei( dynamic_cast<Text *>( p.getThis() ) );
|
|
dat.leseDaten( 0 );
|
|
dat.leseDaten( 0 );
|
|
Bild *b = dat.laden( 0, new Text( bName ) );
|
|
Bild *b = dat.laden( 0, new Text( bName ) );
|
|
delete[] bName;
|
|
delete[] bName;
|
|
@@ -313,9 +299,9 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
int br = b->getBreite();
|
|
int br = b->getBreite();
|
|
int hi = b->getHeight();
|
|
int hi = b->getHeight();
|
|
- zKlient->sendeEncrypted( (char*)&br, 4 );
|
|
|
|
- zKlient->sendeEncrypted( (char*)&hi, 4 );
|
|
|
|
- char *buffer = (char*)b->getBuffer();
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&br, 4 );
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&hi, 4 );
|
|
|
|
+ char *buffer = (char *)b->getBuffer();
|
|
__int64 gr = br * hi * 4;
|
|
__int64 gr = br * hi * 4;
|
|
for( int i = 0, l = gr > 2048 ? 2048 : (int)gr; gr > 0; i += l, gr -= l, l = gr > 2048 ? 2048 : (int)gr )
|
|
for( int i = 0, l = gr > 2048 ? 2048 : (int)gr; gr > 0; i += l, gr -= l, l = gr > 2048 ? 2048 : (int)gr )
|
|
zKlient->sende( &( buffer[ i ] ), l );
|
|
zKlient->sende( &( buffer[ i ] ), l );
|
|
@@ -326,7 +312,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -375,12 +361,12 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *dName = new char[ len + 1 ];
|
|
char *dName = new char[ len + 1 ];
|
|
dName[ (int)len ] = 0;
|
|
dName[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
zKlient->getNachrichtEncrypted( dName, len );
|
|
zKlient->getNachrichtEncrypted( dName, len );
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *bName = new char[ len + 1 ];
|
|
char *bName = new char[ len + 1 ];
|
|
bName[ (int)len ] = 0;
|
|
bName[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -404,7 +390,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
LTDBDatei dat;
|
|
LTDBDatei dat;
|
|
- dat.setDatei( p.getThis() );
|
|
|
|
|
|
+ dat.setDatei( dynamic_cast<Text *>( p.getThis() ) );
|
|
dat.leseDaten( 0 );
|
|
dat.leseDaten( 0 );
|
|
dat.remove( 0, new Text( bName ) );
|
|
dat.remove( 0, new Text( bName ) );
|
|
delete[] bName;
|
|
delete[] bName;
|
|
@@ -415,12 +401,12 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *dName = new char[ len + 1 ];
|
|
char *dName = new char[ len + 1 ];
|
|
dName[ (int)len ] = 0;
|
|
dName[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
zKlient->getNachrichtEncrypted( dName, len );
|
|
zKlient->getNachrichtEncrypted( dName, len );
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *bName = new char[ len + 1 ];
|
|
char *bName = new char[ len + 1 ];
|
|
bName[ (int)len ] = 0;
|
|
bName[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -446,16 +432,16 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
int br = 0;
|
|
int br = 0;
|
|
int hi = 0;
|
|
int hi = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&br, 4 );
|
|
|
|
- zKlient->getNachrichtEncrypted( (char*)&hi, 4 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&br, 4 );
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&hi, 4 );
|
|
__int64 gr = br * hi * 4;
|
|
__int64 gr = br * hi * 4;
|
|
Bild *b = new Bild();
|
|
Bild *b = new Bild();
|
|
b->neuBild( br, hi, 0 );
|
|
b->neuBild( br, hi, 0 );
|
|
- char *buffer = (char*)b->getBuffer();
|
|
|
|
|
|
+ char *buffer = (char *)b->getBuffer();
|
|
for( int i = 0, l = gr > 2048 ? 2048 : (int)gr; gr > 0; i += l, gr -= l, l = gr > 2048 ? 2048 : (int)gr )
|
|
for( int i = 0, l = gr > 2048 ? 2048 : (int)gr; gr > 0; i += l, gr -= l, l = gr > 2048 ? 2048 : (int)gr )
|
|
zKlient->getNachricht( &( buffer[ i ] ), l );
|
|
zKlient->getNachricht( &( buffer[ i ] ), l );
|
|
LTDBDatei dat;
|
|
LTDBDatei dat;
|
|
- dat.setDatei( p.getThis() );
|
|
|
|
|
|
+ dat.setDatei( dynamic_cast<Text *>( p.getThis() ) );
|
|
dat.leseDaten( 0 );
|
|
dat.leseDaten( 0 );
|
|
dat.remove( 0, new Text( bName ) );
|
|
dat.remove( 0, new Text( bName ) );
|
|
if( dat.speichern( 0, b, new Text( bName ) ) < 0 )
|
|
if( dat.speichern( 0, b, new Text( bName ) ) < 0 )
|
|
@@ -477,7 +463,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
int anz = list ? list->getEintragAnzahl() : 0;
|
|
int anz = list ? list->getEintragAnzahl() : 0;
|
|
if( workPfad.getLength() )
|
|
if( workPfad.getLength() )
|
|
anz++;
|
|
anz++;
|
|
- zKlient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&anz, 4 );
|
|
if( workPfad.getLength() )
|
|
if( workPfad.getLength() )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\2", 1 );
|
|
zKlient->sendeEncrypted( "\2", 1 );
|
|
@@ -498,7 +484,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -521,10 +507,10 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
}
|
|
}
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
LTDBDatei dat;
|
|
LTDBDatei dat;
|
|
- dat.setDatei( p.getThis() );
|
|
|
|
|
|
+ dat.setDatei( dynamic_cast<Text *>( p.getThis() ) );
|
|
dat.leseDaten( 0 );
|
|
dat.leseDaten( 0 );
|
|
int anz = dat.getBildAnzahl();
|
|
int anz = dat.getBildAnzahl();
|
|
- zKlient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&anz, 4 );
|
|
for( int i = 0; i < anz; i++ )
|
|
for( int i = 0; i < anz; i++ )
|
|
{
|
|
{
|
|
char len = (char)dat.zBildListe()->z( i )->getLength();
|
|
char len = (char)dat.zBildListe()->z( i )->getLength();
|
|
@@ -537,7 +523,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -563,7 +549,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
dat.setPfad( p );
|
|
dat.setPfad( p );
|
|
dat.leseDaten();
|
|
dat.leseDaten();
|
|
int anz = dat.getModelAnzahl();
|
|
int anz = dat.getModelAnzahl();
|
|
- zKlient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&anz, 4 );
|
|
for( int i = 0; i < anz; i++ )
|
|
for( int i = 0; i < anz; i++ )
|
|
{
|
|
{
|
|
char len = (char)dat.zModelName( i )->getLength();
|
|
char len = (char)dat.zModelName( i )->getLength();
|
|
@@ -576,7 +562,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -616,7 +602,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
gslDatei->setDatei( p );
|
|
gslDatei->setDatei( p );
|
|
gslDatei->leseDaten();
|
|
gslDatei->leseDaten();
|
|
int anz = gslDatei->getSoundAnzahl();
|
|
int anz = gslDatei->getSoundAnzahl();
|
|
- zKlient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&anz, 4 );
|
|
for( int i = 0; i < anz; i++ )
|
|
for( int i = 0; i < anz; i++ )
|
|
{
|
|
{
|
|
Text *n = gslDatei->getSoundName( i );
|
|
Text *n = gslDatei->getSoundName( i );
|
|
@@ -633,7 +619,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -655,7 +641,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
name = new char[ len + 1 ];
|
|
name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -686,7 +672,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -708,7 +694,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
name = new char[ len + 1 ];
|
|
name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -748,7 +734,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -770,7 +756,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
name = new char[ len + 1 ];
|
|
name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -787,27 +773,27 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
}
|
|
}
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
int anz = mdl->polygons ? mdl->polygons->getEintragAnzahl() : 0;
|
|
int anz = mdl->polygons ? mdl->polygons->getEintragAnzahl() : 0;
|
|
- zKlient->sendeEncrypted( (char*)&anz, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&anz, 4 );
|
|
for( int i = 0; i < anz; i++ )
|
|
for( int i = 0; i < anz; i++ )
|
|
{
|
|
{
|
|
Polygon2D pol = mdl->polygons->get( i );
|
|
Polygon2D pol = mdl->polygons->get( i );
|
|
- zKlient->sendeEncrypted( (char*)&pol.transparent, 1 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&pol.transparent, 1 );
|
|
char nLen = (char)pol.name->getLength();
|
|
char nLen = (char)pol.name->getLength();
|
|
zKlient->sendeEncrypted( &nLen, 1 );
|
|
zKlient->sendeEncrypted( &nLen, 1 );
|
|
if( nLen )
|
|
if( nLen )
|
|
zKlient->sendeEncrypted( pol.name->getText(), nLen );
|
|
zKlient->sendeEncrypted( pol.name->getText(), nLen );
|
|
int anz2 = pol.vertex ? pol.vertex->getEintragAnzahl() : 0;
|
|
int anz2 = pol.vertex ? pol.vertex->getEintragAnzahl() : 0;
|
|
- zKlient->sendeEncrypted( (char*)&anz2, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&anz2, 4 );
|
|
for( int j = 0; j < anz2; j++ )
|
|
for( int j = 0; j < anz2; j++ )
|
|
{
|
|
{
|
|
float var = pol.vertex->get( j ).x;
|
|
float var = pol.vertex->get( j ).x;
|
|
- zKlient->sendeEncrypted( (char*)&var, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&var, 4 );
|
|
var = pol.vertex->get( j ).y;
|
|
var = pol.vertex->get( j ).y;
|
|
- zKlient->sendeEncrypted( (char*)&var, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&var, 4 );
|
|
var = ( pol.tKordinaten && pol.tKordinaten->hat( j ) ) ? pol.tKordinaten->get( j ).x : 0;
|
|
var = ( pol.tKordinaten && pol.tKordinaten->hat( j ) ) ? pol.tKordinaten->get( j ).x : 0;
|
|
- zKlient->sendeEncrypted( (char*)&var, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&var, 4 );
|
|
var = ( pol.tKordinaten && pol.tKordinaten->hat( j ) ) ? pol.tKordinaten->get( j ).y : 0;
|
|
var = ( pol.tKordinaten && pol.tKordinaten->hat( j ) ) ? pol.tKordinaten->get( j ).y : 0;
|
|
- zKlient->sendeEncrypted( (char*)&var, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&var, 4 );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
mdl->release();
|
|
mdl->release();
|
|
@@ -818,7 +804,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -840,7 +826,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
name = new char[ len + 1 ];
|
|
name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -875,9 +861,9 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
char channels = sound->istMono() ? 1 : 2;
|
|
char channels = sound->istMono() ? 1 : 2;
|
|
zKlient->sendeEncrypted( &channels, 1 );
|
|
zKlient->sendeEncrypted( &channels, 1 );
|
|
int sample = sound->getSampleRate();
|
|
int sample = sound->getSampleRate();
|
|
- zKlient->sendeEncrypted( (char*)&sample, 4 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&sample, 4 );
|
|
__int64 length = sound->getDatLength();
|
|
__int64 length = sound->getDatLength();
|
|
- zKlient->sendeEncrypted( (char*)&length, 8 );
|
|
|
|
|
|
+ zKlient->sendeEncrypted( (char *)&length, 8 );
|
|
sound->open();
|
|
sound->open();
|
|
char *buffer = new char[ 2048 ];
|
|
char *buffer = new char[ 2048 ];
|
|
while( length > 0 )
|
|
while( length > 0 )
|
|
@@ -885,7 +871,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
int l = length > 2048 ? 2048 : (int)length;
|
|
int l = length > 2048 ? 2048 : (int)length;
|
|
sound->getDaten( buffer, l );
|
|
sound->getDaten( buffer, l );
|
|
zKlient->sende( buffer, l );
|
|
zKlient->sende( buffer, l );
|
|
- length -= l;
|
|
|
|
|
|
+ length -= l;
|
|
}
|
|
}
|
|
delete[] buffer;
|
|
delete[] buffer;
|
|
sound->close();
|
|
sound->close();
|
|
@@ -899,7 +885,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -921,7 +907,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
name = new char[ len + 1 ];
|
|
name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -940,16 +926,16 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
Model2DData *mdl = new Model2DData();
|
|
Model2DData *mdl = new Model2DData();
|
|
Array< Polygon2D > *data = new Array< Polygon2D >();
|
|
Array< Polygon2D > *data = new Array< Polygon2D >();
|
|
int anz = 0;
|
|
int anz = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&anz, 4 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&anz, 4 );
|
|
for( int i = 0; i < anz; i++ )
|
|
for( int i = 0; i < anz; i++ )
|
|
{
|
|
{
|
|
Polygon2D pol;
|
|
Polygon2D pol;
|
|
pol.schwerpunkt = 0;
|
|
pol.schwerpunkt = 0;
|
|
pol.vertex = new Array< Vertex >();
|
|
pol.vertex = new Array< Vertex >();
|
|
pol.tKordinaten = new Array< Vertex >();
|
|
pol.tKordinaten = new Array< Vertex >();
|
|
- zKlient->getNachrichtEncrypted( (char*)&pol.transparent, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&pol.transparent, 1 );
|
|
unsigned char nLen = 0;
|
|
unsigned char nLen = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&nLen, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&nLen, 1 );
|
|
char *txt = new char[ nLen + 1 ];
|
|
char *txt = new char[ nLen + 1 ];
|
|
if( nLen )
|
|
if( nLen )
|
|
zKlient->getNachrichtEncrypted( txt, nLen );
|
|
zKlient->getNachrichtEncrypted( txt, nLen );
|
|
@@ -957,15 +943,15 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
pol.name = new Text( txt );
|
|
pol.name = new Text( txt );
|
|
delete[] txt;
|
|
delete[] txt;
|
|
int anz2 = 0;
|
|
int anz2 = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&anz2, 4 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&anz2, 4 );
|
|
for( int j = 0; j < anz2; j++ )
|
|
for( int j = 0; j < anz2; j++ )
|
|
{
|
|
{
|
|
Vertex v;
|
|
Vertex v;
|
|
Vertex p;
|
|
Vertex p;
|
|
- zKlient->getNachrichtEncrypted( (char*)&v.x, 4 );
|
|
|
|
- zKlient->getNachrichtEncrypted( (char*)&v.y, 4 );
|
|
|
|
- zKlient->getNachrichtEncrypted( (char*)&p.x, 4 );
|
|
|
|
- zKlient->getNachrichtEncrypted( (char*)&p.y, 4 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&v.x, 4 );
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&v.y, 4 );
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&p.x, 4 );
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&p.y, 4 );
|
|
pol.vertex->add( v );
|
|
pol.vertex->add( v );
|
|
pol.tKordinaten->add( p );
|
|
pol.tKordinaten->add( p );
|
|
}
|
|
}
|
|
@@ -998,7 +984,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
{
|
|
{
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
unsigned char len = 0;
|
|
unsigned char len = 0;
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
char *name = new char[ len + 1 ];
|
|
char *name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -1020,7 +1006,7 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
zKlient->sendeEncrypted( "\1", 1 );
|
|
- zKlient->getNachrichtEncrypted( (char*)&len, 1 );
|
|
|
|
|
|
+ zKlient->getNachrichtEncrypted( (char *)&len, 1 );
|
|
name = new char[ len + 1 ];
|
|
name = new char[ len + 1 ];
|
|
name[ (int)len ] = 0;
|
|
name[ (int)len ] = 0;
|
|
if( len )
|
|
if( len )
|
|
@@ -1080,19 +1066,4 @@ bool DateienEditor::prozessMessage( SKlient *zKlient )
|
|
char *DateienEditor::getLetzterFehler() const
|
|
char *DateienEditor::getLetzterFehler() const
|
|
{
|
|
{
|
|
return fehler;
|
|
return fehler;
|
|
-}
|
|
|
|
-
|
|
|
|
-// Reference Counting
|
|
|
|
-DateienEditor *DateienEditor::getThis()
|
|
|
|
-{
|
|
|
|
- ref++;
|
|
|
|
- return this;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-DateienEditor *DateienEditor::release()
|
|
|
|
-{
|
|
|
|
- ref--;
|
|
|
|
- if( !ref )
|
|
|
|
- delete this;
|
|
|
|
- return 0;
|
|
|
|
}
|
|
}
|