Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to itemlink and fixes/improvements to CI #3238

Merged
merged 7 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ environment:
HerculesProject: Hercules-16.sln
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
HerculesProject: Hercules-17.sln
services: mysql56
services: mysql
build_script:
- cmd: MSBuild %HerculesProject% /t:map-server,char-server,login-server
test: off
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ jobs:
CLIENT_TYPE: "--enable-packetver-zero"
- CC: "clang-11"
LTO: "--enable-lto"

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.CC }}-${{ matrix.RENEWAL }}-${{ matrix.CLIENT_TYPE }}-${{ matrix.HTTPLIB }}-${{ matrix.SANITIZER }}-${{ matrix.PACKET_VERSION}}-${{ matrix.LTO }}
cancel-in-progress: true

container:
image: debian:unstable
image: debian:bookworm
services:
mariadb:
image: mariadb:latest
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/clang15_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ jobs:
exclude:
- PACKET_VERSION: "--enable-packetver=20130724"
CLIENT_TYPE: "--enable-packetver-zero"

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.CC }}-${{ matrix.RENEWAL }}-${{ matrix.CLIENT_TYPE }}-${{ matrix.HTTPLIB }}-${{ matrix.SANITIZER }}-${{ matrix.PACKET_VERSION}}
cancel-in-progress: true

container:
image: debian:unstable
services:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
matrix:
language: ['c', 'python']

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.language }}
cancel-in-progress: true

permissions:
security-events: write

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/gcc_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ jobs:
exclude:
- PACKET_VERSION: "--enable-packetver=20130724"
CLIENT_TYPE: "--enable-packetver-zero"

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.CC }}-${{ matrix.RENEWAL }}-${{ matrix.CLIENT_TYPE }}-${{ matrix.HTTPLIB }}-${{ matrix.SANITIZER }}-${{ matrix.PACKET_VERSION}}
cancel-in-progress: true

container:
image: debian:unstable
services:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/gccold1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ jobs:
exclude:
- PACKET_VERSION: "--enable-packetver=20100105"
CLIENT_TYPE: "--enable-packetver-zero"

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.CC }}-${{ matrix.RENEWAL }}-${{ matrix.CLIENT_TYPE }}-${{ matrix.HTTPLIB }}-${{ matrix.SANITIZER }}-${{ matrix.PACKET_VERSION}}-${{ matrix.LTO }}
cancel-in-progress: true

container:
image: ubuntu:22.04
services:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/gccold2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ jobs:
exclude:
- PACKET_VERSION: "--enable-packetver=20100105"
CLIENT_TYPE: "--enable-packetver-zero"

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.CC }}-${{ matrix.RENEWAL }}-${{ matrix.CLIENT_TYPE }}-${{ matrix.HTTPLIB }}-${{ matrix.SANITIZER }}-${{ matrix.PACKET_VERSION}}-${{ matrix.LTO }}
cancel-in-progress: true

container:
image: ubuntu:20.04
services:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/gccold3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ jobs:
exclude:
- PACKET_VERSION: "--enable-packetver=20100105"
CLIENT_TYPE: "--enable-packetver-zero"

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.CC }}-${{ matrix.RENEWAL }}-${{ matrix.CLIENT_TYPE }}-${{ matrix.HTTPLIB }}-${{ matrix.SANITIZER }}-${{ matrix.PACKET_VERSION}}-${{ matrix.LTO }}
cancel-in-progress: true

container:
image: ubuntu:18.04
services:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/gccsnapshot_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ jobs:
exclude:
- PACKET_VERSION: "--enable-packetver=20130724"
CLIENT_TYPE: "--enable-packetver-zero"

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.CC }}-${{ matrix.RENEWAL }}-${{ matrix.CLIENT_TYPE }}-${{ matrix.HTTPLIB }}-${{ matrix.SANITIZER }}-${{ matrix.PACKET_VERSION}}
cancel-in-progress: true

container:
image: debian:unstable
services:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
SANITIZER: ["--disable-manager", "--enable-sanitize=full"]
PACKET_VERSION: ["--enable-packetver=20221024"]
MYSQL: ["10.2", "latest"]

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.CC }}-${{ matrix.RENEWAL }}-${{ matrix.CLIENT_TYPE }}-${{ matrix.HTTPLIB }}-${{ matrix.SANITIZER }}-${{ matrix.PACKET_VERSION}}-${{ matrix.MYSQL }}
cancel-in-progress: true

container:
image: debian:unstable
services:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
SANITIZER: ["--disable-manager", "--enable-sanitize=full"]
PACKET_VERSION: ["--enable-packetver=20221024"]
MYSQL: ["5.6", "5.7", "latest"]

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ matrix.CC }}-${{ matrix.RENEWAL }}-${{ matrix.CLIENT_TYPE }}-${{ matrix.HTTPLIB }}-${{ matrix.SANITIZER }}-${{ matrix.PACKET_VERSION}}-${{ matrix.MYSQL }}
cancel-in-progress: true

container:
image: debian:unstable
services:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ env:
jobs:
build:
runs-on: ubuntu-latest

# github.head_ref will stop previous runs in the same PR (if in a PR)
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

container:
image: debian:unstable
steps:
Expand Down
8 changes: 4 additions & 4 deletions npc/dev/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,19 @@ function script F_TestGetItemLink_BaseWeapon {
}

function script F_TestGetItemLink_FullWeapon {
setarray(.@cards[0], Fabre_Card, Captain_Felock_Card, 0, Agility1);
setarray(.@cards[0], Fabre_Card, Necromancer_Card, 0, Agility1);
setarray(.@options[0], WEAPON_ATTR_GROUND, 1, 0, VAR_MAXHPAMOUNT, 10, 0);
.@str$ = getitemlink(Knife, 10, .@cards, .@options, 2);

.@pass = false;
if (PACKETVER < 20150923) {
.@pass = (.@str$ == getiteminfo(Knife, ITEMINFO_NAME));
} else if (PACKETVER < 20161116) {
.@pass = (.@str$ == "<ITEM>000021jn%0a'12y'74q'00'1ei)2R*00+01)01*00+0a</ITEM>");
.@pass = (.@str$ == "<ITEM>000021jn%0a'12y'19C'00'1ei)2R*00+01)01*00+0a</ITEM>");
} else if (PACKETVER < 20200916) {
.@pass = (.@str$ == "<ITEML>000021jn%0a&00(12y(74q(00(1ei*2R+00,01*01+00,0a</ITEML>");
.@pass = (.@str$ == "<ITEML>000021jn%0a&00(12y(19C(00(1ei*2R+00,01*01+00,0a</ITEML>");
} else {
.@pass = (.@str$ == "<ITEML>000021jn%0a&00'02)12y)74q)00)1ei+2R,00-01+01,00-0a</ITEML>");
.@pass = (.@str$ == "<ITEML>000021jn%0a&00'02)12y)19C)00)1ei+2R,00-01+01,00-0a</ITEML>");
}

return .@pass;
Expand Down
6 changes: 3 additions & 3 deletions src/map/clif.c
Original file line number Diff line number Diff line change
Expand Up @@ -25993,12 +25993,12 @@ static void clif_format_itemlink(StringBuf *buf, const struct item *it)
#if PACKETVER >= 20161116
static const char view_sep = '&';
#endif
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
guilherme-gm marked this conversation as resolved.
Show resolved Hide resolved
static const char grade_sep = '\'';
#endif

// Separators that were updated along the time
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
static const char *tag_name = "ITEML";
static const char card_sep = ')';
static const char optid_sep = '+';
Expand Down Expand Up @@ -26043,7 +26043,7 @@ static void clif_format_itemlink(StringBuf *buf, const struct item *it)
StrBuf->Printf(buf, "%c%s", view_sep, get_padded_value(itd->view_sprite, 2));
#endif // PACKETVER >= 20161116

#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
StrBuf->Printf(buf, "%c%s", grade_sep, get_padded_value(it->grade, 2));
#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723

Expand Down
6 changes: 4 additions & 2 deletions src/test/test_chunked.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,12 @@ static void testChunkedBuf2(char *data, int sz)
fake_rflags = NULL;
}

#define MAX_TEST_BUFFER 10000

static void testChunkedBuf(char *data, int sz)
{
if (sz == 0)
sz = (int)strlen(data);
sz = (int) strnlen(data, MAX_TEST_BUFFER);
for (int f = 1; f < 30; f ++) {
fake_wchunk_size = f;
testChunkedBuf2(data, sz);
Expand All @@ -380,7 +382,7 @@ static void testChunked1(void)
testChunkedBuf("", 0);
show_success = false;
ShowStatus("Test long chunked\n");
for (int f = 0; f < 10000; f += 100) {
for (int f = 0; f < MAX_TEST_BUFFER; f += 100) {
// reallocate buffer always for detect overflow
char *buf = aCalloc(1, f);
for (int i = 0; i < f; i ++) {
Expand Down
4 changes: 3 additions & 1 deletion vcproj-15/char-server.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
<ClInclude Include="..\src\char\pincode.h" />
<ClInclude Include="..\src\common\atomic.h" />
<ClInclude Include="..\src\common\cbasetypes.h" />
<ClInclude Include="..\src\common\base62.h" />
<ClInclude Include="..\src\common\conf.h" />
<ClInclude Include="..\src\common\console.h" />
<ClInclude Include="..\src\common\core.h" />
Expand Down Expand Up @@ -231,6 +232,7 @@
<ClCompile Include="..\src\char\loginif.c" />
<ClCompile Include="..\src\char\mapif.c" />
<ClCompile Include="..\src\char\pincode.c" />
<ClCompile Include="..\src\common\base62.c" />
<ClCompile Include="..\src\common\conf.c" />
<ClCompile Include="..\src\common\console.c" />
<ClCompile Include="..\src\common\core.c" />
Expand Down Expand Up @@ -259,4 +261,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
8 changes: 7 additions & 1 deletion vcproj-15/char-server.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\src\common\base62.c">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\src\common\conf.c">
<Filter>common</Filter>
</ClCompile>
Expand Down Expand Up @@ -156,6 +159,9 @@
<ClInclude Include="..\src\common\cbasetypes.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\src\common\base62.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\src\common\conf.h">
<Filter>common</Filter>
</ClInclude>
Expand Down Expand Up @@ -372,4 +378,4 @@
<UniqueIdentifier>{d2dbc907-ce23-48c3-85ac-049ff2a8c728}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
</Project>
4 changes: 3 additions & 1 deletion vcproj-15/login-server.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
<ClInclude Include="..\3rdparty\mt19937ar\mt19937ar.h" />
<ClInclude Include="..\src\common\atomic.h" />
<ClInclude Include="..\src\common\cbasetypes.h" />
<ClInclude Include="..\src\common\base62.h" />
<ClInclude Include="..\src\common\conf.h" />
<ClInclude Include="..\src\common\console.h" />
<ClInclude Include="..\src\common\core.h" />
Expand Down Expand Up @@ -196,6 +197,7 @@
<ClCompile Include="..\3rdparty\libconfig\scanner.c" />
<ClCompile Include="..\3rdparty\libconfig\strbuf.c" />
<ClCompile Include="..\3rdparty\mt19937ar\mt19937ar.c" />
<ClCompile Include="..\src\common\base62.c" />
<ClCompile Include="..\src\common\conf.c" />
<ClCompile Include="..\src\common\console.c" />
<ClCompile Include="..\src\common\core.c" />
Expand Down Expand Up @@ -230,4 +232,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
8 changes: 7 additions & 1 deletion vcproj-15/login-server.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<ClCompile Include="..\src\login\loginlog.c">
<Filter>login</Filter>
</ClCompile>
<ClCompile Include="..\src\common\base62.c">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\src\common\conf.c">
<Filter>common</Filter>
</ClCompile>
Expand Down Expand Up @@ -126,6 +129,9 @@
<ClInclude Include="..\src\common\cbasetypes.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\src\common\base62.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\src\common\conf.h">
<Filter>common</Filter>
</ClInclude>
Expand Down Expand Up @@ -282,4 +288,4 @@
<UniqueIdentifier>{d8fb6ac7-c87d-4d6b-aea4-98a0ea800666}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
</Project>
4 changes: 3 additions & 1 deletion vcproj-15/map-server.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
<ClInclude Include="..\3rdparty\mt19937ar\mt19937ar.h" />
<ClInclude Include="..\src\common\atomic.h" />
<ClInclude Include="..\src\common\cbasetypes.h" />
<ClInclude Include="..\src\common\base62.h" />
<ClInclude Include="..\src\common\conf.h" />
<ClInclude Include="..\src\common\console.h" />
<ClInclude Include="..\src\common\core.h" />
Expand Down Expand Up @@ -248,6 +249,7 @@
<ClCompile Include="..\3rdparty\libconfig\scanner.c" />
<ClCompile Include="..\3rdparty\libconfig\strbuf.c" />
<ClCompile Include="..\3rdparty\mt19937ar\mt19937ar.c" />
<ClCompile Include="..\src\common\base62.c" />
<ClCompile Include="..\src\common\conf.c" />
<ClCompile Include="..\src\common\console.c" />
<ClCompile Include="..\src\common\core.c" />
Expand Down Expand Up @@ -339,4 +341,4 @@
<Copy SourceFiles="..\conf\import-tmpl\socket.conf" DestinationFolder="..\conf\import\" ContinueOnError="true" Condition="!Exists('..\conf\import\socket.conf')" />
<Copy SourceFiles="..\conf\import-tmpl\script.conf" DestinationFolder="..\conf\import\" ContinueOnError="true" Condition="!Exists('..\conf\import\script.conf')" />
</Target>
</Project>
</Project>
8 changes: 7 additions & 1 deletion vcproj-15/map-server.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
<ClCompile Include="..\src\common\utils.c">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\src\common\base62.c">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\src\common\conf.c">
<Filter>common</Filter>
</ClCompile>
Expand Down Expand Up @@ -456,6 +459,9 @@
<ClInclude Include="..\src\common\utils.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\src\common\base62.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\src\common\conf.h">
<Filter>common</Filter>
</ClInclude>
Expand Down Expand Up @@ -570,4 +576,4 @@
<UniqueIdentifier>{d7d16c66-c973-45d7-b47f-a1f80a898b9b}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
</Project>
Loading
Loading