Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
96442947
Commit
96442947
authored
Mar 30, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update chat handling
parent
738a2bf7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
23 deletions
+7
-23
gframe/event_handler.cpp
gframe/event_handler.cpp
+0
-10
gframe/single_duel.cpp
gframe/single_duel.cpp
+4
-11
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+3
-2
No files found.
gframe/event_handler.cpp
View file @
96442947
...
@@ -916,16 +916,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -916,16 +916,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
const
wchar_t
*
input
=
mainGame
->
ebChatInput
->
getText
();
const
wchar_t
*
input
=
mainGame
->
ebChatInput
->
getText
();
if
(
input
[
0
])
{
if
(
input
[
0
])
{
unsigned
short
msgbuf
[
256
];
unsigned
short
msgbuf
[
256
];
if
(
mainGame
->
dInfo
.
isStarted
)
{
if
(
mainGame
->
dInfo
.
player_type
<
7
)
{
if
(
mainGame
->
dInfo
.
isTag
&&
(
mainGame
->
dInfo
.
player_type
%
2
))
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
2
);
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
0
);
}
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
10
);
}
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
7
);
int
len
=
BufferIO
::
CopyWStr
(
input
,
msgbuf
,
256
);
int
len
=
BufferIO
::
CopyWStr
(
input
,
msgbuf
,
256
);
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
short
));
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
short
));
mainGame
->
ebChatInput
->
setText
(
L""
);
mainGame
->
ebChatInput
->
setText
(
L""
);
...
...
gframe/single_duel.cpp
View file @
96442947
...
@@ -27,17 +27,10 @@ void SingleDuel::Chat(DuelPlayer* dp, void* pdata, int len) {
...
@@ -27,17 +27,10 @@ void SingleDuel::Chat(DuelPlayer* dp, void* pdata, int len) {
scc
.
player
=
dp
->
type
;
scc
.
player
=
dp
->
type
;
unsigned
short
*
msg
=
(
unsigned
short
*
)
pdata
;
unsigned
short
*
msg
=
(
unsigned
short
*
)
pdata
;
int
msglen
=
BufferIO
::
CopyWStr
(
msg
,
scc
.
msg
,
256
);
int
msglen
=
BufferIO
::
CopyWStr
(
msg
,
scc
.
msg
,
256
);
if
(
dp
->
type
>
1
)
{
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_CHAT
,
&
scc
,
4
+
msglen
*
2
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_CHAT
,
&
scc
,
4
+
msglen
*
2
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
pit
=
observers
.
begin
();
pit
!=
observers
.
end
();
++
pit
)
for
(
auto
pit
=
observers
.
begin
();
pit
!=
observers
.
end
();
++
pit
)
if
((
*
pit
)
!=
dp
)
NetServer
::
ReSendToPlayer
(
*
pit
);
NetServer
::
ReSendToPlayer
(
*
pit
);
}
else
{
NetServer
::
SendBufferToPlayer
(
players
[
1
-
dp
->
type
],
STOC_CHAT
,
&
scc
,
4
+
msglen
*
2
);
for
(
auto
pit
=
observers
.
begin
();
pit
!=
observers
.
end
();
++
pit
)
NetServer
::
ReSendToPlayer
(
*
pit
);
}
}
}
void
SingleDuel
::
JoinGame
(
DuelPlayer
*
dp
,
void
*
pdata
,
bool
is_creater
)
{
void
SingleDuel
::
JoinGame
(
DuelPlayer
*
dp
,
void
*
pdata
,
bool
is_creater
)
{
if
(
!
is_creater
)
{
if
(
!
is_creater
)
{
...
...
gframe/tag_duel.cpp
View file @
96442947
...
@@ -24,8 +24,9 @@ void TagDuel::Chat(DuelPlayer* dp, void* pdata, int len) {
...
@@ -24,8 +24,9 @@ void TagDuel::Chat(DuelPlayer* dp, void* pdata, int len) {
unsigned
short
*
msg
=
(
unsigned
short
*
)
pdata
;
unsigned
short
*
msg
=
(
unsigned
short
*
)
pdata
;
int
msglen
=
BufferIO
::
CopyWStr
(
msg
,
scc
.
msg
,
256
);
int
msglen
=
BufferIO
::
CopyWStr
(
msg
,
scc
.
msg
,
256
);
for
(
int
i
=
0
;
i
<
4
;
++
i
)
for
(
int
i
=
0
;
i
<
4
;
++
i
)
if
(
players
[
i
]
!=
dp
)
NetServer
::
SendBufferToPlayer
(
players
[
i
],
STOC_CHAT
,
&
scc
,
4
+
msglen
*
2
);
NetServer
::
SendBufferToPlayer
(
players
[
i
],
STOC_CHAT
,
&
scc
,
4
+
msglen
*
2
);
for
(
auto
pit
=
observers
.
begin
();
pit
!=
observers
.
end
();
++
pit
)
NetServer
::
ReSendToPlayer
(
*
pit
);
}
}
void
TagDuel
::
JoinGame
(
DuelPlayer
*
dp
,
void
*
pdata
,
bool
is_creater
)
{
void
TagDuel
::
JoinGame
(
DuelPlayer
*
dp
,
void
*
pdata
,
bool
is_creater
)
{
if
(
!
is_creater
)
{
if
(
!
is_creater
)
{
...
...
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