private void writeMessages_() {
		if (mode != Main.MODE_IN_GAME && mode != Main.MODE_IN_GAME_WAITING_FOR_ME_TO_START_GAME) {
			return;
		}

		if (Main.getUserPreferences().getBoolean(UserPreferences.WRITE_TO_LOG_FILES)) {
			if (fileOutputStream == null) {
				File file = new File(Main.getUserPreferences().getString(UserPreferences.PATH_TO_LOG_FILES), Util.getTimeString() + ".log");
				try {
					fileOutputStream = new FileOutputStream(file);
				} catch (FileNotFoundException e) {
					Util.printStackTrace(e);
				}
				numMessagesWritten = 0;
			}
			if (fileOutputStream != null) {
				for (int index = numMessagesWritten; index < messages.size(); ++index) {
					try {
						fileOutputStream.write(charset.encode(messages.get(index)).array());
					} catch (IOException e) {
						Util.printStackTrace(e);
					}
				}
				numMessagesWritten = messages.size();
			}
		}
	}