The server now announces what features it has.
I'm not sure why I did this.
This commit is contained in:
		
							parent
							
								
									1124d6b073
								
							
						
					
					
						commit
						4f30afa51d
					
				@ -69,6 +69,10 @@ public:
 | 
			
		||||
  bool improved_loading_enabled = false;
 | 
			
		||||
  bool desk_mod_enabled = false;
 | 
			
		||||
  bool evidence_enabled = false;
 | 
			
		||||
  bool shownames_enabled = false;
 | 
			
		||||
  bool charpairs_enabled = false;
 | 
			
		||||
  bool arup_enabled = false;
 | 
			
		||||
  bool modcall_reason_enabled = false;
 | 
			
		||||
 | 
			
		||||
  ///////////////loading info///////////////////
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -437,6 +437,16 @@ void Courtroom::set_widgets()
 | 
			
		||||
  ui_pair_offset_spinbox->hide();
 | 
			
		||||
  set_size_and_pos(ui_pair_button, "pair_button");
 | 
			
		||||
  ui_pair_button->set_image("pair_button.png");
 | 
			
		||||
  if (ao_app->charpairs_enabled)
 | 
			
		||||
  {
 | 
			
		||||
    ui_pair_button->setEnabled(true);
 | 
			
		||||
    ui_pair_button->show();
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    ui_pair_button->setEnabled(false);
 | 
			
		||||
    ui_pair_button->hide();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  set_size_and_pos(ui_area_list, "music_list");
 | 
			
		||||
  ui_area_list->setStyleSheet("background-color: rgba(0, 0, 0, 0);");
 | 
			
		||||
@ -833,7 +843,16 @@ void Courtroom::enter_courtroom(int p_cid)
 | 
			
		||||
  //ui_server_chatlog->setHtml(ui_server_chatlog->toHtml());
 | 
			
		||||
 | 
			
		||||
  ui_char_select_background->hide();
 | 
			
		||||
  if (ao_app->shownames_enabled)
 | 
			
		||||
  {
 | 
			
		||||
    ui_ic_chat_name->setPlaceholderText(ao_app->get_showname(f_char));
 | 
			
		||||
    ui_ic_chat_name->setEnabled(true);
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    ui_ic_chat_name->setPlaceholderText("---");
 | 
			
		||||
    ui_ic_chat_name->setEnabled(false);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ui_ic_chat_message->setEnabled(m_cid != -1);
 | 
			
		||||
  ui_ic_chat_message->setFocus();
 | 
			
		||||
@ -894,6 +913,9 @@ void Courtroom::list_areas()
 | 
			
		||||
  for (int n_area = 0 ; n_area < area_list.size() ; ++n_area)
 | 
			
		||||
  {
 | 
			
		||||
    QString i_area = area_list.at(n_area);
 | 
			
		||||
 | 
			
		||||
    if (ao_app->arup_enabled)
 | 
			
		||||
    {
 | 
			
		||||
      i_area.append("\n  ");
 | 
			
		||||
 | 
			
		||||
      i_area.append(arup_statuses.at(n_area));
 | 
			
		||||
@ -904,16 +926,20 @@ void Courtroom::list_areas()
 | 
			
		||||
 | 
			
		||||
      i_area.append(QString::number(arup_players.at(n_area)));
 | 
			
		||||
      i_area.append(" users | ");
 | 
			
		||||
 | 
			
		||||
      if (arup_locks.at(n_area) == true)
 | 
			
		||||
          i_area.append("LOCKED");
 | 
			
		||||
      else
 | 
			
		||||
          i_area.append("OPEN");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (i_area.toLower().contains(ui_music_search->text().toLower()))
 | 
			
		||||
    {
 | 
			
		||||
      ui_area_list->addItem(i_area);
 | 
			
		||||
      area_row_to_number.append(n_area);
 | 
			
		||||
 | 
			
		||||
      if (ao_app->arup_enabled)
 | 
			
		||||
      {
 | 
			
		||||
        // Colouring logic here.
 | 
			
		||||
        ui_area_list->item(n_listed_areas)->setBackground(free_brush);
 | 
			
		||||
        if (arup_locks.at(n_area))
 | 
			
		||||
@ -933,6 +959,11 @@ void Courtroom::list_areas()
 | 
			
		||||
            else if (arup_statuses.at(n_area) == "GAMING")
 | 
			
		||||
                ui_area_list->item(n_listed_areas)->setBackground(gaming_brush);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      else
 | 
			
		||||
      {
 | 
			
		||||
        ui_area_list->item(n_listed_areas)->setBackground(free_brush);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      ++n_listed_areas;
 | 
			
		||||
    }
 | 
			
		||||
@ -3070,6 +3101,13 @@ void Courtroom::on_spectator_clicked()
 | 
			
		||||
 | 
			
		||||
void Courtroom::on_call_mod_clicked()
 | 
			
		||||
{
 | 
			
		||||
  if (!ao_app->modcall_reason_enabled)
 | 
			
		||||
  {
 | 
			
		||||
    ao_app->send_server_packet(new AOPacket("ZZ#%"));
 | 
			
		||||
    ui_ic_chat_message->setFocus();
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  bool ok;
 | 
			
		||||
  QString text = QInputDialog::getText(ui_viewport, "Call a mod",
 | 
			
		||||
                                               "Reason for the modcall (optional):", QLineEdit::Normal,
 | 
			
		||||
 | 
			
		||||
@ -147,6 +147,10 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
			
		||||
    improved_loading_enabled = false;
 | 
			
		||||
    desk_mod_enabled = false;
 | 
			
		||||
    evidence_enabled = false;
 | 
			
		||||
    shownames_enabled = false;
 | 
			
		||||
    charpairs_enabled = false;
 | 
			
		||||
    arup_enabled = false;
 | 
			
		||||
    modcall_reason_enabled = false;
 | 
			
		||||
 | 
			
		||||
    //workaround for tsuserver4
 | 
			
		||||
    if (f_contents.at(0) == "NOENCRYPT")
 | 
			
		||||
@ -192,6 +196,14 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
			
		||||
      desk_mod_enabled = true;
 | 
			
		||||
    if (f_packet.contains("evidence",Qt::CaseInsensitive))
 | 
			
		||||
      evidence_enabled = true;
 | 
			
		||||
    if (f_packet.contains("cc_customshownames",Qt::CaseInsensitive))
 | 
			
		||||
      shownames_enabled = true;
 | 
			
		||||
    if (f_packet.contains("characterpairs",Qt::CaseInsensitive))
 | 
			
		||||
      charpairs_enabled = true;
 | 
			
		||||
    if (f_packet.contains("arup",Qt::CaseInsensitive))
 | 
			
		||||
      arup_enabled = true;
 | 
			
		||||
    if (f_packet.contains("modcall_reason",Qt::CaseInsensitive))
 | 
			
		||||
      modcall_reason_enabled = true;
 | 
			
		||||
  }
 | 
			
		||||
  else if (header == "PN")
 | 
			
		||||
  {
 | 
			
		||||
 | 
			
		||||
@ -213,7 +213,7 @@ class AOProtocol(asyncio.Protocol):
 | 
			
		||||
 | 
			
		||||
        self.client.is_ao2 = True
 | 
			
		||||
 | 
			
		||||
        self.client.send_command('FL', 'yellowtext', 'customobjections', 'flipping', 'fastloading', 'noencryption', 'deskmod', 'evidence')
 | 
			
		||||
        self.client.send_command('FL', 'yellowtext', 'customobjections', 'flipping', 'fastloading', 'noencryption', 'deskmod', 'evidence', 'modcall_reason', 'cc_customshownames', 'characterpairs', 'arup')
 | 
			
		||||
 | 
			
		||||
    def net_cmd_ch(self, _):
 | 
			
		||||
        """ Periodically checks the connection.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user