Blame view

src/main.lua 664 Bytes
314bc5df   zhengshouren   提交服务器初始代码
1
2
3
4
5
6
7
  local skynet = require "skynet"
  
  local max_client = 64
  
  skynet.start(function()
  	print("Server start")
  	skynet.newservice("console")
3a694834   zhengshouren   修改默认配置
8
  	skynet.newservice("debug_console", 10001)
314bc5df   zhengshouren   提交服务器初始代码
9
  
3a694834   zhengshouren   修改默认配置
10
  	local ngxd = skynet.newservice("services/ngxd", 11001)
3fe4471e   zhouhaihai   热更新 demo
11
  	local httpd = skynet.newservice("services/httpweb", 8001)
314bc5df   zhengshouren   提交服务器初始代码
12
  	local watchdog = skynet.newservice("services/watchdog", max_client)
3fe4471e   zhouhaihai   热更新 demo
13
  
314bc5df   zhengshouren   提交服务器初始代码
14
  	skynet.call(watchdog, "lua", "start", {
3a694834   zhengshouren   修改默认配置
15
  		port = 12001,
314bc5df   zhengshouren   提交服务器初始代码
16
17
  		maxclient = max_client,
  		ngxd = ngxd,
3fe4471e   zhouhaihai   热更新 demo
18
  		httpd = httpd,
314bc5df   zhengshouren   提交服务器初始代码
19
20
  
  		redishost = "127.0.0.1",
b8a42026   zhengshouren   没必要提交的文件
21
22
  		redisport = 6100,
  		redisdb = 1,
314bc5df   zhengshouren   提交服务器初始代码
23
24
25
26
27
28
29
30
31
32
  		auth = nil,
  
  		mongohost = "127.0.0.1",
  		mongoport = nil,
  		mongouser = nil,
  		mongopswd = nil,
  	})
  
  	skynet.exit()
  end)