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
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
ygopro
Commits
63ad4fbc
Commit
63ad4fbc
authored
Aug 18, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into server-develop
parents
f56aea7a
12259071
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
15 deletions
+15
-15
gframe/config.h
gframe/config.h
+2
-2
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-2
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+1
-1
gframe/netserver.cpp
gframe/netserver.cpp
+2
-2
gframe/single_duel.cpp
gframe/single_duel.cpp
+4
-4
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+3
-3
No files found.
gframe/config.h
View file @
63ad4fbc
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
#define mystrncasecmp strncasecmp
#define mystrncasecmp strncasecmp
#endif
#endif
#include <
string
>
#include <
wchar.h
>
template
<
size_t
N
,
typename
...
TR
>
template
<
size_t
N
,
typename
...
TR
>
inline
int
myswprintf
(
wchar_t
(
&
buf
)[
N
],
const
wchar_t
*
fmt
,
TR
...
args
)
{
inline
int
myswprintf
(
wchar_t
(
&
buf
)[
N
],
const
wchar_t
*
fmt
,
TR
...
args
)
{
return
swprintf
(
buf
,
N
,
fmt
,
args
...);
return
swprintf
(
buf
,
N
,
fmt
,
args
...);
...
@@ -51,9 +51,9 @@ inline int myswprintf(wchar_t(&buf)[N], const wchar_t* fmt, TR... args) {
...
@@ -51,9 +51,9 @@ inline int myswprintf(wchar_t(&buf)[N], const wchar_t* fmt, TR... args) {
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <wchar.h>
#include <iostream>
#include <iostream>
#include <algorithm>
#include <algorithm>
#include <string>
#include "bufferio.h"
#include "bufferio.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/ocgapi.h"
#include "../ocgcore/common.h"
#include "../ocgcore/common.h"
...
...
gframe/deck_manager.cpp
View file @
63ad4fbc
...
@@ -314,7 +314,7 @@ bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) {
...
@@ -314,7 +314,7 @@ bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) {
reader
->
drop
();
reader
->
drop
();
return
false
;
return
false
;
}
}
memset
(
deckBuffer
,
0
,
sizeof
(
deckBuffer
)
);
std
::
memset
(
deckBuffer
,
0
,
sizeof
deckBuffer
);
reader
->
read
(
deckBuffer
,
size
);
reader
->
read
(
deckBuffer
,
size
);
reader
->
drop
();
reader
->
drop
();
std
::
istringstream
deckStream
(
deckBuffer
);
std
::
istringstream
deckStream
(
deckBuffer
);
...
...
gframe/duelclient.cpp
View file @
63ad4fbc
...
@@ -44,7 +44,7 @@ bool DuelClient::StartClient(unsigned int ip, unsigned short port, bool create_g
...
@@ -44,7 +44,7 @@ bool DuelClient::StartClient(unsigned int ip, unsigned short port, bool create_g
client_base
=
event_base_new
();
client_base
=
event_base_new
();
if
(
!
client_base
)
if
(
!
client_base
)
return
false
;
return
false
;
memset
(
&
sin
,
0
,
sizeof
(
sin
)
);
std
::
memset
(
&
sin
,
0
,
sizeof
sin
);
sin
.
sin_family
=
AF_INET
;
sin
.
sin_family
=
AF_INET
;
sin
.
sin_addr
.
s_addr
=
htonl
(
ip
);
sin
.
sin_addr
.
s_addr
=
htonl
(
ip
);
sin
.
sin_port
=
htons
(
port
);
sin
.
sin_port
=
htons
(
port
);
...
@@ -4062,7 +4062,7 @@ void DuelClient::BeginRefreshHost() {
...
@@ -4062,7 +4062,7 @@ void DuelClient::BeginRefreshHost() {
return
;
return
;
SOCKET
reply
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
);
SOCKET
reply
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
);
sockaddr_in
reply_addr
;
sockaddr_in
reply_addr
;
memset
(
&
reply_addr
,
0
,
sizeof
(
reply_addr
)
);
std
::
memset
(
&
reply_addr
,
0
,
sizeof
reply_addr
);
reply_addr
.
sin_family
=
AF_INET
;
reply_addr
.
sin_family
=
AF_INET
;
reply_addr
.
sin_port
=
htons
(
7921
);
reply_addr
.
sin_port
=
htons
(
7921
);
reply_addr
.
sin_addr
.
s_addr
=
0
;
reply_addr
.
sin_addr
.
s_addr
=
0
;
...
...
gframe/menu_handler.cpp
View file @
63ad4fbc
...
@@ -78,7 +78,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -78,7 +78,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
BufferIO
::
CopyWStr
(
mainGame
->
ebJoinPort
->
getText
(),
port
,
6
);
BufferIO
::
CopyWStr
(
mainGame
->
ebJoinPort
->
getText
(),
port
,
6
);
struct
evutil_addrinfo
hints
;
struct
evutil_addrinfo
hints
;
struct
evutil_addrinfo
*
answer
=
NULL
;
struct
evutil_addrinfo
*
answer
=
NULL
;
memset
(
&
hints
,
0
,
sizeof
(
hints
)
);
std
::
memset
(
&
hints
,
0
,
sizeof
hints
);
hints
.
ai_family
=
AF_INET
;
hints
.
ai_family
=
AF_INET
;
hints
.
ai_socktype
=
SOCK_STREAM
;
hints
.
ai_socktype
=
SOCK_STREAM
;
hints
.
ai_protocol
=
IPPROTO_TCP
;
hints
.
ai_protocol
=
IPPROTO_TCP
;
...
...
gframe/netserver.cpp
View file @
63ad4fbc
...
@@ -86,7 +86,7 @@ bool NetServer::StartServer(unsigned short port) {
...
@@ -86,7 +86,7 @@ bool NetServer::StartServer(unsigned short port) {
if
(
!
net_evbase
)
if
(
!
net_evbase
)
return
false
;
return
false
;
sockaddr_in
sin
;
sockaddr_in
sin
;
memset
(
&
sin
,
0
,
sizeof
(
sin
)
);
std
::
memset
(
&
sin
,
0
,
sizeof
sin
);
server_port
=
port
;
server_port
=
port
;
sin
.
sin_family
=
AF_INET
;
sin
.
sin_family
=
AF_INET
;
#ifdef SERVER_PRO2_SUPPORT
#ifdef SERVER_PRO2_SUPPORT
...
@@ -122,7 +122,7 @@ bool NetServer::StartBroadcast() {
...
@@ -122,7 +122,7 @@ bool NetServer::StartBroadcast() {
setsockopt
(
udp
,
SOL_SOCKET
,
SO_BROADCAST
,
(
const
char
*
)
&
opt
,
sizeof
opt
);
setsockopt
(
udp
,
SOL_SOCKET
,
SO_BROADCAST
,
(
const
char
*
)
&
opt
,
sizeof
opt
);
setsockopt
(
udp
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
const
char
*
)
&
opt
,
sizeof
opt
);
setsockopt
(
udp
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
const
char
*
)
&
opt
,
sizeof
opt
);
sockaddr_in
addr
;
sockaddr_in
addr
;
memset
(
&
addr
,
0
,
sizeof
(
addr
)
);
std
::
memset
(
&
addr
,
0
,
sizeof
addr
);
addr
.
sin_family
=
AF_INET
;
addr
.
sin_family
=
AF_INET
;
addr
.
sin_port
=
htons
(
7920
);
addr
.
sin_port
=
htons
(
7920
);
addr
.
sin_addr
.
s_addr
=
0
;
addr
.
sin_addr
.
s_addr
=
0
;
...
...
gframe/single_duel.cpp
View file @
63ad4fbc
...
@@ -1965,7 +1965,7 @@ if(!dp || dp == players[player])
...
@@ -1965,7 +1965,7 @@ if(!dp || dp == players[player])
continue
;
continue
;
auto
position
=
GetPosition
(
qbuf
,
8
);
auto
position
=
GetPosition
(
qbuf
,
8
);
if
(
position
&
POS_FACEDOWN
)
if
(
position
&
POS_FACEDOWN
)
memset
(
qbuf
,
0
,
clen
-
4
);
std
::
memset
(
qbuf
,
0
,
clen
-
4
);
qbuf
+=
clen
-
4
;
qbuf
+=
clen
-
4
;
}
}
#ifdef YGOPRO_SERVER_MODE
#ifdef YGOPRO_SERVER_MODE
...
@@ -2008,7 +2008,7 @@ if(!dp || dp == players[player])
...
@@ -2008,7 +2008,7 @@ if(!dp || dp == players[player])
continue
;
continue
;
auto
position
=
GetPosition
(
qbuf
,
8
);
auto
position
=
GetPosition
(
qbuf
,
8
);
if
(
position
&
POS_FACEDOWN
)
if
(
position
&
POS_FACEDOWN
)
memset
(
qbuf
,
0
,
clen
-
4
);
std
::
memset
(
qbuf
,
0
,
clen
-
4
);
qbuf
+=
clen
-
4
;
qbuf
+=
clen
-
4
;
}
}
#ifdef YGOPRO_SERVER_MODE
#ifdef YGOPRO_SERVER_MODE
...
@@ -2051,7 +2051,7 @@ if(!dp || dp == players[player])
...
@@ -2051,7 +2051,7 @@ if(!dp || dp == players[player])
continue
;
continue
;
auto
position
=
GetPosition
(
qbuf
,
8
);
auto
position
=
GetPosition
(
qbuf
,
8
);
if
(
!
(
position
&
POS_FACEUP
))
if
(
!
(
position
&
POS_FACEUP
))
memset
(
qbuf
,
0
,
slen
-
4
);
std
::
memset
(
qbuf
,
0
,
slen
-
4
);
qbuf
+=
slen
-
4
;
qbuf
+=
slen
-
4
;
}
}
#ifdef YGOPRO_SERVER_MODE
#ifdef YGOPRO_SERVER_MODE
...
@@ -2180,7 +2180,7 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
...
@@ -2180,7 +2180,7 @@ void SingleDuel::RefreshSingle(int player, int location, int sequence, int flag)
if
(
position
&
POS_FACEDOWN
)
{
if
(
position
&
POS_FACEDOWN
)
{
BufferIO
::
WriteInt32
(
qbuf
,
QUERY_CODE
);
BufferIO
::
WriteInt32
(
qbuf
,
QUERY_CODE
);
BufferIO
::
WriteInt32
(
qbuf
,
0
);
BufferIO
::
WriteInt32
(
qbuf
,
0
);
memset
(
qbuf
,
0
,
clen
-
12
);
std
::
memset
(
qbuf
,
0
,
clen
-
12
);
}
}
NetServer
::
SendBufferToPlayer
(
players
[
1
-
player
],
STOC_GAME_MSG
,
query_buffer
,
len
+
4
);
NetServer
::
SendBufferToPlayer
(
players
[
1
-
player
],
STOC_GAME_MSG
,
query_buffer
,
len
+
4
);
for
(
auto
pit
=
observers
.
begin
();
pit
!=
observers
.
end
();
++
pit
)
for
(
auto
pit
=
observers
.
begin
();
pit
!=
observers
.
end
();
++
pit
)
...
...
gframe/tag_duel.cpp
View file @
63ad4fbc
...
@@ -2080,7 +2080,7 @@ if(!dp || dp == players[pid])
...
@@ -2080,7 +2080,7 @@ if(!dp || dp == players[pid])
continue
;
continue
;
auto
position
=
GetPosition
(
qbuf
,
8
);
auto
position
=
GetPosition
(
qbuf
,
8
);
if
(
position
&
POS_FACEDOWN
)
if
(
position
&
POS_FACEDOWN
)
memset
(
qbuf
,
0
,
clen
-
4
);
std
::
memset
(
qbuf
,
0
,
clen
-
4
);
qbuf
+=
clen
-
4
;
qbuf
+=
clen
-
4
;
}
}
pid
=
2
-
pid
;
pid
=
2
-
pid
;
...
@@ -2133,7 +2133,7 @@ if(!dp || dp == players[pid])
...
@@ -2133,7 +2133,7 @@ if(!dp || dp == players[pid])
continue
;
continue
;
auto
position
=
GetPosition
(
qbuf
,
8
);
auto
position
=
GetPosition
(
qbuf
,
8
);
if
(
position
&
POS_FACEDOWN
)
if
(
position
&
POS_FACEDOWN
)
memset
(
qbuf
,
0
,
clen
-
4
);
std
::
memset
(
qbuf
,
0
,
clen
-
4
);
qbuf
+=
clen
-
4
;
qbuf
+=
clen
-
4
;
}
}
pid
=
2
-
pid
;
pid
=
2
-
pid
;
...
@@ -2181,7 +2181,7 @@ if(!dp || dp == cur_player[player])
...
@@ -2181,7 +2181,7 @@ if(!dp || dp == cur_player[player])
continue
;
continue
;
auto
position
=
GetPosition
(
qbuf
,
8
);
auto
position
=
GetPosition
(
qbuf
,
8
);
if
(
!
(
position
&
POS_FACEUP
))
if
(
!
(
position
&
POS_FACEUP
))
memset
(
qbuf
,
0
,
slen
-
4
);
std
::
memset
(
qbuf
,
0
,
slen
-
4
);
qbuf
+=
slen
-
4
;
qbuf
+=
slen
-
4
;
}
}
for
(
int
i
=
0
;
i
<
4
;
++
i
)
for
(
int
i
=
0
;
i
<
4
;
++
i
)
...
...
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