QTfrontend/newnetclient.cpp
changeset 1530 3b8d723661b2
parent 1526 18e412dd7d50
child 1541 61b3b32aede8
equal deleted inserted replaced
1529:3bc916b419cd 1530:3b8d723661b2
   403 		}
   403 		}
   404 		if (lst[1] == "DIVIDETEAMS") {
   404 		if (lst[1] == "DIVIDETEAMS") {
   405 			emit teamsDivideChanged(lst[2].toInt() != 0);
   405 			emit teamsDivideChanged(lst[2].toInt() != 0);
   406 			return;
   406 			return;
   407 		}
   407 		}
       
   408 		if (lst[1] == "SOLIDLAND") {
       
   409 			emit solidChanged(lst[2].toInt() != 0);
       
   410 			return;
       
   411 		}
   408 		if (lst[1] == "AMMO") {
   412 		if (lst[1] == "AMMO") {
   409 			if(lst.size() < 4) return;
   413 			if(lst.size() < 4) return;
   410 			emit ammoChanged(lst[3], lst[2]);
   414 			emit ammoChanged(lst[3], lst[2]);
   411 			return;
   415 			return;
   412 		}
   416 		}
   473 	onThemeChanged(m_pGameCFGWidget->getCurrentTheme());
   477 	onThemeChanged(m_pGameCFGWidget->getCurrentTheme());
   474 	onInitHealthChanged(m_pGameCFGWidget->getInitHealth());
   478 	onInitHealthChanged(m_pGameCFGWidget->getInitHealth());
   475 	onTurnTimeChanged(m_pGameCFGWidget->getTurnTime());
   479 	onTurnTimeChanged(m_pGameCFGWidget->getTurnTime());
   476 	onFortsModeChanged(m_pGameCFGWidget->getGameFlags() & 0x1);
   480 	onFortsModeChanged(m_pGameCFGWidget->getGameFlags() & 0x1);
   477 	onTeamsDivideChanged(m_pGameCFGWidget->getGameFlags() & 0x10);
   481 	onTeamsDivideChanged(m_pGameCFGWidget->getGameFlags() & 0x10);
       
   482 	onSolidChanged(m_pGameCFGWidget->getGameFlags() & 0x04);
   478 	// always initialize with default ammo (also avoiding complicated cross-class dependencies)
   483 	// always initialize with default ammo (also avoiding complicated cross-class dependencies)
   479 	onWeaponsNameChanged("Default", cDefaultAmmoStore->mid(10));
   484 	onWeaponsNameChanged("Default", cDefaultAmmoStore->mid(10));
   480 }
   485 }
   481 
   486 
   482 void HWNewNet::RunGame()
   487 void HWNewNet::RunGame()
   502 			.arg(team.teamColor.name()));
   507 			.arg(team.teamColor.name()));
   503 }
   508 }
   504 
   509 
   505 void HWNewNet::onSeedChanged(const QString & seed)
   510 void HWNewNet::onSeedChanged(const QString & seed)
   506 {
   511 {
   507   if (isChief) RawSendNet(QString("CONFIG_PARAM%1SEED%1%2").arg(delimeter).arg(seed));
   512 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1SEED%1%2").arg(delimeter).arg(seed));
   508 }
   513 }
   509 
   514 
   510 void HWNewNet::onMapChanged(const QString & map)
   515 void HWNewNet::onMapChanged(const QString & map)
   511 {
   516 {
   512   if (isChief) RawSendNet(QString("MAP%1%2").arg(delimeter).arg(map));
   517 	if (isChief) RawSendNet(QString("MAP%1%2").arg(delimeter).arg(map));
   513 }
   518 }
   514 
   519 
   515 void HWNewNet::onThemeChanged(const QString & theme)
   520 void HWNewNet::onThemeChanged(const QString & theme)
   516 {
   521 {
   517   if (isChief) RawSendNet(QString("CONFIG_PARAM%1THEME%1%2").arg(delimeter).arg(theme));
   522 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1THEME%1%2").arg(delimeter).arg(theme));
   518 }
   523 }
   519 
   524 
   520 void HWNewNet::onInitHealthChanged(int health)
   525 void HWNewNet::onInitHealthChanged(int health)
   521 {
   526 {
   522   if (isChief) RawSendNet(QString("CONFIG_PARAM%1HEALTH%1%2").arg(delimeter).arg(health));
   527 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1HEALTH%1%2").arg(delimeter).arg(health));
   523 }
   528 }
   524 
   529 
   525 void HWNewNet::onTurnTimeChanged(int time)
   530 void HWNewNet::onTurnTimeChanged(int time)
   526 {
   531 {
   527   if (isChief) RawSendNet(QString("CONFIG_PARAM%1TURNTIME%1%2").arg(delimeter).arg(time));
   532 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1TURNTIME%1%2").arg(delimeter).arg(time));
   528 }
   533 }
   529 
   534 
   530 void HWNewNet::onFortsModeChanged(bool value)
   535 void HWNewNet::onFortsModeChanged(bool value)
   531 {
   536 {
   532   if (isChief) RawSendNet(QString("CONFIG_PARAM%1FORTSMODE%1%2").arg(delimeter).arg(value));
   537 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1FORTSMODE%1%2").arg(delimeter).arg(value));
   533 }
   538 }
   534 
   539 
   535 void HWNewNet::onTeamsDivideChanged(bool value)
   540 void HWNewNet::onTeamsDivideChanged(bool value)
   536 {
   541 {
   537   if (isChief) RawSendNet(QString("CONFIG_PARAM%1DIVIDETEAMS%1%2").arg(delimeter).arg(value));
   542 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1DIVIDETEAMS%1%2").arg(delimeter).arg(value));
       
   543 }
       
   544 
       
   545 void HWNewNet::onSolidChanged(bool value)
       
   546 {
       
   547 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1SOLIDLAND%1%2").arg(delimeter).arg(value));
   538 }
   548 }
   539 
   549 
   540 void HWNewNet::onWeaponsNameChanged(const QString& name, const QString& ammo)
   550 void HWNewNet::onWeaponsNameChanged(const QString& name, const QString& ammo)
   541 {
   551 {
   542   if (isChief) RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2%1%3").arg(delimeter).arg(ammo).arg(name));
   552 	if (isChief) RawSendNet(QString("CONFIG_PARAM%1AMMO%1%2%1%3").arg(delimeter).arg(ammo).arg(name));
   543 }
   553 }
   544 
   554 
   545 void HWNewNet::chatLineToNet(const QString& str)
   555 void HWNewNet::chatLineToNet(const QString& str)
   546 {
   556 {
   547   if(str!="") {
   557   if(str!="") {