Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOProUnity_V2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
YGOProUnity_V2
Commits
18430657
Commit
18430657
authored
Jun 26, 2025
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into patch-v1362
parents
9ff959b7
79a63bcb
Pipeline
#38120
passed with stage
in 126 minutes and 11 seconds
Changes
8
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
41 deletions
+56
-41
.gitignore
.gitignore
+1
-0
Assets/Plugins/x64/ocgcore.dll
Assets/Plugins/x64/ocgcore.dll
+0
-0
Assets/Plugins/x86/ocgcore.dll
Assets/Plugins/x86/ocgcore.dll
+0
-0
Assets/SibylSystem/ResourceManagers/GameStringHelper.cs
Assets/SibylSystem/ResourceManagers/GameStringHelper.cs
+1
-1
Assets/SibylSystem/coreWrapper.cs
Assets/SibylSystem/coreWrapper.cs
+25
-22
Assets/SibylSystem/selectReplay/selectReplay.cs
Assets/SibylSystem/selectReplay/selectReplay.cs
+23
-12
Assets/YGOSharp/Card.cs
Assets/YGOSharp/Card.cs
+2
-2
Assets/YGOSharp/CardsManager.cs
Assets/YGOSharp/CardsManager.cs
+4
-4
No files found.
.gitignore
View file @
18430657
...
@@ -11,6 +11,7 @@ Assets/AssetStoreTools*
...
@@ -11,6 +11,7 @@ Assets/AssetStoreTools*
/.vs/
/.vs/
.idea
.idea
.vsconfig
.vsconfig
/.vscode/
# Autogenerated VS/MD/Consulo solution and project files
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
ExportedObj/
...
...
Assets/Plugins/x64/ocgcore.dll
View file @
18430657
No preview for this file type
Assets/Plugins/x86/ocgcore.dll
View file @
18430657
No preview for this file type
Assets/SibylSystem/ResourceManagers/GameStringHelper.cs
View file @
18430657
...
@@ -459,7 +459,7 @@ public class GameStringHelper
...
@@ -459,7 +459,7 @@ public class GameStringHelper
return
re
;
return
re
;
}
}
public
static
string
getSetName
(
long
Setcode
)
public
static
string
getSetName
(
u
long
Setcode
)
{
{
var
setcodes
=
new
int
[
4
];
var
setcodes
=
new
int
[
4
];
for
(
var
j
=
0
;
j
<
4
;
j
++)
for
(
var
j
=
0
;
j
<
4
;
j
++)
...
...
Assets/SibylSystem/coreWrapper.cs
View file @
18430657
...
@@ -213,7 +213,10 @@ namespace Percy
...
@@ -213,7 +213,10 @@ namespace Percy
{
{
public
int
Code
;
public
int
Code
;
public
int
Alias
;
public
int
Alias
;
public
long
Setcode
;
public
UInt64
Setcode
;
public
UInt64
_Setcode1
;
public
UInt64
_Setcode2
;
public
UInt64
_Setcode3
;
public
int
Type
;
public
int
Type
;
public
int
Level
;
public
int
Level
;
public
int
Attribute
;
public
int
Attribute
;
...
@@ -294,7 +297,10 @@ namespace Percy
...
@@ -294,7 +297,10 @@ namespace Percy
public
static
extern
IntPtr
create_duel
(
uint
seed
);
public
static
extern
IntPtr
create_duel
(
uint
seed
);
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
public
static
extern
void
start_duel
(
IntPtr
pduel
,
int
options
);
public
static
extern
IntPtr
create_duel_v2
([
In
]
uint
[]
seeds
);
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
public
static
extern
void
start_duel
(
IntPtr
pduel
,
uint
options
);
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
public
static
extern
int
get_ai_going_first_second
(
IntPtr
pduel
,
IntPtr
deckname
);
public
static
extern
int
get_ai_going_first_second
(
IntPtr
pduel
,
IntPtr
deckname
);
...
@@ -348,7 +354,7 @@ namespace Percy
...
@@ -348,7 +354,7 @@ namespace Percy
public
static
extern
int
query_field_info
(
IntPtr
pduel
,
IntPtr
buf
);
public
static
extern
int
query_field_info
(
IntPtr
pduel
,
IntPtr
buf
);
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
public
static
extern
int
preload_script
(
IntPtr
pduel
,
IntPtr
script
,
int
len
);
public
static
extern
int
preload_script
(
IntPtr
pduel
,
IntPtr
script
);
[
UnmanagedFunctionPointer
(
CallingConvention
.
Cdecl
)]
[
UnmanagedFunctionPointer
(
CallingConvention
.
Cdecl
)]
private
delegate
IntPtr
ScriptReader
(
string
scriptName
,
int
*
len
);
private
delegate
IntPtr
ScriptReader
(
string
scriptName
,
int
*
len
);
...
@@ -1112,14 +1118,8 @@ namespace Percy
...
@@ -1112,14 +1118,8 @@ namespace Percy
isFirst
=
true
;
isFirst
=
true
;
dll
.
set_player_info
(
duel
,
0
,
8000
,
5
,
1
);
dll
.
set_player_info
(
duel
,
0
,
8000
,
5
,
1
);
dll
.
set_player_info
(
duel
,
1
,
8000
,
5
,
1
);
dll
.
set_player_info
(
duel
,
1
,
8000
,
5
,
1
);
var
reult
=
0
;
dll
.
preload_script
(
duel
,
getPtrString
(
path
));
for
(
var
i
=
0
;
i
<
10
;
i
++)
{
reult
=
dll
.
preload_script
(
duel
,
getPtrString
(
path
),
0
);
if
(
reult
>
0
)
break
;
}
if
(
reult
==
0
)
return
false
;
dll
.
start_duel
(
duel
,
0
);
dll
.
start_duel
(
duel
,
0
);
Refresh
();
Refresh
();
new
Thread
(
Process
).
Start
();
new
Thread
(
Process
).
Start
();
...
@@ -1133,18 +1133,12 @@ namespace Percy
...
@@ -1133,18 +1133,12 @@ namespace Percy
isFirst
=
playerGoFirst
;
isFirst
=
playerGoFirst
;
dll
.
set_player_info
(
duel
,
0
,
life
,
5
,
1
);
dll
.
set_player_info
(
duel
,
0
,
life
,
5
,
1
);
dll
.
set_player_info
(
duel
,
1
,
life
,
5
,
1
);
dll
.
set_player_info
(
duel
,
1
,
life
,
5
,
1
);
var
reult
=
0
;
dll
.
preload_script
(
duel
,
getPtrString
(
aiScript
));
for
(
var
i
=
0
;
i
<
10
;
i
++)
{
reult
=
dll
.
preload_script
(
duel
,
getPtrString
(
aiScript
),
0
);
if
(
reult
>
0
)
break
;
}
if
(
reult
==
0
)
return
false
;
addDeck
(
playerDek
,
playerGoFirst
?
0
:
1
,
!
unrand
);
addDeck
(
playerDek
,
playerGoFirst
?
0
:
1
,
!
unrand
);
addDeck
(
aiDeck
,
playerGoFirst
?
1
:
0
,
true
);
addDeck
(
aiDeck
,
playerGoFirst
?
1
:
0
,
true
);
dll
.
set_ai_id
(
duel
,
playerGoFirst
?
1
:
0
);
dll
.
set_ai_id
(
duel
,
playerGoFirst
?
1
:
0
);
var
opt
=
0
;
UInt32
opt
=
0
;
opt
|=
0x80
;
opt
|=
0x80
;
if
(
unrand
)
opt
|=
0x10
;
if
(
unrand
)
opt
|=
0x10
;
var
master
=
new
BinaryMaster
();
var
master
=
new
BinaryMaster
();
...
@@ -1157,7 +1151,7 @@ namespace Percy
...
@@ -1157,7 +1151,7 @@ namespace Percy
master
.
writer
.
Write
((
ushort
)
dll
.
query_field_count
(
duel
,
1
,
0x1
));
master
.
writer
.
Write
((
ushort
)
dll
.
query_field_count
(
duel
,
1
,
0x1
));
master
.
writer
.
Write
((
ushort
)
dll
.
query_field_count
(
duel
,
1
,
0x40
));
master
.
writer
.
Write
((
ushort
)
dll
.
query_field_count
(
duel
,
1
,
0x40
));
sendToPlayer
(
master
.
get
());
sendToPlayer
(
master
.
get
());
dll
.
start_duel
(
duel
,
opt
|
(
mr
<<
16
));
dll
.
start_duel
(
duel
,
opt
|
(
UInt32
)(
mr
<<
16
));
Refresh
();
Refresh
();
new
Thread
(
Process
).
Start
();
new
Thread
(
Process
).
Start
();
return
true
;
return
true
;
...
@@ -1188,6 +1182,7 @@ namespace Percy
...
@@ -1188,6 +1182,7 @@ namespace Percy
var
s
=
Encoding
.
UTF8
.
GetBytes
(
path
);
var
s
=
Encoding
.
UTF8
.
GetBytes
(
path
);
var
ptrFileName
=
Marshal
.
AllocHGlobal
(
s
.
Length
+
1
);
var
ptrFileName
=
Marshal
.
AllocHGlobal
(
s
.
Length
+
1
);
Marshal
.
Copy
(
s
,
0
,
ptrFileName
,
s
.
Length
);
Marshal
.
Copy
(
s
,
0
,
ptrFileName
,
s
.
Length
);
Marshal
.
WriteByte
(
ptrFileName
,
s
.
Length
,
0
);
return
ptrFileName
;
return
ptrFileName
;
}
}
...
@@ -1293,8 +1288,15 @@ namespace Percy
...
@@ -1293,8 +1288,15 @@ namespace Percy
yrp3dbuilder
=
new
BinaryWriter
(
stream
);
yrp3dbuilder
=
new
BinaryWriter
(
stream
);
sendToPlayer
(
yrp
.
getNamePacket
());
sendToPlayer
(
yrp
.
getNamePacket
());
dll
.
end_duel
(
duel
);
dll
.
end_duel
(
duel
);
var
mtrnd
=
new
MersenneTwister
(
yrp
.
Seed
);
if
(
yrp
.
ID
==
0x32707279
)
// REPLAY_ID_YRP2
duel
=
dll
.
create_duel
(
mtrnd
.
genrand_Int32
());
{
duel
=
dll
.
create_duel_v2
(
yrp
.
SeedsV2
);
}
else
{
var
mtrnd
=
new
MersenneTwister
(
yrp
.
Seed
);
duel
=
dll
.
create_duel
(
mtrnd
.
genrand_Int32
());
}
godMode
=
true
;
godMode
=
true
;
isFirst
=
true
;
isFirst
=
true
;
dll
.
set_player_info
(
duel
,
0
,
yrp
.
StartLp
,
yrp
.
StartHand
,
yrp
.
DrawCount
);
dll
.
set_player_info
(
duel
,
0
,
yrp
.
StartLp
,
yrp
.
StartHand
,
yrp
.
DrawCount
);
...
@@ -1398,10 +1400,11 @@ namespace Percy
...
@@ -1398,10 +1400,11 @@ namespace Percy
public
List
<
byte
[
]>
gameData
=
new
List
<
byte
[
]>
();
public
List
<
byte
[
]>
gameData
=
new
List
<
byte
[
]>
();
public
int
Hash
=
0
;
public
int
Hash
=
0
;
public
int
ID
=
0
;
public
int
ID
=
0
;
public
int
opt
=
0
;
public
u
int
opt
=
0
;
public
List
<
PlayerData
>
playerData
=
new
List
<
PlayerData
>();
public
List
<
PlayerData
>
playerData
=
new
List
<
PlayerData
>();
public
byte
[]
Props
=
new
byte
[
8
];
public
byte
[]
Props
=
new
byte
[
8
];
public
uint
Seed
=
0
;
public
uint
Seed
=
0
;
public
uint
[]
SeedsV2
=
new
uint
[
8
];
public
int
StartHand
=
0
;
public
int
StartHand
=
0
;
public
int
StartLp
=
0
;
public
int
StartLp
=
0
;
public
int
Version
=
0
;
public
int
Version
=
0
;
...
...
Assets/SibylSystem/selectReplay/selectReplay.cs
View file @
18430657
...
@@ -139,6 +139,17 @@ public class selectReplay : WindowServantSP
...
@@ -139,6 +139,17 @@ public class selectReplay : WindowServantSP
returnValue
.
DataSize
=
reader
.
ReadInt32
();
returnValue
.
DataSize
=
reader
.
ReadInt32
();
returnValue
.
Hash
=
reader
.
ReadInt32
();
returnValue
.
Hash
=
reader
.
ReadInt32
();
returnValue
.
Props
=
reader
.
ReadBytes
(
8
);
returnValue
.
Props
=
reader
.
ReadBytes
(
8
);
if
(
returnValue
.
ID
==
0x32707279
)
// REPLAY_ID_YRP2
{
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
returnValue
.
SeedsV2
[
i
]
=
reader
.
ReadUInt32
();
}
for
(
int
i
=
0
;
i
<
4
;
i
++)
// other flags, unused for now
{
reader
.
ReadUInt32
();
}
}
var
raw
=
reader
.
ReadToEnd
();
var
raw
=
reader
.
ReadToEnd
();
if
((
returnValue
.
Flag
&
0x1
)
>
0
)
if
((
returnValue
.
Flag
&
0x1
)
>
0
)
{
{
...
@@ -164,8 +175,8 @@ public class selectReplay : WindowServantSP
...
@@ -164,8 +175,8 @@ public class selectReplay : WindowServantSP
returnValue
.
StartLp
=
reader
.
ReadInt32
();
returnValue
.
StartLp
=
reader
.
ReadInt32
();
returnValue
.
StartHand
=
reader
.
ReadInt32
();
returnValue
.
StartHand
=
reader
.
ReadInt32
();
returnValue
.
DrawCount
=
reader
.
ReadInt32
();
returnValue
.
DrawCount
=
reader
.
ReadInt32
();
returnValue
.
opt
=
reader
.
ReadInt32
();
returnValue
.
opt
=
reader
.
Read
U
Int32
();
Program
.
I
().
ocgcore
.
MasterRule
=
returnValue
.
opt
>>
16
;
Program
.
I
().
ocgcore
.
MasterRule
=
(
int
)(
returnValue
.
opt
>>
16
)
;
for
(
var
i
=
0
;
i
<
4
;
i
++)
for
(
var
i
=
0
;
i
<
4
;
i
++)
{
{
var
count
=
reader
.
ReadInt32
();
var
count
=
reader
.
ReadInt32
();
...
@@ -183,8 +194,8 @@ public class selectReplay : WindowServantSP
...
@@ -183,8 +194,8 @@ public class selectReplay : WindowServantSP
returnValue
.
StartLp
=
reader
.
ReadInt32
();
returnValue
.
StartLp
=
reader
.
ReadInt32
();
returnValue
.
StartHand
=
reader
.
ReadInt32
();
returnValue
.
StartHand
=
reader
.
ReadInt32
();
returnValue
.
DrawCount
=
reader
.
ReadInt32
();
returnValue
.
DrawCount
=
reader
.
ReadInt32
();
returnValue
.
opt
=
reader
.
ReadInt32
();
returnValue
.
opt
=
reader
.
Read
U
Int32
();
Program
.
I
().
ocgcore
.
MasterRule
=
returnValue
.
opt
>>
16
;
Program
.
I
().
ocgcore
.
MasterRule
=
(
int
)(
returnValue
.
opt
>>
16
)
;
for
(
var
i
=
0
;
i
<
2
;
i
++)
for
(
var
i
=
0
;
i
<
2
;
i
++)
{
{
var
count
=
reader
.
ReadInt32
();
var
count
=
reader
.
ReadInt32
();
...
@@ -342,14 +353,14 @@ public class selectReplay : WindowServantSP
...
@@ -342,14 +353,14 @@ public class selectReplay : WindowServantSP
public
void
KF_replay
(
string
name
,
bool
god
=
false
)
public
void
KF_replay
(
string
name
,
bool
god
=
false
)
{
{
string
filename
=
name
;
string
filename
=
name
;
if
(!
File
.
Exists
(
filename
))
if
(!
File
.
Exists
(
filename
))
{
{
if
(
File
.
Exists
(
"replay/"
+
name
+
".yrp3d"
))
if
(
File
.
Exists
(
"replay/"
+
name
+
".yrp3d"
))
filename
=
"replay/"
+
name
+
".yrp3d"
;
filename
=
"replay/"
+
name
+
".yrp3d"
;
if
(
name
.
Length
>
4
&&
name
.
ToLower
().
Substring
(
name
.
Length
-
4
,
4
)
==
".yrp"
)
if
(
name
.
Length
>
4
&&
name
.
ToLower
().
Substring
(
name
.
Length
-
4
,
4
)
==
".yrp"
)
filename
=
"replay/"
+
name
;
filename
=
"replay/"
+
name
;
if
(!
File
.
Exists
(
filename
))
if
(!
File
.
Exists
(
filename
))
return
;
return
;
}
}
bool
yrp3d
=
filename
.
Length
>
6
&&
filename
.
ToLower
().
Substring
(
filename
.
Length
-
6
,
6
)
==
".yrp3d"
;
bool
yrp3d
=
filename
.
Length
>
6
&&
filename
.
ToLower
().
Substring
(
filename
.
Length
-
6
,
6
)
==
".yrp3d"
;
try
try
...
...
Assets/YGOSharp/Card.cs
View file @
18430657
...
@@ -9,7 +9,7 @@ namespace YGOSharp
...
@@ -9,7 +9,7 @@ namespace YGOSharp
public
int
Id
;
public
int
Id
;
public
int
Ot
;
public
int
Ot
;
public
int
Alias
;
public
int
Alias
;
public
long
Setcode
;
public
u
long
Setcode
;
public
int
Type
;
public
int
Type
;
public
int
Level
;
public
int
Level
;
...
@@ -118,7 +118,7 @@ namespace YGOSharp
...
@@ -118,7 +118,7 @@ namespace YGOSharp
this
.
Id
=
(
int
)
reader
.
GetInt64
(
0
);
this
.
Id
=
(
int
)
reader
.
GetInt64
(
0
);
this
.
Ot
=
reader
.
GetInt32
(
1
);
this
.
Ot
=
reader
.
GetInt32
(
1
);
this
.
Alias
=
(
int
)
reader
.
GetInt64
(
2
);
this
.
Alias
=
(
int
)
reader
.
GetInt64
(
2
);
this
.
Setcode
=
reader
.
GetInt64
(
3
);
this
.
Setcode
=
(
ulong
)
reader
.
GetInt64
(
3
);
this
.
Type
=
(
int
)
reader
.
GetInt64
(
4
);
this
.
Type
=
(
int
)
reader
.
GetInt64
(
4
);
this
.
Attack
=
reader
.
GetInt32
(
5
);
this
.
Attack
=
reader
.
GetInt32
(
5
);
this
.
Defense
=
reader
.
GetInt32
(
6
);
this
.
Defense
=
reader
.
GetInt32
(
6
);
...
...
Assets/YGOSharp/CardsManager.cs
View file @
18430657
...
@@ -438,12 +438,12 @@ namespace YGOSharp
...
@@ -438,12 +438,12 @@ namespace YGOSharp
!=
((
int
)
CardType
.
Monster
+
(
int
)
CardType
.
Token
));
!=
((
int
)
CardType
.
Monster
+
(
int
)
CardType
.
Token
));
}
}
public
static
bool
IfSetCard
(
int
setCodeToAnalyse
,
long
setCodeFromCard
)
public
static
bool
IfSetCard
(
int
setCodeToAnalyse
,
u
long
setCodeFromCard
)
{
{
bool
res
=
false
;
bool
res
=
false
;
int
settype
=
setCodeToAnalyse
&
0xfff
;
uint
settype
=
(
uint
)
setCodeToAnalyse
&
0xfff
;
int
setsubtype
=
setCodeToAnalyse
&
0xf000
;
uint
setsubtype
=
(
uint
)
setCodeToAnalyse
&
0xf000
;
long
sc
=
setCodeFromCard
;
u
long
sc
=
setCodeFromCard
;
while
(
sc
!=
0
)
while
(
sc
!=
0
)
{
{
if
((
sc
&
0xfff
)
==
settype
&&
(
sc
&
0xf000
&
setsubtype
)
==
setsubtype
)
if
((
sc
&
0xfff
)
==
settype
&&
(
sc
&
0xf000
&
setsubtype
)
==
setsubtype
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment