fixed versioning
This commit is contained in:
		
							parent
							
								
									c540c1094e
								
							
						
					
					
						commit
						c836981e55
					
				@ -11,7 +11,7 @@ void call_error(QString p_message)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //msgBox->setWindowModality(Qt::NonModal);
 | 
					  //msgBox->setWindowModality(Qt::NonModal);
 | 
				
			||||||
  msgBox->show();
 | 
					  msgBox->exec();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void call_notice(QString p_message)
 | 
					void call_notice(QString p_message)
 | 
				
			||||||
@ -23,5 +23,5 @@ void call_notice(QString p_message)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //msgBox->setWindowModality(Qt::NonModal);
 | 
					  //msgBox->setWindowModality(Qt::NonModal);
 | 
				
			||||||
  msgBox->show();
 | 
					  msgBox->exec();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -206,6 +206,8 @@ void Lobby::on_add_to_fav_pressed()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void Lobby::on_add_to_fav_released()
 | 
					void Lobby::on_add_to_fav_released()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					  ao_app->server_packet_received(new AOPacket("AO2CHECK#2.1.1#%"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ui_add_to_fav->set_image("addtofav.png");
 | 
					  ui_add_to_fav->set_image("addtofav.png");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  //you cant add favorites from favorites m8
 | 
					  //you cant add favorites from favorites m8
 | 
				
			||||||
 | 
				
			|||||||
@ -350,7 +350,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
				
			|||||||
      int remote_cid = f_contents.at(0).toInt();
 | 
					      int remote_cid = f_contents.at(0).toInt();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (f_cid != remote_cid && remote_cid != -1)
 | 
					      if (f_cid != remote_cid && remote_cid != -1)
 | 
				
			||||||
        return;
 | 
					        goto end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      call_notice("You have been kicked.");
 | 
					      call_notice("You have been kicked.");
 | 
				
			||||||
      construct_lobby();
 | 
					      construct_lobby();
 | 
				
			||||||
@ -367,6 +367,41 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    call_notice("You are banned on this server.");
 | 
					    call_notice("You are banned on this server.");
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  else if (header == "AO2CHECK")
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    if (f_contents.size() < 1)
 | 
				
			||||||
 | 
					      goto end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    QStringList version_contents = f_contents.at(0).split(".");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (version_contents.size() < 3)
 | 
				
			||||||
 | 
					      goto end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    int f_release = version_contents.at(0).toInt();
 | 
				
			||||||
 | 
					    int f_major = version_contents.at(1).toInt();
 | 
				
			||||||
 | 
					    int f_minor = version_contents.at(2).toInt();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    //qDebug() << "local version: " << get_version_string();
 | 
				
			||||||
 | 
					    //qDebug() << "remote version: " << QString::number(f_release) << QString::number(f_major) << QString::number(f_minor);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (get_release() > f_release)
 | 
				
			||||||
 | 
					      goto end;
 | 
				
			||||||
 | 
					    else if (get_release() == f_release)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      if (get_major_version() > f_major)
 | 
				
			||||||
 | 
					        goto end;
 | 
				
			||||||
 | 
					      else if (get_major_version() == f_major)
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        if (get_minor_version() >= f_minor)
 | 
				
			||||||
 | 
					          goto end;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    call_notice("Outdated version! Your version: " + get_version_string()
 | 
				
			||||||
 | 
					                + "\nPlease go to aceattorneyonline.com to update.");
 | 
				
			||||||
 | 
					    destruct_courtroom();
 | 
				
			||||||
 | 
					    destruct_lobby();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  else if (header == "checkconnection")
 | 
					  else if (header == "checkconnection")
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    send_server_packet(new AOPacket("CH#" + QString::number(w_courtroom->get_cid()) + "#%"));
 | 
					    send_server_packet(new AOPacket("CH#" + QString::number(w_courtroom->get_cid()) + "#%"));
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user