public void onDisable() {
		// save players
		for (ChatPlayer p : PlayerManager.getPlayersByServer(name)) {
			String pre = "players." + p.name + ".";
			persist.get().set(pre + "channel", p.channel);
			persist.get().set(pre + "listening", p.listening);
			ArrayList<String> modes = new ArrayList<String>();
			for(ChatPlayer.Mode mode : p.modes)
				modes.add(mode.name());
			persist.get().set(pre + "modes", modes);
		}
		// save channels (soft list, will be updated by core on next sync)
		persist.get().set("channels", null);
		ArrayList<HashMap<String, Object>> chanMap = new ArrayList<HashMap<String, Object>>();
		for (ChatChannel c : ChannelManager.channels) {
			HashMap<String, Object> chan = new HashMap<String, Object>();
			chan.put("name", c.name);
			chan.put("read_permission", c.read_permission);
			chan.put("write_permission", c.write_permission);
			chan.put("alias", c.alias);
			chan.put("color", c.color);
			ArrayList<String> modes = new ArrayList<String>();
			for(ChatChannel.Mode mode : c.modes)
				modes.add(mode.name());
			chan.put("modes", modes);
			chanMap.add(chan);
		}
		persist.get().set("channels", chanMap);
		persist.save();
		
		//Save timeouts
		TimeoutsManager.save(this);

		if (thread != null && thread.socket != null) {
			getLogger().info("Socket is being closed NOW!");
			try {
				thread.socket.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
			thread = null;
		}
		fileHandler.close();
	}