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
YGOPRO-520DIY
ygopro
Commits
7e584bb9
Commit
7e584bb9
authored
Jun 08, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add CTOS_HOSTNAME
parent
7ff76322
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+5
-0
gframe/netserver.cpp
gframe/netserver.cpp
+4
-0
gframe/network.h
gframe/network.h
+8
-0
No files found.
gframe/duelclient.cpp
View file @
7e584bb9
...
...
@@ -117,6 +117,11 @@ void DuelClient::ClientRead(bufferevent* bev, void* ctx) {
void
DuelClient
::
ClientEvent
(
bufferevent
*
bev
,
short
events
,
void
*
ctx
)
{
if
(
events
&
BEV_EVENT_CONNECTED
)
{
bool
create_game
=
(
intptr_t
)
ctx
;
if
(
!
create_game
)
{
uint16_t
msgbuf
[
LEN_HOSTNAME
];
int
len
=
BufferIO
::
CopyCharArray
(
mainGame
->
ebJoinHost
->
getText
(),
msgbuf
);
DuelClient
::
SendBufferToServer
(
CTOS_HOSTNAME
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
uint16_t
));
}
CTOS_PlayerInfo
cspi
;
BufferIO
::
CopyCharArray
(
mainGame
->
ebNickName
->
getText
(),
cspi
.
name
);
SendPacketToServer
(
CTOS_PLAYER_INFO
,
cspi
);
...
...
gframe/netserver.cpp
View file @
7e584bb9
...
...
@@ -253,6 +253,10 @@ void NetServer::HandleCTOSPacket(DuelPlayer* dp, unsigned char* data, int len) {
BufferIO
::
CopyCharArray
(
pkt
->
name
,
dp
->
name
);
break
;
}
case
CTOS_HOSTNAME
:
{
// for other server impl use only
break
;
}
case
CTOS_CREATE_GAME
:
{
if
(
dp
->
game
||
duel_mode
)
return
;
...
...
gframe/network.h
View file @
7e584bb9
...
...
@@ -164,6 +164,13 @@ constexpr int LEN_CHAT_PLAYER = 1;
constexpr
int
LEN_CHAT_MSG
=
256
;
constexpr
int
SIZE_STOC_CHAT
=
(
LEN_CHAT_PLAYER
+
LEN_CHAT_MSG
)
*
sizeof
(
uint16_t
);
/*
* STOC_HOSTNAME
* uint16_t hostname[256]; (UTF-16 string)
*/
constexpr
int
LEN_HOSTNAME
=
256
;
struct
STOC_HS_PlayerEnter
{
uint16_t
name
[
20
]{};
uint8_t
pos
{};
...
...
@@ -269,6 +276,7 @@ public:
#define CTOS_SURRENDER 0x14 // no data
#define CTOS_TIME_CONFIRM 0x15 // no data
#define CTOS_CHAT 0x16 // uint16_t array
#define CTOS_HOSTNAME 0x17 // uint16_t array
#define CTOS_HS_TODUELIST 0x20 // no data
#define CTOS_HS_TOOBSERVER 0x21 // no data
#define CTOS_HS_READY 0x22 // no data
...
...
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