Skip to content

Commit e5af7bb

Browse files
author
Ochii
committed
Attempt to mitigate 'ghost rooms' by forcing the host to join its old room when creating a new one
1 parent 5e4acb1 commit e5af7bb

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cso2-master-server",
3-
"version": "0.8.8",
3+
"version": "0.8.9",
44
"repository": "github:Ochii/cso2-master-server",
55
"description": "A master server for Nexon's Counter-Strike: Online 2",
66
"author": "Luís Leite",

src/channel/channelmanager.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,13 @@ export class ChannelManager {
194194
if (user.currentRoom) {
195195
console.warn('user "%s" tried to create a new room, while in an existing one'
196196
+ 'current room: "%s" (id: %i)', user.userName, user.currentRoom.settings.roomName, user.currentRoom.id)
197+
198+
// tell the user to rejoin its own room
199+
// this tried to mitigate the 'ghost rooms' issue
200+
// (where the host's client left the room, but it's still in the room for the server)
201+
// TODO: find a better way to detect this
202+
user.currentRoom.sendJoinNewRoom(user)
203+
197204
return false
198205
}
199206

src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { getOrAskNetIntf, INetIntf } from 'interfacepicker'
1111
import { ServerInstance } from 'serverinstance'
1212

1313
program
14-
.version('0.8.4')
14+
.version('0.8.9')
1515
.option('-i, --ip-address [ip]', 'The IP address to be used by the server', null)
1616
.option('-p, --port-master [port]', 'The server\'s (TCP) port', 30001)
1717
.option('-P, --port-holepunch [port]', 'The server\'s holepunch (UDP) port', 30002)

0 commit comments

Comments
 (0)