Warchat
This project aims to create a simple ruby interface for connecting to Blizzard’s Mobile Guild Chat.
Features
-
SRP authentication
-
Guild Chat
-
Officer Chat
-
Whispers
-
Presence notifications
Acknowledgements
A big thanks to Eike Siewertsen (www.github.com/fry), without whom this probably wouldn’t be possible.
Simple Usage example
This is a simple chat client that will let you talk in guild chat and receive messages.
require 'rubygems'
require 'warchat'
USERNAME = ''
PASSWORD = ''
CHARACTER_NAME = ''
CHARACTER_REALM = ''
client = Warchat::Chat::Client.new
client.on_establish = Proc.new do |response|
client.character_name = CHARACTER_NAME
client.character_realm = CHARACTER_REALM
client.login
end
client. = Proc.new do ||
case .type
when Warchat::Chat::Message::CHAT_MSG_TYPE_GUILD_CHAT
puts "[Guild] #{.character_name}: #{.body}"
when Warchat::Chat::Message::CHAT_MSG_TYPE_GUILD_MOTD
puts "MOTD: #{.body}"
when Warchat::Chat::Message::CHAT_MSG_TYPE_OFFICER_CHAT
puts "[Officer] #{.character_name}: #{.body}"
when Warchat::Chat::Message::CHAT_MSG_TYPE_WHISPER
puts "[Whisper] #{.character_name}: #{.body}"
end
end
begin
client.start(USERNAME,PASSWORD)
loop do
msg = gets.chomp
client. msg,Warchat::Chat::Message::CHAT_MSG_TYPE_GUILD_CHAT
end
rescue Interrupt => e
client.close
end