feat: Progress to add Splatoon servers

This commit is contained in:
Akatsuki Levi
2024-04-12 19:17:06 -03:00
parent f77d3bd8d5
commit 58a76230df
20 changed files with 185 additions and 8 deletions

View File

@@ -459,6 +459,54 @@ services:
- ./environment/super-mario-maker.env
- ./environment/super-mario-maker.local.env
splatoon-authentication:
build: ./repos/splatoon-authentication
depends_on:
- account
- mongodb
restart: unless-stopped
ports:
# Go delve debugger
- 127.0.0.1:2349:2349
# Authentication server
- 61002:61002/udp
volumes:
- type: bind
source: ./logs/splatoon-authentication/
target: /app/log/
networks:
internal:
dns: 172.20.0.200
env_file:
- ./environment/splatoon.env
- ./environment/splatoon.local.env
splatoon-secure:
build: ./repos/splatoon-secure
depends_on:
- account
- mongodb
- splatoon-authentication
restart: unless-stopped
ports:
# Go delve debugger
- 127.0.0.1:2350:2350
# Secure server
- 60003:60003/udp
volumes:
- type: bind
source: ./logs/splatoon-secure/
target: /app/log/
- type: bind
source: ./environment/splatoon-secure.conf
target: /app/secure.conf
networks:
internal:
dns: 172.20.0.200
env_file:
- ./environment/splatoon.env
- ./environment/splatoon.local.env
volumes:
mitmproxy-pretendo-data:
mongodb-database:

View File

@@ -0,0 +1,21 @@
PrudpVersion=1
SignatureVersion=1
ServerPort=60003
KerberosKeySize=32
AccessKey=6f599f81
ServerName=Pretendo Splatoon Secure
NexVersion=30500
AccountDatabaseIP=account
AccountDatabasePort=5000
NEXDatabaseIP=mongodb
NEXDatabasePort=27017
DatabaseUseAuth=false
AccountDatabase=pretendo
PNIDCollection=pnids
NexAccountsCollection=nexaccounts
SplatoonDatabase=splatoon
RoomsCollection=rooms
SessionsCollection=sessions
UsersCollection=users
RegionsCollection=regions
TournamentsCollection=tourneys

2
environment/splatoon.env Normal file
View File

@@ -0,0 +1,2 @@
PN_SPLATOON_AUTHENTICATION_SERVER_PORT=61002
MONGO_URI=mongodb://mongodb:27017/pretendo_account?replicaSet=rs

View File

View File

View File

@@ -0,0 +1,23 @@
diff --git c/Dockerfile i/Dockerfile
new file mode 100644
index 0000000..d2d087b
--- /dev/null
+++ i/Dockerfile
@@ -0,0 +1,17 @@
+FROM golang:alpine AS builder
+WORKDIR /build
+
+RUN go install github.com/go-delve/delve/cmd/dlv@latest
+
+COPY go.* ./
+RUN go mod download
+
+COPY . ./
+RUN go build -gcflags "all=-N -l" -v -o server
+
+FROM alpine:latest AS runner
+WORKDIR /app
+
+COPY --from=builder /build/server /app/server
+COPY --from=builder /go/bin/dlv /app/
+CMD ["/app/dlv", "exec", "/app/server", "--listen=:2349", "--headless", "--api-version=2", "--log", "--accept-multiclient", "--continue"]

View File

@@ -0,0 +1,23 @@
diff --git c/Dockerfile i/Dockerfile
new file mode 100644
index 0000000..d2d087b
--- /dev/null
+++ i/Dockerfile
@@ -0,0 +1,17 @@
+FROM golang:alpine AS builder
+WORKDIR /build
+
+RUN go install github.com/go-delve/delve/cmd/dlv@latest
+
+COPY go.* ./
+RUN go mod download
+
+COPY . ./
+RUN go build -gcflags "all=-N -l" -v -o server
+
+FROM alpine:latest AS runner
+WORKDIR /app
+
+COPY --from=builder /build/server /app/server
+COPY --from=builder /go/bin/dlv /app/
+CMD ["/app/dlv", "exec", "/app/server", "--listen=:2350", "--headless", "--api-version=2", "--log", "--accept-multiclient", "--continue"]

View File

@@ -0,0 +1,48 @@
diff --git a/nex/matchmake-extension/auto_matchmake_with_param_postpone.go b/nex/matchmake-extension/auto_matchmake_with_param_postpone.go
index 7e1fff0..22b06d5 100644
--- a/nex/matchmake-extension/auto_matchmake_with_param_postpone.go
+++ b/nex/matchmake-extension/auto_matchmake_with_param_postpone.go
@@ -69,7 +69,7 @@ func AutoMatchmakeWithParam_Postpone(err error, client *nex.Client, callID uint3
oEvent.PIDSource = client.PID()
oEvent.Type = 122000 // Switch gathering
oEvent.Param1 = gid
- oEvent.Param3 = 1
+ // oEvent.Param3 = 1
for _, pid := range database.GetRoomPlayers(sourceGid) {
if pid == 0 {
@@ -160,7 +160,7 @@ func AutoMatchmakeWithParam_Postpone(err error, client *nex.Client, callID uint3
oEvent.Type = 3001 // New participant
oEvent.Param1 = gid
oEvent.Param2 = client.PID()
- oEvent.Param3 = uint32(participationCount)
+ // oEvent.Param3 = uint32(participationCount)
/* if matchmakeSession.GameMode == 12 {
oEvent.Param3 = 4
} else {
diff --git a/nex/matchmake-extension/create_matchmake_session_with_param.go b/nex/matchmake-extension/create_matchmake_session_with_param.go
index c8b79cf..b113f56 100644
--- a/nex/matchmake-extension/create_matchmake_session_with_param.go
+++ b/nex/matchmake-extension/create_matchmake_session_with_param.go
@@ -95,7 +95,7 @@ func CreateMatchmakeSessionWithParam(err error, client *nex.Client, callID uint3
oEvent.Type = 3001 // New participant
oEvent.Param1 = gid
oEvent.Param2 = hostpid
- oEvent.Param3 = 1
+ // oEvent.Param3 = 1
stream := nex.NewStreamOut(globals.NEXServer)
oEventBytes := oEvent.Bytes(stream)
diff --git a/nex/matchmake-extension/join_matchmake_session_with_param.go b/nex/matchmake-extension/join_matchmake_session_with_param.go
index 40b4d85..309385c 100644
--- a/nex/matchmake-extension/join_matchmake_session_with_param.go
+++ b/nex/matchmake-extension/join_matchmake_session_with_param.go
@@ -138,7 +138,7 @@ func JoinMatchmakeSessionWithParam(err error, client *nex.Client, callID uint32,
oEvent.Type = 3001 // New participant
oEvent.Param1 = gid
oEvent.Param2 = client.PID()
- oEvent.Param3 = 1
+ // oEvent.Param3 = 1
stream := nex.NewStreamOut(globals.NEXServer)
oEventBytes := oEvent.Bytes(stream)

Submodule repos/splatoon-authentication added at 189bc9e6c7

1
repos/splatoon-secure Submodule

Submodule repos/splatoon-secure added at 2f3ca91e77

View File

@@ -83,6 +83,15 @@ async function runAsync() {
1,
"0".repeat(64)
);
await createNexServer(
"Splatoon",
"10176900",
["00050000-10176A00", "00050000-10176900", "00050000-10162B00"],
process.env.SERVER_IP,
process.env.SPLATOON_PORT,
1,
"0".repeat(64)
);
await mongoose.connection.close();
}

View File

@@ -130,6 +130,7 @@ echo "SERVER_IP=$server_ip" >>"$git_base_dir/.env"
echo "PN_FRIENDS_SECURE_SERVER_HOST=$server_ip" >>./friends.local.env
echo "PN_WIIU_CHAT_SECURE_SERVER_LOCATION=$server_ip" >>./wiiu-chat.local.env
echo "PN_SMM_SECURE_SERVER_HOST=$server_ip" >>./super-mario-maker.local.env
echo "PN_SPLATOON_AUTHENTICATION_SERVER_HOST=$server_ip" >>./splatoon.local.env
# Get the Wii U IP address
if [[ -n "$wiiu_ip" ]]; then

View File

@@ -120,4 +120,4 @@ print_stage "Setting up containers with first-run scripts."
setup_containers
print_title "Pretendo Network server setup script finished"
print_success "Setup completed! You can now start your Pretendo Network server with \"docker compose up -d --build\"."
print_success "Setup completed! You can now start your Pretendo Network server with \"docker compose up -d --build\"."