예제 #1
0
        public Main()
        {
            InterconnectServer interconnectServer = new InterconnectServer();

            interconnectServer.Add("utils", new Utils());
            interconnectServer.Add("config", new ConfigLoader());
            interconnectServer.Add("heartbeat", new Heartbeat());
            interconnectServer.Add("resources", new Resources());

            configLoader = interconnectServer.Get("config");
            heartbeat    = interconnectServer.Get("heartbeat");
            resources    = interconnectServer.Get("resources");

            TriggerServerEvent("geminis:get_client_config");

            EventHandlers["geminis:set_client_config"] += new Action <dynamic>(configLoader.SetConfig);
            EventHandlers["geminis:set_identifier"]    += new Action <string>(heartbeat.OnSetIdentifier);

            interconnectServer.Initialize();

            TriggerServerEvent("geminis:client_start_resource");

            EventHandlers["onClientResourceStart"] += new Action <string>(resources.OnResourceStart);
            EventHandlers["onClientResourceStop"]  += new Action <string>(resources.OnResourceStop);

            EventHandlers["geminis:new_resource"] += new Action <string>(resources.OnNewResource);
        }
예제 #2
0
파일: Classes.cs 프로젝트: MrSentex/Geminis
        public void set_instances(InterconnectServer server)
        {
            if (this.instances != null)
            {
                return;
            }

            this.instances = server;
        }