commit d3193b92dc5495d7e6cad89d33dcbbc5329e4279 Author: Pratyush Desai Date: Tue Oct 15 01:53:17 2024 +0530 Initial Commit Set the base routing and base html Signed-off-by: Pratyush Desai diff --git a/README.md b/README.md new file mode 100644 index 0000000..1689d33 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# GibCasa Game Server Supervisor + +## Skeleton + +* Stick with HL2 and HL2DM +* Set up routing +* GS Lifecycle Management and Statistics +* Concurrency - manage simultaneously events and schedule tasks. +* File Handling - configs, logs, backups and export config server +* TODO: Add auth and db stuff later. For persistent configurations. \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..2adbeb8 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.com.de/gibcasa + +go 1.22.7 diff --git a/main.go b/main.go new file mode 100644 index 0000000..a1418ea --- /dev/null +++ b/main.go @@ -0,0 +1,39 @@ +package main + +import ( + "fmt" + "html/template" + "log" + "net/http" +) + +func main() { + http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static")))) + + // Define routes + http.HandleFunc("/", homeHandler) + http.HandleFunc("/hl2", hl2Handler) + http.HandleFunc("/quake", quakeHandler) + + // Start the server + fmt.Println("Server running on http://localhost:8080") + log.Fatal(http.ListenAndServe(":8080", nil)) +} + +// Render the homepage +func homeHandler(w http.ResponseWriter, r *http.Request) { + tmpl := template.Must(template.ParseFiles("templates/index.xhtml")) + tmpl.Execute(w, nil) +} + +// Render the Half-Life 2 page +func hl2Handler(w http.ResponseWriter, r *http.Request) { + tmpl := template.Must(template.ParseFiles("templates/hl2.xhtml")) + tmpl.Execute(w, nil) +} + +// Render the Quake page +func quakeHandler(w http.ResponseWriter, r *http.Request) { + tmpl := template.Must(template.ParseFiles("templates/quake.xhtml")) + tmpl.Execute(w, nil) +} diff --git a/static/hl2cover.jpeg b/static/hl2cover.jpeg new file mode 100644 index 0000000..052e1b0 Binary files /dev/null and b/static/hl2cover.jpeg differ diff --git a/static/q1cover.jpg b/static/q1cover.jpg new file mode 100644 index 0000000..6c79cdf Binary files /dev/null and b/static/q1cover.jpg differ diff --git a/static/styles.css b/static/styles.css new file mode 100644 index 0000000..9d4c483 --- /dev/null +++ b/static/styles.css @@ -0,0 +1,56 @@ +body { + background-color: #1c1c1c; + color: #bfbfbf; + font-family: 'Courier New', Courier, monospace; + text-align: center; + margin: 0; + padding: 0; +} + +h1 { + color: #e0b0ff; /* Rose Pine hint */ + margin-top: 30px; +} + +h2 { + color: #ff79c6; /* Rose Pine inspired soft magenta */ +} + +.container { + margin: 0 auto; + padding: 20px; + max-width: 800px; +} + +.games { + display: flex; + justify-content: space-around; + margin-top: 50px; +} + +.game { + margin: 20px; +} + +.game img { + width: 200px; + height: 200px; + border: 2px solid #ff79c6; +} + +.section { + margin: 40px 0; + padding: 20px; + background-color: #282828; + border-radius: 10px; +} + +a { + color: #e0b0ff; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + diff --git a/templates/hl2.xhtml b/templates/hl2.xhtml new file mode 100644 index 0000000..f291c05 --- /dev/null +++ b/templates/hl2.xhtml @@ -0,0 +1,22 @@ + + + + + + + Half-Life 2 + + +
+

Half-Life 2

+
+

Multiplayer Server

+

Manage or join the multiplayer servers here.

+
+
+

Coop

+

Start or manage cooperative campaigns here.

+
+
+ + diff --git a/templates/index.xhtml b/templates/index.xhtml new file mode 100644 index 0000000..2a0a16b --- /dev/null +++ b/templates/index.xhtml @@ -0,0 +1,28 @@ + + + + + + + Game Server Manager + + +
+

Choose Your Game

+ +
+ + diff --git a/templates/quake.xhtml b/templates/quake.xhtml new file mode 100644 index 0000000..1b4d936 --- /dev/null +++ b/templates/quake.xhtml @@ -0,0 +1,22 @@ + + + + + + + Quake + + +
+

Quake

+
+

Multiplayer Server

+

Manage or join the multiplayer servers here.

+
+
+

Coop

+

Start or manage cooperative campaigns here.

+
+
+ +