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
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
perfectdicky
YGOProUnity_V2
Commits
465e6d94
Commit
465e6d94
authored
Jun 06, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multi replay
parent
3f8943fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
20 deletions
+30
-20
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
+8
-2
Assets/SibylSystem/Ocgcore/Ocgcore.cs
Assets/SibylSystem/Ocgcore/Ocgcore.cs
+1
-0
Assets/SibylSystem/selectReplay/selectReplay.cs
Assets/SibylSystem/selectReplay/selectReplay.cs
+21
-18
No files found.
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
View file @
465e6d94
...
...
@@ -200,10 +200,12 @@ public static class TcpHelper
Program
.
I
().
shiftToServant
(
Program
.
I
().
selectServer
);
}
Program
.
I
().
cardDescription
.
RMSshow_none
(
InterString
.
Get
(
"连接被断开。"
));
packagesInRecord
.
Clear
();
}
else
{
Program
.
I
().
cardDescription
.
RMSshow_none
(
InterString
.
Get
(
"对方离开游戏,您现在可以截图。"
));
packagesInRecord
.
Clear
();
Program
.
I
().
ocgcore
.
forceMSquit
();
}
...
...
@@ -402,7 +404,7 @@ public static class TcpHelper
Send
(
message
);
}
static
List
<
Package
>
packagesInRecord
=
new
List
<
Package
>();
public
static
List
<
Package
>
packagesInRecord
=
new
List
<
Package
>();
public
static
List
<
Package
>
readPackagesInRecord
(
string
path
)
{
...
...
@@ -482,6 +484,10 @@ public static class TcpHelper
startI
=
packagesInRecord
.
Count
;
}
packagesInRecord
.
Insert
(
startI
,
Program
.
I
().
ocgcore
.
getNamePacket
());
if
(
File
.
Exists
(
"replay/"
+
lastRecordName
+
".yrp3d"
))
{
File
.
Delete
(
"replay/"
+
lastRecordName
+
".yrp3d"
);
}
lastRecordName
=
UIHelper
.
getTimeString
();
FileStream
stream
=
File
.
Create
(
"replay/"
+
lastRecordName
+
".yrp3d"
);
BinaryWriter
writer
=
new
BinaryWriter
(
stream
);
...
...
@@ -496,7 +502,7 @@ public static class TcpHelper
stream
.
Close
();
}
}
packagesInRecord
.
Clear
();
//
packagesInRecord.Clear();
}
catch
(
System
.
Exception
e
)
{
...
...
Assets/SibylSystem/Ocgcore/Ocgcore.cs
View file @
465e6d94
...
...
@@ -2703,6 +2703,7 @@ public class Ocgcore : ServantWithCardDescription
}
File
.
Move
(
"replay/"
+
TcpHelper
.
lastRecordName
+
".yrp3d"
,
"replay/"
+
winCaculator
.
input
.
value
+
".yrp3d"
);
}
TcpHelper
.
lastRecordName
=
""
;
}
catch
(
Exception
e
)
{
...
...
Assets/SibylSystem/selectReplay/selectReplay.cs
View file @
465e6d94
...
...
@@ -128,13 +128,13 @@ public class selectReplay : WindowServantSP
new
messageSystemValue
{
hint
=
"no"
,
value
=
"no"
});
}
byte
[]
getYRPbuffer
(
string
path
)
List
<
byte
[
]>
getYRPbuffer
(
string
path
)
{
if
(
path
.
Substring
(
path
.
Length
-
4
,
4
)
==
".yrp"
)
{
return
File
.
ReadAllBytes
(
path
)
;
return
new
List
<
byte
[
]>
{
File
.
ReadAllBytes
(
path
)
}
;
}
byte
[]
returnValue
=
null
;
var
returnValue
=
new
List
<
byte
[
]>
()
;
try
{
var
collection
=
TcpHelper
.
readPackagesInRecord
(
path
);
...
...
@@ -142,23 +142,16 @@ public class selectReplay : WindowServantSP
{
if
(
item
.
Fuction
==
(
int
)
YGOSharp
.
OCGWrapper
.
Enums
.
GameMessage
.
sibyl_replay
)
{
returnValue
=
item
.
Data
.
reader
.
ReadToEnd
();
break
;
byte
[]
replay
=
item
.
Data
.
reader
.
ReadToEnd
();
// TODO: don't include other replays
returnValue
.
Add
(
replay
);
}
}
}
catch
(
Exception
e
)
{
Debug
.
Log
(
e
);
}
if
(
returnValue
!=
null
)
{
if
(
returnValue
.
Length
<
50
)
{
returnValue
=
null
;
}
}
return
returnValue
;
}
...
...
@@ -266,7 +259,7 @@ public class selectReplay : WindowServantSP
}
else
{
yrp
=
getYRP
(
getYRPbuffer
(
"replay/"
+
superScrollView
.
selectedString
+
".yrp3d"
));
yrp
=
getYRP
(
getYRPbuffer
(
"replay/"
+
superScrollView
.
selectedString
+
".yrp3d"
)
[
0
]
);
}
for
(
int
i
=
0
;
i
<
yrp
.
playerData
.
Count
;
i
++)
{
...
...
@@ -287,11 +280,13 @@ public class selectReplay : WindowServantSP
if
(
yrp
.
playerData
.
Count
==
0
)
{
RMSshow_none
(
InterString
.
Get
(
"录像没有录制完整。"
));
RMSshow_none
(
InterString
.
Get
(
"MATCH局中可能只有最后一局决斗才包含卡组信息。"
));
}
}
catch
(
Exception
)
{
RMSshow_none
(
InterString
.
Get
(
"录像没有录制完整。"
));
RMSshow_none
(
InterString
.
Get
(
"MATCH局中可能只有最后一局决斗才包含卡组信息。"
));
}
}
...
...
@@ -305,18 +300,24 @@ public class selectReplay : WindowServantSP
{
if
(
File
.
Exists
(
"replay/"
+
superScrollView
.
selectedString
+
".yrp3d"
))
{
File
.
WriteAllBytes
(
"replay/"
+
superScrollView
.
selectedString
+
".yrp"
,
getYRPbuffer
(
"replay/"
+
superScrollView
.
selectedString
+
".yrp3d"
));
RMSshow_none
(
InterString
.
Get
(
"录像入库:[?]"
,
"replay/"
+
superScrollView
.
selectedString
+
".yrp"
));
var
replays
=
getYRPbuffer
(
"replay/"
+
superScrollView
.
selectedString
+
".yrp3d"
);
for
(
int
i
=
1
;
i
<=
replays
.
Count
;
i
++)
{
string
filename
=
"replay/"
+
superScrollView
.
selectedString
+
"-Game"
+
i
+
".yrp"
;
File
.
WriteAllBytes
(
filename
,
replays
[
i
-
1
]);
RMSshow_none
(
InterString
.
Get
(
"录像入库:[?]"
,
filename
));
}
printFile
();
}
else
{
RMSshow_none
(
InterString
.
Get
(
"录像没有录制完整。"
));
RMSshow_none
(
InterString
.
Get
(
"MATCH局中可能只有最后一局决斗才包含旧版录像信息。"
));
}
}
catch
(
Exception
)
{
RMSshow_none
(
InterString
.
Get
(
"录像没有录制完整。"
));
RMSshow_none
(
InterString
.
Get
(
"MATCH局中可能只有最后一局决斗才包含旧版录像信息。"
));
}
}
...
...
@@ -375,7 +376,7 @@ public class selectReplay : WindowServantSP
FileInfo
[]
fileInfos
=
(
new
DirectoryInfo
(
"replay"
)).
GetFiles
();
for
(
int
i
=
0
;
i
<
fileInfos
.
Length
;
i
++)
{
if
(
fileInfos
[
i
].
Name
.
Length
==
21
)
if
(
fileInfos
[
i
].
Name
.
Length
==
21
||
fileInfos
[
i
].
Name
.
Length
==
25
)
{
if
(
fileInfos
[
i
].
Name
[
2
]
==
'-'
)
{
...
...
@@ -429,7 +430,8 @@ public class selectReplay : WindowServantSP
if
(
precy
!=
null
)
precy
.
dispose
();
precy
=
new
PrecyOcg
();
var
collections
=
TcpHelper
.
getPackages
(
precy
.
ygopro
.
getYRP3dBuffer
(
getYRP
(
getYRPbuffer
(
"replay/"
+
name
+
".yrp3d"
))));
var
replays
=
getYRPbuffer
(
"replay/"
+
name
+
".yrp3d"
);
var
collections
=
TcpHelper
.
getPackages
(
precy
.
ygopro
.
getYRP3dBuffer
(
getYRP
(
replays
[
replays
.
Count
-
1
])));
pushCollection
(
collections
);
}
else
...
...
@@ -457,6 +459,7 @@ public class selectReplay : WindowServantSP
catch
(
Exception
)
{
RMSshow_none
(
InterString
.
Get
(
"录像没有录制完整。"
));
RMSshow_none
(
InterString
.
Get
(
"MATCH局中可能只有最后一局决斗才包含旧版录像信息。"
));
}
}
...
...
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