aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/share/ruby/config.rb
blob: 8484274f37dbf13cef7f2be0256ff644232ec41c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Various config data

class SimConfig
  attr_reader :cfgSimName, :cfgSimIP, :cfgSimPort, :cfgSimX, 
  		:cfgSimX, :cfgSimY, :cfgAssetServerUrl, :cfgUserServerUrl

  def initialize
    @cfgSimName = "DalienLand"
    @cfgSimIP = "192.168.1.103"
    @cfgSimPort = "9000"
    @cfgSimX = 997
    @cfgSimY = 996
    @cfgSimX = 1000
    @cfgSimY = 1000
    @cfgAssetServerUrl = "http://192.168.1.103:8003/"
    @cfgUserServerUrl = "http://192.168.1.103:8003/"
  end

end


class UUID
  def initialize
    @uuid = rand(1<<128)
  end
  def to_dashed_s
    part1 = @uuid & 0xFFFFFFFFFFFF
    part2 = (@uuid >> 48) && 0xFFFF
    part3 = (@uuid >> (48 + 16)) & 0xFFFF
    part4 = (@uuid >> (48 + 32)) & 0xFFFF
    part5 = @uuid >> (128-32)
    return sprintf "%08x-%04x-%04x-%04x-%012x", part5, part4, part3, part2, part1
  end
end

print UUID.new.to_dashed_s