Commit Graph

167 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
Mercury233 23c3cf1add update ClientField::UpdateDeclarableList & NormalizeChar (#3037) 2026-04-09 09:30:55 +08:00
salix5 78c1a9b390 Remove unnecessary header files from config.h (#3036) 2026-03-29 22:44:32 +08:00
salix5 6fea874dac Change Deck to (const CardDataC*) vector (#3006) 2026-03-25 09:34:16 +08:00
salix5 6378795a52 Use %zu for size_t values in printf (#3023) 2026-03-23 08:31:21 +08:00
Mercury233 4cc19918bf update irrlicht clipboard (#2979) 2026-03-15 18:31:33 +08:00
salix5 bd326e20d9 Add datas.rule_code (#3000) 2026-03-15 18:21:01 +08:00
mercury233 ac2a919d4e fix missing break in DeckBuilder::OnEvent 2026-02-27 15:57:31 +08:00
salix5 03e1fa3128 Change key type to uint32_t in DataManager (#2968) 2026-02-09 09:40:04 +08:00
Mercury233 17f3ec4c9d fix is_modified for clear/sort/shuffle deck buttons (#2959) 2026-02-04 08:59:55 +08:00
Mercury233 9b09b57078 add sound for ShowBigCard (#2960) 2026-02-04 08:59:35 +08:00
salix5 89f5265394 remove: pics/thumbnail, use_image_scale, ImageManager::RemoveTexture (#2868) 2026-01-29 15:21:35 +08:00
salix5 56c313c61d Use vector in DuelClient::SendUpdateDeck (#2952) 2026-01-10 16:34:51 +08:00
salix5 09b4854ea3 Change loop variable type in DeckBuilder::OnEvent 2025-08-31 21:29:05 +08:00
salix5 e7fd61c975 fix category add, rename, delete handler 2025-08-31 21:29:05 +08:00
salix5 17715fe485 add GetDataTable, GetStringTable (#2905)
* add GetDataTable, GetStringTable

* Refactor table access in ClientField and DeckBuilder

* Refactor LoadDeck to use table lookup

* Refactor loops in DeckBuilder::check_limit
2025-08-22 13:55:06 +08:00
Mercury233 a789c1bbc0 fix prev_deck on BUTTON_SAVE_DECK_AS (#2892) 2025-08-07 15:30:44 +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 3e2be8dd05 Redefine CardDataC structure and remove inheritance from card_data (#2867) 2025-07-06 12:06:34 +08:00
salix5 bfa02b0b78 Simplify card name retrieval in UpdateDeclarableList (#2869) 2025-07-03 22:28:21 +08:00
Mercury233 b9e1089f8e add import/export deck code (#2577) 2025-06-18 14:58:05 +08:00
salix5 56b65a1e69 change RNG except shuffle in duel to std::mt19937 (#2827) 2025-06-14 15:26:15 +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 194608f8f0 replace irr::core::recti 2025-03-14 19:10:07 +08:00
salix5 296c0d757e fix namespace irr::video 2025-03-14 19:10:07 +08:00
salix5 d06a9096fd rename: GetLFListContent -> GetLFList (#2715)
* update DeckManager::GetLFListContent

* change DeckBuilder::filterList into const LFList*

* update Game::DrawThumb

* rename: GetLFListContent -> GetLFList

* update the signature of DeckManager::GetLFListName

* change code to unsigned
2025-03-08 15:22:53 +08:00
salix5 ffc6aee169 replace position2d with vector2d (#2709)
* update MenuHandler

* update DeckBuilder

* replace position2di with irr::core::vector2di

* replace position2di with vector2di

* replace core::position2d with irr::core::vector2d

* replace position2d with vector2d
2025-03-02 12:22:54 +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
salix5 dc5a305301 use <ctime> header (#2668) 2025-02-12 16:26:38 +08:00
salix5 37cb3cea64 use override in class DeckBuilder (#2664)
* update DeckBuilder::FilterCards()

* use override
2025-02-08 23:39:52 +08:00
salix5 53d951c7d1 update signature of ClientCard::SetCode (#2655)
* update signature of ClientCard::SetCode

* ClientField: fix AddCard, RemoveCard

* minor fix

* use int counter variable
2025-01-28 05:35:26 +08:00
salix5 d376ed0e65 use <cwchar> function (#2651) 2025-01-17 19:50:59 +08:00
salix5 b57b331b65 move struct CardDataC, deck sort functions to data_manager.h (#2647)
* move struct CardDataC to data_manager.h

* update struct CardDataC

* move deck sort functions to DataManager

* update DeckBuilder::filter_effect
2025-01-14 13:25:16 +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 b0e0ca3c79 add datas_begin(), strings_begin() (#2607)
* reorder

* DataManager: add datas_begin(), strings_begin()

* replace
2024-10-16 18:51:22 +08:00
Mercury233 3369ec0538 update card search trycode (#2589) 2024-09-23 10:09:13 +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 cc91dc81ee verify the source of BufferIO::CopyWStr (#2558)
* verify the source of BufferIO::CopyWStr

* add BufferIO::NullTerminate

* use MAX_STRING_ID

* use constant

* use constant
2024-06-09 11:00:08 +08:00
salix5 e209e77502 disconnect when the packet is too large (#2551)
* use memcpy in DuelClient, NetServer

* NetServer: discard too large packet

* DuelClient: discard too large packet

* replace memcpy with std::memcpy

* disconnect when the packet is too large

* check packet_len

* check len in HandleCTOSPacket()

* check len in HandleSTOCPacketLan()

* remove bool type in HostInfo

* check len in packet handling

* add boundary check to STOC_CHAT packet

* use memcpy in DuelMode::JoinGame

* add DECK_MAX_SIZE, DECK_MIN_SIZE

* fix DuelMode::UpdateDeck()

* fix

* fix Manager::OpenDeckFile()

* update DuelMode init

* update DuelMode::JoinGame

* update DuelMode::GetResponse

* Revert "check len in packet handling"

This reverts commit 2b5c12f360.

* use memcpy in GetPosition

* check struct size by static_assert

* update DuelMode::UpdateDeck

* check if the struct is trivially copyable

* replace unsigned short to uint16_t

* replace unsigned int to uint32_t

* add padding member to STOC_HS_PlayerEnter

* workaround: use STOC_HS_PlayerEnter_size
2024-05-31 21:52:06 +08:00
Mercury233 1b59f4c602 support search part of setname (#2546) 2024-05-21 15:48:05 +08:00
Mercury233 b7dcae4ef1 change side chat drawing (#2545)
* fix CGUITTFont lineBreak

* change side chat drawing

* fix

* fix

* update normal chat

* less changement

* fix
2024-05-11 09:55:47 +08:00
salix5 05da015f89 Use array to store setcode (#2510)
* card_data.setcode: use std vector

* remove CARD_ARTWORK_VERSIONS_OFFSET

* add extra_setcode for cards with 5+ setcodes

* setcode use array

* Update data_manager.cpp
2024-02-12 16:38:50 +08:00
salix5 c52977150a DataManager: change _strings to private 2024-01-10 17:45:54 +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
salix5 0423cf886e update mt19937 2023-12-12 14:10:05 +08:00
mercury233 306349014f fix scrPackCards reset 2022-09-24 21:31:15 +08:00