adamaig-ruby_activeworld 0.1-linux

Sign up to get free protection for your applications and to get access to all the features.
data/README ADDED
@@ -0,0 +1,131 @@
1
+ = Purpose
2
+
3
+ This project provides a ruby binding for the Activeworlds SDK. The current
4
+ target version of the binding is the 4.1 version (build 66).
5
+
6
+ I say generate because once the project is run, the .so file for the extension
7
+ is built, and can be ported wherever needed.
8
+
9
+ This binding takes certain liberties around the SDK, primarily doing everything
10
+ possible to make it a more sane object-oriented design, and makes some attempt
11
+ to hide the worst aspects of the SDK's design. One particular case is the that
12
+ binding wraps all attributes available to a given callback in a hash that is
13
+ returned to the ruby script.
14
+
15
+ Additionally, there is a ruby level wrapper to the binding that wraps calls that
16
+ are made against the SDK, like sending a console message, so that only the
17
+ critical parameters are necessarily passed, and sane defaults are provided as
18
+ an options hash for the other settings that might apply.
19
+
20
+ This is a work in progress, with many pieces remaining untested. Sample programs
21
+ are provided and implement the tested functions.
22
+
23
+ The license for the AWSDK is repeated here, and the code is included in the
24
+ extension because I don't see anything in the license that restricts it.
25
+
26
+ == Installation Note
27
+
28
+ I haven't worked out a great way to get the AW SDK installed as part of this
29
+ process, so you'll have to specify the directory the library is in with the
30
+ option --with-awsdk-dir=
31
+
32
+ I hope to get a post-compile hook implemented that will allow this to be done
33
+ automagically.
34
+
35
+ == The Activeworlds SDK License
36
+
37
+ BY USING THE ACTIVE WORLDS SDK MODULE OR THE ACTIVE WORLDS API ITSELF, AS PART
38
+ OF, OR IN CONJUNCTION WITH, APPLICATIONS DEVELOPED, DISTRIBUTED OR IMPLEMENTED
39
+ BY YOU OR ON YOUR BEHALF, YOU ARE CONSENTING TO BE BOUND BY THIS AGREEMENT, BY
40
+ THE APPLICABLE PROVISIONS OF THE LICENSE AGREEMENT OF THE ACTIVE WORLDS
41
+ SOFTWARE. IF YOU DO NOT AGREE, DO NOT USE THE ACTIVE WORLDS SDK MODULE OR THE
42
+ ACTIVE WORLDS API ITSELF. ACTIVE WORLDS SDK LICENSE AGREEMENT. This Agreement
43
+ sets forth the terms and conditions of use of the Active Worlds software that
44
+ enables use of Active Worlds by other applications ("SDK Module") and the
45
+ Active Worlds API itself (hereafter collectively or separately referred to as
46
+ "Active Worlds SDK") GRANT OF LICENSE. Subject to the provisions contained
47
+ herein, Activeworlds Inc. hereby grants to you a non-exclusive,
48
+ non-transferable license (without the right to sublicense) to use the Active
49
+ Worlds SDK as part of, or in conjunction with, Applications developed,
50
+ distributed or implemented by you or on your behalf (the "SDK Applications").
51
+ This license does not grant you any right to any version enhancement update,
52
+ or to a continuous availability of the Active Worlds SDK and the functionality
53
+ of the Active Worlds End User Software (The "Software"), or to any support or
54
+ telephone assistance. Activeworlds Inc. may revise or cease to provide the
55
+ Active Worlds SDK, the Software or its functionality or any part thereof
56
+ including without limitation, loss of compatibility, denial of access to the
57
+ functionality of the Software or the Active Worlds Network from any SDK
58
+ Application, from time to time without notice.
59
+
60
+ SOME LIMITATIONS. You may not use the Active Worlds SDK to: (a) modify,
61
+ translate, reverse engineer, decompile, disassemble (except and solely to the
62
+ extent an applicable statute expressly and specifically prohibits such
63
+ restrictions), or create derivative works of the Active Worlds Software and
64
+ network; (b) create applications for unlawful or illegal purposes or
65
+ activities; MISSION CRITICAL AND CONTENT SENSITIVE APPLICATIONS. Do not
66
+ create, distribute or otherwise use any SDK Application which uses or relies
67
+ on the Active Worlds Software, the Active Worlds network, the Activeworlds
68
+ Inc. websites, including but not limited to, message boards, directories,
69
+ databases, ("Active Worlds Services and Information") or any other program,
70
+ information or service whatsoever related thereto for "Mission Critical" or
71
+ "Content Sensitive" applications and use. "Content Sensitive" shall mean any
72
+ information or data you do not wish to be freely accessible and generally
73
+ available to Internet users. "Mission Critical" application and use shall mean
74
+ applications and use that may result in damage if failed, for any reason
75
+ whatsoever including without limitation, for fraud, eavesdropping, electronic
76
+ trespassing, sniffing, spoofing, imposturing, breaking passwords, harassment,
77
+ for reaching erroneous address or recipient, or out of negligence. NO
78
+ WARRANTY. The Active Worlds SDK is available on an "AS IS" basis, without
79
+ warranty of any kind Including without limitation the warranties it is free of
80
+ defects, merchantable, fit for a particular purpose or non-infringing. The
81
+ entire risk as to the quality and performance of the Active Worlds SDK is
82
+ borne by you. Should the Active Worlds SDK prove defective or inaccurate or
83
+ should the Active Worlds SDK cease to operate, as the case may be you and not
84
+ Activeworlds Inc. or its suppliers assume the entire cost of any damage,
85
+ service and repair. This disclaimer of warranty constitutes an essential part
86
+ of the agreement.
87
+
88
+ TERM AND TERMINATION. This license shall continue for a year or until
89
+ terminated, whichever is first. The license will terminate automatically with
90
+ no delay, if (1) you fail to comply with the limitations described herein; or
91
+ (2) Activeworlds Inc. gave you a 72 hours prior notice of termination; or (3)
92
+ Activeworlds Inc. posted a notice of termination on the Activeworlds Inc.
93
+ website; or (4) you have reached the Copies Limit. Upon termination of this
94
+ License you agree to immediately destroy all copies of the SDK Applications in
95
+ your possession and not to use the Active Worlds SDK for SDK Applications,
96
+ without a special license from Activeworlds Inc.
97
+
98
+ LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
99
+ TORT, CONTRACT, OR OTHERWISE, SHALL ACTIVEWORLDS INC. BE LIABLE TO YOU OR ANY
100
+ OTHER PERSON FOR ANY INDIRECT, SPECIAL IncIDENTAL, OR CONSEQUENTIAL DAMAGES OF
101
+ ANY KIND INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, LOSS OF
102
+ POTENTIAL REVENUES, LOSS OF BUSINESS OPPORTUNITIES, WORK STOPPAGE, COMPUTER
103
+ FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES. IN
104
+ NO EVENT WILL ACTIVEWORLDS INC. BE LIABLE FOR ANY DAMAGES, EVEN IF
105
+ ACTIVEWORLDS INC. HAD BEEN INFORMED OR SHALL HAVE BEEN INFORMED OF THE
106
+ POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY THIRD PARTY. SOME
107
+ JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
108
+ CONSEQUENTIAL DAMAGES, SO THIS LIMITATION AND EXCLUSION MAY NOT APPLY TO YOU.
109
+
110
+ RIGHTS. Title, ownership rights, and intellectual property rights in the
111
+ Active Worlds Software and the Active Worlds SDK shall remain in Activeworlds
112
+ Inc. The Active Worlds Software and the Active Worlds SDK is protected by
113
+ copyright and other intellectual property laws and by international treaties.
114
+ Title and related rights in the content accessed through the Active Worlds
115
+ Software or the Active Worlds SDK is the property of the applicable content
116
+ owner and is protected by applicable law. The license granted under this
117
+ Agreement gives you no rights to such content.
118
+
119
+ MISCELLANEOUS. This Agreement represents the complete agreement and
120
+ understanding concerning the license granted hereunder and may be amended only
121
+ in writing executed by both parties. This Agreement shall be governed by
122
+ Massachusetts law, excluding conflict of law provisions (except to the extent
123
+ applicable law, if any, provides otherwise). This license is granted to you
124
+ personally and you agree not to assign your rights herein. Any attempted
125
+ assignment by you shall be null and void. If any provision of this Agreement
126
+ is held to be unenforceable, such provision shall be reformed only to the
127
+ extent necessary to make it enforceable.
128
+
129
+ SPECIAL LICENSE. Any use of the Active Worlds SDK which is not detailed in
130
+ this License Agreement is prohibited without a special License from
131
+ Activeworlds Inc.
@@ -0,0 +1,10 @@
1
+ ---
2
+ :simple_event_config:
3
+ :universe_port: 5870
4
+ :enter_global: true
5
+ :citizen_id: 1
6
+ :app_name: SampleBot
7
+ :worldname: <worldname>
8
+ :password: <password>
9
+ :universe_server: <server>
10
+
@@ -0,0 +1,29 @@
1
+ $:.unshift "#{File.dirname(__FILE__)}/../lib"
2
+ require 'yaml'
3
+ require 'ruby_aw.rb'
4
+
5
+ $configs = YAML.load_file("configs.yml")[:simple_event_config]
6
+
7
+ class SampleEventBot < RubyAw
8
+
9
+ def avatar_add_event_callback
10
+ attrs = attributes_for(:AW_EVENT_AVATAR_ADD)
11
+ puts "** Avatar added: parameters are #{attrs.inspect}"
12
+ end
13
+
14
+ def self.bot_for_world(worldname)
15
+ bot = SampleEventBot.new($configs[:universe_server], $configs[:universe_port], $configs[:enter_global])
16
+ bot.login($configs[:app_name], $configs[:citizen_id], $configs[:password])
17
+ bot.enter(worldname)
18
+ bot.receive :AW_EVENT_AVATAR_ADD
19
+ bot
20
+ end
21
+ end
22
+
23
+ bot = SampleEventBot.bot_for_world($configs[:worldname])
24
+
25
+ 3.times do
26
+ while 0 == SampleEventBot.ruby_aw_wait(2000)
27
+ puts "Taking a break"
28
+ end
29
+ end
data/ext/extconf.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'mkmf'
2
+
3
+ dir_config("awsdk")
4
+
5
+ $CFLAGS << "-x c++"
6
+ $LDFLAGS << "-Wl,-rpath,. -law_sdk.41 -lstdc++"
7
+
8
+ create_makefile("ruby_activeworld")