private void Start() { _config = ConfigSingleton.GetInstance(); _waiting = UIHelper.CenterInParent(Instantiate(ConnectionBroker), MainCanvas.gameObject); _waiting.transform.Find("Button").gameObject.GetComponent <Button>().onClick.AddListener(SetupConnection); // _waiting = UIHelper.CenterInParent(Instantiate(WaitingScreen), MainCanvas.gameObject); }
// Use this for initialization private void Start() { string config = LoadFile(); ConfigContent configuration = JsonUtility.FromJson <ConfigContent>(config); ConfigSingleton configInstance = ConfigSingleton.GetInstance(); configInstance.SetMyNetworkConfig(new MyNetworkConfig(configuration.ServerIp, configuration.ServerPort)); transform.GetComponent <NetworkConnectionConfigurator>().SetupConnection(); }
private void btnStart_Click(object sender, EventArgs e) { Console.SetOut(tw); Console.WriteLine("Beginning ..."); var type = ConfigSingleton.CreateInstance().GetAppConfig <string>("ReptileType"); reptile = IocUnity.GetService <IReptile>(type); reptile.Start(); }
private Reptile() { var mem = new MatchEntityManager(); mem.Init(this); matchEntityManager = mem; IocUnity.RegisterInstance("MatchEntityManager", matchEntityManager); socket = new EventSocket(); socket.SocketSink = this; socket.ServerIP = ConfigSingleton.CreateInstance().GetAppConfig <string>("ServerIP"); socket.ServerPort = ConfigSingleton.CreateInstance().GetAppConfig <ushort>("ServerPort"); }
private void InitTaskFactory() { var countStr = ConfigSingleton.CreateInstance().GetAppConfig <string>(this.GetType().Name, "3,1"); var executerThreadCount = Convert.ToInt32(countStr.Split(',')[0]); var processerThreadCount = Convert.ToInt32(countStr.Split(',')[1]); var executerScheduler = new LimitedConcurrencyLevelTaskScheduler(executerThreadCount); executerFactory = new TaskFactory(executerScheduler); var processerScheduler = new LimitedConcurrencyLevelTaskScheduler(processerThreadCount); processerFactory = new TaskFactory(processerScheduler); }
// Use this for initialization private void Start() { string config = LoadFile(); ConfigContent configuration = JsonUtility.FromJson <ConfigContent>(config); ConfigSingleton configInstance = ConfigSingleton.GetInstance(); configInstance.SetMyNetworkConfig(new MyNetworkConfig("0.0.0.0", configuration.ServerPort)); configInstance.DBDomain = configuration.DBDomain; configInstance.TestGroup = configuration.TestGroup; NetworkManagerEvents.singleton.networkPort = int.Parse(configuration.ServerPort); NetworkManagerEvents.singleton.StartServer(); }
private void Awake() { if (_instance == null) { _instance = this; DontDestroyOnLoad(gameObject); LoadOption(); } else { Destroy(this); } }
// Use this for initialization void Start() { _testCounter = 0; _config = ConfigSingleton.GetInstance(); _targetDatas = new List <TargetData>(); _experimentResults = new List <List <TargetData> >(); // Caring about complexity is overrated. _testCases = _config.GetTestCases(); _canvas = GameObject.Find("Canvas"); GameObject window = UIHelper.CenterInParent(Instantiate(UserType), _canvas); window.transform.Find("New").gameObject.GetComponent <Button>().onClick.AddListener(delegate { transform.root.GetComponent <ButtonBehaviour>().NewUser(); }); window.transform.Find("Returning").gameObject.GetComponent <Button>().onClick.AddListener(delegate { transform.root.GetComponent <ButtonBehaviour>().ReturningUser(); }); }
private void HandleProcessTest() { Console.SetOut(tw); var type = ConfigSingleton.CreateInstance().GetAppConfig <string>("ReptileType"); IReptile r = IocUnity.GetService <IReptile>(type); var ph = new TeamHandle(); var path = @"C:\Users\Gaushee\Desktop\555.txt"; var txt = File.ReadAllText(path); var data = new BRData { Param = new TeamParam() { TeamId = "223423", PlayerId = "12334" }, Html = txt }; ph.Process(data); }
public bool OnConnect() { try { var code = ConfigSingleton.CreateInstance().GetAppConfig <string>("ValidCode"); Console.WriteLine("Collector Socket Connected Success!"); //发送登录信息 TakeServerLoginDto tslLoginDto = new TakeServerLoginDto() { TakeType = collectorType, ValidCode = code }; string data = ProtocalSerialize.SerializeObject(tslLoginDto); ProtocolLogger.WriteLog <TakeServerLoginDto>(tslLoginDto, MainCommand.TakeServer, (ushort)TakeServerCommand.Login, LogerType.Info); socket.Send((ushort)MainCommand.TakeServer, (ushort)TakeServerCommand.Login, data); return(true); } catch (Exception ex) { logger.Error(ex.ToString()); } return(true); }
//Instance getter public static ConfigSingleton GetInstance() { return(_instance ?? (_instance = new ConfigSingleton())); }
// Use this for initialization void Start() { Application.targetFrameRate = 10; _config = ConfigSingleton.GetInstance(); }
// Use this for initialization private void Awake() { _item = this.gameObject; _center = this.gameObject.transform.Find("Center").gameObject; _config = ConfigSingleton.GetInstance(); }
// Use this for initialization private void Awake() { _config = ConfigSingleton.GetInstance(); }
private void Start() { _config = ConfigSingleton.GetInstance(); }
public WebHooksProcess(IBrokerServicesBLL bll, ConfigSingleton config, ILogger logger) { this.BLL = bll; this.Config = config; this.Logger = logger; }
private void Start() { _config = ConfigSingleton.GetInstance(); _rng = new System.Random(); }