D
D
Davilkus Games2021-11-22 15:24:58
Unity
Davilkus Games, 2021-11-22 15:24:58

How to make loading of resources (asset bundles) from the same server that handles multiplayer?

I need to make loading mods (addons) when connecting to a server. (As it is done in the Source engine (and GoldSrc): for example in Garry's Mod, CS 1.6):

When a player connects to another, the mods and resources of that player (server) are automatically installed for him.

Please tell me - are there any ready-made solutions or do I have to write it myself? And how to do it? With UWR? Are there any tutorials/books on this? Thank you.

PS I have experience with Photon and Mirror.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-11-22
@Davilkus

The update system is a very complicated thing, especially when you have modifications that are not required to be downloaded. Most likely there are no ready-made tools, or those that are will limit you in something so much that you will spend a lot of energy to overcome it.
You should have:
1. a system for describing and storing packages of add-ons / modifications, taking into account their versions and interdependencies
, already at this stage, ready-made is something like a package manager from the linux world (dpkg apt or rpm, they all do not end with hundreds of package managers in world) it is they who offer a complete and ready-made infrastructure in all respects, be careful with licenses, there may be GPL and not LPGL, which will limit the use in proprietary projects.
In addition to just the function to add a package + version, there should be a recall function .. try to implement when the package has dependencies
2. the system for distributing and downloading files
I strongly recommend not to invent anything new, if the package size is small (hundreds of megabytes maximum), then just the http protocol is enough, statics on the web server (this is what the above package managers use)
If the files are large, then God himself ordered to use the torrent protocol, a minimal tracker is enough on the server and also an http web server with statics, on the client - libtorrent with webtorrent support (latest versions) and optionally launched torrent client, for minimal dht support (in this case, you don’t need to distribute torrent files, just magnet links will suffice, but usually this is no longer important)
In this case, you can greatly (from the word a lot) save money on server support, since after several hundred clients downloading gigabytes of content at once (the gigabytes themselves are not expensive, the problem is to distribute a lot at once), even rich wallets are devastated.
3. The system for monitoring the integrity of client files
is generally a hell of a hell, ready-made tools to get everything together - no
separately yes, for example, ready-made anti-cheat (for a lot of money)
The solution is closely intertwined with the actual file installation system (each package controls its own list of files, modifies some, replaces some, controls dependency conflicts (even linux-package managers do this with the help of a client, but here the question is more about how you organize the database itself and how will you test it, users sometimes want very strange things, for example, they fix old versions of individual packages)
You can upload a ready-made directory structure right in the torrent file as a package right away - a great idea, then file integrity control can be outsourced to the libtorrent library, with the exception of intersections of files of different versions (this should be avoided by all means, for example, the file name should always contain its version or even a hash of the data).
ps the vast majority of small projects do not have such a hell, there are no dependencies, the versions are linear, the updates concern all packages at once, in this case everything degenerates into a fairly simple system, and as I said libtorrent on the client can resolve everything more than

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question