Commit ec9c71bf authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro into develop

parents a4d27804 2e0af898
#ifndef BUFFERIO_H
#define BUFFERIO_H
#include <cstdint>
#include "../ocgcore/buffer.h"
class BufferIO {
public:
inline static int ReadInt32(unsigned char*& p) {
int ret = *(int*)p;
p += 4;
return ret;
return buffer_read<int32_t>(p);
}
inline static unsigned int ReadUInt32(unsigned char*& p) {
unsigned int ret = *(unsigned int*)p;
......@@ -15,9 +15,7 @@ public:
return ret;
}
inline static short ReadInt16(unsigned char*& p) {
short ret = *(short*)p;
p += 2;
return ret;
return buffer_read<int16_t>(p);
}
inline static unsigned short ReadUInt16(unsigned char*& p) {
unsigned short ret = *(unsigned short*)p;
......@@ -25,26 +23,19 @@ public:
return ret;
}
inline static char ReadInt8(unsigned char*& p) {
char ret = *(char*)p;
p++;
return ret;
return buffer_read<char>(p);
}
inline static unsigned char ReadUInt8(unsigned char*& p) {
unsigned char ret = *(unsigned char*)p;
p++;
return ret;
return buffer_read<unsigned char>(p);
}
inline static void WriteInt32(unsigned char*& p, int val) {
(*(int*)p) = val;
p += 4;
buffer_write<int32_t>(p, val);
}
inline static void WriteInt16(unsigned char*& p, short val) {
(*(short*)p) = val;
p += 2;
buffer_write<int16_t>(p, val);
}
inline static void WriteInt8(unsigned char*& p, char val) {
*p = val;
p++;
buffer_write<char>(p, val);
}
template<typename T1, typename T2>
inline static int CopyWStr(T1* src, T2* pstr, int bufsize) {
......
#include "replay.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h"
#include "lzma/LzmaLib.h"
namespace ygo {
......@@ -54,7 +52,7 @@ void Replay::WriteData(const void* data, int length, bool flush) {
return;
if (length < 0 || (pdata - replay_data) + length > MAX_REPLAY_SIZE)
return;
memcpy(pdata, data, length);
std::memcpy(pdata, data, length);
pdata += length;
#ifdef _WIN32
DWORD size;
......@@ -70,8 +68,7 @@ void Replay::WriteInt32(int data, bool flush) {
return;
if ((pdata - replay_data) + 4 > MAX_REPLAY_SIZE)
return;
*((int*)(pdata)) = data;
pdata += 4;
BufferIO::WriteInt32(pdata, data);
#ifdef _WIN32
DWORD size;
WriteFile(recording_fp, &data, sizeof(int), &size, NULL);
......@@ -86,8 +83,7 @@ void Replay::WriteInt16(short data, bool flush) {
return;
if ((pdata - replay_data) + 2 > MAX_REPLAY_SIZE)
return;
*((short*)(pdata)) = data;
pdata += 2;
BufferIO::WriteInt16(pdata, data);
#ifdef _WIN32
DWORD size;
WriteFile(recording_fp, &data, sizeof(short), &size, NULL);
......@@ -102,8 +98,7 @@ void Replay::WriteInt8(char data, bool flush) {
return;
if ((pdata - replay_data) + 1 > MAX_REPLAY_SIZE)
return;
*pdata = data;
pdata++;
BufferIO::WriteInt8(pdata, data);
#ifdef _WIN32
DWORD size;
WriteFile(recording_fp, &data, sizeof(char), &size, NULL);
......@@ -266,7 +261,7 @@ bool Replay::ReadNextResponse(unsigned char resp[]) {
int len = *pdata++;
if(len > SIZE_RETURN_VALUE)
return false;
memcpy(resp, pdata, len);
std::memcpy(resp, pdata, len);
pdata += len;
return true;
}
......@@ -280,27 +275,26 @@ void Replay::ReadName(wchar_t* data) {
void Replay::ReadData(void* data, int length) {
if(!is_replaying)
return;
memcpy(data, pdata, length);
std::memcpy(data, pdata, length);
pdata += length;
}
int Replay::ReadInt32() {
if(!is_replaying)
return -1;
int ret = *((int*)pdata);
pdata += 4;
int ret = BufferIO::ReadInt32(pdata);
return ret;
}
short Replay::ReadInt16() {
if(!is_replaying)
return -1;
short ret = *((short*)pdata);
pdata += 2;
short ret = BufferIO::ReadInt16(pdata);
return ret;
}
char Replay::ReadInt8() {
if(!is_replaying)
return -1;
return *pdata++;
char ret= BufferIO::ReadInt8(pdata);
return ret;
}
void Replay::Rewind() {
pdata = replay_data;
......
#[2024.4][2024.1 TCG][2024.1][2023.10][2023.7][2023.4][2023.1][2022.10][2022.7][2022.4][2022.1][2021.10][2021.7][2021.4][2021.1][2020.10][2020.7][2020.4][2020.1][2019.10][2019.7][2019.4][2019.1][2018.10][2018.7][2018.4][2018.1][2017.10][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2023.9 TCG][2023.6 TCG][2023.2 TCG][2022.12 TCG][2022.10 TCG][2022.5 TCG][2022.2 TCG][2021.10 TCG][2021.7 TCG][2021.3 TCG][2020.12 TCG][2020.9 TCG][2020.6 TCG][2020.4 TCG][2020.1 TCG][2019.10 TCG][2019.7 TCG][2019.4 TCG][2019.1 TCG][2018.12 TCG][2018.9 TCG][2018.5 TCG][2018.2 TCG][2017.11 TCG][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1]
#[2024.4][2024.4 TCG][2024.1][2023.10][2023.7][2023.4][2023.1][2022.10][2022.7][2022.4][2022.1][2021.10][2021.7][2021.4][2021.1][2020.10][2020.7][2020.4][2020.1][2019.10][2019.7][2019.4][2019.1][2018.10][2018.7][2018.4][2018.1][2017.10][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2024.1 TCG][2023.9 TCG][2023.6 TCG][2023.2 TCG][2022.12 TCG][2022.10 TCG][2022.5 TCG][2022.2 TCG][2021.10 TCG][2021.7 TCG][2021.3 TCG][2020.12 TCG][2020.9 TCG][2020.6 TCG][2020.4 TCG][2020.1 TCG][2019.10 TCG][2019.7 TCG][2019.4 TCG][2019.1 TCG][2018.12 TCG][2018.9 TCG][2018.5 TCG][2018.2 TCG][2017.11 TCG][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1]
!2024.4
#forbidden
91869203 0 --アマゾネスの射手
......@@ -194,10 +194,9 @@
14532163 2 --ライトニング・ストーム
92714517 2 --ビッグウェルカム・ラビュリンス
!2024.1 TCG
!2024.4 TCG
#forbidden
62320425 0 --Agido the Ancient Sentinel
06728559 0 --Archnemeses Protos
20292186 0 --Artifact Scythe
73356503 0 --Barrier Statue of the Stormwinds
09929398 0 --Blackwing - Gofu the Vague Shadow
......@@ -215,7 +214,6 @@
25926710 0 --Kelbek the Ancient Vanguard
57421866 0 --Level Eater
34206604 0 --Magical Scientist
31178212 0 --Majespecter Unicorn - Kirin
21377582 0 --Master Peace, the True Dracoslaying King
36521307 0 --Mathmech Circular
23434538 0 --Maxx "C"
......@@ -225,12 +223,10 @@
01357146 0 --Ronintoadin
91258852 0 --SPYRAL Master Plan
88071625 0 --The Tyrant Neptune
26400609 0 --Tidal, Dragon Ruler of Waterfalls
44910027 0 --Victory Dragon
17412721 0 --Elder Entity Norden
43387895 0 --Supreme King Dragon Starving Venom
92731385 0 --Tearlaments Kitkallos
15291624 0 --Thunder Dragon Colossus
50588353 0 --Crystron Halqifibrax
98095162 0 --Curious, the Lightsworn Dominion
59537380 0 --Guardragon Agarpain
......@@ -240,6 +236,7 @@
39064822 0 --Knightmare Goblin
03679218 0 --Knightmare Mermaid
85243784 0 --Linkross
41999284 0 --Linkuriboh
44097050 0 --Mecha Phantom Beast Auroradon
25725326 0 --Prank-Kids Meow-Meow-Mu
70369116 0 --Predaplant Verte Anaconda
......@@ -249,6 +246,8 @@
33918636 0 --Superheavy Samurai Scarecrow
22593417 0 --Topologic Gumblar Dragon
83152482 0 --Union Carrier
84815190 0 --Baronne de Fleur
27548199 0 --Borreload Savage Dragon
03040496 0 --Chaos Ruler, the Chaotic Magical Dragon
63101919 0 --Tempest Magician
48626373 0 --Kashtira Arise-Heart
......@@ -268,7 +267,6 @@
07394770 0 --Brilliant Fusion
69243953 0 --Butterfly Dagger - Elma
57953380 0 --Card of Safe Return
67616300 0 --Chicken Game
60682203 0 --Cold Wave
17375316 0 --Confiscation
44763025 0 --Delinquent Duo
......@@ -299,6 +297,7 @@
93016201 0 --Royal Oppression
57585212 0 --Self-Destruct Button
03280747 0 --Sixth Sense
23516703 0 --Summon Limit
64697231 0 --Trap Dustshoot
80604091 0 --Ultimate Offering
05851097 0 --Vanity's Emptiness
......@@ -307,7 +306,7 @@
44519536 1 --Left Leg of the Forbidden One
70903634 1 --Right Arm of the Forbidden One
08124921 1 --Right Leg of the Forbidden One
28985331 1 --Armageddon Knight
06728559 1 --Archnemeses Protos
76794549 1 --Astrograph Sorcerer
61901281 1 --Black Dragon Collapserpent
53804307 1 --Blaster, Dragon Ruler of Infernos
......@@ -319,10 +318,10 @@
33396948 1 --Exodia the Forbidden One
63542003 1 --Keldo the Sacred Protector
83190280 1 --Lunalight Tiger
31178212 1 --Majespecter Unicorn - Kirin
38572779 1 --Miscellaneousaurus
33508719 1 --Morphing Jar
99937011 1 --Mudora the Sword Oracle
57835716 1 --Orcust Harp Horror
17330916 1 --Performapal Monkeyboard
12958919 1 --Phantom Skyblaster
38814750 1 --PSY-Framegear Gamma
......@@ -334,10 +333,12 @@
74078255 1 --Tearlaments Merrli
00572850 1 --Tearlaments Scheiren
89399912 1 --Tempest, Dragon Ruler of Storms
26400609 1 --Tidal, Dragon Ruler of Waterfalls
41165831 1 --Unchained Soul of Sharvara
99234526 1 --White Dragon Wyverburster
78872731 1 --Zoodiac Ratpier
39512984 1 --Gem-Knight Master Diamond
15291624 1 --Thunder Dragon Colossus
73539069 1 --Striker Dragon
93896655 1 --Sunavalon Dryas
65563871 1 --Sunvine Healer
......@@ -354,6 +355,7 @@
91623717 1 --Chain Strike
04031928 1 --Change of Heart
99266988 1 --Chaos Space
67616300 1 --Chicken Game
15854426 1 --Divine Wind of Mist Valley
13035077 1 --Dragonic Diagram
95308449 1 --Final Countdown
......@@ -369,7 +371,6 @@
83764718 1 --Monster Reborn
33782437 1 --One Day of Peace
02295440 1 --One for One
55584558 1 --Purrely Delicious Memory
58577036 1 --Reasoning
32807846 1 --Reinforcement of the Army
24940422 1 --Sekka's Light
......@@ -378,6 +379,7 @@
71344451 1 --Slash Draw
45986603 1 --Snatch Steal
73628505 1 --Terraforming
58921041 1 --Anti-Spell Fragrance
53334471 1 --Gozen Match
32723153 1 --Magical Explosion
03734202 1 --Naturia Sacred Tree
......@@ -385,13 +387,12 @@
24207889 1 --There Can Be Only One
35316708 1 --Time Seal
#semi limit
09411399 2 --Destiny HERO - Malicious
28985331 2 --Armageddon Knight
82385847 2 --Dinowrestler Pankratops
81275020 2 --Speedroid Terrortop
14532163 2 --Lightning Storm
55584558 2 --Purrely Delicious Memory
21347668 2 --Purrely Sleepy Memory
92107604 2 --Runick Fountain
63166095 2 --Sky Striker Mobilize - Engage!
!2024.1
#forbidden
......@@ -7361,6 +7362,205 @@
53582587 2 --激流葬
29401950 2 --奈落の落とし穴
!2024.1 TCG
#forbidden
62320425 0 --Agido the Ancient Sentinel
06728559 0 --Archnemeses Protos
20292186 0 --Artifact Scythe
73356503 0 --Barrier Statue of the Stormwinds
09929398 0 --Blackwing - Gofu the Vague Shadow
94689206 0 --Block Dragon
69015963 0 --Cyber-Stein
15341821 0 --Dandylion
08903700 0 --Djinn Releaser of Rituals
51858306 0 --Eclipse Wyvern
40177746 0 --Eva
55623480 0 --Fairy Tail - Snow
78706415 0 --Fiber Jar
93369354 0 --Fishborg Blaster
67441435 0 --Glow-Up Bulb
75732622 0 --Grinder Golem
25926710 0 --Kelbek the Ancient Vanguard
57421866 0 --Level Eater
34206604 0 --Magical Scientist
31178212 0 --Majespecter Unicorn - Kirin
21377582 0 --Master Peace, the True Dracoslaying King
36521307 0 --Mathmech Circular
23434538 0 --Maxx "C"
96782886 0 --Mind Master
07563579 0 --Performage Plushfire
23558733 0 --Phoenixian Cluster Amaryllis
01357146 0 --Ronintoadin
91258852 0 --SPYRAL Master Plan
88071625 0 --The Tyrant Neptune
26400609 0 --Tidal, Dragon Ruler of Waterfalls
44910027 0 --Victory Dragon
17412721 0 --Elder Entity Norden
43387895 0 --Supreme King Dragon Starving Venom
92731385 0 --Tearlaments Kitkallos
15291624 0 --Thunder Dragon Colossus
50588353 0 --Crystron Halqifibrax
98095162 0 --Curious, the Lightsworn Dominion
59537380 0 --Guardragon Agarpain
86148577 0 --Guardragon Elpy
24094258 0 --Heavymetalfoes Electrumite
59934749 0 --Isolde, Two Tales of the Noble Knights
39064822 0 --Knightmare Goblin
03679218 0 --Knightmare Mermaid
85243784 0 --Linkross
44097050 0 --Mecha Phantom Beast Auroradon
25725326 0 --Prank-Kids Meow-Meow-Mu
70369116 0 --Predaplant Verte Anaconda
72330894 0 --Simorgh, Bird of Sovereignty
27381364 0 --Spright Elf
61665245 0 --Summon Sorceress
33918636 0 --Superheavy Samurai Scarecrow
22593417 0 --Topologic Gumblar Dragon
83152482 0 --Union Carrier
03040496 0 --Chaos Ruler, the Chaotic Magical Dragon
63101919 0 --Tempest Magician
48626373 0 --Kashtira Arise-Heart
34086406 0 --Lavalval Chain
04423206 0 --M-X-Saber Invoker
54719828 0 --Number 16: Shock Master
10389142 0 --Number 42: Galaxy Tomahawk
63504681 0 --Number 86: Heroic Champion - Rhongomyniad
95474755 0 --Number 89: Diablosis the Mind Hacker
58820923 0 --Number 95: Galaxy-Eyes Dark Matter Dragon
52653092 0 --Number S0: Utopic ZEXAL
34945480 0 --Outer Entity Azathot
88581108 0 --True King of All Calamities
81122844 0 --Wind-Up Carrier Zenmaity
85115440 0 --Zoodiac Broadbull
48905153 0 --Zoodiac Drident
07394770 0 --Brilliant Fusion
69243953 0 --Butterfly Dagger - Elma
57953380 0 --Card of Safe Return
67616300 0 --Chicken Game
60682203 0 --Cold Wave
17375316 0 --Confiscation
44763025 0 --Delinquent Duo
23557835 0 --Dimension Fusion
42703248 0 --Giant Trunade
79571449 0 --Graceful Charity
19613556 0 --Heavy Storm
35059553 0 --Kaiser Colosseum
85602018 0 --Last Will
34906152 0 --Mass Driver
46411259 0 --Metamorphosis
41482598 0 --Mirage of Nightmare
76375976 0 --Mystic Mine
74191942 0 --Painful Choice
55144522 0 --Pot of Greed
70828912 0 --Premature Burial
63789924 0 --Smoke Grenade of the Thief
54447022 0 --Soul Charge
11110587 0 --That Grass Looks Greener
42829885 0 --The Forceful Sentry
46060017 0 --Zoodiac Barrage
43262273 0 --Appointer of the Red Lotus
01041278 0 --Branded Expulsion
61740673 0 --Imperial Order
28566710 0 --Last Turn
23002292 0 --Red Reboot
27174286 0 --Return from the Different Dimension
93016201 0 --Royal Oppression
57585212 0 --Self-Destruct Button
03280747 0 --Sixth Sense
64697231 0 --Trap Dustshoot
80604091 0 --Ultimate Offering
05851097 0 --Vanity's Emptiness
#limit
07902349 1 --Left Arm of the Forbidden One
44519536 1 --Left Leg of the Forbidden One
70903634 1 --Right Arm of the Forbidden One
08124921 1 --Right Leg of the Forbidden One
28985331 1 --Armageddon Knight
76794549 1 --Astrograph Sorcerer
61901281 1 --Black Dragon Collapserpent
53804307 1 --Blaster, Dragon Ruler of Infernos
33854624 1 --Bystial Magnamhut
34124316 1 --Cyber Jar
43694650 1 --Danger!? Jackalope?
99745551 1 --Danger!? Tsuchinoko?
14536035 1 --Dark Grepher
33396948 1 --Exodia the Forbidden One
63542003 1 --Keldo the Sacred Protector
83190280 1 --Lunalight Tiger
38572779 1 --Miscellaneousaurus
33508719 1 --Morphing Jar
99937011 1 --Mudora the Sword Oracle
57835716 1 --Orcust Harp Horror
17330916 1 --Performapal Monkeyboard
12958919 1 --Phantom Skyblaster
38814750 1 --PSY-Framegear Gamma
26118970 1 --Red Rose Dragon
90411554 1 --Redox, Dragon Ruler of Boulders
65734501 1 --Rescue-ACE Air Lifter
20663556 1 --Substitoad
37961969 1 --Tearlaments Havnis
74078255 1 --Tearlaments Merrli
00572850 1 --Tearlaments Scheiren
89399912 1 --Tempest, Dragon Ruler of Storms
41165831 1 --Unchained Soul of Sharvara
99234526 1 --White Dragon Wyverburster
78872731 1 --Zoodiac Ratpier
39512984 1 --Gem-Knight Master Diamond
73539069 1 --Striker Dragon
93896655 1 --Sunavalon Dryas
65563871 1 --Sunvine Healer
25862681 1 --Ancient Fairy Dragon
65536818 1 --Denglong, First of the Yang Zing
94677445 1 --Ib the World Chalice Justiciar
74586817 1 --PSY-Framelord Omega
90953320 1 --T.G. Hyper Librarian
27552504 1 --Beatrice, Lady of the Eternal
00581014 1 --Daigusto Emeral
24224830 1 --Called by the Grave
72892473 1 --Card Destruction
59750328 1 --Card of Demise
91623717 1 --Chain Strike
04031928 1 --Change of Heart
99266988 1 --Chaos Space
15854426 1 --Divine Wind of Mist Valley
13035077 1 --Dragonic Diagram
95308449 1 --Final Countdown
81439173 1 --Foolish Burial
27970830 1 --Gateway of the Six
75500286 1 --Gold Sarcophagus
18144506 1 --Harpie's Feather Duster
66957584 1 --Infernity Launcher
01845204 1 --Instant Fusion
93946239 1 --Into the Void
71650854 1 --Magical Mid-Breaker Field
43040603 1 --Monster Gate
83764718 1 --Monster Reborn
33782437 1 --One Day of Peace
02295440 1 --One for One
55584558 1 --Purrely Delicious Memory
58577036 1 --Reasoning
32807846 1 --Reinforcement of the Army
24940422 1 --Sekka's Light
73468603 1 --Set Rotation
52340444 1 --Sky Striker Mecha - Hornet Drones
71344451 1 --Slash Draw
45986603 1 --Snatch Steal
73628505 1 --Terraforming
53334471 1 --Gozen Match
32723153 1 --Magical Explosion
03734202 1 --Naturia Sacred Tree
90846359 1 --Rivalry of Warlords
24207889 1 --There Can Be Only One
35316708 1 --Time Seal
#semi limit
09411399 2 --Destiny HERO - Malicious
82385847 2 --Dinowrestler Pankratops
81275020 2 --Speedroid Terrortop
14532163 2 --Lightning Storm
21347668 2 --Purrely Sleepy Memory
92107604 2 --Runick Fountain
63166095 2 --Sky Striker Mobilize - Engage!
!2023.9 TCG
#forbidden
06728559 0 --Archnemeses Protos
......
......@@ -672,7 +672,7 @@
!setname 0x2 次世代 ジェネクス
!setname 0x1002 真次世代 レアル·ジェネクス
#!setname 0x2002 盟军·次世代 A・ジェネクス
#setname 0x3 N/A
!setname 0x3 魅惑的女王 魅惑の女王
!setname 0x4 亚马逊 アマゾネス
!setname 0x5 秘仪之力 アルカナフォース
!setname 0x6 暗黑界 暗黒界
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment