@@ -9,7 +9,6 @@ package main
99import (
1010 "bufio"
1111 "context"
12- "errors"
1312 "flag"
1413 "fmt"
1514 "os"
@@ -226,43 +225,14 @@ Once the server is running, use MCP tools to manage games:
226225// === Server Command ===
227226
228227func runServer (ctx context.Context , log util.Logger , opts options ) int {
229- // Enforce a single global GABS server process per user.
230- lockPaths , err := config .NewConfigPaths ("" )
231- if err != nil {
232- log .Errorw ("failed to resolve server lock path" , "error" , err )
233- return 1
234- }
235- if err := lockPaths .EnsureBaseDir (); err != nil {
236- log .Errorw ("failed to create server lock directory" , "path" , lockPaths .GetBaseDir (), "error" , err )
237- return 1
238- }
239-
240- serverLock , err := config .AcquireServerLock (lockPaths .GetServerLockPath ())
241- if err != nil {
242- var runningErr * config.ServerAlreadyRunningError
243- if errors .As (err , & runningErr ) {
244- log .Errorw ("another GABS server is already running" ,
245- "pid" , runningErr .Info .PID ,
246- "startedAt" , runningErr .Info .StartedAt ,
247- "lockPath" , runningErr .Path )
248- } else {
249- log .Errorw ("failed to acquire server singleton lock" , "lockPath" , lockPaths .GetServerLockPath (), "error" , err )
250- }
251- return 1
252- }
253- defer func () {
254- if err := serverLock .Release (); err != nil {
255- log .Warnw ("failed to release server lock" , "lockPath" , lockPaths .GetServerLockPath (), "error" , err )
256- }
257- }()
258-
259228 // Load games configuration
260229 gamesConfig , err := config .LoadGamesConfigFromDir (opts .configDir )
261230 if err != nil {
262231 log .Errorw ("failed to load games config" , "error" , err )
263232 return 1
264233 }
265234
235+ log .Debugw ("starting per-session GABS server" , "transport" , opts .transport , "configDir" , opts .configDir )
266236 log .Infow ("loaded games configuration" , "gameCount" , len (gamesConfig .Games ))
267237
268238 // Create MCP server with game management tools
0 commit comments