Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
MDPro3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
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
Dark_Zane
MDPro3
Commits
39e677ff
Commit
39e677ff
authored
Jun 07, 2024
by
SherryChaos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ocgcore interface
parent
76000034
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
Assets/Scripts/MDPro3/Duel/CoreWrapper.cs
Assets/Scripts/MDPro3/Duel/CoreWrapper.cs
+5
-7
No files found.
Assets/Scripts/MDPro3/Duel/CoreWrapper.cs
View file @
39e677ff
...
...
@@ -260,7 +260,7 @@ namespace Percy
private
static
Ygopro
.
CardHandler
card_handler
;
private
static
Ygopro
.
ScriptHandler
script_handler
;
private
static
Ygopro
.
ChatHandler
chat_handler
;
private
static
readonly
IntPtr
_buffer_2
=
Marshal
.
AllocHGlobal
(
65536
)
;
private
static
readonly
byte
[]
_buffer_2
=
new
byte
[
256
]
;
[
UnmanagedFunctionPointer
(
CallingConvention
.
Cdecl
)]
private
delegate
IntPtr
ScriptReader
(
string
scriptName
,
int
*
len
);
...
...
@@ -298,7 +298,8 @@ namespace Percy
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
public
static
extern
int
get_message
(
IntPtr
pduel
,
IntPtr
buf
);
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
public
static
extern
void
get_log_message
(
IntPtr
pduel
,
IntPtr
buf
);
//public static extern void get_log_message(IntPtr pduel, IntPtr buf);
public
static
extern
void
get_log_message
(
IntPtr
pduel
,
byte
[]
buf
);
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
public
static
extern
void
set_responseb
(
IntPtr
pduel
,
IntPtr
buf
);
[
DllImport
(
"ocgcore"
,
CharSet
=
CharSet
.
Unicode
,
CallingConvention
=
CallingConvention
.
Cdecl
)]
...
...
@@ -343,15 +344,12 @@ namespace Percy
*
pData
=
card_handler
(
code
);
return
code
;
}
[
MonoPInvokeCallback
]
private
static
uint
OnMessageHandler
(
IntPtr
pDuel
,
uint
messageType
)
{
var
arr
=
new
byte
[
256
];
get_log_message
(
pDuel
,
_buffer_2
);
Marshal
.
Copy
(
_buffer_2
,
arr
,
0
,
256
);
var
message
=
Encoding
.
UTF8
.
GetString
(
arr
);
if
(
message
.
Contains
(
"\0"
))
message
=
message
.
Substring
(
0
,
message
.
IndexOf
(
'\0'
));
var
message
=
Encoding
.
UTF8
.
GetString
(
_buffer_2
).
TrimEnd
(
'\0'
);
chat_handler
(
message
);
return
0
;
}
...
...
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