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
23740294
Commit
23740294
authored
Mar 13, 2012
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版本0.4.1
parent
830fa94f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
lib/window_host.rb
lib/window_host.rb
+7
-1
lib/ygocore/game.rb
lib/ygocore/game.rb
+16
-3
lib/ygocore/window_login.rb
lib/ygocore/window_login.rb
+1
-1
No files found.
lib/window_host.rb
View file @
23740294
...
...
@@ -11,7 +11,13 @@ class Window_Host < Window
@title_color
=
[
0xFF
,
0xFF
,
0xFF
]
@color
=
[
0x04
,
0x47
,
0x7c
]
@roomname_inputbox
=
Widget_InputBox
.
new
(
@x
+
96
,
@y
+
41
,
165
,
WLH
){
clicked
;
false
}
@roomname_inputbox
.
value
=
$game
.
user
.
name
default_name
=
$game
.
user
.
name
1
.
upto
(
1000
)
do
|
i
|
if
$game
.
rooms
.
all?
{
|
room
|
room
.
name
!=
i
.
to_s
}
break
default_name
=
i
.
to_s
end
end
@roomname_inputbox
.
value
=
default_name
@pvp
=
Widget_Checkbox
.
new
(
self
,
33
+
@x
,
70
+
@y
,
120
,
24
,
false
,
"竞技场"
)
@pvp
.
background
=
@background
.
copy_rect
(
33
,
70
,
120
,
24
)
@match
=
Widget_Checkbox
.
new
(
self
,
120
+
@x
,
70
+
@y
,
120
,
24
,
true
,
"三回决斗"
)
...
...
lib/ygocore/game.rb
View file @
23740294
...
...
@@ -31,9 +31,22 @@ class Ygocore < Game
if
username
.
empty?
return
Widget_Msgbox
.
new
(
"登陆"
,
"请输入用户名"
,
:ok
=>
"确定"
)
end
if
password
.
empty?
return
Widget_Msgbox
.
new
(
"登陆"
,
"请输入密码"
,
:ok
=>
"确定"
)
end
require
'cgi'
open
(
"
#{
API_Url
}
?userregist=CHANGEPASS&username=
#{
CGI
.
escape
username
}
&password=
#{
CGI
.
escape
password
}
&oldpass=
#{
CGI
.
escape
password
}
"
)
do
|
file
|
file
.
set_encoding
"GBK"
result
=
file
.
read
.
encode
(
"UTF-8"
)
$log
.
debug
(
'用户登陆传回消息'
){
result
}
if
result
==
"修改成功"
connect
@password
=
password
Game_Event
.
push
Game_Event
::
Login
.
new
(
User
.
new
(
username
.
to_sym
,
username
))
else
Game_Event
.
push
Game_Event
::
Error
.
new
(
"登陆"
,
"用户名或密码错误"
)
end
end
end
def
host
(
room_name
,
room_config
)
room
=
Room
.
new
(
0
,
room_name
)
...
...
lib/ygocore/window_login.rb
View file @
23740294
...
...
@@ -4,7 +4,7 @@ class Window_Login
return
if
@last_clicked
and
Time
.
now
-
@last_clicked
<
3
#防止重复点击
case
@index
when
:login
#Widget_Msgbox.new("iDuel
", "正在登陆")
Widget_Msgbox
.
new
(
"ygocore
"
,
"正在登陆"
)
$scene
.
draw
#强制重绘一次,下面会阻塞
$game
=
Ygocore
.
new
$config
[
$config
[
'game'
]][
'username'
]
=
@username_inputbox
.
value
...
...
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