Python Forum

Full Version: How can i create a server for already existing client using Python?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
(Aug-18-2020, 08:46 AM)Chapanson Wrote: [ -> ]
Quote:If the details of the server and the protocol used by the client and server aren't publicly available
What do you mean by that?

In an earlier post, you quoted Wikipedia to say a server emulator is a clone of some proprietary software. That means its source code isn't available and presumably a description of the messages that the client and server send to each other isn't available publicly either. If you want to create a server that mimics what the original does, you need to infer that information somehow. How else are you going to produce a server that an existing client can talk to?
The first task is to investigate how server and client communicates.
This requires knowledge about:
  • networking and protocols
  • protocols for serialization. For example, CSGO uses Protocol Buffers from google.
  • packet analyzing, make assumptions about the meaning of the packets

The second task is, to replicate what the server is doing.
This requires understanding how to write a server which can handle more than one connection at the time.


You can use for example already existing documentation.
The a2s protocol for Source Dedicated Engine is described here: https://developer.valvesoftware.com/wiki/Server_queries
But it's not the communication between server <-> client. This is just to query information about a game server. The server browser uses it. So implementing a csgo-emulator-server requires to implement a2s, rcon and the unknown protocol between server <-> client.

In addition, a game server has state about the current world, positions of players, health, etc.
The communication follows often the concept of Key-Frames and Delta-Frames. Key-Frames holds all information about current state and the Delta-Frames have only information about state changes, which relies on the server state.

If you want to write a game server emulator, then choose a simple game server.
Otherwise, you can make your own gameserver (not emulator) with Pygame. You'll also find some examples if you google.
Pages: 1 2 3