rubyfox-client 0.6.0-java → 0.7.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.tool-versions +2 -0
- data/examples/README.md +39 -0
- data/examples/any.rb +1 -1
- data/examples/keep_alive.rb +1 -1
- data/examples/simple.rb +1 -1
- data/examples/smartfox/.gitignore +2 -0
- data/examples/smartfox/.tool-versions +1 -0
- data/examples/smartfox/Gemfile +3 -0
- data/examples/smartfox/template/config/log4j.properties +79 -0
- data/examples/smartfox/template/config/server.xml +97 -0
- data/examples/smartfox/template/extensions/examples/config.properties +4 -0
- data/examples/smartfox/template/extensions/examples/rubyfox.jar +0 -0
- data/examples/smartfox/template/lib/apache-tomcat/conf/server.xml +161 -0
- data/examples/smartfox/template/lib/rubyfox.rb +34 -0
- data/examples/smartfox/template/sfs2x.sh +21 -0
- data/examples/smartfox/template/version +1 -0
- data/examples/smartfox/template/zones/examples.zone.xml +81 -0
- data/lib/rubyfox/client/request.rb +5 -3
- data/lib/rubyfox/client/version.rb +1 -1
- metadata +17 -8
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f84d3ff5226bbb88b83a90faf9a61501d6ef41fdeaf4a8710a859e7791975a21
|
|
4
|
+
data.tar.gz: 2b9e516735e53449fdd6b597c27a0f7d2a8d1e97b48648dbb9a0c002f6f5e1e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a80fc361540c4a1b74552f6f725d9815e77387fa87baf8fc6948ff0a1ca8a76d5e50f2704e6a4da493643022c84f59ce98731644f378dae1a9818d018a41c8f5
|
|
7
|
+
data.tar.gz: bd827a596987dc9a30034e52e8916ea8adbd7467f9d3e01981cb090c523e41fc4c26e0d9ee4f9722574fe1410522df137f110d1f09f2eebb361cc1f34b8f5a03
|
data/.tool-versions
ADDED
data/examples/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
## Test smartfox instance
|
|
2
|
+
|
|
3
|
+
Boots a minimal SmartFoxServer instance, just enough to run the scripts in
|
|
4
|
+
this directory: a single `examples` zone with no login/database backing, and
|
|
5
|
+
a JRuby extension that answers the `KeepAlive` request/response used by
|
|
6
|
+
`keep_alive.rb` and `any.rb`.
|
|
7
|
+
|
|
8
|
+
Run
|
|
9
|
+
|
|
10
|
+
```shell
|
|
11
|
+
cd smartfox/
|
|
12
|
+
|
|
13
|
+
bundle install
|
|
14
|
+
|
|
15
|
+
bundle exec smartfox install instance/
|
|
16
|
+
|
|
17
|
+
# Download used JRuby
|
|
18
|
+
mkdir -p template/extensions/__lib__
|
|
19
|
+
curl -Lo template/extensions/__lib__/jruby-complete-10.0.6.0.jar \
|
|
20
|
+
https://repo1.maven.org/maven2/org/jruby/jruby-complete/10.0.6.0/jruby-complete-10.0.6.0.jar
|
|
21
|
+
|
|
22
|
+
# Configure SmartFox server based on templates directory overwriting any conflicts
|
|
23
|
+
yes | bundle exec smartfox configure instance/ template/
|
|
24
|
+
|
|
25
|
+
# Start the SmartFox server
|
|
26
|
+
bundle exec smartfox start instance/
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then, from `examples/`, run an example against the `examples` zone:
|
|
30
|
+
|
|
31
|
+
```shell
|
|
32
|
+
export SF_DIR=`pwd`/smartfox/instance
|
|
33
|
+
|
|
34
|
+
bundle exec ruby simple.rb some_user some_password examples
|
|
35
|
+
bundle exec ruby any.rb some_user some_password examples
|
|
36
|
+
bundle exec ruby keep_alive.rb some_user some_password examples
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
You need to `CTRL+C` each example.
|
data/examples/any.rb
CHANGED
|
@@ -11,7 +11,7 @@ end
|
|
|
11
11
|
Rubyfox::Client.require_libs(ENV["SF_DIR"] + "/lib")
|
|
12
12
|
Rubyfox::Client.boot!
|
|
13
13
|
|
|
14
|
-
Rubyfox::Client.new(:debug => true) do |client|
|
|
14
|
+
Rubyfox::Client.new(:debug => true, :zone => ARGV[2]) do |client|
|
|
15
15
|
client.on_event :connection do
|
|
16
16
|
client.send :login, *ARGV
|
|
17
17
|
end
|
data/examples/keep_alive.rb
CHANGED
|
@@ -11,7 +11,7 @@ end
|
|
|
11
11
|
Rubyfox::Client.require_libs(ENV["SF_DIR"] + "/lib")
|
|
12
12
|
Rubyfox::Client.boot!
|
|
13
13
|
|
|
14
|
-
Rubyfox::Client.new(:debug => true) do |client|
|
|
14
|
+
Rubyfox::Client.new(:debug => true, :zone => ARGV[2]) do |client|
|
|
15
15
|
client.on_event :connection do
|
|
16
16
|
client.send :login, *ARGV
|
|
17
17
|
end
|
data/examples/simple.rb
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ruby 4.0.6
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with
|
|
3
|
+
# this work for additional information regarding copyright ownership.
|
|
4
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
5
|
+
# (the "License"); you may not use this file except in compliance with
|
|
6
|
+
# the License. You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# An example log4j configuration file that outputs to System.out. The
|
|
18
|
+
# output information consists of relative time, log level, thread
|
|
19
|
+
# name, logger name, nested diagnostic context and the message in that
|
|
20
|
+
# order.
|
|
21
|
+
|
|
22
|
+
# For the general syntax of property based configuration files see the
|
|
23
|
+
# documenation of org.apache.log4j.PropertyConfigurator.
|
|
24
|
+
|
|
25
|
+
#log4j.rootLogger=DEBUG, fileAppender, consoleAppender
|
|
26
|
+
|
|
27
|
+
# ConsoleAppender
|
|
28
|
+
log4j.appender.consoleAppender=org.apache.log4j.ConsoleAppender
|
|
29
|
+
log4j.appender.consoleAppender.layout=org.apache.log4j.PatternLayout
|
|
30
|
+
log4j.appender.consoleAppender.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%t] %c{2} %3x - %m%n
|
|
31
|
+
|
|
32
|
+
# SocketAppender
|
|
33
|
+
#log4j.appender.socketAppender=org.apache.log4j.net.SocketAppender
|
|
34
|
+
#log4j.appender.socketAppender.remoteHost=localhost
|
|
35
|
+
#log4j.appender.socketAppender.port=4445
|
|
36
|
+
#log4j.appender.socketAppender.locationInfo=true
|
|
37
|
+
|
|
38
|
+
# Regular FileAppender
|
|
39
|
+
# NOTE: altering the ConversionPattern will cause a portion of the AdminTool's Log Viewer module to stop working properly
|
|
40
|
+
log4j.appender.fileAppender=org.apache.log4j.DailyRollingFileAppender
|
|
41
|
+
log4j.appender.fileAppender.layout=org.apache.log4j.PatternLayout
|
|
42
|
+
log4j.appender.fileAppender.File=logs/smartfox.log
|
|
43
|
+
log4j.appender.fileAppender.layout.ConversionPattern=%d{dd MMM yyyy | HH:mm:ss,SSS} | %-5p | %t | %c{3} | %3x | %m%n
|
|
44
|
+
log4j.appender.fileAppender.Encoding=UTF-8
|
|
45
|
+
log4j.appender.fileAppender.DatePattern='.'yyyy-MM-dd
|
|
46
|
+
|
|
47
|
+
# BootLogger FileAppender(s)
|
|
48
|
+
log4j.appender.bootFileAppender=org.apache.log4j.DailyRollingFileAppender
|
|
49
|
+
log4j.appender.bootFileAppender.layout=org.apache.log4j.PatternLayout
|
|
50
|
+
log4j.appender.bootFileAppender.File=logs/boot/boot.log
|
|
51
|
+
log4j.appender.bootConsoleAppender.threshold=DEBUG
|
|
52
|
+
log4j.appender.bootFileAppender.layout.ConversionPattern=%d{dd MMM yyyy | HH:mm:ss,SSS} | %-5p | %t | %c{3} | %3x | %m%n
|
|
53
|
+
log4j.appender.bootFileAppender.Encoding=UTF-8
|
|
54
|
+
|
|
55
|
+
log4j.appender.bootConsoleAppender=org.apache.log4j.ConsoleAppender
|
|
56
|
+
log4j.appender.bootConsoleAppender.layout=org.apache.log4j.PatternLayout
|
|
57
|
+
log4j.appender.bootConsoleAppender.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%t] %c{3} %3x - %m%n
|
|
58
|
+
log4j.appender.bootConsoleAppender.threshold=WARN
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# ConversionPattern=%-4r %-5p [%t] %37c %3x - %m%n
|
|
62
|
+
|
|
63
|
+
# The file is rolled over very day
|
|
64
|
+
# '.'yyyy-MM-dd-HH rolls every hour
|
|
65
|
+
# '.'yyyy-MM-dd-HH-mm rolls every minute
|
|
66
|
+
log4j.appender.fileAppender.DatePattern ='.'yyyy-MM-dd-HH
|
|
67
|
+
|
|
68
|
+
# log4j.category.com.smartfoxserver.v2=DEBUG,consoleAppender,fileAppender,socketAppender
|
|
69
|
+
log4j.category.com.smartfoxserver=INFO,consoleAppender,fileAppender
|
|
70
|
+
log4j.category.org.apache=INFO,consoleAppender,fileAppender
|
|
71
|
+
log4j.category.org.apache.http=INFO,consoleAppender,fileAppender
|
|
72
|
+
log4j.category.org.eclipse.jetty=WARN,consoleAppender,fileAppender
|
|
73
|
+
log4j.category.bootLogger=DEBUG,bootFileAppender,bootConsoleAppender
|
|
74
|
+
log4j.category.sfs2x=INFO,consoleAppender,fileAppender
|
|
75
|
+
log4j.category.Extensions=INFO,consoleAppender,fileAppender
|
|
76
|
+
log4j.category.hsqldb.db=WARN,consoleAppender,fileAppender
|
|
77
|
+
log4j.category.jndi=INFO,consoleAppender,fileAppender
|
|
78
|
+
|
|
79
|
+
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<serverSettings>
|
|
2
|
+
<socketAddresses>
|
|
3
|
+
<socket address="0.0.0.0" port="9933" type="TCP"/>
|
|
4
|
+
<socket address="::/0" port="9933" type="TCP"/>
|
|
5
|
+
<socket address="::" port="9933" type="UDP"/>
|
|
6
|
+
</socketAddresses>
|
|
7
|
+
<ipFilter>
|
|
8
|
+
<addressBlackList/>
|
|
9
|
+
<addressWhiteList/>
|
|
10
|
+
<maxConnectionsPerAddress>9999999</maxConnectionsPerAddress>
|
|
11
|
+
</ipFilter>
|
|
12
|
+
<flashCrossdomainPolicy>
|
|
13
|
+
<useMasterSocketPolicy>true</useMasterSocketPolicy>
|
|
14
|
+
<policyXmlFile>crossdomain.xml</policyXmlFile>
|
|
15
|
+
</flashCrossdomainPolicy>
|
|
16
|
+
<systemControllerRequestQueueSize>40000</systemControllerRequestQueueSize>
|
|
17
|
+
<extensionControllerRequestQueueSize>40000</extensionControllerRequestQueueSize>
|
|
18
|
+
<schedulerThreadPoolSize>4</schedulerThreadPoolSize>
|
|
19
|
+
<protocolCompressionThreshold>1024</protocolCompressionThreshold>
|
|
20
|
+
<protocolMode>BINARY</protocolMode>
|
|
21
|
+
<useBinaryProtocol>true</useBinaryProtocol>
|
|
22
|
+
<remoteAdmin>
|
|
23
|
+
<administrators>
|
|
24
|
+
<adminUser>
|
|
25
|
+
<login>admin</login>
|
|
26
|
+
<password>changeme</password>
|
|
27
|
+
</adminUser>
|
|
28
|
+
</administrators>
|
|
29
|
+
<allowedRemoteAddresses>
|
|
30
|
+
</allowedRemoteAddresses>
|
|
31
|
+
<adminTcpPort>8080</adminTcpPort>
|
|
32
|
+
<useEncryption>false</useEncryption>
|
|
33
|
+
</remoteAdmin>
|
|
34
|
+
<bannedUserManager>
|
|
35
|
+
<isAutoRemove>true</isAutoRemove>
|
|
36
|
+
<isPersistent>true</isPersistent>
|
|
37
|
+
<customPersistenceClass></customPersistenceClass>
|
|
38
|
+
</bannedUserManager>
|
|
39
|
+
<extensionRemoteDebug>true</extensionRemoteDebug>
|
|
40
|
+
<useFriendlyExceptions>true</useFriendlyExceptions>
|
|
41
|
+
<mailer>
|
|
42
|
+
<isActive>false</isActive>
|
|
43
|
+
<mailHost>mail.example.com</mailHost>
|
|
44
|
+
<mailUser>mail</mailUser>
|
|
45
|
+
<mailPass>mail</mailPass>
|
|
46
|
+
<smtpPort>25</smtpPort>
|
|
47
|
+
<workerThreads>1</workerThreads>
|
|
48
|
+
</mailer>
|
|
49
|
+
<webServer>
|
|
50
|
+
<isActive>true</isActive>
|
|
51
|
+
<blueBoxPollingTimeout>26</blueBoxPollingTimeout>
|
|
52
|
+
<blueBoxMsgQueueSize>40</blueBoxMsgQueueSize>
|
|
53
|
+
<isWSActive>true</isWSActive>
|
|
54
|
+
</webServer>
|
|
55
|
+
<analytics>
|
|
56
|
+
<isActive>false</isActive>
|
|
57
|
+
<runOnDay>[everyday]</runOnDay>
|
|
58
|
+
<runAtHour>2</runAtHour>
|
|
59
|
+
<runOnStartup>false</runOnStartup>
|
|
60
|
+
<rebuildDB>false</rebuildDB>
|
|
61
|
+
<skipGeolocation>false</skipGeolocation>
|
|
62
|
+
<sourceFolder></sourceFolder>
|
|
63
|
+
<locale></locale>
|
|
64
|
+
</analytics>
|
|
65
|
+
<systemThreadPoolSettings>
|
|
66
|
+
<name>Sys</name>
|
|
67
|
+
<coreThreads>4</coreThreads>
|
|
68
|
+
<backupThreads>8</backupThreads>
|
|
69
|
+
<maxBackups>16</maxBackups>
|
|
70
|
+
<queueSizeTriggeringBackup>100</queueSizeTriggeringBackup>
|
|
71
|
+
<secondsTriggeringBackup>50</secondsTriggeringBackup>
|
|
72
|
+
<backupThreadsExpiry>3600</backupThreadsExpiry>
|
|
73
|
+
<queueSizeTriggeringBackupExpiry>60</queueSizeTriggeringBackupExpiry>
|
|
74
|
+
<logActivity>true</logActivity>
|
|
75
|
+
<queueFullWarningInterval>300</queueFullWarningInterval>
|
|
76
|
+
</systemThreadPoolSettings>
|
|
77
|
+
<extensionThreadPoolSettings>
|
|
78
|
+
<name>Ext</name>
|
|
79
|
+
<coreThreads>4</coreThreads>
|
|
80
|
+
<backupThreads>8</backupThreads>
|
|
81
|
+
<maxBackups>16</maxBackups>
|
|
82
|
+
<queueSizeTriggeringBackup>100</queueSizeTriggeringBackup>
|
|
83
|
+
<secondsTriggeringBackup>50</secondsTriggeringBackup>
|
|
84
|
+
<backupThreadsExpiry>3600</backupThreadsExpiry>
|
|
85
|
+
<queueSizeTriggeringBackupExpiry>60</queueSizeTriggeringBackupExpiry>
|
|
86
|
+
<logActivity>true</logActivity>
|
|
87
|
+
<queueFullWarningInterval>300</queueFullWarningInterval>
|
|
88
|
+
</extensionThreadPoolSettings>
|
|
89
|
+
<startExtensionFileMonitor>true</startExtensionFileMonitor>
|
|
90
|
+
<useDebugMode>true</useDebugMode>
|
|
91
|
+
<sessionMaxIdleTime>200</sessionMaxIdleTime>
|
|
92
|
+
<userMaxIdleTime>300</userMaxIdleTime>
|
|
93
|
+
<licenseCode></licenseCode>
|
|
94
|
+
<licenseEmails></licenseEmails>
|
|
95
|
+
<ghostHunterEnabled>true</ghostHunterEnabled>
|
|
96
|
+
<statsExtraLoggingEnabled>true</statsExtraLoggingEnabled>
|
|
97
|
+
</serverSettings>
|
|
Binary file
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!--
|
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
+
contributor license agreements. See the NOTICE file distributed with
|
|
4
|
+
this work for additional information regarding copyright ownership.
|
|
5
|
+
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
+
(the "License"); you may not use this file except in compliance with
|
|
7
|
+
the License. You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
--><!-- Note: A "Server" is not itself a "Container", so you may not
|
|
17
|
+
define subcomponents such as "Valves" at this level.
|
|
18
|
+
Documentation at /docs/config/server.html
|
|
19
|
+
--><Server port="8005" shutdown="SHUTDOWN">
|
|
20
|
+
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
|
|
21
|
+
<!-- Security listener. Documentation at /docs/config/listeners.html
|
|
22
|
+
<Listener className="org.apache.catalina.security.SecurityListener" />
|
|
23
|
+
-->
|
|
24
|
+
<!--APR library loader. Documentation at /docs/apr.html -->
|
|
25
|
+
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
|
|
26
|
+
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
|
|
27
|
+
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
|
|
28
|
+
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
|
|
29
|
+
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
|
|
30
|
+
|
|
31
|
+
<!-- Global JNDI resources
|
|
32
|
+
Documentation at /docs/jndi-resources-howto.html
|
|
33
|
+
-->
|
|
34
|
+
<GlobalNamingResources>
|
|
35
|
+
<!-- Editable user database that can also be used by
|
|
36
|
+
UserDatabaseRealm to authenticate users
|
|
37
|
+
-->
|
|
38
|
+
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
|
|
39
|
+
</GlobalNamingResources>
|
|
40
|
+
|
|
41
|
+
<!-- A "Service" is a collection of one or more "Connectors" that share
|
|
42
|
+
a single "Container" Note: A "Service" is not itself a "Container",
|
|
43
|
+
so you may not define subcomponents such as "Valves" at this level.
|
|
44
|
+
Documentation at /docs/config/service.html
|
|
45
|
+
-->
|
|
46
|
+
<Service name="Catalina">
|
|
47
|
+
|
|
48
|
+
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
|
|
49
|
+
<!--
|
|
50
|
+
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
|
|
51
|
+
maxThreads="150" minSpareThreads="4"/>
|
|
52
|
+
-->
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<!-- A "Connector" represents an endpoint by which requests are received
|
|
56
|
+
and responses are returned. Documentation at :
|
|
57
|
+
Java HTTP Connector: /docs/config/http.html
|
|
58
|
+
Java AJP Connector: /docs/config/ajp.html
|
|
59
|
+
APR (HTTP/AJP) Connector: /docs/apr.html
|
|
60
|
+
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
|
|
61
|
+
-->
|
|
62
|
+
<Connector connectionTimeout="20000" address="0.0.0.0" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
|
|
63
|
+
<!-- A "Connector" using the shared thread pool-->
|
|
64
|
+
<!--
|
|
65
|
+
<Connector executor="tomcatThreadPool"
|
|
66
|
+
port="8080" protocol="HTTP/1.1"
|
|
67
|
+
connectionTimeout="20000"
|
|
68
|
+
redirectPort="8443" />
|
|
69
|
+
-->
|
|
70
|
+
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
|
|
71
|
+
This connector uses the NIO implementation. The default
|
|
72
|
+
SSLImplementation will depend on the presence of the APR/native
|
|
73
|
+
library and the useOpenSSL attribute of the
|
|
74
|
+
AprLifecycleListener.
|
|
75
|
+
Either JSSE or OpenSSL style configuration may be used regardless of
|
|
76
|
+
the SSLImplementation selected. JSSE style configuration is used below.
|
|
77
|
+
-->
|
|
78
|
+
<!--
|
|
79
|
+
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
|
|
80
|
+
maxThreads="150" SSLEnabled="true">
|
|
81
|
+
<SSLHostConfig>
|
|
82
|
+
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
|
|
83
|
+
type="RSA" />
|
|
84
|
+
</SSLHostConfig>
|
|
85
|
+
</Connector>
|
|
86
|
+
-->
|
|
87
|
+
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
|
|
88
|
+
This connector uses the APR/native implementation which always uses
|
|
89
|
+
OpenSSL for TLS.
|
|
90
|
+
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
|
|
91
|
+
configuration is used below.
|
|
92
|
+
-->
|
|
93
|
+
<!--
|
|
94
|
+
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
|
|
95
|
+
maxThreads="150" SSLEnabled="true" >
|
|
96
|
+
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
|
|
97
|
+
<SSLHostConfig>
|
|
98
|
+
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
|
|
99
|
+
certificateFile="conf/localhost-rsa-cert.pem"
|
|
100
|
+
certificateChainFile="conf/localhost-rsa-chain.pem"
|
|
101
|
+
type="RSA" />
|
|
102
|
+
</SSLHostConfig>
|
|
103
|
+
</Connector>
|
|
104
|
+
-->
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
<!-- Define an AJP 1.3 Connector on port 8009 -->
|
|
109
|
+
<!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> -->
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<!-- An Engine represents the entry point (within Catalina) that processes
|
|
113
|
+
every request. The Engine implementation for Tomcat stand alone
|
|
114
|
+
analyzes the HTTP headers included with the request, and passes them
|
|
115
|
+
on to the appropriate Host (virtual host).
|
|
116
|
+
Documentation at /docs/config/engine.html -->
|
|
117
|
+
|
|
118
|
+
<!-- You should set jvmRoute to support load-balancing via AJP ie :
|
|
119
|
+
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
|
|
120
|
+
-->
|
|
121
|
+
|
|
122
|
+
<Engine defaultHost="localhost" name="Catalina">
|
|
123
|
+
|
|
124
|
+
<!--For clustering, please take a look at documentation at:
|
|
125
|
+
/docs/cluster-howto.html (simple how to)
|
|
126
|
+
/docs/config/cluster.html (reference documentation) -->
|
|
127
|
+
<!--
|
|
128
|
+
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
|
|
129
|
+
-->
|
|
130
|
+
|
|
131
|
+
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
|
|
132
|
+
via a brute-force attack -->
|
|
133
|
+
<Realm className="org.apache.catalina.realm.LockOutRealm">
|
|
134
|
+
<!-- This Realm uses the UserDatabase configured in the global JNDI
|
|
135
|
+
resources under the key "UserDatabase". Any edits
|
|
136
|
+
that are performed against this UserDatabase are immediately
|
|
137
|
+
available for use by the Realm. -->
|
|
138
|
+
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
|
|
139
|
+
</Realm>
|
|
140
|
+
|
|
141
|
+
<Host appBase="../../www" autoDeploy="true" name="localhost" unpackWARs="false">
|
|
142
|
+
|
|
143
|
+
<!-- SingleSignOn valve, share authentication between web applications
|
|
144
|
+
Documentation at: /docs/config/valve.html -->
|
|
145
|
+
<!--
|
|
146
|
+
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
|
|
147
|
+
-->
|
|
148
|
+
|
|
149
|
+
<!-- Access log processes all example.
|
|
150
|
+
Documentation at: /docs/config/valve.html
|
|
151
|
+
Note: The pattern used is equivalent to using pattern="common" -->
|
|
152
|
+
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="../../logs/http/" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/>
|
|
153
|
+
|
|
154
|
+
<Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
|
|
155
|
+
|
|
156
|
+
<Valve className="sfs2x.ws.tomcat.shared.WSUpgradeFilter"/>
|
|
157
|
+
|
|
158
|
+
</Host>
|
|
159
|
+
</Engine>
|
|
160
|
+
<Connector SSLEnabled="true" clientAuth="false" keystoreFile="lib/apache-tomcat/conf/keystore.jks" keystorePass="password" maxThreads="200" address="0.0.0.0" port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sslProtocol="TLS"/></Service>
|
|
161
|
+
</Server>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require "java"
|
|
2
|
+
|
|
3
|
+
module Rubyfox
|
|
4
|
+
SFSObject = com.smartfoxserver.v2.entities.data.SFSObject
|
|
5
|
+
|
|
6
|
+
class Handler
|
|
7
|
+
def initialize(extension)
|
|
8
|
+
@extension = extension
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def on_init
|
|
12
|
+
@extension.trace "examples extension ready"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def on_request(command, user, params)
|
|
16
|
+
case command
|
|
17
|
+
when "KeepAlive"
|
|
18
|
+
response = SFSObject.new_instance
|
|
19
|
+
response.put_int "next_in", 5
|
|
20
|
+
@extension.send "KeepAlive", response, user
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def on_event(event)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def on_destroy
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.init(extension)
|
|
32
|
+
Handler.new(extension)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Use -Dlog4j.debug for Log4J startup debugging info
|
|
2
|
+
# Use -Xms512M -Xmx512M to start with 512MB of heap memory. Set size according to your needs.
|
|
3
|
+
|
|
4
|
+
JRE_FOLDER="../jre/bin"
|
|
5
|
+
JAVA_CMD="java"
|
|
6
|
+
if [ -d "$JRE_FOLDER" ]; then
|
|
7
|
+
JAVA_CMD="../jre/bin/java"
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
# Java 9+ blocks deep reflection into JDK internals. The bundled XStream 1.3.1
|
|
11
|
+
# (SFS config loading) and the embedded JRuby runtime both rely on it.
|
|
12
|
+
JAVA_OPTS="--add-opens=java.base/java.lang=ALL-UNNAMED \
|
|
13
|
+
--add-opens=java.base/java.util=ALL-UNNAMED \
|
|
14
|
+
--add-opens=java.base/java.text=ALL-UNNAMED \
|
|
15
|
+
--add-opens=java.base/java.io=ALL-UNNAMED \
|
|
16
|
+
--add-opens=java.base/java.nio.channels=ALL-UNNAMED \
|
|
17
|
+
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
|
|
18
|
+
--add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
|
|
19
|
+
|
|
20
|
+
CPATH="./:lib/*:lib/apache-tomcat/bin/*:extensions/__lib__/*"
|
|
21
|
+
exec ${JAVA_CMD} ${JAVA_OPTS} -cp ${CPATH} -Dfile.encoding=UTF-8 com.smartfoxserver.v2.Main $1 $2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.19.0
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<zone>
|
|
2
|
+
<name>examples</name>
|
|
3
|
+
<isCustomLogin>false</isCustomLogin>
|
|
4
|
+
<isForceLogout>true</isForceLogout>
|
|
5
|
+
<applyWordsFilterToUserName>false</applyWordsFilterToUserName>
|
|
6
|
+
<applyWordsFilterToRoomName>false</applyWordsFilterToRoomName>
|
|
7
|
+
<applyWordsFilterToPrivateMessages>false</applyWordsFilterToPrivateMessages>
|
|
8
|
+
<isFilterBuddyMessages>false</isFilterBuddyMessages>
|
|
9
|
+
<isEncrypted>false</isEncrypted>
|
|
10
|
+
<maxUsers>10000</maxUsers>
|
|
11
|
+
<maxUserVariablesAllowed>5</maxUserVariablesAllowed>
|
|
12
|
+
<maxRoomVariablesAllowed>5</maxRoomVariablesAllowed>
|
|
13
|
+
<minRoomNameChars>3</minRoomNameChars>
|
|
14
|
+
<maxRoomNameChars>100</maxRoomNameChars>
|
|
15
|
+
<maxRooms>20000</maxRooms>
|
|
16
|
+
<maxRoomsCreatedPerUser>10</maxRoomsCreatedPerUser>
|
|
17
|
+
<userCountChangeUpdateInterval>1000</userCountChangeUpdateInterval>
|
|
18
|
+
<userReconnectionSeconds>0</userReconnectionSeconds>
|
|
19
|
+
<overrideMaxUserIdleTime>30</overrideMaxUserIdleTime>
|
|
20
|
+
<maxFailedLogins>10</maxFailedLogins>
|
|
21
|
+
<allowGuestUsers>false</allowGuestUsers>
|
|
22
|
+
<guestUserNamePrefix>Guest#</guestUserNamePrefix>
|
|
23
|
+
<publicRoomGroups>default</publicRoomGroups>
|
|
24
|
+
<defaultRoomGroups>default</defaultRoomGroups>
|
|
25
|
+
<defaultPlayerIdGeneratorClass></defaultPlayerIdGeneratorClass>
|
|
26
|
+
<allowInvitationsOnlyForBuddies>true</allowInvitationsOnlyForBuddies>
|
|
27
|
+
<maxUsersPerJoinInvitationRequest>5</maxUsersPerJoinInvitationRequest>
|
|
28
|
+
<geoLocationEnabled>false</geoLocationEnabled>
|
|
29
|
+
<wordsFilter active="false">
|
|
30
|
+
<useWarnings>false</useWarnings>
|
|
31
|
+
<warningsBeforeKick>3</warningsBeforeKick>
|
|
32
|
+
<kicksBeforeBan>2</kicksBeforeBan>
|
|
33
|
+
<banDuration>1440</banDuration>
|
|
34
|
+
<maxBadWordsPerMessage>0</maxBadWordsPerMessage>
|
|
35
|
+
<kicksBeforeBanMinutes>3</kicksBeforeBanMinutes>
|
|
36
|
+
<secondsBeforeBanOrKick>5</secondsBeforeBanOrKick>
|
|
37
|
+
<warningMessage>Stop swearing or you will be banned</warningMessage>
|
|
38
|
+
<kickMessage>Swearing not allowed: you are being kicked</kickMessage>
|
|
39
|
+
<banMessage>Too much swearing: you are banned</banMessage>
|
|
40
|
+
<wordsFile>config/wordsFile.txt</wordsFile>
|
|
41
|
+
<filterMode>BLACKLIST</filterMode>
|
|
42
|
+
<banMode>NAME</banMode>
|
|
43
|
+
<hideBadWordWithCharacter>*</hideBadWordWithCharacter>
|
|
44
|
+
</wordsFilter>
|
|
45
|
+
<floodFilter active="false">
|
|
46
|
+
<banDurationMinutes>1440</banDurationMinutes>
|
|
47
|
+
<maxFloodingAttempts>5</maxFloodingAttempts>
|
|
48
|
+
<secondsBeforeBan>5</secondsBeforeBan>
|
|
49
|
+
<banMode>NAME</banMode>
|
|
50
|
+
<logFloodingAttempts>true</logFloodingAttempts>
|
|
51
|
+
<banMessage>Too much flooding, you are banned</banMessage>
|
|
52
|
+
</floodFilter>
|
|
53
|
+
<rooms>
|
|
54
|
+
</rooms>
|
|
55
|
+
<disabledSystemEvents/>
|
|
56
|
+
<privilegeManager active="false">
|
|
57
|
+
<profiles/>
|
|
58
|
+
</privilegeManager>
|
|
59
|
+
<extension>
|
|
60
|
+
<name>examples</name>
|
|
61
|
+
<type>JAVA</type>
|
|
62
|
+
<file>com.neopoly.rubyfox.RubyExtension</file>
|
|
63
|
+
<propertiesFile></propertiesFile>
|
|
64
|
+
<reloadMode>NONE</reloadMode>
|
|
65
|
+
</extension>
|
|
66
|
+
<buddyList active="false">
|
|
67
|
+
<allowOfflineBuddyVariables>true</allowOfflineBuddyVariables>
|
|
68
|
+
<maxItemsPerList>100</maxItemsPerList>
|
|
69
|
+
<maxBuddyVariables>15</maxBuddyVariables>
|
|
70
|
+
<offlineBuddyVariablesCacheSize>500</offlineBuddyVariablesCacheSize>
|
|
71
|
+
<customStorageClass></customStorageClass>
|
|
72
|
+
<useTempBuddies>true</useTempBuddies>
|
|
73
|
+
<buddyStates>
|
|
74
|
+
<string>Available</string>
|
|
75
|
+
<string>Away</string>
|
|
76
|
+
<string>Occupied</string>
|
|
77
|
+
</buddyStates>
|
|
78
|
+
<badWordsFilter isActive="false"/>
|
|
79
|
+
</buddyList>
|
|
80
|
+
<databaseManager active="false"/>
|
|
81
|
+
</zone>
|
|
@@ -5,15 +5,17 @@ module Rubyfox
|
|
|
5
5
|
module Client
|
|
6
6
|
Request = Java::Request
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
def self.inflector
|
|
9
|
+
@inflector ||= Dry::Inflector.new
|
|
10
|
+
end
|
|
10
11
|
|
|
12
|
+
module Request
|
|
11
13
|
def self.[](name)
|
|
12
14
|
case name
|
|
13
15
|
when Request::BaseRequest
|
|
14
16
|
name
|
|
15
17
|
else
|
|
16
|
-
name =
|
|
18
|
+
name = Client.inflector.camelize(name.to_s)
|
|
17
19
|
name += "Request" unless name.end_with?("Request")
|
|
18
20
|
Request.__send__(name)
|
|
19
21
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubyfox-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Leitzen
|
|
8
8
|
- Jakob Holderbaum
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: dry-inflector
|
|
@@ -76,14 +75,26 @@ extensions: []
|
|
|
76
75
|
extra_rdoc_files: []
|
|
77
76
|
files:
|
|
78
77
|
- ".gitignore"
|
|
79
|
-
- ".
|
|
80
|
-
- ".ruby-version"
|
|
78
|
+
- ".tool-versions"
|
|
81
79
|
- Gemfile
|
|
82
80
|
- README.rdoc
|
|
83
81
|
- Rakefile
|
|
82
|
+
- examples/README.md
|
|
84
83
|
- examples/any.rb
|
|
85
84
|
- examples/keep_alive.rb
|
|
86
85
|
- examples/simple.rb
|
|
86
|
+
- examples/smartfox/.gitignore
|
|
87
|
+
- examples/smartfox/.tool-versions
|
|
88
|
+
- examples/smartfox/Gemfile
|
|
89
|
+
- examples/smartfox/template/config/log4j.properties
|
|
90
|
+
- examples/smartfox/template/config/server.xml
|
|
91
|
+
- examples/smartfox/template/extensions/examples/config.properties
|
|
92
|
+
- examples/smartfox/template/extensions/examples/rubyfox.jar
|
|
93
|
+
- examples/smartfox/template/lib/apache-tomcat/conf/server.xml
|
|
94
|
+
- examples/smartfox/template/lib/rubyfox.rb
|
|
95
|
+
- examples/smartfox/template/sfs2x.sh
|
|
96
|
+
- examples/smartfox/template/version
|
|
97
|
+
- examples/smartfox/template/zones/examples.zone.xml
|
|
87
98
|
- lib/rubyfox/client.rb
|
|
88
99
|
- lib/rubyfox/client/config.rb
|
|
89
100
|
- lib/rubyfox/client/event.rb
|
|
@@ -103,7 +114,6 @@ files:
|
|
|
103
114
|
homepage: https://github.com/neopoly/rubyfox-client
|
|
104
115
|
licenses: []
|
|
105
116
|
metadata: {}
|
|
106
|
-
post_install_message:
|
|
107
117
|
rdoc_options: []
|
|
108
118
|
require_paths:
|
|
109
119
|
- lib
|
|
@@ -118,8 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
118
128
|
- !ruby/object:Gem::Version
|
|
119
129
|
version: '0'
|
|
120
130
|
requirements: []
|
|
121
|
-
rubygems_version: 3.
|
|
122
|
-
signing_key:
|
|
131
|
+
rubygems_version: 3.7.2
|
|
123
132
|
specification_version: 4
|
|
124
133
|
summary: ''
|
|
125
134
|
test_files: []
|
data/.ruby-gemset
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
rubyfox-client
|
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
jruby
|