" +
"
Chat
" +
"
" +
@@ -281,8 +354,9 @@ Loading cockatrice web client...
$("#tab-room-" + room["roomId"] + " .userlist").empty();
$.each(room["userList"], function(key, value) {
- $("#tab-room-" + room["roomId"] + " .userlist").append('
');
+ $("#tab-room-" + room["roomId"] + " .userlist").append('
' + value.name + '');
});
+ $("#tab-room-" + room["roomId"] + " .userlist").selectable();
$("#tab-room-" + room["roomId"] + " .say").click(function() {
var msg = $("#tab-room-" + room["roomId"] + " .input").val();
diff --git a/webclient/style.css b/webclient/style.css
index 51e77e21..bb06e435 100755
--- a/webclient/style.css
+++ b/webclient/style.css
@@ -24,6 +24,7 @@ h3 {
#tab-login input {
margin-bottom: 10px;
+ width: 20em;
}
#loading {
@@ -33,7 +34,7 @@ h3 {
}
.output, #servermessages {
- min-height: 400px;
+ height: 400px;
overflow-x: hidden;
overflow-y: scroll;
word-wrap: break-word;
@@ -44,7 +45,7 @@ h3 {
}
.input {
- width:93%;
+ width:92%;
}
.say {
@@ -75,7 +76,27 @@ h3 {
#buddies, #ignores, .userlist {
width: 100%;
- min-height: 470px;
+ height: 500px;
+ list-style-type: none;
+ overflow-x: hidden;
+ overflow-y: scroll;
+ background: #fff;
+ padding: 0;
+ margin: 0;
+ cursor: pointer;
+ border: 1px solid #999;
+}
+
+#buddies li, #ignores li, .userlist li {
+ padding: 0 3px;
+}
+
+#buddies .ui-selecting, #ignores .ui-selecting, .userlist .ui-selecting {
+ background: #FECA40;
+}
+
+#buddies .ui-selected, #ignores .ui-selected, .userlist .ui-selected {
+ background: #F39814; color: white;
}
.buddies-container, .ignores-container, .userinfo-container, .missingfeatures-container {
diff --git a/webclient/webclient.js b/webclient/webclient.js
index 6777381c..31c67fa8 100755
--- a/webclient/webclient.js
+++ b/webclient/webclient.js
@@ -9,6 +9,7 @@ var StatusEnum = {
var WebClient = {
status : StatusEnum.DISCONNECTED,
+ protocolVersion : 14,
socket : 0,
keepalivecb: null,
lastPingPending: false,
@@ -39,6 +40,9 @@ var WebClient = {
"pb/response_login.proto",
"pb/session_event.proto",
"pb/event_server_message.proto",
+ "pb/event_server_identification.proto",
+ "pb/event_server_shutdown.proto",
+ "pb/event_notify_user.proto",
"pb/event_connection_closed.proto",
"pb/event_list_rooms.proto",
"pb/response_join_room.proto",
@@ -157,8 +161,14 @@ var WebClient = {
"userName" : this.options.user,
"password" : this.options.pass,
"clientid" : this.guid(),
- "clientver" : "webclient-0.1 (2015-12-23)",
- "clientfeatures" : [ "client_id", "client_ver"],
+ "clientver" : "webclient-0.2 (2016-08-03)",
+ "clientfeatures" : [
+ "client_id",
+ "client_ver",
+ "feature_set",
+ "room_chat_history",
+ "client_warnings"
+ ]
});
var sc = new WebClient.pb.SessionCommand({
@@ -293,6 +303,37 @@ var WebClient = {
}
return;
}
+
+ if(raw[".Event_ServerIdentification.ext"]) {
+ if(this.options.serverIdentificationCallback)
+ this.options.serverIdentificationCallback(
+ raw[".Event_ServerIdentification.ext"]
+ );
+
+ if(raw[".Event_ServerIdentification.ext"].protocolVersion != WebClient.protocolVersion)
+ {
+ WebClient.socket.close();
+ WebClient.setStatus(StatusEnum.DISCONNECTED, 'Protocol version mismatch: ' + raw[".Event_ServerIdentification.ext"].protocolVersion);
+ return;
+ }
+
+ WebClient.setStatus(StatusEnum.CONNECTED, 'Logging in...');
+ WebClient.resetConnectionvars();
+ WebClient.doLogin();
+ return;
+ }
+
+ if(raw[".Event_ServerShutdown.ext"]) {
+ if(this.options.serverShutdownCallback)
+ this.options.serverShutdownCallback(raw[".Event_ServerShutdown.ext"]);
+ return;
+ }
+
+ if(raw[".Event_NotifyUser.ext"]) {
+ if(this.options.notifyUserCallback)
+ this.options.notifyUserCallback(raw[".Event_NotifyUser.ext"]);
+ return;
+ }
},
processRoomEvent : function (raw)
@@ -348,9 +389,7 @@ var WebClient = {
}
this.socket.onopen = function(){
- WebClient.setStatus(StatusEnum.CONNECTED, 'Connected, logging in...');
- WebClient.resetConnectionvars();
- WebClient.doLogin();
+ WebClient.setStatus(StatusEnum.CONNECTED, 'Connected');
}
this.socket.onmessage = function(event) {