[Conceptual Guide] Detecting Missing Client Maps - Server Side

12/29/2012 09:11 Spirited#1
Introduction:
Hey everyone. So, in Conquer Online, there's a teleportation feature where you can teleport a character to any map and (x, y) coordinate on the server. The problem is, when you teleport a character to a map that does not exist in the client, the client seems to freeze. That's because the client cannot find the dmap file that should be in its map folder. You can detect when this happens though, and either teleport the character back to its previous location, or disconnect it.

The Concept:
When a successful teleportation occurs, the client sends a packet to the server requesting for surrounding spawns. This packet is the general action packet, subtype 114. When a unsuccessful teleportation occurs, that packet is not sent.

The Solution:
To detect when a map is not being loaded by the client, you should start a timer on the map change method. When the map has been assigned to the client in server management, it should take no longer than 10 seconds (one ping cycle in Conquer Online) to receive the request for surroundings. If the map loaded successfully, the timer should be stopped (reset at map change). Else, the timer will continue and the timer action will be executed. That action can be what you like, but it only occurs if the map has not been loaded (or the player is attempting to play using a bot that removes entity spawns). This is also helpful for the server so that the character doesn't just stand their defenseless for longer than the protection period (which should also be one ping cycle in Conquer Online). Cheers.
12/29/2012 14:54 InfamousNoone#2
Quote:
Originally Posted by Fаng View Post
Introduction:
Hey everyone. So, in Conquer Online, there's a teleportation feature where you can teleport a character to any map and (x, y) coordinate on the server. The problem is, when you teleport a character to a map that does not exist in the client, the client seems to freeze. That's because the client cannot find the dmap file that should be in its map folder. You can detect when this happens though, and either teleport the character back to its previous location, or disconnect it.

The Concept:
When a successful teleportation occurs, the client sends a packet to the server requesting for surrounding spawns. This packet is the general action packet, subtype 114. When a unsuccessful teleportation occurs, that packet is not sent.

The Solution:
To detect when a map is not being loaded by the client, you should start a timer on the map change method. When the map has been assigned to the client in server management, it should take no longer than 10 seconds (one ping cycle in Conquer Online) to receive the request for surroundings. If the map loaded successfully, the timer should be stopped (reset at map change). Else, the timer will continue and the timer action will be executed. That action can be what you like, but it only occurs if the map has not been loaded (or the player is attempting to play using a bot that removes entity spawns). This is also helpful for the server so that the character doesn't just stand their defenseless for longer than the protection period (which should also be one ping cycle in Conquer Online). Cheers.
This is slightly incorrect. Logically, without a basis, we first assumed many years back that subtype 114 was GetSurroundings due to the phenomenon you just described. However, a later look down the road revealed that this sub type was used when vending and coincided to values close to other vending sub types. We later concluded that the subtype was really "StopVending", but conventionally never changed it from GetSurroudings; See CSV3:
Quote:
GetSurroundings = 114, // This is actually "StopVending" but I abuse it for locations
12/29/2012 17:13 pro4never#3
Regardless of the official purpose of the packet it wouldn't be such a bad idea to put a system like this in for development purposes. Personally I never had a problem as you can still type and send commands during the black screen to get back to a valid map but it could be nice for quickly checking out different maps and getting events setup.

As you mentioned though, not correct usage of the subtype and also serves no real purpose in most live server environments.
12/29/2012 19:57 L1nk1n*P4rK#4
Quote:
Originally Posted by pro4never View Post
also serves no real purpose in most live server environments.
The problem starts when your players use other clients, with edited files.

But this is a very informative thread and I would love to hear other opinions.
12/29/2012 20:55 pro4never#5
Quote:
Originally Posted by L1nk1n*P4rK View Post
The problem starts when your players use other clients, with edited files.

But this is a very informative thread and I would love to hear other opinions.

Unless you're doing completely custom maps this would serve no purpose... there's been like 5 maps added in the last few years total and if they can connect to your server at all then chances are high they already have the map.

The only time this would be useful would be on a server where commands are enabled to keep people from getting their character stuck.
12/29/2012 21:02 Korvacs#6
Quote:
Originally Posted by L1nk1n*P4rK View Post
The problem starts when your players use other clients, with edited files.

But this is a very informative thread and I would love to hear other opinions.
Very simple solution, change the protocol value sent by the client to mark your client as...your own, then any invalid clients that connect are disconnected and told to download your client instead. Saves you a hell of alot more time than this system.
12/29/2012 21:03 CptSky#7
Quote:
Originally Posted by L1nk1n*P4rK View Post
The problem starts when your players use other clients, with edited files.

But this is a very informative thread and I would love to hear other opinions.
Meh. As Korvacs said, you can "force" your players to use your client and to be always on the lastest patch. Plus, if you're really motivated, you could include a checksum of the client.
12/29/2012 23:10 Spirited#8
Everything we do is an assumption that our previous work is correct.
12/29/2012 23:23 L1nk1n*P4rK#9
So many ways to handle such a small issue :3
I'm glad I saw this thread.

-Thanks for everyone-