L-Leite / cso2-master-server

A master server for CSO2
MIT License
155 stars 64 forks source link

If the host leaves the game, the match stops #26

Closed cso2 closed 2 years ago

cso2 commented 5 years ago

cso2_0000 If a host goes to a game, it changes to unconnected and the game stops.

L-Leite commented 5 years ago

Just to leave as a reference the game is supposed to be migrated to the new host when this occurs

Chinayangzhihong commented 5 years ago

The problem is that the building is not created in the server, only in the local host building, so the local machine will be offline, others will be out.

Chinayangzhihong commented 5 years ago

supplement,Your local host acts as servers, and if servers are offline, they will of course be offline.

leang97 commented 5 years ago

supplement,Your local host acts as servers, and if servers are offline, they will of course be offline.

The problem is that the server is run using NodeJS, it was not possible to run the game server on the server side right now. Right now, it was able to host a multiplayer game while using the HOST and a P2P network to host the game.

@Ochii I have a quick question, was it possible to host the game on the server side instead of running the game on the HOST pc? Since there is problem like disconnection of HOST might cause the entire game to get destroyed, etc.

L-Leite commented 5 years ago

When a host starts hosting a match, it will send data to the master server about the match (either once in a while or when the host leaves, I haven't looked into it). This allows host migration.

@leang97 On a side note, it should be possible to host a dedicated server, although it would require a dedicated server launcher, I believe.

The game modes that CSO2 handles as dedicated server exclusives are Big City and the battle royales (and variations of these game modes)

leang97 commented 5 years ago

When a host starts hosting a match, it will send data to the master server about the match (either once in a while or when the host leaves, I haven't looked into it). This allows host migration.

@leang97 On a side note, it should be possible to host a dedicated server, although it would require a dedicated server launcher, I believe.

The game modes that CSO2 handles as dedicated server exclusives are Big City and the battle royales (and variations of these game modes)

Good info you have there. I found out that most of the people have trouble becoming a room host because of their ISP have nated their network. Is it possible that I call my friends to get connected to a VPN server and we host a game internally without going through the WAN IP addresses?How does the client find the host IP address and get connected with the one that host the game?

About the dedicated server launcher you mentioned, is a different thing that runs on another server and is seperated from the Lobby Server, right?

EDIT: Not a different server, I mean run on a different piece of software just like what source dedicated server did. So the Master Server gets a message of a new game and it initiate a start of another dedicated server which in this case, was a game server.

Chinayangzhihong commented 5 years ago

Sorry to disturb you. Can I get in a word? If the player's computer serves as a server, can the computer of large multiplayer players support it? For example, biochemical Z of 32 people and the big city you just mentioned, etc. When the server runs on the client PC, will it be quite a hard carry for the client PC to handle a 32 player server? If so, the host will cause the entire game to lag.

Chinayangzhihong commented 5 years ago

Consider that not everyone has a good computer configuration.

cso2 commented 5 years ago

When a host starts hosting a match, it will send data to the master server about the match (either once in a while or when the host leaves, I haven't looked into it). This allows host migration.

@leang97 On a side note, it should be possible to host a dedicated server, although it would require a dedicated server launcher, I believe.

The game modes that CSO2 handles as dedicated server exclusives are Big City and the battle royales (and variations of these game modes)

If battle royale refers to MADCITY_TEAM or MADCITY, it starts by opening an invisible room, not a server. At the time of the official service, we could see that a room was created if we were waiting for a server that had no people.

L-Leite commented 5 years ago

@leang97 The client sends an udp packet to the master server. This gives the master server the client's client port, server port and sourcetv port (see UDP hole punching, @Wikipedia).

This is an alternative to port forwarding, allowing more than one client in a single network to connect to someone. This requires an open NAT (I think).

The dedicated server launcher is just like the Source Dedicated Server that you would find on Steam, like you said. It's also somewhat similiar to cso2-launcher

@Chinayangzhihong it's possible, but it sounds impractical to me without a dedicated server launcher

@DebugBios thanks, I'll amend by previous comment

leang97 commented 5 years ago

@leang97 The client sends an udp packet to the master server. This gives the master server the client's client port, server port and sourcetv port (see UDP hole punching, @Wikipedia).

This is an alternative to port forwarding, allowing more than one client in a single network to connect to someone. This requires an open NAT (I think).

The dedicated server launcher is just like the Source Dedicated Server that you would find on Steam, like you said. It's also somewhat similiar to cso2-launcher

@Chinayangzhihong it's possible, but it sounds impractical to me without a dedicated server launcher

@DebugBios thanks, I'll amend by previous comment

Yeah. I confirmed it needs an open NAT for the player be able to host a match. I also tested it with a VPN server that I created, and ISP NATed players was be able to host a game internally with the LAN on the VPN network.

w123456w30w commented 5 years ago

@leang97 The client sends an udp packet to the master server. This gives the master server the client's client port, server port and sourcetv port (see UDP hole punching, @Wikipedia).

This is an alternative to port forwarding, allowing more than one client in a single network to connect to someone. This requires an open NAT (I think).

The dedicated server launcher is just like the Source Dedicated Server that you would find on Steam, like you said. It's also somewhat similiar to cso2-launcher

@Chinayangzhihong it's possible, but it sounds impractical to me without a dedicated server launcher

@DebugBios thanks, I'll amend by previous comment

@leang97 The client sends an udp packet to the master server. This gives the master server the client's client port, server port and sourcetv port (see UDP hole punching, @Wikipedia).

This is an alternative to port forwarding, allowing more than one client in a single network to connect to someone. This requires an open NAT (I think).

The dedicated server launcher is just like the Source Dedicated Server that you would find on Steam, like you said. It's also somewhat similiar to cso2-launcher

@Chinayangzhihong it's possible, but it sounds impractical to me without a dedicated server launcher

@DebugBios thanks, I'll amend by previous comment

You can see at this project. If "Master Server" can implement the port forwarding function provided by this project (with the client), maybe NAT forwarding problem will not exist.

missing233 commented 5 years ago

@Ochii Could you make a dedicated server launcher (like cso2-launcher)? If possible,maybe you can let the master server start a match instead of host, just like the official CSO2 server

L-Leite commented 5 years ago

@awsl1 I plan on creating one, just not so soon

cso2 commented 5 years ago

"CSO2Temp_HostCrashAlert" "%s1님이 퇴장하여 %s2님이 방장이 됩니다. 게임이 새로 시작됩니다." "CSO2_HostCrashAlert" "'%s1'님으로 방장 전환 중 입니다."

Can't I use this feature?

L-Leite commented 5 years ago

"CSO2Temp_HostCrashAlert" "%s1님이 퇴장하여 %s2님이 방장이 됩니다. 게임이 새로 시작됩니다." "CSO2_HostCrashAlert" "'%s1'님으로 방장 전환 중 입니다."

Can't I use this feature?

The host seems to send to the master server larger amounts of data (about 50kB) every X seconds. I think the data sent is a snapshot of the match (that should include entity info, such as position)

organnerx commented 4 years ago

I have read about the udp/holepunch systems in games and I found out that many Nexon games including CSO2 were using it. This mean that some of the matches were hosted on players computers instead of Nexon servers. So it should be totally possible to migrate the host to a different player in the room, just need to find a correct packet type/subtype for it. @L-Leite Can you look into this issue anytime soon? It is probably related to the host.js which is currently only having joinHost and hostStop functions, but not hostChange. In server files there are also [HostPacketType["HostJoin"] = 1] and [HostPacketType["HostStop"] = 3]. I suspect HostChange may have id 2.