mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
code formatting,
client lines coloring
This commit is contained in:
@@ -7,12 +7,13 @@ div.wrap { width: 640px; margin: 100px auto;}
|
|||||||
.title input {width: 300px; }
|
.title input {width: 300px; }
|
||||||
.title span { display: inline-block; width: 120px; text-align: right; }
|
.title span { display: inline-block; width: 120px; text-align: right; }
|
||||||
|
|
||||||
.messages { height: 20ex; overflow: auto; background-color: #eee; padding: 4px; border: 1px solid black; list-style: none; }
|
.messages { height: 20ex; overflow: auto; background-color: #fff; padding: 4px; border: 1px solid black; list-style: none; }
|
||||||
.messages .incoming { color: #006; }
|
.messages .incoming { color: #006; }
|
||||||
.messages .incoming:before { content: "<< "}
|
.messages .incoming:before { content: "<< "}
|
||||||
.messages .outcoming { color: #060; }
|
.messages .outcoming { color: #060; }
|
||||||
.messages .outcoming:before { content: ">> "}
|
.messages .outcoming:before { content: ">> "}
|
||||||
.messages .error { color: #600; }
|
.messages .error { color: #600; }
|
||||||
|
.messages li:nth-child(2n) { background-color: #f7f7f7; }
|
||||||
|
|
||||||
.packets { padding: 4px; background-color: #ddd; border: 1px solid black; border-top: 0px; display: none; }
|
.packets { padding: 4px; background-color: #ddd; border: 1px solid black; border-top: 0px; display: none; }
|
||||||
.packets span { display: inline-block; width: 120px; text-align: right; }
|
.packets span { display: inline-block; width: 120px; text-align: right; }
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ function addLi(className, text) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onConnectClicked() {
|
function onConnectClicked() {
|
||||||
server.connect($("#ws_uri").val());
|
var uri = $("#ws_uri").val()
|
||||||
|
addLi("connecting", "Connecting to ws://" + uri + " ..." )
|
||||||
|
server.connect(uri);
|
||||||
$('#connect').attr("disabled", "disabled")
|
$('#connect').attr("disabled", "disabled")
|
||||||
$('#disconn').removeAttr("disabled")
|
$('#disconn').removeAttr("disabled")
|
||||||
|
|
||||||
|
|||||||
@@ -44,12 +44,10 @@ public enum PacketOpcode {
|
|||||||
|
|
||||||
private static IPacket decodePacket(PacketOpcode code, String data) {
|
private static IPacket decodePacket(PacketOpcode code, String data) {
|
||||||
switch(code) {
|
switch(code) {
|
||||||
case Echo:
|
case Echo: return EchoPacket.parse(data);
|
||||||
return EchoPacket.parse(data);
|
case Authorize: return AuthorizePacket.parse(data);
|
||||||
case Authorize:
|
|
||||||
return AuthorizePacket.parse(data);
|
default: return UnknownPacket.parse(data);
|
||||||
default:
|
|
||||||
return UnknownPacket.parse(data);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user