local skynet = require "skynet" require "skynet.manager" local cluster = require "skynet.cluster" local logger = require "logger" skynet.start(function() logger.info("game start") local daemon = skynet.getenv("daemon") if not daemon then skynet.newservice("console") end skynet.newservice("debug_console", "127.0.0.1", assert(option.console_port)) -- skynet.newservice("protoloader") local snowflake = skynet.newservice("snowflake") skynet.call(snowflake, "lua", "start") skynet.newservice("webserver") -- skynet.newservice("https_client") -- 新版本skynet 代https访问 if option.cluster then cluster.reload(option.cluster) if option.cluster.address then cluster.open("address") end if option.cluster.log then cluster.proxy("log", "logserver") end end local loginserver = skynet.newservice("loginserver") local log = skynet.newservice("log") local mq = skynet.newservice("mq") local assetcenter = skynet.newservice("assetcenter") local namecenter = skynet.newservice("namecenter") local usercenter = skynet.newservice("usercenter") local mailbox = skynet.newservice("mailbox") local recharge = skynet.newservice("recharge") local ws_watchdog = skynet.newservice("ws_watchdog") -- local quest = skynet.newservice("quest") -- local gift = skynet.newservice("gift") -- local rankinglist = skynet.newservice("rankinglist") -- local act_rankinglist = skynet.newservice("act_rankinglist") -- local relic_manual = skynet.newservice("relic_manual") -- local activitytime = skynet.newservice("activitytime") -- local itemavg = skynet.newservice("itemavg") -- local statistics = skynet.newservice("statistics") -- local watchdog = skynet.newservice("watchdog") skynet.call(loginserver, "lua", "start") skynet.call(log, "lua", "start") skynet.call(mq, "lua", "start") skynet.call(assetcenter, "lua", "start") skynet.call(namecenter, "lua", "start") skynet.call(usercenter, "lua", "start") skynet.call(mailbox, "lua", "start") skynet.call(recharge, "lua", "start") -- skynet.call(quest, "lua", "start") -- skynet.call(gift, "lua", "start") -- skynet.call(rankinglist, "lua", "start") -- skynet.call(act_rankinglist, "lua", "start") -- skynet.call(activitytime, "lua", "start") -- skynet.call(itemavg, "lua", "start") -- skynet.call(statistics, "lua", "start") -- skynet.call(relic_manual, "lua", "start") -- skynet.call(watchdog, "lua", "start", { -- port = option.game_port, -- maxclient = option.max_client, -- nodelay = true, -- }) skynet.call(ws_watchdog, "lua", "start", { port = option.game_port, maxclient = option.max_client, nodelay = true, protocol = "ws", }) skynet.exit() end)