2025-01-20 01:16:42 +01:00
2025-01-19 22:06:41 +01:00
2025-01-19 21:44:17 +01:00
2025-01-19 21:17:07 +01:00
2025-01-19 21:17:07 +01:00
2025-01-20 01:16:42 +01:00
2025-01-20 00:03:15 +01:00
2025-01-13 15:12:16 +01:00

GoonServer

The server component for GoonScape, handling multiplayer synchronization and chat.

Features

  • Tick-based game state synchronization
  • Player movement validation
  • Global chat system
  • Client connection management
  • Protobuf-based network protocol

Prerequisites

  • Go 1.23 or higher
  • Protocol Buffers compiler (protoc)

Installation

  1. Clone the repository:
git clone https://gitea.boner.be/bdnugget/goonserver.git
cd goonserver
  1. Install dependencies:
go mod tidy
  1. Build and run:
go run main.go

Configuration

Server settings can be modified in main.go:

const (
    port     = ":6969"               // Port to listen on
    tickRate = 600 * time.Millisecond // Server tick rate
)

Protocol

The server uses Protocol Buffers for client-server communication. The protocol is defined in actions/actions.proto:

  • Action: Player actions (movement, chat)
  • ActionBatch: Grouped actions from a player
  • ServerMessage: Game state updates to clients
  • PlayerState: Individual player state
  • ChatMessage: Player chat messages

Development

After modifying the protocol (actions.proto), regenerate the Go code:

protoc --go_out=. actions/actions.proto

Deployment

The server is designed to run on a single instance. For production deployment:

  1. Build the binary:
go build -o goonserver
  1. Run with logging:
./goonserver > server.log 2>&1 &
Description
No description provided
Readme MIT 110 KiB
Languages
Go 100%