diff options
author | Adam Frisby | 2007-11-06 21:41:11 +0000 |
---|---|---|
committer | Adam Frisby | 2007-11-06 21:41:11 +0000 |
commit | c0010e4940dd0ca067d469d8194be69b2bc1dece (patch) | |
tree | 3dd9a39e2b9db0d6e97e15c8b3bb7d595f2da612 /share/ruby/config.rb | |
parent | set svn:eol-style (diff) | |
download | opensim-SC_OLD-c0010e4940dd0ca067d469d8194be69b2bc1dece.zip opensim-SC_OLD-c0010e4940dd0ca067d469d8194be69b2bc1dece.tar.gz opensim-SC_OLD-c0010e4940dd0ca067d469d8194be69b2bc1dece.tar.bz2 opensim-SC_OLD-c0010e4940dd0ca067d469d8194be69b2bc1dece.tar.xz |
* Moved /branches/ruby to /trunk/share/ruby
Diffstat (limited to '')
-rw-r--r-- | share/ruby/config.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/share/ruby/config.rb b/share/ruby/config.rb new file mode 100644 index 0000000..8484274 --- /dev/null +++ b/share/ruby/config.rb | |||
@@ -0,0 +1,38 @@ | |||
1 | # Various config data | ||
2 | |||
3 | class SimConfig | ||
4 | attr_reader :cfgSimName, :cfgSimIP, :cfgSimPort, :cfgSimX, | ||
5 | :cfgSimX, :cfgSimY, :cfgAssetServerUrl, :cfgUserServerUrl | ||
6 | |||
7 | def initialize | ||
8 | @cfgSimName = "DalienLand" | ||
9 | @cfgSimIP = "192.168.1.103" | ||
10 | @cfgSimPort = "9000" | ||
11 | @cfgSimX = 997 | ||
12 | @cfgSimY = 996 | ||
13 | @cfgSimX = 1000 | ||
14 | @cfgSimY = 1000 | ||
15 | @cfgAssetServerUrl = "http://192.168.1.103:8003/" | ||
16 | @cfgUserServerUrl = "http://192.168.1.103:8003/" | ||
17 | end | ||
18 | |||
19 | end | ||
20 | |||
21 | |||
22 | class UUID | ||
23 | def initialize | ||
24 | @uuid = rand(1<<128) | ||
25 | end | ||
26 | def to_dashed_s | ||
27 | part1 = @uuid & 0xFFFFFFFFFFFF | ||
28 | part2 = (@uuid >> 48) && 0xFFFF | ||
29 | part3 = (@uuid >> (48 + 16)) & 0xFFFF | ||
30 | part4 = (@uuid >> (48 + 32)) & 0xFFFF | ||
31 | part5 = @uuid >> (128-32) | ||
32 | return sprintf "%08x-%04x-%04x-%04x-%012x", part5, part4, part3, part2, part1 | ||
33 | end | ||
34 | end | ||
35 | |||
36 | print UUID.new.to_dashed_s | ||
37 | |||
38 | |||