mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 23:44:52 +01:00
Merge pull request #38 from EclipseKnight/main
Added world_name and land columns to the servers table
This commit is contained in:
5
main.go
5
main.go
@@ -14,6 +14,7 @@ import (
|
||||
"erupe-ce/server/entranceserver"
|
||||
"erupe-ce/server/launcherserver"
|
||||
"erupe-ce/server/signserver"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
_ "github.com/lib/pq"
|
||||
"go.uber.org/zap"
|
||||
@@ -173,7 +174,7 @@ func main() {
|
||||
ci := 0
|
||||
count := 1
|
||||
for _, ee := range erupeConfig.Entrance.Entries {
|
||||
for _, ce := range ee.Channels {
|
||||
for i, ce := range ee.Channels {
|
||||
sid := (4096 + si*256) + (16 + ci)
|
||||
c := *channelserver.NewServer(&channelserver.Config{
|
||||
ID: uint16(sid),
|
||||
@@ -192,7 +193,7 @@ func main() {
|
||||
if err != nil {
|
||||
preventClose(fmt.Sprintf("Failed to start channel server: %s", err.Error()))
|
||||
} else {
|
||||
channelQuery += fmt.Sprintf("INSERT INTO servers (server_id, season, current_players) VALUES (%d, %d, 0);", sid, si%3)
|
||||
channelQuery += fmt.Sprintf(`INSERT INTO servers (server_id, season, current_players, world_name, world_description, land) VALUES (%d, %d, 0, '%s', '%s', %d);`, sid, si%3, ee.Name, ee.Description, i+1)
|
||||
channels = append(channels, &c)
|
||||
logger.Info(fmt.Sprintf("Started channel server %d on port %d", count, ce.Port))
|
||||
ci++
|
||||
|
||||
23
patch-schema/servers_info.sql
Normal file
23
patch-schema/servers_info.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
--adds world_name and land columns
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.servers
|
||||
(
|
||||
server_id integer NOT NULL,
|
||||
season integer NOT NULL,
|
||||
current_players integer NOT NULL,
|
||||
world_name text COLLATE pg_catalog."default",
|
||||
world_description text,
|
||||
land integer
|
||||
);
|
||||
|
||||
ALTER TABLE public.servers
|
||||
ADD COLUMN IF NOT EXISTS land integer;
|
||||
|
||||
ALTER TABLE public.servers
|
||||
ADD COLUMN IF NOT EXISTS world_name text COLLATE pg_catalog."default";
|
||||
|
||||
ALTER TABLE public.servers
|
||||
ADD COLUMN IF NOT EXISTS world_description text;
|
||||
|
||||
END;
|
||||
Reference in New Issue
Block a user