Commit Graph
114 Commits
Author SHA1 Message Date
Mercury233 488e66c5a4 fix face-down MSG_SPSUMMONING (#2896) 2025-08-15 17:06:47 +08:00
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 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 dc5a305301 use <ctime> header (#2668) 2025-02-12 16:26:38 +08:00
salix5 2bfb8198bd check len before memcpy in UpdateDeck (#2652) 2025-01-24 00:59:24 +08:00
salix5 d376ed0e65 use <cwchar> function (#2651) 2025-01-17 19:50:59 +08:00
salix5 1127be0fba add CTOS_DeckData (#2641)
* add CTOS_DeckData

* Update netserver.cpp

* update length check

* update length check
2025-01-11 18:09:47 +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 f2278ae751 use vector rbegin (#2628)
* use vector rbegin

* const reference

* use vector assign

* minor update

* init
2024-12-06 23:50:39 +08:00
salix5 85793b7105 replace intN macro (#2627)
* remove int32

* replace uint32_t

* remove uint8
2024-12-05 19:29:41 +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 51929625b3 BufferIO: add CopyCharArray (#2616)
array length is determined by reference to array
2024-11-16 11:51:18 +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 bb82764e0b Use local variable in ServerEchoRead, ClientRead (#2562)
* use local var in ServerEchoRead, ClientRead

* zero init in GetResponse
2024-06-18 16:54:48 +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
salix5 1f03d7321c update get_log_message() (#2550) 2024-05-31 21:51:52 +08:00
Mercury233 0a7a4745f7 add STOC_TEAMMATE_SURRENDER (#2548) 2024-05-21 15:17:32 +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 31bd9394da remove warning 4267 (#2529) 2024-04-21 20:46:54 +08:00
salix5 e3155746c5 fix: check response size before writing (#2514)
* update DuelClient::response_buf[]

* fix: check response size before writing
2024-02-14 04:03:07 +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 6784a0ffbd TagDuel: use std vector 2023-12-16 15:25:07 +08:00
salix5 32ac47c2dc TagDuel: use inline function 2023-12-16 15:21:06 +08:00
salix5 32389dda77 use unsigned char buffer 2023-12-14 16:10:19 +08:00
salix5 905bb0d913 rename 2023-12-14 12:51:50 +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
Mercury233 545f42bffa update time limit handling (#2296) 2022-09-28 08:40:38 +08:00
Mercury233 c0bb37190a update Simplified Chinese ot rule (#2368) 2021-09-02 15:56:33 +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
Nanahira 0087c9b911 fix CVE-2020-24213 (#2327) 2021-03-16 13:47:01 +08:00
DailyShana d50ffd162f add STOC_DECK_COUNT (#2290)
* add STOC_DECK_COUNT

* side count

* show deck in tag duel
2020-04-30 09:38:55 +08:00
DailyShana 84c42fb12b remove MSG_SORT_CHAIN 2020-01-23 18:52:45 +08:00
DailyShana c7614adae9 add HINT_ZONE (#2263) 2020-01-11 13:19:17 +08:00
nekrozar e7bac45bf2 fix HINT_CARD for tag duel 2019-12-05 16:17:03 +09:00
Edoardo Lolletti 16219d2fab Merge MSG_ANNOUNCE_CARD with MSG_ANNOUNCE_CARD_FILTER (#2205) 2019-07-07 20:38:26 +08:00
DailyShana ba65c383b1 server should send STOC to client but not CTOS
although these two have the same value
2019-07-04 21:02:59 +08:00
DailyShana e444e818f3 do not stop server at duel end process (#2217)
server will stop when host player leaves the game

* do not need stop server at duel end process

* update tag_duel.cpp

* add duel stage

* fix

* fix
2019-07-04 20:56:33 +08:00
DailyShana 34ef185256 use error code 0 when verify deck data failed 2019-06-17 13:26:44 +08:00
DailyShana 0a8a47264d verify deck data (#2216) 2019-06-16 21:36:38 -07:00