Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
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
syntax_j
mycard
Commits
c95825ee
Commit
c95825ee
authored
Feb 22, 2013
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temp
parent
6e5905af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
15 deletions
+27
-15
.gitignore
.gitignore
+15
-14
lib/ygocore/game.rb
lib/ygocore/game.rb
+12
-1
No files found.
.gitignore
View file @
c95825ee
/nbproject/
/Gemfile.lock
/.idea/
/nbproject/
/ruby/
/.idea/
/pkg/
/ruby/
/config.yml
/pkg/
/log.log
/config.yml
/profile.log
/log.log
/replay/
/profile.log
/mycard/
/replay/
/mycard.exe
/mycard/
/7z.exe
/mycard.exe
/ygocore/
/7z.exe
/images/
/ygocore/
/error-程序出错请到论坛反馈.txt
/images/
/error-程序出错请到论坛反馈.txt
Thumbs.db
Thumbs.db
\ No newline at end of file
lib/ygocore/game.rb
View file @
c95825ee
...
@@ -48,6 +48,12 @@ class Ygocore < Game
...
@@ -48,6 +48,12 @@ class Ygocore < Game
$log
.
error
(
'聊天出错'
)
{
[
exception
,
c
,
where
]
}
$log
.
error
(
'聊天出错'
)
{
[
exception
,
c
,
where
]
}
Game_Event
.
push
(
Game_Event
::
Chat
.
new
(
ChatMessage
.
new
(
User
.
new
(
:system
,
'System'
),
'聊天服务连接中断: '
+
exception
.
to_s
)))
Game_Event
.
push
(
Game_Event
::
Chat
.
new
(
ChatMessage
.
new
(
User
.
new
(
:system
,
'System'
),
'聊天服务连接中断: '
+
exception
.
to_s
)))
end
end
@@im
.
add_message_callback
do
|
m
|
p
m
end
@@im
.
add_presence_callback
do
|
m
|
p
m
end
@@im_room
.
add_message_callback
do
|
m
|
@@im_room
.
add_message_callback
do
|
m
|
user
=
m
.
from
.
resource
==
nickname
?
@user
:
User
.
new
(
m
.
from
.
resource
.
to_sym
,
m
.
from
.
resource
)
user
=
m
.
from
.
resource
==
nickname
?
@user
:
User
.
new
(
m
.
from
.
resource
.
to_sym
,
m
.
from
.
resource
)
Game_Event
.
push
Game_Event
::
Chat
.
new
ChatMessage
.
new
(
user
,
m
.
body
,
:lobby
)
rescue
$log
.
error
(
'收到聊天消息'
)
{
$!
}
Game_Event
.
push
Game_Event
::
Chat
.
new
ChatMessage
.
new
(
user
,
m
.
body
,
:lobby
)
rescue
$log
.
error
(
'收到聊天消息'
)
{
$!
}
...
@@ -120,8 +126,13 @@ class Ygocore < Game
...
@@ -120,8 +126,13 @@ class Ygocore < Game
connected
=
false
connected
=
false
if
@@im
.
jid
.
domain
==
"my-card.in"
if
@@im
.
jid
.
domain
==
"my-card.in"
@@im
.
connect
(
"ygopro-server.my-card.in"
,
5223
)
rescue
Game_Event
.
push
Game_Event
::
Error
.
new
(
'登录'
,
'连接服务器失败'
)
begin
@@im
.
connect
(
"chat.my-card.in"
,
5223
)
connected
=
true
connected
=
true
rescue
Game_Event
.
push
Game_Event
::
Error
.
new
(
'登录'
,
'连接服务器失败'
)
Thread
.
exit
end
else
else
srv
=
[]
srv
=
[]
Resolv
::
DNS
.
open
{
|
dns
|
Resolv
::
DNS
.
open
{
|
dns
|
...
...
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