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
01d3da47
Commit
01d3da47
authored
Mar 29, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
636695b7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
12 deletions
+15
-12
gframe/duelclient.cpp
gframe/duelclient.cpp
+5
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+1
-1
gframe/game.cpp
gframe/game.cpp
+1
-1
gframe/netserver.cpp
gframe/netserver.cpp
+2
-2
gframe/network.h
gframe/network.h
+1
-1
gframe/single_duel.cpp
gframe/single_duel.cpp
+4
-5
system.conf
system.conf
+1
-1
No files found.
gframe/duelclient.cpp
View file @
01d3da47
...
...
@@ -398,6 +398,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnBP
->
setVisible
(
false
);
mainGame
->
btnM2
->
setVisible
(
false
);
mainGame
->
btnEP
->
setVisible
(
false
);
mainGame
->
wChat
->
setVisible
(
true
);
mainGame
->
imgCard
->
setImage
(
imageManager
.
tCover
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
dField
);
if
(
selftype
>
1
)
{
...
...
@@ -472,6 +473,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
if
(
mainGame
->
chkIgnore1
->
isChecked
())
break
;
BufferIO
::
CopyWStr
(
pkt
->
msg
,
msg
,
256
);
msg
[(
len
-
3
)
/
2
]
=
0
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
AddChatMsg
(
msg
,
mainGame
->
LocalPlayer
(
pkt
->
player
));
mainGame
->
gMutex
.
Unlock
();
...
...
@@ -479,6 +481,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
if
(
mainGame
->
chkIgnore2
->
isChecked
())
break
;
BufferIO
::
CopyWStr
(
pkt
->
msg
,
msg
,
256
);
msg
[(
len
-
3
)
/
2
]
=
0
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
AddChatMsg
(
msg
,
2
);
mainGame
->
gMutex
.
Unlock
();
...
...
@@ -2021,7 +2024,8 @@ int DuelClient::ClientAnalyze(char* msg, unsigned int len) {
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
player
,
LOCATION_DECK
,
mainGame
->
dField
.
deck
[
player
].
size
()
-
1
-
i
);
pcard
->
SetCode
(
code
);
if
(
!
mainGame
->
dField
.
deck_reversed
||
code
)
pcard
->
SetCode
(
code
);
}
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
mainGame
->
gMutex
.
Lock
();
...
...
gframe/event_handler.cpp
View file @
01d3da47
...
...
@@ -772,7 +772,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
0
);
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
2
);
int
len
=
BufferIO
::
CopyWStr
(
input
,
msgbuf
,
256
);
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
len
*
sizeof
(
short
));
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
short
));
mainGame
->
ebChatInput
->
setText
(
L""
);
}
break
;
...
...
gframe/game.cpp
View file @
01d3da47
...
...
@@ -441,8 +441,8 @@ bool Game::Initialize() {
wChat
=
env
->
addWindow
(
rect
<
s32
>
(
305
,
615
,
1020
,
640
),
false
,
L""
);
wChat
->
getCloseButton
()
->
setVisible
(
false
);
wChat
->
setDraggable
(
false
);
// wChat->setDrawBackground(false);
wChat
->
setDrawTitlebar
(
false
);
wChat
->
setVisible
(
false
);
ebChatInput
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
3
,
2
,
710
,
22
),
true
,
wChat
,
EDITBOX_CHAT
);
//
btnLeaveGame
=
env
->
addButton
(
rect
<
s32
>
(
205
,
5
,
295
,
80
),
0
,
BUTTON_LEAVE_GAME
,
L""
);
...
...
gframe/netserver.cpp
View file @
01d3da47
...
...
@@ -171,7 +171,7 @@ void NetServer::DisconnectPlayer(DuelPlayer* dp) {
void
NetServer
::
HandleCTOSPacket
(
DuelPlayer
*
dp
,
char
*
data
,
unsigned
int
len
)
{
char
*
pdata
=
data
;
unsigned
char
pktType
=
BufferIO
::
ReadUInt8
(
pdata
);
if
((
pktType
!=
CTOS_SURRENDER
)
&&
(
dp
->
state
==
0xff
||
(
dp
->
state
&&
dp
->
state
!=
pktType
)))
if
((
pktType
!=
CTOS_SURRENDER
)
&&
(
pktType
!=
CTOS_CHAT
)
&&
(
dp
->
state
==
0xff
||
(
dp
->
state
&&
dp
->
state
!=
pktType
)))
return
;
switch
(
pktType
)
{
case
CTOS_RESPONSE
:
{
...
...
@@ -189,7 +189,7 @@ void NetServer::HandleCTOSPacket(DuelPlayer* dp, char* data, unsigned int len) {
case
CTOS_CHAT
:
{
if
(
!
dp
->
game
)
return
;
duel_mode
->
Chat
(
dp
,
data
,
len
);
duel_mode
->
Chat
(
dp
,
pdata
,
len
-
1
);
break
;
}
case
CTOS_UPDATE_DECK
:
{
...
...
gframe/network.h
View file @
01d3da47
...
...
@@ -81,7 +81,7 @@ struct STOC_TimeLimit {
unsigned
short
left_time
;
};
struct
STOC_Chat
{
unsigned
char
player
;
unsigned
short
player
;
unsigned
short
msg
[
256
];
};
struct
STOC_HS_PlayerEnter
{
...
...
gframe/single_duel.cpp
View file @
01d3da47
...
...
@@ -24,18 +24,17 @@ void SingleDuel::Chat(DuelPlayer* dp, void* pdata, int len) {
scc
.
player
=
dp
->
type
;
unsigned
short
*
msg
=
(
unsigned
short
*
)
pdata
;
int
msglen
=
BufferIO
::
CopyWStr
(
msg
,
scc
.
msg
,
256
);
if
(
dp
->
type
<
2
)
{
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_CHAT
,
&
scc
,
1
+
msglen
*
2
);
NetServer
::
SendBufferToPlayer
(
players
[
1
],
STOC_CHAT
,
&
scc
,
1
+
msglen
*
2
);
if
(
dp
->
type
>
1
)
{
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_CHAT
,
&
scc
,
4
+
msglen
*
2
);
NetServer
::
ReSendToPlayer
(
players
[
1
]
);
for
(
auto
pit
=
observers
.
begin
();
pit
!=
observers
.
end
();
++
pit
)
if
((
*
pit
)
!=
dp
)
NetServer
::
ReSendToPlayer
(
*
pit
);
}
else
{
NetServer
::
SendBufferToPlayer
(
players
[
1
-
dp
->
type
],
STOC_CHAT
,
&
scc
,
1
+
msglen
*
2
);
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
)
{
if
(
!
is_creater
)
{
...
...
system.conf
View file @
01d3da47
...
...
@@ -7,5 +7,5 @@ lastdeck = test
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
14
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
serverport
=
7911
lastip
=
192
.
168
.
3
.
235
lastip
=
192
.
168
.
2
.
100
lastport
=
7911
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