Commit Graph

124 Commits

Author SHA1 Message Date
salix5 42a427a4fa use function template BufferIO::Read (#2835) 2025-07-06 13:18:46 +08:00
Mercury233 e7ebb75fa0 update forced in MSG_SELECT_CHAIN (#2797) 2025-06-29 17:40:43 +08:00
Mercury233 f4db575058 update MSG_CONFIRM_CARDS, add skip_panel (#2470) 2025-06-29 17:39:57 +08:00
salix5 b3482765e4 fix: seeding std::mt19937 with only 1 uint32_t (#2820) 2025-06-18 15:47:55 +08:00
salix5 233a9aad75 Refactor buffer sizes for name and message handling (#2825) 2025-06-04 09:56:20 +08:00
salix5 f9b5c7ed33 fix MSG_AI_NAME, MSG_SHOW_HINT (#2800)
* fix MSG_AI_NAME

* fix MSG_SHOW_HINT
2025-05-20 12:24:44 +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 cc18709fb0 Replay: add read/write template (#2637)
* Replay: add read/write template

* Replay: remove WriteInt8, WriteInt16

* use int32_t in WriteInt32

* remove ReadInt8, ReadInt16

* use int32_t in ReadInt32

* update ReadData

* add ReadHeader

* use array index
2024-12-27 08:23:02 +08:00
salix5 fb4580f93d Patch1 (#2635)
* update include in network.h

* format
2024-12-15 15:15:24 +08:00
salix5 85793b7105 replace intN macro (#2627)
* remove int32

* replace uint32_t

* remove uint8
2024-12-05 19:29:41 +08:00
salix5 7721bfe017 remove NULL (#2626) 2024-12-04 23:19:51 +08:00
salix5 c1cd59c475 change byte to unsigned char (#2622)
the dependency of byte is Windows SDK, not common.h
2024-11-30 15:27:20 +08:00
salix5 a696078dd8 fix SingleMode::SinglePlayThread 2024-11-30 13:22:13 +08:00
salix5 51929625b3 BufferIO: add CopyCharArray (#2616)
array length is determined by reference to array
2024-11-16 11:51:18 +08:00
salix5 cc9497b79b ocgapi change: preload_script (#2601) 2024-10-18 19:41:38 +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 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
salix5 1f03d7321c update get_log_message() (#2550) 2024-05-31 21:51:52 +08:00
Nanahira 1b1fb66437 fix chat player name display (#2542)
* fix after change side chat reverse

* fix

* fix

* fix

* Update replay_mode.cpp

* fix tag

* simplify

* fix
2024-05-07 16:13:39 +08:00
salix5 b290125977 Use BufferIO::ReadUInt8 (#2537)
* change code, location, position to unsigned

* change code, location, postion to unsigned

* use ReadUInt8() for 1-byte data

* Game::LocalPlayer() returns 0, 1

* wrong matching

* change card code to unsigned
2024-05-02 21:59:41 +08:00
salix5 2491768e8d add boundary check to network buffer (#2517)
* fix warning

* add boundary check to network buffer

* update submodule
2024-03-12 02:52:18 +08:00
salix5 203011d5cb fix DuelInfo.Clear() 2023-12-20 23:40:41 +08:00
salix5 e082f6e0f3 add DuelInfo.Clear() 2023-12-19 16:36:52 +08:00
salix5 3c6de95686 update message handler 2023-12-18 11:00:05 +08:00
salix5 86825b0a6c update script reader 2023-12-18 01:37:32 +08:00
salix5 7d446e2477 update card reader 2023-12-18 00:44:53 +08:00
salix5 e94a2e032e update class SingleMode, ReplayMode 2023-12-16 13:05:16 +08:00
salix5 bd9a269048 declare large array 2023-12-14 17:33:43 +08:00
salix5 32389dda77 use unsigned char buffer 2023-12-14 16:10:19 +08:00
salix5 a887c624a9 update class SingleMode 2023-12-14 12:57:29 +08:00
salix5 1110ff16a0 use std::vector buffer 2023-12-14 01:21:09 +08:00
salix5 0423cf886e update mt19937 2023-12-12 14:10:05 +08:00
mercury233 d63e517791 replace 0x80 with LOCATION_OVERLAY 2022-11-06 09:02:04 +08:00
神楽坂玲奈 1cfa1a1cbb clean abuse of ptr type, compiles on vs x64. (#2370) 2022-09-28 08:56:18 +08:00
Nanahira 55536b64a1 update max value of LP bar (#2459) 2022-09-25 08:49:37 +08:00
Mercury233 bf1ea01081 add an option in single play (#2388)
control return to deck top or bottom
2021-11-01 19:05:49 +08:00
salix5 81b781d918 update RNG and uniform distribution, part 2 (#2363)
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

* replace mtrandom with mt19937
2021-08-21 22:25:01 +08:00
Mercury233 a4a38143c8 fix support for reloading field again in single mode (#2349) 2021-06-07 10:17:58 +08:00
DailyShana 84c42fb12b remove MSG_SORT_CHAIN 2020-01-23 18:52:45 +08:00
DailyShana 9addd24631 use standard mutex library (#2224) 2019-07-15 08:16:07 +08:00
DailyShana de2ec1baaa use standard thread library (#2221)
* use standard thread library
* use standard sleep function
2019-07-14 10:08:33 +08:00
DailyShana 6052366e73 fix 2019-07-11 12:01:19 +08:00
Edoardo Lolletti 16219d2fab Merge MSG_ANNOUNCE_CARD with MSG_ANNOUNCE_CARD_FILTER (#2205) 2019-07-07 20:38:26 +08:00
Nanahira e65e5c615f really retry when receiving MSG_RETRY (#2196)
* really retrying one when MSG_RETRY
* remove unnecessary retry paramter
* retry in single mode
* different hint for different action
* update retry hint
2019-06-30 20:16:45 +08:00
Mercury233 9edf6ab787 update MSG_ANNOUNCE_CARD_FILTER (#2199) 2019-05-26 14:45:42 +08:00
Mercury233 87e96921fa add window resize (#2123) 2019-03-26 21:26:35 +08:00
Mercury233 ae3da99161 use one ScriptReaderEx (#2165) 2018-12-09 20:29:17 +08:00
Mercury233 4530524af4 add auto save replay (#2150) 2018-11-16 20:45:29 +08:00
DailyShana 99c86f43bd tweak 2018-11-15 21:17:56 +08:00