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

xmpp

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