Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro2
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
hex
ygopro2
Commits
835e3805
Commit
835e3805
authored
Jun 20, 2025
by
hex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed a typo in mygo server
- Optimized TCPHelper - Fixed card description layout on iOS notch screens
parent
1b3f593e
Pipeline
#37858
failed
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
189 additions
and
127 deletions
+189
-127
Assets/NGUI/mod_2d_ui.prefab
Assets/NGUI/mod_2d_ui.prefab
+1
-1
Assets/NGUI/mod_3d_ui.prefab
Assets/NGUI/mod_3d_ui.prefab
+1
-1
Assets/SibylSystem/CardDescription/CardDescription.cs
Assets/SibylSystem/CardDescription/CardDescription.cs
+10
-1
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
+176
-123
Assets/SibylSystem/selectServer/SelectServer.cs
Assets/SibylSystem/selectServer/SelectServer.cs
+1
-1
No files found.
Assets/NGUI/mod_2d_ui.prefab
View file @
835e3805
...
@@ -93,11 +93,11 @@ Camera:
...
@@ -93,11 +93,11 @@ Camera:
m_TargetEye
:
3
m_TargetEye
:
3
m_HDR
:
0
m_HDR
:
0
m_AllowMSAA
:
1
m_AllowMSAA
:
1
m_AllowDynamicResolution
:
0
m_ForceIntoRT
:
0
m_ForceIntoRT
:
0
m_OcclusionCulling
:
1
m_OcclusionCulling
:
1
m_StereoConvergence
:
10
m_StereoConvergence
:
10
m_StereoSeparation
:
0.022
m_StereoSeparation
:
0.022
m_StereoMirrorMode
:
0
---
!u!54
&5496038
---
!u!54
&5496038
Rigidbody
:
Rigidbody
:
m_ObjectHideFlags
:
1
m_ObjectHideFlags
:
1
...
...
Assets/NGUI/mod_3d_ui.prefab
View file @
835e3805
...
@@ -93,11 +93,11 @@ Camera:
...
@@ -93,11 +93,11 @@ Camera:
m_TargetEye
:
3
m_TargetEye
:
3
m_HDR
:
0
m_HDR
:
0
m_AllowMSAA
:
1
m_AllowMSAA
:
1
m_AllowDynamicResolution
:
0
m_ForceIntoRT
:
0
m_ForceIntoRT
:
0
m_OcclusionCulling
:
1
m_OcclusionCulling
:
1
m_StereoConvergence
:
10
m_StereoConvergence
:
10
m_StereoSeparation
:
0.022
m_StereoSeparation
:
0.022
m_StereoMirrorMode
:
0
---
!u!54
&5484482
---
!u!54
&5484482
Rigidbody
:
Rigidbody
:
m_ObjectHideFlags
:
1
m_ObjectHideFlags
:
1
...
...
Assets/SibylSystem/CardDescription/CardDescription.cs
View file @
835e3805
...
@@ -117,9 +117,18 @@ public class CardDescription : Servant
...
@@ -117,9 +117,18 @@ public class CardDescription : Servant
if
(
gameObject
!=
null
)
if
(
gameObject
!=
null
)
{
{
underSprite
.
height
=
Screen
.
height
+
4
;
underSprite
.
height
=
Screen
.
height
+
4
;
int
offset
=
0
;
// 暴力适配 ios 刘海屏
if
(
Screen
.
safeArea
.
x
>
0
)
{
offset
=
66
;
}
iTween
.
MoveTo
(
iTween
.
MoveTo
(
gameObject
,
gameObject
,
Program
.
camera_main_2d
.
ScreenToWorldPoint
(
new
Vector3
(-
2
,
Screen
.
height
/
2
,
0
)),
Program
.
camera_main_2d
.
ScreenToWorldPoint
(
new
Vector3
(
offset
,
Screen
.
height
/
2
,
0
)
),
1.2f
1.2f
);
);
resizer
.
gameObject
.
GetComponent
<
BoxCollider
>().
enabled
=
true
;
resizer
.
gameObject
.
GetComponent
<
BoxCollider
>().
enabled
=
true
;
...
...
Assets/SibylSystem/MonoHelpers/TcpHelper.cs
View file @
835e3805
...
@@ -40,6 +40,7 @@ public static class TcpHelper
...
@@ -40,6 +40,7 @@ public static class TcpHelper
networkStream
=
tcpClient
.
GetStream
();
networkStream
=
tcpClient
.
GetStream
();
Thread
t
=
new
Thread
(
receiver
);
Thread
t
=
new
Thread
(
receiver
);
t
.
Start
();
t
.
Start
();
StartSendThread
();
CtosMessage_PlayerInfo
(
name
);
CtosMessage_PlayerInfo
(
name
);
if
(
pswString
==
"L"
)
if
(
pswString
==
"L"
)
{
{
...
@@ -88,33 +89,64 @@ public static class TcpHelper
...
@@ -88,33 +89,64 @@ public static class TcpHelper
public
static
void
addDateJumoLine
(
byte
[]
data
)
public
static
void
addDateJumoLine
(
byte
[]
data
)
{
{
Monitor
.
Enter
(
datas
);
lock
(
datasLock
)
try
{
{
datas
.
Add
(
data
);
datas
.
Enqueue
(
data
);
}
}
catch
(
System
.
Exception
e
)
{
UnityEngine
.
Debug
.
Log
(
e
);
}
Monitor
.
Exit
(
datas
);
}
}
public
static
bool
onDisConnected
=
false
;
public
static
bool
onDisConnected
=
false
;
static
List
<
byte
[
]>
datas
=
new
List
<
byte
[
]>
();
static
Queue
<
byte
[
]>
datas
=
new
Queue
<
byte
[
]>
();
static
object
datasLock
=
new
object
();
static
object
locker
=
new
object
();
public
static
void
StartSendThread
()
{
if
(
sendThread
==
null
)
{
sendThreadRunning
=
true
;
sendThread
=
new
Thread
(
SendThreadFunc
);
sendThread
.
IsBackground
=
true
;
sendThread
.
Start
();
}
}
static
void
StopSendThread
()
{
sendThreadRunning
=
false
;
if
(
sendThread
!=
null
)
{
try
{
if
(!
sendThread
.
Join
(
100
))
{
sendThread
.
Abort
();
}
}
catch
{
}
sendThread
=
null
;
}
}
public
static
void
preFrameFunction
()
public
static
void
preFrameFunction
()
{
byte
[][]
packets
=
null
;
lock
(
datasLock
)
{
{
if
(
datas
.
Count
>
0
)
if
(
datas
.
Count
>
0
)
{
{
if
(
Monitor
.
TryEnter
(
datas
))
packets
=
datas
.
ToArray
();
datas
.
Clear
();
}
}
if
(
packets
!=
null
)
{
{
for
(
int
i
=
0
;
i
<
datas
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
packets
.
Length
;
i
++)
{
{
try
try
{
{
MemoryStream
memoryStream
=
new
MemoryStream
(
data
s
[
i
]);
MemoryStream
memoryStream
=
new
MemoryStream
(
packet
s
[
i
]);
BinaryReader
r
=
new
BinaryReader
(
memoryStream
);
BinaryReader
r
=
new
BinaryReader
(
memoryStream
);
var
ms
=
(
StocMessage
)(
r
.
ReadByte
());
var
ms
=
(
StocMessage
)(
r
.
ReadByte
());
switch
(
ms
)
switch
(
ms
)
...
@@ -201,9 +233,6 @@ public static class TcpHelper
...
@@ -201,9 +233,6 @@ public static class TcpHelper
// Program.DEBUGLOG(e);
// Program.DEBUGLOG(e);
}
}
}
}
datas
.
Clear
();
Monitor
.
Exit
(
datas
);
}
}
}
if
(
onDisConnected
==
true
)
if
(
onDisConnected
==
true
)
{
{
...
@@ -227,6 +256,8 @@ public static class TcpHelper
...
@@ -227,6 +256,8 @@ public static class TcpHelper
}
}
tcpClient
=
null
;
tcpClient
=
null
;
StopSendThread
();
if
(
Program
.
I
().
ocgcore
.
isShowed
==
false
)
if
(
Program
.
I
().
ocgcore
.
isShowed
==
false
)
{
{
if
(
Program
.
I
().
menu
.
isShowed
==
false
)
if
(
Program
.
I
().
menu
.
isShowed
==
false
)
...
@@ -257,29 +288,34 @@ public static class TcpHelper
...
@@ -257,29 +288,34 @@ public static class TcpHelper
}
}
}
}
public
static
void
Send
(
Package
message
)
static
Queue
<
Package
>
sendQueue
=
new
Queue
<
Package
>();
static
object
sendLock
=
new
object
();
static
Thread
sendThread
=
null
;
static
bool
sendThreadRunning
=
false
;
static
void
SendThreadFunc
()
{
{
if
(
tcpClient
!=
null
&&
tcpClient
.
Connected
)
while
(
sendThreadRunning
)
{
Package
pkg
=
null
;
lock
(
sendLock
)
{
{
Thread
t
=
new
Thread
(
sender
);
if
(
sendQueue
.
Count
>
0
)
t
.
Start
(
message
);
{
pkg
=
sendQueue
.
Dequeue
();
}
}
}
}
if
(
pkg
!=
null
)
static
object
locker
=
new
object
();
static
void
sender
(
object
o
)
{
{
try
try
{
{
lock
(
locker
)
lock
(
locker
)
{
{
Package
message
=
(
Package
)
o
;
byte
[]
data
=
pkg
.
Data
.
get
();
byte
[]
data
=
message
.
Data
.
get
();
MemoryStream
memstream
=
new
MemoryStream
();
MemoryStream
memstream
=
new
MemoryStream
();
BinaryWriter
b
=
new
BinaryWriter
(
memstream
);
BinaryWriter
b
=
new
BinaryWriter
(
memstream
);
b
.
Write
(
BitConverter
.
GetBytes
((
Int16
)
data
.
Length
+
1
),
0
,
2
);
b
.
Write
(
BitConverter
.
GetBytes
((
Int16
)
data
.
Length
+
1
),
0
,
2
);
b
.
Write
(
BitConverter
.
GetBytes
((
byte
)
message
.
Fuction
),
0
,
1
);
b
.
Write
(
BitConverter
.
GetBytes
((
byte
)
pkg
.
Fuction
),
0
,
1
);
b
.
Write
(
data
,
0
,
data
.
Length
);
b
.
Write
(
data
,
0
,
data
.
Length
);
byte
[]
s
=
memstream
.
ToArray
();
byte
[]
s
=
memstream
.
ToArray
();
tcpClient
.
Client
.
Send
(
s
);
tcpClient
.
Client
.
Send
(
s
);
...
@@ -291,6 +327,23 @@ public static class TcpHelper
...
@@ -291,6 +327,23 @@ public static class TcpHelper
Program
.
DEBUGLOG
(
"onDisConnected 5"
);
Program
.
DEBUGLOG
(
"onDisConnected 5"
);
}
}
}
}
else
{
Thread
.
Sleep
(
2
);
// 避免空转
}
}
}
public
static
void
Send
(
Package
message
)
{
if
(
tcpClient
!=
null
&&
tcpClient
.
Connected
)
{
lock
(
sendLock
)
{
sendQueue
.
Enqueue
(
message
);
}
}
}
public
static
void
CtosMessage_Response
(
byte
[]
response
)
public
static
void
CtosMessage_Response
(
byte
[]
response
)
{
{
...
...
Assets/SibylSystem/selectServer/SelectServer.cs
View file @
835e3805
...
@@ -93,7 +93,7 @@ public class SelectServer : WindowServantSP
...
@@ -93,7 +93,7 @@ public class SelectServer : WindowServantSP
}
}
case
"[OCG]MYGO"
:
case
"[OCG]MYGO"
:
{
{
UIHelper
.
getByName
<
UIInput
>(
gameObject
,
"ip_"
).
value
=
"mygo.sup
re
pre.pro"
;
UIHelper
.
getByName
<
UIInput
>(
gameObject
,
"ip_"
).
value
=
"mygo.sup
er
pre.pro"
;
UIHelper
.
getByName
<
UIInput
>(
gameObject
,
"port_"
).
value
=
"888"
;
UIHelper
.
getByName
<
UIInput
>(
gameObject
,
"port_"
).
value
=
"888"
;
Config
.
Set
(
"serversPicker"
,
"[OCG]MYGO"
);
Config
.
Set
(
"serversPicker"
,
"[OCG]MYGO"
);
...
...
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