Commit Graph

128 Commits

Author SHA1 Message Date
Mercury233 9fa42dd103 move global vars from gframe to member of mainGame (#3041) 2026-04-11 08:57:44 +08:00
salix5 192cb6b77c Replay: add SaveDeck (#2986) 2026-03-02 11:33:46 +08:00
mercury233 e638987f6d add CloseHandle after CreateProcess 2026-02-27 16:32:02 +08:00
salix5 56c313c61d Use vector in DuelClient::SendUpdateDeck (#2952) 2026-01-10 16:34:51 +08:00
salix5 6c84c3bf38 fix buffer underflow (#2918) 2025-09-03 15:17:37 +08:00
Mercury233 70af2f52e6 add mysnprintf, use std::forward in myswprintf (#2885) 2025-08-11 09:16:01 +08:00
Mercury233 0f73f2282a update CopyString & CopyWideString (#2884) 2025-07-23 11:28:37 +08:00
salix5 c9573debfd use uint32_t code as key (#2874) 2025-07-06 16:13:11 +08:00
salix5 42a427a4fa use function template BufferIO::Read (#2835) 2025-07-06 13:18:46 +08:00
salix5 c23725c046 workaround fix argument -r (#2864) 2025-06-29 18:09:15 +08:00
salix5 b3482765e4 fix: seeding std::mt19937 with only 1 uint32_t (#2820) 2025-06-18 15:47:55 +08:00
salix5 5a37286e8a check header in OpenReplay (#2807)
* check header in OpenReplay

* add version_info for old replay

* simplify

* add newline char
2025-05-30 16:05:24 +08:00
salix5 c3e2599358 add MenuHandler::temp_replay (#2802) 2025-05-21 13:57:35 +08:00
salix5 471c2134a3 Read player names, deck & check script path on OpenReplay (#2776) 2025-05-17 08:53:06 +08:00
salix5 fd189e5c8c DeckManager: use uint32_t code (#2739)
* fix LoadLFListSingle

* update LoadDeck, LoadSide

* rename to LoadDeckFromStream

* update CTOS_DeckData

* static member function
2025-03-29 10:44:21 +08:00
salix5 b5bf7990e9 replace irr::s32, irr::u32 2025-03-14 19:10:07 +08:00
salix5 6c53d02a2b use <cstdlib> functions (#2720)
* replace exit

* replace malloc, calloc

* replace strtol

* #include <cstdlib>
2025-03-13 17:26:44 +08:00
salix5 148c76806e DeckManager: update GetDeckFile LoadCurrentDeck (#2694)
* update DeckManager::GetDeckFile

* update reference

* update DeckManager::LoadCurrentDeck

* update reference

* clean header in deck_manager.h
2025-02-22 14:21:02 +08:00
Mercury233 6bcc96d222 rename myfopen to mywfopen (#2691)
* use fopen in DataManager::ReadScriptFromFile

* rename myfopen to mywfopen

* use std namespace

---------

Co-authored-by: salix5 <salix5566@gmail.com>
2025-02-22 10:54:31 +08:00
salix5 c675547122 replace snprintf, sscanf 2025-02-22 10:37:38 +08:00
salix5 f5955f854f replace fopen, fclose, fgets 2025-02-22 10:37:38 +08:00
salix5 dc5a305301 use <ctime> header (#2668) 2025-02-12 16:26:38 +08:00
salix5 d376ed0e65 use <cwchar> function (#2651) 2025-01-17 19:50:59 +08:00
salix5 7721bfe017 remove NULL (#2626) 2024-12-04 23:19:51 +08:00
salix5 48d53cda9f use wchar_t name in myfopen 2024-11-30 13:22:13 +08:00
salix5 4d82b74efc use full path in OpenReplay 2024-11-30 13:22:13 +08:00
salix5 b22ff21ace use macro _WIN32 2024-11-16 15:50:01 +08:00
salix5 48b01b838c remove wcscpy, wcscat (#2602)
* use wcsncpy

* fix FileSystem::TraversalDir

* avoid wcscat

* remove wcscat

* add BufferIO::CopyWideString

* struct Config: path string changed to wchar_t[256]

* Revert "use wcsncpy"

This reverts commit b05e0c96a3.

* check lastcategory, lastdeck

* fix Game::LoadConfig

max length of filename should be determined by file system

* remove wcscpy

* use BufferIO::CopyWideString

* fix UpdateDeck

* myfilesystem: use std functions

* DataManager: fix GetNumString (#2603)

* DataManager: fix FormatAttribute, FormatRace

* update FormatAttribute, FormatRace

* DataManager: fix FormatType

* update FormatType

* DataManager: fix FormatSetName

* DataManager: fix FormatLinkMarker

* merge

* DataManager: fix GetNumString

* rebuild class ustring16 from edopro version

* add stringw conversion

core::stringw in current version does not have data()

* add CGUITTFont::drawUstring

* use drawUstring

* update DrawShadowText

* fix Game::lpcstring

* fix DuelInfo::vic_string

* add PACK_MAX_SIZE

* add IsExtension (#2604)

* CGUITTFont: use override

* ustring16: only accept basic_string
2024-11-06 08:34:12 +08:00
salix5 a8ccdbb107 add wrapper function myfopen (#2582)
* add wrapper function myfopen

* open file with myfopen
2024-09-08 21:52:57 +08:00
salix5 2dd2263c44 use <cstring> functions (#2580) 2024-08-18 03:14:02 +08:00
salix5 848348ca9c deckManager: add LoadCurrentDeck, SaveDeckBuffer (#2571)
* update LoadDeck from int array

* update LoadDeck from std::istringstream

* reorder

* rename to LoadCurrentDeck

* akways clear current_deck in LoadCurrentDeck

* reorder

* change LoadDeck from std::istringstream

* set errorcode for TYPE_TOKEN

* use LoadDeck in export deck

* update LoadSide

* fix CheckDeck

* fix LoadLFListSingle

* minor fix

* add SaveDeckBuffer

* fix LoadSide

* update LoadDeck(Deck&, std::istringstream&
2024-08-11 05:06:08 +08:00
salix5 080d7781f0 clean config.h (#2568)
* move header files to game.h

* include mutex when necessary

* include myfilesystem.h when necessary

* include thread when necessary

* include string

* include GL when necessary

* remove #pragma once

* rename guard macro to YGOPRO_CONFIG_H

* fix warning C4456, C4458

* move GL to game.h

* use <cstring> functions

* include <wchar.h>
2024-08-11 05:05:20 +08:00
salix5 4c91f19f41 fix EncodeUTF8, DecodeUTF8 (#2540)
* check sizeof(wchar_t)

* EncodeUTF8: use unsigned operand

* DecodeUTF8: use unsigned operand

* EncodeUTF8: check array size

* DecodeUTF8: check array size

* replace sprintf with snprintf

* zero initialize

* remove outdated macro

* remove outdated macro in clzma
2024-05-21 15:32:29 +08:00
salix5 4297cb3ef6 DataManager: change _datas to private 2024-01-10 16:42:07 +08:00
salix5 32389dda77 use unsigned char buffer 2023-12-14 16:10:19 +08:00
Mercury233 60c76b6b3a use evutil_freeaddrinfo after evutil_getaddrinfo (#2471) 2022-12-06 08:29:15 +08:00
Mercury233 1227e78fe3 add fail hint (#2472)
* add deck not selected hint

* add create host fail hint
2022-12-06 08:26:32 +08:00
Mercury233 3ecfeece45 fix deck arg (#2380) 2021-10-01 22:13:29 +08:00
Yuzurisa a3b333122c add --deck-category for specifying deck category in command line (#2375)
* add --deck-category

* fix length
2021-09-12 23:48:53 +08:00
Mercury233 7c71bf63c7 check the filename generated from the playername (#2372) 2021-09-08 16:45:57 +08:00
mercury233 301569f7ba fix deck export filename 2021-09-05 09:13:56 +08:00
Nanahira e98e2abd1e add export deck from replay (#2138) 2021-09-02 14:59:47 +08:00
salix5 1c829da02e update RNG and uniform distribution, part 1 (#2362)
Old version:
pheader.flag does not contain REPLAY_UNIFORM
RNG: mt19937
distribution: almost-uniform

New version
pheader.flag contains REPLAY_UNIFORM
RNG: mt19937
distribution: uniform

* add bounds checking

* update RNG in replay mode

* replace mtrandom with mt19937

* replace mtrandom with mt19937
2021-08-21 18:46:19 +08:00
Mercury233 f934b83a79 Deck category and deck manage (#2187) 2021-03-21 11:24:47 +00:00
Mercury233 fb780c633b add select bot deckfile (#2333) 2021-03-18 03:06:09 +00:00
Mercury233 f1969f7cec auto trim hostname and port when joining host (#2286) 2020-04-24 10:43:24 +08:00
Mercury233 fe5a197c71 update new rule (#2257)
* update new rule option

* update bot rule select

* customize default rule
2020-01-04 15:54:15 +08:00
DailyShana 9addd24631 use standard mutex library (#2224) 2019-07-15 08:16:07 +08:00
DailyShana 794b8e78e4 unicode windows api 2019-05-02 11:02:32 +08:00
Mercury233 87e96921fa add window resize (#2123) 2019-03-26 21:26:35 +08:00