在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):criticalstack/quake-kube开源软件地址(OpenSource Url):https://github.com/criticalstack/quake-kube开源编程语言(OpenSource Language):Go 87.0%开源软件介绍(OpenSource Introduction):Due to changes in the priorities, this project is currently not being supported. The project is archived as of 11/17/21 and will be available in a read-only state. Please note, since archival, the project is not maintained or reviewed.QuakeKubeQuakeKube is a Kubernetes-ified version of QuakeJS that runs a dedicated Quake 3 server in a Kubernetes Deployment, and then allow clients to connect via QuakeJS in the browser. Quick startWith an existing K8s clusterDeploy the example manifest: $ kubectl apply -f https://raw.githubusercontent.com/criticalstack/quake-kube/master/example.yaml Without an existing K8s clusterStart an instance of Kubernetes locally using cinder (or kind): $ cinder create cluster Deploy the example manifest: $ kubectl apply -f example.yaml Finally, navigate to How it worksQuakeKube makes use of ioquake for the Quake 3 dedicated server, and QuakeJS, a port of ioquake to javascript using Emscripten, to provide an in-browser game client. NetworkingThe client/server protocol of Quake 3 uses UDP to synchronize game state. Browsers do not natively support sending UDP packets so QuakeJS wraps the client and dedicated server net code in websockets, allowing the browser-based clients to send messages and enable multiplayer for other clients. This ends up preventing the browser client from using any other Quake 3 dedicated server. In order to use other Quake 3 dedicated servers, a proxy handles websocket traffic coming from browser clients and translates that into UDP to the backend. This gives the flexibility of being able to talk to other existing Quake 3 servers, but also allows using ioquake (instead of the javascript translation of it), which uses considerably less CPU and memory. QuakeKube also uses a cool trick with cmux to multiplex the client and websocket traffic into the same connection. Having all the traffic go through the same address makes routing a client to its backend much easier (since it can just use its Quake 3 demo EULAThe Quake 3 dedicated server requires an End-User License Agreement be agreed to by the user before distributing the Quake 3 demo files that are used (maps, textures, etc). To ensure that the installer is aware of, and agrees to, this EULA, the flag ConfigurationThe server and maps are configured via ConfigMap that is mounted to the container: apiVersion: v1
kind: ConfigMap
metadata:
name: quake3-server-config
data:
config.yaml: |
fragLimit: 25
timeLimit: 15m
game:
motd: "Welcome to Critical Stack"
type: FreeForAll
forceRespawn: false
inactivity: 10m
quadFactor: 3
weaponRespawn: 3
server:
hostname: "quakekube"
maxClients: 12
password: "changeme"
maps:
- name: q3dm7
type: FreeForAll
- name: q3dm17
type: FreeForAll
- name: q3wctf1
type: CaptureTheFlag
captureLimit: 8
- name: q3tourney2
type: Tournament
- name: q3wctf3
type: CaptureTheFlag
captureLimit: 8
- name: ztn3tourney1
type: Tournament The time limit and frag limit can be specified with each map (it will change it for subsequent maps in the list): - name: q3dm17
type: FreeForAll
fragLimit: 30
timeLimit: 30 Capture limit for CTF maps can also be configured: - name: q3wctf3
type: CaptureTheFlag
captureLimit: 8 Any commands not captured by the config yaml can be specified in the commands:
- seta g_inactivity 600
- seta sv_timeout 120 Add botsBots can be added individually to map rotations using the commands:
- addbot crash 1
- addbot sarge 2 The Another way to add bots is by setting a minimum number of players to allow the server to add bots up to a certain value (removed when human players join): bot:
minPlayers: 8
game:
singlePlayerSkill: 2
Setting a passwordA password should be set for the server to allow remote administration and is found in the server configuration settings: server:
password: "changeme" This will allow clients to use game:
password: "letmein" This will add an additional dialog to the in-browser client to accept the password. It will only appear if the server indicates it needs a password. Add custom mapsThe content server hosts a small upload app to allow uploading DevelopmentThe easiest way to develop quake-kube is building the binary locally with $ bin/q3 server -c config.yaml --assets-dir $HOME/.q3a --agree-eula Multi-platform imagesContainer images are being cross-compiled with Docker Buildx so it can run on hardware with different architectures and operating systems. Currently, it is building for Docker Buildx uses QEMU to virtualize non-native platforms, which has unfortunately had long-running issues running the Go compiler: This issue is circumvented by ensuring that the Go compiler does not run across multiple hardware threads, which is why the affinity is being limited in the Dockerfile. Credits
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论