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
1
Merge Requests
1
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
987cd120
Commit
987cd120
authored
Jun 26, 2025
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocgcore API changements
parent
f21817f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
31 deletions
+22
-31
Assets/SibylSystem/coreWrapper.cs
Assets/SibylSystem/coreWrapper.cs
+10
-19
Assets/SibylSystem/selectReplay/selectReplay.cs
Assets/SibylSystem/selectReplay/selectReplay.cs
+12
-12
No files found.
Assets/SibylSystem/coreWrapper.cs
View file @
987cd120
...
...
@@ -297,7 +297,10 @@ namespace Percy
public
static
extern
IntPtr
create_duel
(
uint
seed
);
[
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
)]
public
static
extern
int
get_ai_going_first_second
(
IntPtr
pduel
,
IntPtr
deckname
);
...
...
@@ -351,7 +354,7 @@ namespace Percy
public
static
extern
int
query_field_info
(
IntPtr
pduel
,
IntPtr
buf
);
[
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
)]
private
delegate
IntPtr
ScriptReader
(
string
scriptName
,
int
*
len
);
...
...
@@ -1114,14 +1117,8 @@ namespace Percy
isFirst
=
true
;
dll
.
set_player_info
(
duel
,
0
,
8000
,
5
,
1
);
dll
.
set_player_info
(
duel
,
1
,
8000
,
5
,
1
);
var
reult
=
0
;
for
(
var
i
=
0
;
i
<
10
;
i
++)
{
reult
=
dll
.
preload_script
(
duel
,
getPtrString
(
path
),
0
);
if
(
reult
>
0
)
break
;
}
dll
.
preload_script
(
duel
,
getPtrString
(
path
));
if
(
reult
==
0
)
return
false
;
dll
.
start_duel
(
duel
,
0
);
Refresh
();
new
Thread
(
Process
).
Start
();
...
...
@@ -1135,18 +1132,12 @@ namespace Percy
isFirst
=
playerGoFirst
;
dll
.
set_player_info
(
duel
,
0
,
life
,
5
,
1
);
dll
.
set_player_info
(
duel
,
1
,
life
,
5
,
1
);
var
reult
=
0
;
for
(
var
i
=
0
;
i
<
10
;
i
++)
{
reult
=
dll
.
preload_script
(
duel
,
getPtrString
(
aiScript
),
0
);
if
(
reult
>
0
)
break
;
}
dll
.
preload_script
(
duel
,
getPtrString
(
aiScript
));
if
(
reult
==
0
)
return
false
;
addDeck
(
playerDek
,
playerGoFirst
?
0
:
1
,
!
unrand
);
addDeck
(
aiDeck
,
playerGoFirst
?
1
:
0
,
true
);
dll
.
set_ai_id
(
duel
,
playerGoFirst
?
1
:
0
);
var
opt
=
0
;
UInt32
opt
=
0
;
opt
|=
0x80
;
if
(
unrand
)
opt
|=
0x10
;
var
master
=
new
BinaryMaster
();
...
...
@@ -1159,7 +1150,7 @@ namespace Percy
master
.
writer
.
Write
((
ushort
)
dll
.
query_field_count
(
duel
,
1
,
0x1
));
master
.
writer
.
Write
((
ushort
)
dll
.
query_field_count
(
duel
,
1
,
0x40
));
sendToPlayer
(
master
.
get
());
dll
.
start_duel
(
duel
,
opt
|
(
mr
<<
16
));
dll
.
start_duel
(
duel
,
opt
|
(
UInt32
)(
mr
<<
16
));
Refresh
();
new
Thread
(
Process
).
Start
();
return
true
;
...
...
@@ -1401,7 +1392,7 @@ namespace Percy
public
List
<
byte
[
]>
gameData
=
new
List
<
byte
[
]>
();
public
int
Hash
=
0
;
public
int
ID
=
0
;
public
int
opt
=
0
;
public
u
int
opt
=
0
;
public
List
<
PlayerData
>
playerData
=
new
List
<
PlayerData
>();
public
byte
[]
Props
=
new
byte
[
8
];
public
uint
Seed
=
0
;
...
...
Assets/SibylSystem/selectReplay/selectReplay.cs
View file @
987cd120
...
...
@@ -164,8 +164,8 @@ public class selectReplay : WindowServantSP
returnValue
.
StartLp
=
reader
.
ReadInt32
();
returnValue
.
StartHand
=
reader
.
ReadInt32
();
returnValue
.
DrawCount
=
reader
.
ReadInt32
();
returnValue
.
opt
=
reader
.
ReadInt32
();
Program
.
I
().
ocgcore
.
MasterRule
=
returnValue
.
opt
>>
16
;
returnValue
.
opt
=
reader
.
Read
U
Int32
();
Program
.
I
().
ocgcore
.
MasterRule
=
(
int
)(
returnValue
.
opt
>>
16
)
;
for
(
var
i
=
0
;
i
<
4
;
i
++)
{
var
count
=
reader
.
ReadInt32
();
...
...
@@ -183,8 +183,8 @@ public class selectReplay : WindowServantSP
returnValue
.
StartLp
=
reader
.
ReadInt32
();
returnValue
.
StartHand
=
reader
.
ReadInt32
();
returnValue
.
DrawCount
=
reader
.
ReadInt32
();
returnValue
.
opt
=
reader
.
ReadInt32
();
Program
.
I
().
ocgcore
.
MasterRule
=
returnValue
.
opt
>>
16
;
returnValue
.
opt
=
reader
.
Read
U
Int32
();
Program
.
I
().
ocgcore
.
MasterRule
=
(
int
)(
returnValue
.
opt
>>
16
)
;
for
(
var
i
=
0
;
i
<
2
;
i
++)
{
var
count
=
reader
.
ReadInt32
();
...
...
@@ -342,14 +342,14 @@ public class selectReplay : WindowServantSP
public
void
KF_replay
(
string
name
,
bool
god
=
false
)
{
string
filename
=
name
;
if
(!
File
.
Exists
(
filename
))
{
if
(
File
.
Exists
(
"replay/"
+
name
+
".yrp3d"
))
filename
=
"replay/"
+
name
+
".yrp3d"
;
if
(
name
.
Length
>
4
&&
name
.
ToLower
().
Substring
(
name
.
Length
-
4
,
4
)
==
".yrp"
)
filename
=
"replay/"
+
name
;
if
(!
File
.
Exists
(
filename
))
return
;
if
(!
File
.
Exists
(
filename
))
{
if
(
File
.
Exists
(
"replay/"
+
name
+
".yrp3d"
))
filename
=
"replay/"
+
name
+
".yrp3d"
;
if
(
name
.
Length
>
4
&&
name
.
ToLower
().
Substring
(
name
.
Length
-
4
,
4
)
==
".yrp"
)
filename
=
"replay/"
+
name
;
if
(!
File
.
Exists
(
filename
))
return
;
}
bool
yrp3d
=
filename
.
Length
>
6
&&
filename
.
ToLower
().
Substring
(
filename
.
Length
-
6
,
6
)
==
".yrp3d"
;
try
...
...
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