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

版本0.4.1

parent 830fa94f
...@@ -11,7 +11,13 @@ class Window_Host < Window ...@@ -11,7 +11,13 @@ class Window_Host < Window
@title_color = [0xFF, 0xFF, 0xFF] @title_color = [0xFF, 0xFF, 0xFF]
@color = [0x04, 0x47, 0x7c] @color = [0x04, 0x47, 0x7c]
@roomname_inputbox = Widget_InputBox.new(@x+96, @y+41, 165, WLH){clicked;false} @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 = Widget_Checkbox.new(self, 33+@x,70+@y,120,24,false,"竞技场")
@pvp.background = @background.copy_rect(33,70,120,24) @pvp.background = @background.copy_rect(33,70,120,24)
@match = Widget_Checkbox.new(self, 120+@x,70+@y,120,24,true,"三回决斗") @match = Widget_Checkbox.new(self, 120+@x,70+@y,120,24,true,"三回决斗")
......
...@@ -31,9 +31,22 @@ class Ygocore < Game ...@@ -31,9 +31,22 @@ class Ygocore < Game
if username.empty? if username.empty?
return Widget_Msgbox.new("登陆", "请输入用户名", :ok => "确定") return Widget_Msgbox.new("登陆", "请输入用户名", :ok => "确定")
end end
connect if password.empty?
@password = password return Widget_Msgbox.new("登陆", "请输入密码", :ok => "确定")
Game_Event.push Game_Event::Login.new(User.new(username.to_sym, username)) 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 end
def host(room_name, room_config) def host(room_name, room_config)
room = Room.new(0, room_name) room = Room.new(0, room_name)
......
...@@ -4,7 +4,7 @@ class Window_Login ...@@ -4,7 +4,7 @@ class Window_Login
return if @last_clicked and Time.now - @last_clicked < 3 #防止重复点击 return if @last_clicked and Time.now - @last_clicked < 3 #防止重复点击
case @index case @index
when :login when :login
#Widget_Msgbox.new("iDuel", "正在登陆") Widget_Msgbox.new("ygocore", "正在登陆")
$scene.draw #强制重绘一次,下面会阻塞 $scene.draw #强制重绘一次,下面会阻塞
$game = Ygocore.new $game = Ygocore.new
$config[$config['game']]['username'] = @username_inputbox.value $config[$config['game']]['username'] = @username_inputbox.value
......
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