Merge pull request 'develop' (#12) from develop into master
Reviewed-on: michele/Map#12
This commit is contained in:
commit
cc301bea19
21 changed files with 1278 additions and 24 deletions
|
@ -9,4 +9,4 @@ Dockerfile*
|
|||
**/*.md
|
||||
**/*.ps1
|
||||
**/*.cmd
|
||||
**/*.sh
|
||||
#**/*.sh
|
45
.drone.yml
45
.drone.yml
|
@ -1,7 +1,46 @@
|
|||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: compile
|
||||
image: mcr.microsoft.com/dotnet/sdk:5.0
|
||||
- name: backend
|
||||
image: plugins/docker
|
||||
settings:
|
||||
repo: privateregistry.michelescandura.com/michele/sledgemapper
|
||||
registry: privateregistry.michelescandura.com
|
||||
auto_tag: true
|
||||
|
||||
- name: frontend
|
||||
image: privateregistry.michelescandura.com/michele/basecompileimage
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /release
|
||||
commands:
|
||||
- sh build.sh
|
||||
- chmod +x build.sh
|
||||
- sh build.sh
|
||||
|
||||
- name: zip
|
||||
image: alpine:latest
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /release
|
||||
commands:
|
||||
- apk update
|
||||
- apk add zip
|
||||
- cd /release/net5.0/win-x64
|
||||
- zip -r sledgemapper-win.zip ./publish
|
||||
- mkdir /release/zip
|
||||
- cp sledgemapper-win.zip /release/zip
|
||||
|
||||
- name: gitea_release
|
||||
image: plugins/gitea-release
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /release
|
||||
settings:
|
||||
api_key: 96d2ba3da7491bd7760e2681f8882cf41f82e609
|
||||
base_url: https://git.michelescandura.com
|
||||
files: /release/zip/*
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
temp: {}
|
||||
|
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"files.eol": "\n"
|
||||
}
|
25
BaseCompileImage/Dockerfile
Normal file
25
BaseCompileImage/Dockerfile
Normal file
|
@ -0,0 +1,25 @@
|
|||
FROM ubuntu:focal
|
||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
wget \
|
||||
ca-certificates \
|
||||
\
|
||||
# Install Microsoft package feed
|
||||
&& wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \
|
||||
&& dpkg -i packages-microsoft-prod.deb \
|
||||
&& rm packages-microsoft-prod.deb \
|
||||
\
|
||||
# Install .NET
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
apt-transport-https \
|
||||
dotnet-sdk-5.0 \
|
||||
dotnet-sdk-3.1 \
|
||||
libpng16-16 \
|
||||
libnvtt-dev \
|
||||
\
|
||||
# Cleanup
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN dotnet tool install -g dotnet-mgcb
|
14
Dockerfile
14
Dockerfile
|
@ -1,10 +1,12 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
#FROM privateregistry.michelescandura.com/michele/basecompileimage as build
|
||||
WORKDIR /src
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
|
||||
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
|
||||
# COPY Sledgemapper/*.csproj ./Sledgemapper/
|
||||
|
||||
|
||||
WORKDIR /src/Sledgemapper.Api
|
||||
RUN dotnet restore
|
||||
|
@ -12,10 +14,20 @@ RUN dotnet restore
|
|||
WORKDIR /src/Sledgemapper.Shared
|
||||
RUN dotnet restore
|
||||
|
||||
WORKDIR /src/Sledgemapper
|
||||
# RUN dotnet restore
|
||||
|
||||
# copy everything else and build app
|
||||
WORKDIR /src
|
||||
COPY Sledgemapper.Api/. ./Sledgemapper.Api/
|
||||
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
|
||||
#COPY Sledgemapper/. ./Sledgemapper/
|
||||
#WORKDIR /src/Sledgemapper
|
||||
|
||||
#COPY build.sh .
|
||||
|
||||
#RUN chmod +x build.sh
|
||||
#RUN sh build.sh
|
||||
WORKDIR /src/Sledgemapper.Api
|
||||
RUN dotnet publish -c release -o /app --no-restore
|
||||
|
||||
|
|
37
Dockerfile.app
Normal file
37
Dockerfile.app
Normal file
|
@ -0,0 +1,37 @@
|
|||
#FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
FROM privateregistry.michelescandura.com/michele/basecompileimage as build
|
||||
WORKDIR /src
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
#COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
|
||||
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
|
||||
COPY Sledgemapper/*.csproj ./Sledgemapper/
|
||||
|
||||
|
||||
#WORKDIR /src/Sledgemapper.Api
|
||||
#RUN dotnet restore
|
||||
|
||||
WORKDIR /src/Sledgemapper.Shared
|
||||
RUN dotnet restore
|
||||
|
||||
WORKDIR /src/Sledgemapper
|
||||
RUN dotnet restore
|
||||
|
||||
# copy everything else and build app
|
||||
WORKDIR /src
|
||||
#COPY Sledgemapper.Api/. ./Sledgemapper.Api/
|
||||
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
|
||||
COPY Sledgemapper/. ./Sledgemapper/
|
||||
WORKDIR /src/Sledgemapper
|
||||
|
||||
COPY build.sh .
|
||||
RUN chmod +x build.sh
|
||||
RUN sh build.sh
|
||||
#WORKDIR /src/Sledgemapper.Api
|
||||
#RUN dotnet publish -c release -o /app --no-restore
|
||||
|
||||
# final stage/image
|
||||
#FROM mcr.microsoft.com/dotnet/aspnet:5.0
|
||||
#WORKDIR /app
|
||||
#COPY --from=build /app ./
|
||||
#ENTRYPOINT ["dotnet", "Sledgemapper.Api.dll"]
|
26
Dockerfile2
Normal file
26
Dockerfile2
Normal file
|
@ -0,0 +1,26 @@
|
|||
# https://hub.docker.com/_/microsoft-dotnet-core
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# copy csproj and restore as distinct layers
|
||||
COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
|
||||
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
|
||||
|
||||
WORKDIR /src/Sledgemapper.Api
|
||||
RUN dotnet restore
|
||||
|
||||
WORKDIR /src/Sledgemapper.Shared
|
||||
RUN dotnet restore
|
||||
|
||||
# copy everything else and build app
|
||||
WORKDIR /src
|
||||
COPY Sledgemapper.Api/. ./Sledgemapper.Api/
|
||||
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
|
||||
WORKDIR /src/Sledgemapper.Api
|
||||
RUN dotnet publish -c release -o /app --no-restore
|
||||
|
||||
# final stage/image
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:5.0
|
||||
WORKDIR /app
|
||||
COPY --from=build /app ./
|
||||
ENTRYPOINT ["dotnet", "Sledgemapper.Api.dll"]
|
|
@ -2478,7 +2478,7 @@
|
|||
/processorParam:PremultiplyAlpha=True
|
||||
/processorParam:ResizeToPowerOfTwo=True
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=DxtCompressed
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:overlays/rubble.png
|
||||
|
||||
#begin overlays/saber-tooth.png
|
||||
|
@ -2670,7 +2670,7 @@
|
|||
/processorParam:PremultiplyAlpha=True
|
||||
/processorParam:ResizeToPowerOfTwo=True
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=DxtCompressed
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:overlays/stairs1.png
|
||||
|
||||
#begin overlays/stairs2.png
|
||||
|
@ -2682,7 +2682,7 @@
|
|||
/processorParam:PremultiplyAlpha=True
|
||||
/processorParam:ResizeToPowerOfTwo=True
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=DxtCompressed
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:overlays/stairs2.png
|
||||
|
||||
#begin overlays/stairs3.png
|
||||
|
@ -2694,7 +2694,7 @@
|
|||
/processorParam:PremultiplyAlpha=True
|
||||
/processorParam:ResizeToPowerOfTwo=True
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=DxtCompressed
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:overlays/stairs3.png
|
||||
|
||||
#begin overlays/stone-block.png
|
||||
|
|
BIN
Sledgemapper/Content/fonts/Roboto Condensed.ttf
Normal file
BIN
Sledgemapper/Content/fonts/Roboto Condensed.ttf
Normal file
Binary file not shown.
|
@ -11,7 +11,7 @@ with.
|
|||
<!--
|
||||
Modify this string to change the font that will be imported.
|
||||
-->
|
||||
<FontName>Arial</FontName>
|
||||
<FontName>Roboto Condensed.ttf</FontName>
|
||||
|
||||
<!--
|
||||
Size is a float value, measured in points. Modify this value to change
|
||||
|
|
|
@ -11,7 +11,7 @@ with.
|
|||
<!--
|
||||
Modify this string to change the font that will be imported.
|
||||
-->
|
||||
<FontName>Arial</FontName>
|
||||
<FontName>Roboto Condensed.ttf</FontName>
|
||||
|
||||
<!--
|
||||
Size is a float value, measured in points. Modify this value to change
|
||||
|
|
|
@ -11,7 +11,7 @@ with.
|
|||
<!--
|
||||
Modify this string to change the font that will be imported.
|
||||
-->
|
||||
<FontName>Arial</FontName>
|
||||
<FontName>Roboto Condensed.ttf</FontName>
|
||||
|
||||
<!--
|
||||
Size is a float value, measured in points. Modify this value to change
|
||||
|
|
|
@ -11,7 +11,7 @@ with.
|
|||
<!--
|
||||
Modify this string to change the font that will be imported.
|
||||
-->
|
||||
<FontName>Arial</FontName>
|
||||
<FontName>Roboto Condensed.ttf</FontName>
|
||||
|
||||
<!--
|
||||
Size is a float value, measured in points. Modify this value to change
|
||||
|
|
|
@ -11,7 +11,7 @@ with.
|
|||
<!--
|
||||
Modify this string to change the font that will be imported.
|
||||
-->
|
||||
<FontName>Arial</FontName>
|
||||
<FontName>Roboto Condensed.ttf</FontName>
|
||||
|
||||
<!--
|
||||
Size is a float value, measured in points. Modify this value to change
|
||||
|
|
|
@ -11,7 +11,7 @@ with.
|
|||
<!--
|
||||
Modify this string to change the font that will be imported.
|
||||
-->
|
||||
<FontName>Arial</FontName>
|
||||
<FontName>Roboto Condensed.ttf</FontName>
|
||||
|
||||
<!--
|
||||
Size is a float value, measured in points. Modify this value to change
|
||||
|
|
|
@ -11,7 +11,7 @@ with.
|
|||
<!--
|
||||
Modify this string to change the font that will be imported.
|
||||
-->
|
||||
<FontName>Arial</FontName>
|
||||
<FontName>Roboto Condensed.ttf</FontName>
|
||||
|
||||
<!--
|
||||
Size is a float value, measured in points. Modify this value to change
|
||||
|
|
|
@ -11,7 +11,7 @@ with.
|
|||
<!--
|
||||
Modify this string to change the font that will be imported.
|
||||
-->
|
||||
<FontName>Arial</FontName>
|
||||
<FontName>Roboto Condensed.ttf</FontName>
|
||||
|
||||
<!--
|
||||
Size is a float value, measured in points. Modify this value to change
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Sledgemapper
|
|||
Dictionary<string, T> result = new();
|
||||
|
||||
FileInfo[] files = dir.GetFiles("*.*");
|
||||
foreach (FileInfo file in files)
|
||||
foreach (FileInfo file in files.Where(f=>f.Extension!=".ttf"))
|
||||
{
|
||||
result.Add(file.Name.Split('.')[0], contentManager.Load<T>(contentFolder + "/" + file.Name.Split('.')[0]));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using Microsoft.AspNetCore.SignalR.Client;
|
||||
using Microsoft.AspNetCore.SignalR.Client;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
|
@ -325,15 +325,16 @@ namespace Sledgemapper
|
|||
{
|
||||
return;
|
||||
}
|
||||
GraphicsDevice.Clear(Color.LightGray);
|
||||
GraphicsDevice.Clear(Color.DarkGray);
|
||||
|
||||
var visibleTilesX = GraphicsDevice.Viewport.Width / _state.TileSize + 1;
|
||||
var visibleTilesY = GraphicsDevice.Viewport.Height / _state.TileSize + 1;
|
||||
|
||||
_spriteBatch.Begin(transformMatrix: Matrix.CreateTranslation(_viewportCenter));
|
||||
|
||||
DrawGrid(visibleTilesX, visibleTilesY);
|
||||
DrawTiles();
|
||||
DrawGrid(visibleTilesX, visibleTilesY);
|
||||
|
||||
DrawWalls();
|
||||
DrawOverlays();
|
||||
|
||||
|
@ -446,7 +447,7 @@ namespace Sledgemapper
|
|||
posX1, posY1,
|
||||
posX2,
|
||||
posY2,
|
||||
Color.GhostWhite);
|
||||
Color.Black);
|
||||
}
|
||||
|
||||
for (var i = -1; i < visibleTilesY + 2; i++)
|
||||
|
@ -463,7 +464,7 @@ namespace Sledgemapper
|
|||
_spriteBatch.DrawLine(posX1, posY1,
|
||||
posX2,
|
||||
posY2,
|
||||
Color.GhostWhite);
|
||||
Color.Black);
|
||||
}
|
||||
|
||||
|
||||
|
|
5
build.sh
5
build.sh
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cd Sledgemapper
|
||||
|
||||
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
|
||||
dotnet publish -r linux-x64 -c Release /p:PublishSingleFile=true
|
||||
dotnet publish -r osx-x64 -c Release /p:PublishSingleFile=true
|
||||
|
||||
# cp -r /src/Sledgemapper/bin/Release/net5.0 /release
|
||||
cp -r /drone/src/Sledgemapper/bin/Release/net5.0 /release
|
||||
|
|
1108
dotnet-install.sh
vendored
Normal file
1108
dotnet-install.sh
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue