add upstream source (adch++ 2.12.1 from sourceforge)

This commit is contained in:
2020-03-22 01:45:29 -07:00
parent 3574617350
commit 2cfbcf1301
9637 changed files with 1934407 additions and 0 deletions

42
src/rbutil/adchpp.rb Normal file
View File

@@ -0,0 +1,42 @@
$:.unshift(File.expand_path('../build/debug-default/bin/'))
$:.unshift(File.expand_path('../build/release-default/bin/'))
puts "Loading module..."
require 'rbadchpp'
a = Rbadchpp
config_path = File.expand_path("../etc/") + '/'
puts "Configuration path is #{config_path}..."
core = a::Core.create(config_path)
sil = a::TServerInfoList.new
si = a::ServerInfo.create()
si.port= 2780
sil.push(si)
core.get_socket_manager().set_servers(sil)
cm = core.get_client_manager()
print "."
counter = 0
connected = cm.signal_connected().connect(Proc.new { counter = counter + 1 })
disconnected = cm.signal_disconnected().connect(Proc.new { counter = counter - 1 })
cb = core.add_timed_job(1000, Proc.new { puts counter })
trap("INT") { core.shutdown() }
core.run()
puts "Shutting down..."
disconnected = nil
connected = nil
puts cb
cb.call
cb = nil
core = nil