diff --git a/assets/web/index.html b/assets/web/index.html index 27685d1..db6b233 100644 --- a/assets/web/index.html +++ b/assets/web/index.html @@ -62,10 +62,6 @@
${m.text} ` - msg.oncontextmenu = () => { - document.getElementById('msg-context-menu').style.display = 'flex'; - return false; - } let history = document.getElementById('chat-history'); // this is to force update everytime we get a duplicate msg to allow msg editing (yay) let exists = Array.from(history.children).filter(e => e.style.order == m.id)[0]; @@ -141,6 +137,7 @@ background-color:#0f0f2f; } .chat-message { + background-color: #ffffd6; color: #000000; border-width: 2px; @@ -188,10 +185,5 @@ - - + \ No newline at end of file diff --git a/assets/web/socket.js b/assets/web/socket.js index d68ca6f..d660fab 100644 --- a/assets/web/socket.js +++ b/assets/web/socket.js @@ -1,5 +1,5 @@ const tavern = { - socket: socket = new WebSocket('ws:/' + window.location.host + '/ws'), + socket: socket = new WebSocket('ws://localhost:3001/ws'), connected: false, loggedIn: false, call: (f, ...args) => { @@ -41,4 +41,4 @@ tavern.get_chat_history = (from, amount) => { tavern.get_last_msgs = (amount) => { if(!tavern.connected || tavern.loggedIn) { return false; } tavern.socket.send(JSON.stringify({ get_last_messages: { amount: amount } })) -} +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index f00ffd2..af1e2be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,12 +41,8 @@ impl GameServer { continue; } if msg.source.is_empty() { - msg.source = format!("({})", id.clone()); + msg.source = id.clone(); } - else { - msg.source = format!("{} ({})", msg.source, id.clone()); - } - self.chat.push((id.clone(), msg.clone())); _ = broadcast.send((None, api::Response::Message(msg))); }, @@ -74,4 +70,4 @@ impl GameServer { } _ = broadcast.send((None, api::Response::Shutdown)); } -} +} \ No newline at end of file