aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/share/ruby/userserv.rb
diff options
context:
space:
mode:
authorSean Dague2008-10-01 18:57:37 +0000
committerSean Dague2008-10-01 18:57:37 +0000
commit5d5a886b3401d4b229485014186b917c9bb1b530 (patch)
tree1423bd40b6a431aacf4c64bed44f663ffe23162a /share/ruby/userserv.rb
parentremove mysql_connection.ini.example, no one should be using this any (diff)
downloadopensim-SC_OLD-5d5a886b3401d4b229485014186b917c9bb1b530.zip
opensim-SC_OLD-5d5a886b3401d4b229485014186b917c9bb1b530.tar.gz
opensim-SC_OLD-5d5a886b3401d4b229485014186b917c9bb1b530.tar.bz2
opensim-SC_OLD-5d5a886b3401d4b229485014186b917c9bb1b530.tar.xz
remove these old ruby grid servers as they are really old (like a year
old). A project like this is welcomed to come back on opensim forge.
Diffstat (limited to '')
-rwxr-xr-xshare/ruby/userserv.rb135
1 files changed, 0 insertions, 135 deletions
diff --git a/share/ruby/userserv.rb b/share/ruby/userserv.rb
deleted file mode 100755
index 18559c0..0000000
--- a/share/ruby/userserv.rb
+++ /dev/null
@@ -1,135 +0,0 @@
1require "webrick"
2require "xmlrpc/server"
3require 'xmlrpc/client'
4require 'config.rb'
5
6class SessionServlet < WEBrick::HTTPServlet::AbstractServlet
7 def do_DELETE(req, res)
8 # does nothing, obviously
9 STDERR.print "----\n"
10 end
11end
12
13s = XMLRPC::WEBrickServlet.new
14s.add_handler("login_to_simulator") do |param|
15 sc = SimConfig.new
16 #
17 # Some stuff just grabbed from a sniff of the session with OGS
18 #
19 zSessionId = "133086b6-1270-78c6-66f7-c7f64865b16c"
20 zSecureSessionId = "6ee4df6a-0ea9-4cf5-8ac7-9745acbacccc"
21 zAgentId = "0f00ba47-42d1-498e-b010-aa585a81862e"
22 zAgentId = UUID.new.to_dashed_s
23 STDERR.print "AgentID: #{zAgentId}\n"
24 zCircuitCode = rand(0x1000000)
25 zRegionX = sc.cfgSimX
26 zRegionY = sc.cfgSimY
27
28 xxSimParams = Hash.new
29 xxSimParams["session_id"] = zSessionId.gsub("-","")
30 xxSimParams["secure_session_id"] = zSecureSessionId.gsub("-","")
31 xxSimParams["firstname"] = param["first"];
32 xxSimParams["lastname"] = param["last"];
33 xxSimParams["agent_id"] = zAgentId.gsub("-", "")
34 xxSimParams["circuit_code"] = zCircuitCode
35 xxSimParams["startpos_x"] = 128
36 xxSimParams["startpos_y"] = 128
37 xxSimParams["startpos_z"] = 30
38 xxSimParams["regionhandle"] = ((zRegionX << 40) + (zRegionY *256)).to_s
39 STDERR.print "Region handle: #{xxSimParams["regionhandle"]}\n"
40
41
42
43 server = XMLRPC::Client.new2("http://#{sc.cfgSimIP}:#{sc.cfgSimPort}/")
44 # the dispatcher in OpenSim.exe did not get excited from specifying
45 # the content-type in the request.. no XML was executed at all.
46 # this "fixes" it.
47 server.http_header_extra = { "Content-Type" => "text/xml" };
48 result = server.call("expect_user", xxSimParams )
49 # STDERR.print result.inspect
50
51 STDERR.print "---- notified the sim ----\n"
52
53 responseData = Hash.new
54
55 xxGlobalT = Hash.new
56 xxGlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
57 xxGlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
58 xxGlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
59
60 xxLoginFlags = Hash.new
61 xxLoginFlags["daylight_savings"] = "N"
62 xxLoginFlags["stipend_since_login"] = "N"
63 xxLoginFlags["gendered"] = "Y"
64 xxLoginFlags["ever_logged_in"] = "Y"
65
66 responseData["first_name"] = param["first"]
67 responseData["last_name"] = param["last"]
68 responseData["ui-config"] = [ { "allow_first_life" => "Y" } ]
69
70 responseData["login-flags"] = [ xxLoginFlags ]
71 responseData["global-textures"] = [ xxGlobalT ]
72 # responseData["classified_categories"] = [ { category_name => "Generic", category_id => 1 } ]
73 # responseData["event_categories"] =
74 responseData["inventory-skeleton"] = [
75 { "folder_id" => "9846e02a-f41b-4199-860e-cde46cc25649",
76 "parent_id" => "00000000-0000-0000-0000-000000000000",
77 "name" => "My Inventory test",
78 "type_default" => 8,
79 "version" => 1 },
80 { "folder_id" => "b846e02a-f41b-4199-860e-cde46cc25649",
81 "parent_id" => "9846e02a-f41b-4199-860e-cde46cc25649",
82 "name" => "test",
83 "type_default" => 0,
84 "version" => 1 }
85 ]
86 responseData["inventory-skel-lib"] = [
87 { "folder_id" => "a846e02a-f41b-4199-860e-cde46cc25649",
88 "parent_id" => "00000000-0000-0000-0000-000000000000",
89 "name" => "Lib Inventory",
90 "type_default" => 8,
91 "version" => 1 }
92 ]
93 responseData["inventory-root"] = [ { "folder_id" => "9846e02a-f41b-4199-860e-cde46cc25649" } ]
94 # responseData["event_notifications"] = [ ]
95 responseData["gestures"] = [ ]
96 # responseData["inventory-lib-owner"] =
97 responseData["initial-outfit"] = [
98 { "folder_name" => "Nightclub female", "gender" => "female" }
99 ]
100 responseData["seconds_since_epoch"] = Time.new.to_i
101 responseData["start_location"] = "last";
102 responseData["message"] = "Hello there!"
103 responseData["circuit_code"] = zCircuitCode # random
104 # responseData["look_at"] =
105 responseData["agent_id"] = zAgentId
106 responseData["home"] = "\{'region_handle':[r#{zRegionX*256}.0,r#{zRegionY*256}.0], 'position':[r128.0,r128.0,r30.0], 'look_at':[r0.0,r0.0,r0.0]\}"
107 # responseData["home"] = "\{'region_handle':[r255232,r254976], 'position':[r128,r128,r100], 'look_at':[r128,r128,r100]\}"
108
109 responseData["region_x"] = zRegionX*256
110 responseData["region_y"] = zRegionY*256
111 responseData["sim_ip"] = "192.168.1.103"
112 responseData["sim_port"] = 9000
113 # responseData["seed_capability"]
114 responseData["agent_access"] = "M";
115 responseData["session_id"] = zSessionId
116 responseData["secure_session_id"] = zSecureSessionId
117 responseData["login"] = "true"
118
119 # raise XMLRPC::FaultException.new(1, "just some exception")
120 responseData
121end
122
123s.set_default_handler do |name, *args|
124 STDERR.print "Unknown method #{name}, #{args.inspect}\n\n"
125 raise XMLRPC::FaultException.new(-99, "Method #{name} missing" +
126 " or wrong number of parameters!")
127end
128
129httpserver = WEBrick::HTTPServer.new(:Port => 8002)
130httpserver.mount("/", s)
131httpserver.mount("/usersessions", SessionServlet);
132
133trap(:INT) { httpserver.shutdown }
134httpserver.start
135