1
0

config.rb 851 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Various config data
  2. class SimConfig
  3. attr_reader :cfgSimName, :cfgSimIP, :cfgSimPort, :cfgSimX,
  4. :cfgSimX, :cfgSimY, :cfgAssetServerUrl, :cfgUserServerUrl
  5. def initialize
  6. @cfgSimName = "DalienLand"
  7. @cfgSimIP = "192.168.1.103"
  8. @cfgSimPort = "9000"
  9. @cfgSimX = 997
  10. @cfgSimY = 996
  11. @cfgSimX = 1000
  12. @cfgSimY = 1000
  13. @cfgAssetServerUrl = "http://192.168.1.103:8003/"
  14. @cfgUserServerUrl = "http://192.168.1.103:8003/"
  15. end
  16. end
  17. class UUID
  18. def initialize
  19. @uuid = rand(1<<128)
  20. end
  21. def to_dashed_s
  22. part1 = @uuid & 0xFFFFFFFFFFFF
  23. part2 = (@uuid >> 48) && 0xFFFF
  24. part3 = (@uuid >> (48 + 16)) & 0xFFFF
  25. part4 = (@uuid >> (48 + 32)) & 0xFFFF
  26. part5 = @uuid >> (128-32)
  27. return sprintf "%08x-%04x-%04x-%04x-%012x", part5, part4, part3, part2, part1
  28. end
  29. end
  30. print UUID.new.to_dashed_s