Index: src/main/webapp/newtournament.xhtml
===================================================================
--- src/main/webapp/newtournament.xhtml	(revision 28)
+++ src/main/webapp/newtournament.xhtml	(revision 29)
@@ -200,5 +200,5 @@
         
         var domainwebsocket = null;
-        var partieswebsocket=null;
+        var partieslistlistener=null;
         // currently known domains (and profiles) as coming from domainwebsocket.
         // keys are domain names, values are list of profile names
@@ -317,36 +317,59 @@
     	selectDomain();
     }
-	/**
-	Refresh known parties using given partiesserver URL. 
-	Called when user enters URL for parties server.
-	*/
-    function connectParties() {
-    	if (partieswebsocket!=null) {
-    		partieswebsocket.close();
-    		partieswebsocket=null;
-    	}
-		var url=document.getElementById("partiesserverurl").value;
-        var target = "ws://"+url+"/available";
-        if ('WebSocket' in window) {
-        	partieswebsocket = new WebSocket(target);
-        } else if ('MozWebSocket' in window) {
-        	partieswebsocket = new MozWebSocket(target);
-        } else {
-            alert('WebSocket is not supported by this browser. Please use a newer browser');
-            return;
-        }
-        partieswebsocket.onopen = function () {
-        	// whatever.
-        };
-        partieswebsocket.onmessage = function (event) {
-        	updateParties(JSON.parse(event.data));
-        };
-        partieswebsocket.onclose = function (event) {
-            alert('Info: Server closed connection. Code: ' + event.code + 
-            		(event.reason == "" ? "" : ", Reason: " + event.reason));
-            partieswebsocket=null;
-        	updateParties({});
-        };
-    }
+        
+	/**
+	Connects to partieslist service on partiesserver and 
+	forwards reported parties into the updateParties() call.
+	*/
+	class PartiesListWebsocket {
+		constructor(target) {
+			this.isopen=false
+			var that=this
+	        if ('WebSocket' in window) {
+	        	this.partieswebsocket = new WebSocket(target);
+	        } else if ('MozWebSocket' in window) {
+	        	this.partieswebsocket = new MozWebSocket(target);
+	        } else {
+	            alert('WebSocket is not supported by this browser. Please use a newer browser');
+	            return;
+	        }
+	        this.partieswebsocket.onopen = function () {
+	        	console.log("new websocket conn made")
+	        	that.isopen=true
+	        };
+	        this.partieswebsocket.onmessage = function (event) {
+	        	console.log("new parties data came in")
+	        	updateParties(JSON.parse(event.data));
+	        };
+	        this.partieswebsocket.onclose = function (event) {
+	            if (that.isopen) {
+	                alert('Info: Server closed connection. Code: ' + event.code + 
+	                		(event.reason == "" ? "" : ", Reason: " + event.reason));
+	            	that.isopen=false;
+	            	updateParties({});
+	            }
+	        };
+		}
+		close() {
+			if (this.isopen)
+				console.log("closing parties listener")
+	 		this.isopen=false;
+			this.partieswebsocket.close()
+		}
+	}   
+	
+   	/**
+   	Refresh known parties using given partiesserver URL. 
+   	Called when user enters URL for parties server.
+   	*/
+       function connectParties() {
+       	if (partieslistlistener!=null) {
+       		partieslistlistener.close();
+       	}
+   		var url=document.getElementById("partiesserverurl").value;
+           var target = "ws://"+url+"/available";
+           partieslistlistener = new PartiesListWebsocket(target)
+       }
+
 
 	/**
@@ -586,8 +609,8 @@
 		const dtypecombo  = document.getElementById("deadlinetype");
 		if (dtypecombo.options[dtypecombo.selectedIndex].value=="TIME") {
-			deadline["deadlinetime"] = { "durationms": 1000*value};
+			deadline["DeadlineTime"] = { "durationms": 1000*value};
 		} else {
 			// ROUNDS
-			deadline["deadlinerounds"] = {"rounds": value, "durationms": 10000};
+			deadline["DeadlineRounds"] = {"rounds": value, "durationms": 10000};
 		}
 		
@@ -660,6 +683,6 @@
 	*/
 	function init() {
-		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.6.1";
-		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.6.1";
+		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-2.0.0";
+		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-2.0.0";
 
 		selectSessionProtocol();
