Commit c95825ee authored by 神楽坂玲奈's avatar 神楽坂玲奈

temp

parent 6e5905af
/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
...@@ -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|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment