Opened 9 years ago
Last modified 3 years ago
#3556 new enhancement
[PATCH] Dedicated server — at Version 17
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Backlog |
Component: | Network | Keywords: | patch, beta |
Cc: | andy011973@…, Victor ADASCALITEI | Patch: |
Description (last modified by )
Requirements
- A dedicated host is a gameserver running from command-line
- It has almost no performance requirements
- no graphics are displayed
- no local player/observer joins the game
- could allow Wildfire Games to host multiple games on a single machine
- can be patched independently from the release cycle (f.e. in case of bugs or abuse)
- might satisfy the demand for servers (as only a minority of users can host/configure their router currently)
- useful for rated games as we could make sure to not quit the server prematurely
- ideally ensure not to kill all games when restarting the lobbybot
Notice that the source code is freely available, which means everyone will be able to use dedicated hosts. It will be the job of the programmers and lobby moderators to prevent and stop abuse.
Roadmap:
1. Implement & commit basic functions* Only one host per instance* Use chat commands instead of gui (similar to scythewirlers autohost implementation #3419)* No client-side changes required (bugs can't affect regular hosting/joining)(Skipped to avoid adding code which would have to be removed later)
- Implement gamesetup UI changes
- Allow either the first or everyone to control the gamesettings (#3806)
- If there are serious bugs, we could revert to 1
- Implement hosting on different ports (done in #3575)
- Requirement for Wildfire Games being able to host multiple games simultaneously on a single machine
- To prevent abuse (in case of attacks on users IP-addresses), hosting games by unauthorized users could be prohibited.
- Optional: Trusted hosts (authorized lobby accounts) could be able to advertize more than one game at a time.
- Lobby changes
- New button "Wildfire-Games Host"
- XPartaMupp will spawn (at most) 1 gameserver per user
- The user will join this game and become a moderator of it
- New button "Wildfire-Games Host"
Change History (20)
by , 8 years ago
Attachment: | t3556_dedicated_server_WIP_v0.1.patch added |
---|
by , 8 years ago
Attachment: | t3556_dedicated_server_WIP_v0.2.patch added |
---|
No more useless windows, only command line. Takes a fraction of a second to start. Changed to class
structure.
by , 8 years ago
Attachment: | t3556_dedicated_server_WIP_v0.3.patch added |
---|
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
follow-up: 3 comment:2 by , 8 years ago
Description: | modified (diff) |
---|
comment:3 by , 8 years ago
Current patch still creates the graphic context, so app could be crashed when runs on the server w/o a graphic card. The rest of the patch looks good.
comment:4 by , 8 years ago
Description: | modified (diff) |
---|
comment:7 by , 8 years ago
Cc: | added |
---|
comment:8 by , 8 years ago
Description: | modified (diff) |
---|
comment:9 by , 8 years ago
Keywords: | patch added |
---|---|
Summary: | Dedicated server → [PATCH] Dedicated server |
Update:
- Rebased the patch at https://github.com/elexis1/0ad/tree/3556-dedicated-server
- Removed all c++ gamesetup hardcoding.
- Imaroks cleanup works like a charm with this patch! The first to join (having that patch applied) can setup the game as usual.
Besides the new controller authorization mechanism #3806, removing DedicatedServer_Gamesetup.cpp
implies:
Problem: lobby stanzas
- The server should send the stanza (so that it doesn't depend on some client registering the game which might disconnect and thus unregister the game)
- but only the client has access to the simulation data (defeated state #3476) and the server should avoid any gameattribute-parsing logic ideally
- Edge cases empty host: If the server doesn't construct the packets on its own, but relays a copy sent by a client: which packets should be sent if no client connected yet? what stanza to send if the game is running and all clients disconnected (the "player X is offline" state would be outdated with the last disconnect)
Proposed solution:
- So the server has to construct an empty packet from scratch when starting a lobbied game. If the last client disconnected from a lobbied game, the server has to correct the playerlist entry. Therefore it would make sense if the server can produce the entire logic on its own.
- Instead of requesting a lobby stanza from a client, the server could just request the player-defeated-state. But introducing a packet for either of these things seems very undesirable. It is probably better to just not send the defeated state if the game is hosted by a dedicated server. (There might be a dedicated server that also simulates the game optionally, for example to determine the winner of rated games. If that were enabled, it could also report the defeated state without asking a client).
- The
NetServer
knows the current player assignments, game attributes and has a list of connected GUIDs / clients, thus could send these 3 arguments to a JS function that does the complex stanza construction in r18534. The affected functions would have to be moved to source/lobby/ if we want to distribute the dedicated server without requiring public/.
comment:10 by , 7 years ago
Keywords: | beta added |
---|
comment:11 by , 7 years ago
Milestone: | Backlog → Alpha 22 |
---|
comment:12 by , 7 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:13 by , 7 years ago
Status: | assigned → new |
---|
comment:14 by , 7 years ago
Owner: | removed |
---|
comment:15 by , 7 years ago
refs #4364 a comment from scythetwirler at this ticket, that is probably better suited here: "If you could set the XMPP resource on the JID of the default dedicated server to something different (0ad is the default for the main client) for easy recognition, that'd be great. :)"
Proof of concept. Server running and chat working. Still opens an unused window and has no features besides chat yet.