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
xiaoye
mycard
Commits
32725c5d
Commit
32725c5d
authored
Mar 18, 2012
by
zh99998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版本0.4.3,iDuel修复 还不完整
parent
9e41e6af
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
4 deletions
+13
-4
lib/game.rb
lib/game.rb
+1
-0
lib/iduel/event.rb
lib/iduel/event.rb
+3
-1
lib/iduel/game.rb
lib/iduel/game.rb
+1
-0
lib/iduel/user.rb
lib/iduel/user.rb
+2
-1
lib/scene.rb
lib/scene.rb
+6
-2
No files found.
lib/game.rb
View file @
32725c5d
...
...
@@ -27,6 +27,7 @@ class Game
def
chat
(
chatmessage
)
end
def
exit
$scene
=
Scene_Login
.
new
end
def
watching?
@room
and
@room
.
include?
@user
...
...
lib/iduel/event.rb
View file @
32725c5d
...
...
@@ -8,8 +8,10 @@ class Game_Event
Login
when
"C"
AllUsers
when
"F"
,
"Q"
#F=加入观战
when
"F"
Join
when
"Q"
NewRoom
when
"G"
Watch
when
"H"
,
"M"
...
...
lib/iduel/game.rb
View file @
32725c5d
...
...
@@ -64,6 +64,7 @@ class Iduel < Game
@conn
.
close
@conn
=
nil
end
super
end
def
recv
(
info
)
if
info
.
nil?
...
...
lib/iduel/user.rb
View file @
32725c5d
...
...
@@ -22,11 +22,12 @@ class User
def
avatar
(
size
=
:small
)
cache
=
"graphics/avatars/
#{
@id
}
_
#{
size
}
.png"
result
=
Surface
.
load
(
cache
)
rescue
Surface
.
load
(
"graphics/avatars/loading_
#{
size
}
.gif"
)
scene
=
$scene
if
block_given?
yield
result
Thread
.
new
do
open
(
"http://www.duelcn.com/uc_server/avatar.php?uid=
#{
id
-
100000
}
&size=
#{
size
}
"
,
'rb'
)
{
|
io
|
open
(
cache
,
'wb'
)
{
|
c
|
c
.
write
io
.
read
}}
rescue
cache
=
"graphics/avatars/noavatar_
#{
size
}
.gif"
yield
Surface
.
load
(
cache
)
yield
Surface
.
load
(
cache
)
if
scene
==
$scene
end
else
result
...
...
lib/scene.rb
View file @
32725c5d
...
...
@@ -136,8 +136,12 @@ class Scene
def
handle_game
(
event
)
case
event
when
Game_Event
::
Error
$game
.
exit
if
$game
Widget_Msgbox
.
new
(
event
.
title
,
event
.
message
,
:ok
=>
"确定"
){
$scene
=
Scene_Login
.
new
if
event
.
fatal
}
if
event
.
fatal
$game
.
exit
if
$game
Widget_Msgbox
.
new
(
event
.
title
,
event
.
message
,
:ok
=>
"确定"
){
$scene
=
Scene_Login
.
new
}
else
Widget_Msgbox
.
new
(
event
.
title
,
event
.
message
,
:ok
=>
"确定"
)
end
else
$log
.
debug
(
'未处理的游戏事件'
){
event
.
inspect
}
end
...
...
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