Skip to content

Commit

Permalink
Sockets: Go rewrite
Browse files Browse the repository at this point in the history
WIP

Fixes smogon#2943
  • Loading branch information
Morfent committed Dec 16, 2016
1 parent e8fa447 commit 56daaf5
Show file tree
Hide file tree
Showing 6 changed files with 1,000 additions and 468 deletions.
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
"preferGlobal": true,
"description": "The server for the Pokémon Showdown battle simulator",
"version": "0.10.2",
"dependencies": {
"sockjs": "0.3.18"
},
"optionalDependencies": {
"cloud-env": "0.1.1",
"http-proxy": "0.10.0",
"nodemailer": "1.4.0",
"node-static": "0.7.7"
},
"nonDefaultDependencies": {
"ofe": "0.1.2"
"nodemailer": "1.4.0"
},
"engines": {
"node": ">=6.0.0"
Expand Down
5 changes: 4 additions & 1 deletion rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,10 @@ class ChatRoom extends Room {
if (this.users[user.userid]) return user;

if (user.named) {
this.reportJoin('j', user.getIdentity(this.id));
// Prevents a race condition where this message would send before
// Connection#joinRoom has a chance to finish, preventing it from
// reaching users joining empty rooms.
process.nextTick(() => this.reportJoin('j', user.getIdentity(this.id)));
}

this.users[user.userid] = user;
Expand Down
Loading

0 comments on commit 56daaf5

Please sign in to comment.