Browse Source

Main Server Port angepasst

Kolja Strohm 6 years ago
parent
commit
24751f5f06
1 changed files with 7 additions and 2 deletions
  1. 7 2
      patcher/News.cpp

+ 7 - 2
patcher/News.cpp

@@ -260,7 +260,12 @@ bool NewsKlient::verbinde()
 		InitDatei *dat = new InitDatei( "data/optionen.ini" );
 		dat->laden();
 		Text *ipT = dat->getWert( "ServerIP" );
-		unsigned short msPort = (unsigned short)TextZuInt( dat->zWert( "ServerPort" )->getText(), 10 );
+        Datei d;
+        d.setDatei( "data/tmp/m.port" );
+        d.open( Datei::Style::lesen );
+        int port = 0;
+        d.lese( (char*)&port, 4 );
+        d.close();
 		dat->release();
 		int län = ipT->getLength();
 		char *msIp = new char[ län + 1 ];
@@ -277,7 +282,7 @@ bool NewsKlient::verbinde()
         Keys::getServerKey( &key, l, Keys::MAIN, Keys::SENDEN );
 		klient->setEmpfangKey( key, l );
         delete[] key;
-		if( !klient->verbinde( msPort, msIp ) )
+		if( !klient->verbinde( port, msIp ) )
 		{
 			klient = klient->release();
 			delete[]msIp;