Skip to content

Commit 6d582aa

Browse files
authored
Merge pull request #323 from hybrasyl/develop
Hybrasyl Server 0.9.4
2 parents 402d0fb + 439f6f8 commit 6d582aa

File tree

363 files changed

+16851
-9991
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+16851
-9991
lines changed

.github/workflows/hybrasyl-build.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name: Hybrasyl packaging and testing
33

44
on:
5-
workflow_dispatch:
65
push:
76
paths-ignore:
87
- 'contrib/**'
@@ -12,25 +11,26 @@ on:
1211
- main
1312
- develop
1413
pull_request:
15-
paths-ignore:
16-
- 'contrib/**'
17-
- '**.md'
18-
- '.github/**'
14+
branches: [ main ]
15+
workflow_dispatch:
1916
branches:
2017
- main
2118
- develop
2219

20+
permissions:
21+
packages: write
22+
contents: read
23+
2324
jobs:
2425
build:
2526
runs-on: ubuntu-latest
2627
environment: deploy
2728
if: github.repository == 'hybrasyl/server'
2829
container:
2930
image: public.ecr.aws/l6u7z4o9/hybrasyl:build-latest
30-
3131
strategy:
3232
matrix:
33-
dotnet-version: ['7.0.x']
33+
dotnet-version: ['8.0.x']
3434

3535
steps:
3636
- name: start local redis
@@ -48,9 +48,7 @@ jobs:
4848
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
4949
- name: generate test config
5050
run: >
51-
echo "{ \"WorldDataDirectory\": \"$GITHUB_WORKSPACE/ceridwen/xml\",
52-
\"LogDataDirectory\": \"$GITHUB_WORKSPACE/ceridwen/logs\",
53-
\"DataDirectory\": \"$GITHUB_WORKSPACE/ceridwen\"}"
51+
echo -e "{\n \"Directories\": {\n \"Linux\": {\n \"WorldDataDirectory\": \"$GITHUB_WORKSPACE\\/ceridwen\\/xml\",\n \"LogDirectory\": \"$GITHUB_WORKSPACE\\/ceridwen\\/logs\",\n \"DataDirectory\": \"$GITHUB_WORKSPACE\\/ceridwen\"\n }\n }\n}\n"
5452
> $GITHUB_WORKSPACE/server/Hybrasyl.Tests/hybrasyltest-settings.json
5553
shell: bash
5654
- name: show config
@@ -65,28 +63,30 @@ jobs:
6563
REDIS_HOST: localhost
6664
REDIS_PORT: 6379
6765
- name: Codecov
68-
uses: codecov/codecov-action@v3
66+
uses: codecov/[email protected]
67+
env:
68+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6969
with:
7070
fail_ci_if_error: true
7171
verbose: true
7272
- name: Create release directory
7373
run: mkdir /releases
7474
- name: Publish Win64
7575
run: >
76-
cd $GITHUB_WORKSPACE/server && dotnet publish -c Release -r win10-x64 &&
77-
cd $GITHUB_WORKSPACE/server/hybrasyl/bin/Release/net7.0/win10-x64/publish &&
76+
cd $GITHUB_WORKSPACE/server && dotnet publish -c Release -r win-x64 &&
77+
cd $GITHUB_WORKSPACE/server/hybrasyl/bin/Release/net8.0/win-x64/publish &&
7878
echo "${SHORT_SHA}" > commit.txt &&
7979
zip -r /releases/HybrasylServer-${SHORT_SHA}-windows.zip .
8080
- name: Publish Linux
8181
run: >
82-
cd $GITHUB_WORKSPACE/server && dotnet publish -c Release -r ubuntu.18.04-x64 &&
83-
cd $GITHUB_WORKSPACE/server/hybrasyl/bin/Release/net7.0/ubuntu.18.04-x64/publish &&
82+
cd $GITHUB_WORKSPACE/server && dotnet publish -c Release -r linux-x64 &&
83+
cd $GITHUB_WORKSPACE/server/hybrasyl/bin/Release/net8.0/linux-x64/publish &&
8484
echo "${SHORT_SHA}" > commit.txt &&
8585
zip -r /releases/HybrasylServer-${SHORT_SHA}-linux.zip .
8686
- name: Publish MacOS
8787
run: >
8888
cd $GITHUB_WORKSPACE/server && dotnet publish -c Release -r osx-x64 &&
89-
cd $GITHUB_WORKSPACE/server/hybrasyl/bin/Release/net7.0/osx-x64/publish &&
89+
cd $GITHUB_WORKSPACE/server/hybrasyl/bin/Release/net8.0/osx-x64/publish &&
9090
echo "${SHORT_SHA}" > commit.txt &&
9191
zip -r /releases/HybrasylServer-${SHORT_SHA}-osx.zip .
9292
- name: Upload to current
@@ -115,6 +115,10 @@ jobs:
115115
env:
116116
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
117117
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
118+
# - name: Upload to GHCR
119+
# uses: KuhlTime/ghcr-action@v2
120+
# with:
121+
# token: ${{ secrets.GITHUB_TOKEN }}
118122
- name: Notify discord
119123
run: >
120124
/usr/local/bin/discord.sh

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,10 @@ __pycache__/
281281
**/hybrasyl/log.txt
282282
**/*.txt
283283

284-
XML/api
285-
XML/articles
286-
XML/site
287-
XML/docfx.json
288-
XML/toc.yml
289-
290284
hybrasyl/api
291285
hybrasyl/articles
292286
hybrasyl/site
287+
hybrasyl/_site
293288
hybrasyl/docfx.json
294289
hybrasyl/toc.yml
295290

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# and not a viable production server.
55
#
66

7-
FROM mcr.microsoft.com/dotnet/runtime:7.0
7+
FROM mcr.microsoft.com/dotnet/runtime:8.0
88

9-
COPY /hybrasyl/bin/Release/net6.0/linux-x64 /App
9+
COPY /hybrasyl/bin/Release/net8.0/linux-x64 /App
1010

1111
ENTRYPOINT ["dotnet", "/App/Hybrasyl.dll"]
1212

Hybrasyl.Tests/BaseTests.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This file is part of Project Hybrasyl.
2+
//
3+
// This program is free software; you can redistribute it and/or modify
4+
// it under the terms of the Affero General Public License as published by
5+
// the Free Software Foundation, version 3.
6+
//
7+
// This program is distributed in the hope that it will be useful, but
8+
// without ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9+
// or FITNESS FOR A PARTICULAR PURPOSE. See the Affero General Public License
10+
// for more details.
11+
//
12+
// You should have received a copy of the Affero General Public License along
13+
// with this program. If not, see <http://www.gnu.org/licenses/>.
14+
//
15+
// (C) 2020-2023 ERISCO, LLC
16+
//
17+
// For contributors and individual authors please refer to CONTRIBUTORS.MD.
18+
19+
namespace Hybrasyl.Tests;
20+
21+
22+
// No really, disable parallelization
23+
//[CollectionDefinition("Hybrasyl", DisableParallelization = true)]
24+
//public class HybrasylTestDefinitionClass { }

Hybrasyl.Tests/CastableRestrictions.cs

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
using Hybrasyl;
2-
using Hybrasyl.Objects;
3-
using Hybrasyl.Tests;
4-
using Hybrasyl.Xml.Objects;
5-
using System.Drawing;
1+
// This file is part of Project Hybrasyl.
2+
//
3+
// This program is free software; you can redistribute it and/or modify
4+
// it under the terms of the Affero General Public License as published by
5+
// the Free Software Foundation, version 3.
6+
//
7+
// This program is distributed in the hope that it will be useful, but
8+
// without ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9+
// or FITNESS FOR A PARTICULAR PURPOSE. See the Affero General Public License
10+
// for more details.
11+
//
12+
// You should have received a copy of the Affero General Public License along
13+
// with this program. If not, see <http://www.gnu.org/licenses/>.
14+
//
15+
// (C) 2020-2023 ERISCO, LLC
16+
//
17+
// For contributors and individual authors please refer to CONTRIBUTORS.MD.
18+
619
using System.Linq;
7-
using System.Numerics;
20+
using Hybrasyl.Xml.Objects;
821
using Xunit;
922

1023
namespace Hybrasyl.Tests;
@@ -103,7 +116,6 @@ public void ForbidItem()
103116
Assert.True(Fixture.TestUser.UseCastable(castable));
104117
GiveItem("nochdaidh deum");
105118
Assert.True(Fixture.TestUser.UseCastable(castable));
106-
107119
}
108120

109121
[Fact]
@@ -169,7 +181,7 @@ public void RequireWeaponAny()
169181
GiveEquipment("Smol Sword");
170182
Assert.True(Fixture.TestUser.UseCastable(castable));
171183
}
172-
184+
173185
[Fact]
174186
public void RequireWeaponType()
175187
{
@@ -425,23 +437,23 @@ public void TestForbidSlotAny()
425437
[Fact]
426438
public void TestForbidSlot()
427439
{
428-
// <Item Slot="Foot" RestrictionType="NotEquipped" Message="err_forbid_slot">Testinium Foot</Item>
429-
Fixture.TestUser.Inventory.Clear();
430-
Fixture.TestUser.Equipment.Clear();
431-
432-
var castable = GetCastable("TestForbidSlot");
433-
434-
// Test requirement missing
435-
GiveEquipment("Testinium Foot");
436-
Assert.False(Fixture.TestUser.UseCastable(castable));
437-
Assert.Equal("err_forbid_slot", Fixture.TestUser.LastSystemMessage);
438-
Fixture.TestUser.Equipment.Clear();
439-
440-
// Test requirement succeeding
441-
GiveEquipment("Testinium Foot2");
442-
Assert.True(Fixture.TestUser.UseCastable(castable));
443-
GiveEquipment("Testinium Claw");
444-
Assert.True(Fixture.TestUser.UseCastable(castable));
440+
// <Item Slot="Foot" RestrictionType="NotEquipped" Message="err_forbid_slot">Testinium Foot</Item>
441+
Fixture.TestUser.Inventory.Clear();
442+
Fixture.TestUser.Equipment.Clear();
443+
444+
var castable = GetCastable("TestForbidSlot");
445+
446+
// Test requirement missing
447+
GiveEquipment("Testinium Foot");
448+
Assert.False(Fixture.TestUser.UseCastable(castable));
449+
Assert.Equal("err_forbid_slot", Fixture.TestUser.LastSystemMessage);
450+
Fixture.TestUser.Equipment.Clear();
451+
452+
// Test requirement succeeding
453+
GiveEquipment("Testinium Foot2");
454+
Assert.True(Fixture.TestUser.UseCastable(castable));
455+
GiveEquipment("Testinium Claw");
456+
Assert.True(Fixture.TestUser.UseCastable(castable));
445457
}
446458

447459
[Fact]
@@ -491,7 +503,5 @@ public void TestForbidWeapon()
491503
Fixture.TestUser.Equipment.Clear();
492504
GiveEquipment("Smol Sword");
493505
Assert.True(Fixture.TestUser.UseCastable(castable));
494-
495506
}
496-
497507
}

0 commit comments

Comments
 (0)