package main

import (
	"sparrow/pkg/rpcs"
	"sparrow/pkg/server"
	"sparrow/services/scene-service/internal/service"
)

func main() {
	// init server
	err := server.Init(rpcs.SceneServiceName)
	if err != nil {
		server.Log.Fatal(err)
		return
	}
	s := service.NewSceneService()
	s.RestartScenes()
	err = server.RegisterRPCHandler(s)
	if err != nil {
		server.Log.Errorf("Register RPC manager Error: %s", err)
		return
	}

	err = server.Run()
	if err != nil {
		server.Log.Fatal(err)
	}
}
