check validity of saved server settings
added missing property for validity check
This commit is contained in:
		@@ -123,8 +123,13 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
 | 
				
			|||||||
			return true;
 | 
								return true;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							$serverOptions = ServerOptions::fromArray($savedSettings);
 | 
				
			||||||
 | 
							if (!$serverOptions->isValid()) {
 | 
				
			||||||
 | 
								$message = "Couldn't load server settings from database because of their invalid state.";
 | 
				
			||||||
 | 
								$this->maniaControl->chat->sendErrorToAdmins($message);
 | 
				
			||||||
 | 
								return false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			$serverOptions = ServerOptions::fromArray($savedSettings);
 | 
					 | 
				
			||||||
			return $this->maniaControl->client->setServerOptions($serverOptions);
 | 
								return $this->maniaControl->client->setServerOptions($serverOptions);
 | 
				
			||||||
		} catch (ServerOptionsException $exception) {
 | 
							} catch (ServerOptionsException $exception) {
 | 
				
			||||||
			$this->maniaControl->chat->sendExceptionToAdmins($exception);
 | 
								$this->maniaControl->chat->sendExceptionToAdmins($exception);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -82,7 +82,8 @@ class ServerOptions extends AbstractStructure
 | 
				
			|||||||
			&& is_string($this->comment)
 | 
								&& is_string($this->comment)
 | 
				
			||||||
			&& is_string($this->password)
 | 
								&& is_string($this->password)
 | 
				
			||||||
			&& is_string($this->passwordForSpectator)
 | 
								&& is_string($this->passwordForSpectator)
 | 
				
			||||||
			&& VoteRatio::isRatio($this->callVoteRatio);
 | 
							    && VoteRatio::isRatio($this->callVoteRatio)
 | 
				
			||||||
 | 
							    && is_int($this->nextCallVoteTimeOut);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user