Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
wind2009
ygopro
Commits
2ea30047
Commit
2ea30047
authored
Dec 23, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
other fixes on server
parent
8b07a795
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
+12
-10
gframe/game.cpp
gframe/game.cpp
+2
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+5
-5
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+4
-4
ocgcore
ocgcore
+1
-1
No files found.
gframe/game.cpp
View file @
2ea30047
...
...
@@ -31,6 +31,7 @@ namespace ygo {
Game
*
mainGame
;
#ifndef YGOPRO_SERVER_MODE
void
DuelInfo
::
Clear
()
{
isStarted
=
false
;
isFinished
=
false
;
...
...
@@ -62,6 +63,7 @@ void DuelInfo::Clear() {
time_left
[
0
]
=
0
;
time_left
[
1
]
=
0
;
}
#endif
#ifdef YGOPRO_SERVER_MODE
unsigned
short
server_port
;
...
...
gframe/single_duel.cpp
View file @
2ea30047
...
...
@@ -1820,7 +1820,7 @@ void SingleDuel::RequestField(DuelPlayer* dp) {
int
player
=
dp
->
type
;
NetServer
::
SendPacketToPlayer
(
dp
,
STOC_DUEL_START
);
char
startbuf
[
32
],
*
pbuf
=
startbuf
;
unsigned
char
startbuf
[
32
],
*
pbuf
=
startbuf
;
BufferIO
::
WriteInt8
(
pbuf
,
MSG_START
);
BufferIO
::
WriteInt8
(
pbuf
,
player
);
BufferIO
::
WriteInt8
(
pbuf
,
host_info
.
duel_rule
);
...
...
@@ -1836,18 +1836,18 @@ void SingleDuel::RequestField(DuelPlayer* dp) {
if
(
turn_player
==
1
)
newturn_count
=
2
;
for
(
int
i
=
0
;
i
<
newturn_count
;
i
++
)
{
char
turnbuf
[
2
],
*
pbuf_t
=
turnbuf
;
unsigned
char
turnbuf
[
2
],
*
pbuf_t
=
turnbuf
;
BufferIO
::
WriteInt8
(
pbuf_t
,
MSG_NEW_TURN
);
BufferIO
::
WriteInt8
(
pbuf_t
,
i
);
NetServer
::
SendBufferToPlayer
(
dp
,
STOC_GAME_MSG
,
turnbuf
,
2
);
}
char
phasebuf
[
4
],
*
pbuf_p
=
phasebuf
;
unsigned
char
phasebuf
[
4
],
*
pbuf_p
=
phasebuf
;
BufferIO
::
WriteInt8
(
pbuf_p
,
MSG_NEW_PHASE
);
BufferIO
::
WriteInt16
(
pbuf_p
,
phase
);
NetServer
::
SendBufferToPlayer
(
dp
,
STOC_GAME_MSG
,
phasebuf
,
3
);
char
query_buffer
[
1024
];
unsigned
char
query_buffer
[
1024
];
int
length
=
query_field_info
(
pduel
,
(
unsigned
char
*
)
query_buffer
);
NetServer
::
SendBufferToPlayer
(
dp
,
STOC_GAME_MSG
,
query_buffer
,
length
);
RefreshMzone
(
1
-
player
,
0xefffff
,
0
,
dp
);
...
...
@@ -2095,7 +2095,7 @@ if(!dp || dp == players[player])
qbuf
+=
clen
-
4
;
}
if
(
!
dp
||
dp
==
players
[
1
-
player
])
NetServer
::
SendBufferToPlayer
(
players
[
1
-
player
],
STOC_GAME_MSG
,
query_buffer
,
len
+
3
);
NetServer
::
SendBufferToPlayer
(
players
[
1
-
player
],
STOC_GAME_MSG
,
query_buffer
.
data
()
,
len
+
3
);
if
(
!
dp
)
for
(
auto
pit
=
observers
.
begin
();
pit
!=
observers
.
end
();
++
pit
)
NetServer
::
ReSendToPlayer
(
*
pit
);
...
...
gframe/tag_duel.cpp
View file @
2ea30047
...
...
@@ -1912,7 +1912,7 @@ void TagDuel::RequestField(DuelPlayer* dp) {
int
player
=
(
dp
->
type
>
1
)
?
1
:
0
;
NetServer
::
SendPacketToPlayer
(
dp
,
STOC_DUEL_START
);
char
startbuf
[
32
],
*
pbuf
=
startbuf
;
unsigned
char
startbuf
[
32
],
*
pbuf
=
startbuf
;
BufferIO
::
WriteInt8
(
pbuf
,
MSG_START
);
BufferIO
::
WriteInt8
(
pbuf
,
player
);
BufferIO
::
WriteInt8
(
pbuf
,
host_info
.
duel_rule
);
...
...
@@ -1928,18 +1928,18 @@ void TagDuel::RequestField(DuelPlayer* dp) {
if
(
newturn_count
==
0
)
newturn_count
=
4
;
for
(
int
i
=
0
;
i
<
newturn_count
;
i
++
)
{
char
turnbuf
[
2
],
*
pbuf_t
=
turnbuf
;
unsigned
char
turnbuf
[
2
],
*
pbuf_t
=
turnbuf
;
BufferIO
::
WriteInt8
(
pbuf_t
,
MSG_NEW_TURN
);
BufferIO
::
WriteInt8
(
pbuf_t
,
i
%
2
);
NetServer
::
SendBufferToPlayer
(
dp
,
STOC_GAME_MSG
,
turnbuf
,
2
);
}
char
phasebuf
[
4
],
*
pbuf_p
=
phasebuf
;
unsigned
char
phasebuf
[
4
],
*
pbuf_p
=
phasebuf
;
BufferIO
::
WriteInt8
(
pbuf_p
,
MSG_NEW_PHASE
);
BufferIO
::
WriteInt16
(
pbuf_p
,
phase
);
NetServer
::
SendBufferToPlayer
(
dp
,
STOC_GAME_MSG
,
phasebuf
,
3
);
char
query_buffer
[
1024
];
unsigned
char
query_buffer
[
1024
];
int
length
=
query_field_info
(
pduel
,
(
unsigned
char
*
)
query_buffer
);
NetServer
::
SendBufferToPlayer
(
dp
,
STOC_GAME_MSG
,
query_buffer
,
length
);
RefreshMzone
(
1
-
player
,
0xefffff
,
0
,
dp
);
...
...
ocgcore
@
8a44abb6
Subproject commit
31785ae6e80d89f31290d0e2411225b44de6b785
Subproject commit
8a44abb6810a30a7aed0d2fd3d845c718f06e214
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