Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qiuxu_code
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
邱旭
qiuxu_code
Commits
cda869e0
Commit
cda869e0
authored
Jun 16, 2021
by
邱旭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联机初版,代码未整理
parent
ff82fcf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
server.js
src/server/server.js
+2
-2
No files found.
src/server/server.js
View file @
cda869e0
...
@@ -199,7 +199,7 @@ function broadcastOnlineCount() {
...
@@ -199,7 +199,7 @@ function broadcastOnlineCount() {
*/
*/
function
broadcastJson
(
data
)
{
function
broadcastJson
(
data
)
{
const
msg
=
JSON
.
stringify
(
data
);
const
msg
=
JSON
.
stringify
(
data
);
server
.
connections
.
forEach
(
function
(
conn
)
{
server
.
connections
.
forEach
(
(
conn
)
=>
{
conn
.
sendText
(
msg
);
conn
.
sendText
(
msg
);
});
});
}
}
...
@@ -219,7 +219,7 @@ function sendJson(conn, data) {
...
@@ -219,7 +219,7 @@ function sendJson(conn, data) {
* @param {string} msg
* @param {string} msg
*/
*/
function
broadcast
(
msg
)
{
function
broadcast
(
msg
)
{
server
.
connections
.
forEach
(
function
(
conn
)
{
server
.
connections
.
forEach
(
(
conn
)
=>
{
conn
.
sendText
(
msg
);
conn
.
sendText
(
msg
);
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment