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

xmpp

parent 7be8d5bf
...@@ -39,6 +39,9 @@ class Game ...@@ -39,6 +39,9 @@ class Game
def refresh_interval def refresh_interval
5 5
end end
def show_chat_self
false
end
end end
...@@ -124,6 +124,9 @@ class Iduel < Game ...@@ -124,6 +124,9 @@ class Iduel < Game
end end
end end
end end
def show_chat_self
true
end
private private
def connect def connect
require 'socket' require 'socket'
......
...@@ -27,11 +27,9 @@ class Window_Chat < Window_Scrollable ...@@ -27,11 +27,9 @@ class Window_Chat < Window_Scrollable
if !@chat_input.value.empty? if !@chat_input.value.empty?
chatmessage = ChatMessage.new($game.user, @chat_input.value, @channel) chatmessage = ChatMessage.new($game.user, @chat_input.value, @channel)
$game.chat chatmessage $game.chat chatmessage
Game_Event.push Game_Event::Chat.new(chatmessage) Game_Event.push Game_Event::Chat.new(chatmessage) if $game.show_chat_self
true true
end end
when :ESC
true
end end
end end
@chat_input.refresh @chat_input.refresh
......
...@@ -7,8 +7,8 @@ class Game_Event ...@@ -7,8 +7,8 @@ class Game_Event
else else
Error.new('登录', '用户名或密码错误') Error.new('登录', '用户名或密码错误')
end end
when :users #when :users
AllUsers.new data.collect{|user|parse_user(user)} # AllUsers.new data.collect{|user|parse_user(user)}
when :rooms when :rooms
rooms_wait = [] rooms_wait = []
rooms_start = [] rooms_start = []
...@@ -21,21 +21,21 @@ class Game_Event ...@@ -21,21 +21,21 @@ class Game_Event
end end
end end
AllRooms.new rooms_wait + rooms_start AllRooms.new rooms_wait + rooms_start
when :newuser #when :newuser
NewUser.new parse_user data #NewUser.new parse_user data
when :missinguser #when :missinguser
MissingUser.new parse_user data #MissingUser.new parse_user data
when :newroom when :newroom
NewRoom.new parse_room data NewRoom.new parse_room data
when :missingroom when :missingroom
MissingRoom.new parse_room data MissingRoom.new parse_room data
when :chat #when :chat
case data[:channel] # case data[:channel]
when :lobby # when :lobby
Chat.new ChatMessage.new User.new(data[:from][:id],data[:from][:name]), data[:message], :lobby # Chat.new ChatMessage.new User.new(data[:from][:id],data[:from][:name]), data[:message], :lobby
else # else
Chat.new ChatMessage.new User.new(data[:from][:id],data[:from][:name]), data[:message], User.new(data[:channel]) # Chat.new ChatMessage.new User.new(data[:from][:id],data[:from][:name]), data[:message], User.new(data[:channel])
end # end
end end
end end
def self.parse_room(room) def self.parse_room(room)
......
This diff is collapsed.
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