Ejemplo n.º 1
0
        public void reg_server(String type, String ip, Int64 port, String uuid)
        {
            _hubmanager.for_each_hub(
                (hubproxy _hubproxy) => {
                _hubproxy.distribute_server_address(type, ip, port, uuid);
            }
                );

            if (type == "hub")
            {
                hubproxy _hubproxy = _hubmanager.reg_hub(juggle.Imodule.current_ch, type, ip, port, uuid);

                _svrmanager.for_each_svr_info(
                    (String _type, String _ip, Int64 _port, String _uuid) => {
                    _hubproxy.distribute_server_address(_type, _ip, _port, _uuid);
                }
                    );
            }

            if (type == "dbproxy")
            {
                _dbproxy = new dbproxy(juggle.Imodule.current_ch, type, ip, port, uuid);
            }

            svrproxy _svrproxy = _svrmanager.reg_svr(juggle.Imodule.current_ch, type, ip, port, uuid);

            _svrproxy.reg_server_sucess();

            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "{0} server {1} connected", type, uuid);
        }
Ejemplo n.º 2
0
        public svrproxy reg_svr(juggle.Ichannel ch, String type, String ip, Int64 port, String uuid)
        {
            svrproxy _svrproxy = new svrproxy(ch);

            svrproxys.Add(ch, Tuple.Create(type, ip, port, uuid, _svrproxy));
            svrproxys_uuid.Add(uuid, Tuple.Create(type, ip, port, uuid, _svrproxy));

            return(_svrproxy);
        }
Ejemplo n.º 3
0
        public svrproxy reg_svr(juggle.Ichannel ch, String type, String ip, Int64 port, String uuid)
        {
            svrproxy _svrproxy = new svrproxy(ch, type);

            svrproxys.Add(ch, Tuple.Create(type, ip, port, uuid, _svrproxy));

            if (type == "dbproxy")
            {
                _dbproxys.Add(_svrproxy);
            }

            return(_svrproxy);
        }
Ejemplo n.º 4
0
        public void reg_server(String type, String ip, Int64 port, String uuid)
        {
            _logicmanager.for_each_logic(
                (logicproxy _logicproxy) => {
                _logicproxy.distribute_server_address(type, ip, port, uuid);
            }
                );

            _hubmanager.for_each_hub(
                (hubproxy _hubproxy) => {
                _hubproxy.distribute_server_address(type, ip, port, uuid);
            }
                );

            if (type == "logic")
            {
                logicproxy _logicproxy = _logicmanager.reg_logic(juggle.Imodule.current_ch, type, ip, port, uuid);

                _svrmanager.for_each_svr_info(
                    (String _type, String _ip, Int64 _port, String _uuid) => {
                    _logicproxy.distribute_server_address(_type, _ip, _port, _uuid);
                }
                    );
            }

            if (type == "hub")
            {
                hubproxy _hubproxy = _hubmanager.reg_hub(juggle.Imodule.current_ch, type, ip, port, uuid);

                _svrmanager.for_each_svr_info(
                    (String _type, String _ip, Int64 _port, String _uuid) => {
                    _hubproxy.distribute_server_address(_type, _ip, _port, _uuid);
                }
                    );
            }

            if (type == "dbproxy")
            {
                _dbproxy = new dbproxy(juggle.Imodule.current_ch, type, ip, port, uuid);
            }

            svrproxy _svrproxy = _svrmanager.reg_svr(juggle.Imodule.current_ch, type, ip, port, uuid);

            _svrproxy.reg_server_sucess();

            System.Console.WriteLine(type + " server " + uuid + " connected");
        }
Ejemplo n.º 5
0
        public void reg_server(String type, String ip, Int64 port, String uuid)
        {
            Int64 zone_id = 0;

            if (type != "dbproxy")
            {
                if (zone_id != 0)
                {
                    var _tmp_zone = _clutter.get_zone((int)zone_id);
                    _tmp_zone.for_each_hub_ch(
                        (juggle.Ichannel ch) =>
                    {
                        _hubmanager.get_hub(ch).distribute_server_address(type, ip, port, uuid);
                    }
                        );
                }
                else
                {
                    _hubmanager.for_each_hub(
                        (hubproxy _hubproxy) =>
                    {
                        _hubproxy.distribute_server_address(type, ip, port, uuid);
                    }
                        );
                }
            }

            if (type == "hub")
            {
                hubproxy _hubproxy = _hubmanager.reg_hub(juggle.Imodule.current_ch, type, ip, port, uuid, (int)zone_id);

                if (zone_id != 0)
                {
                    var _tmp_zone = _clutter.get_zone((int)zone_id);
                    _tmp_zone.for_each_svr_ch(
                        (juggle.Ichannel ch) =>
                    {
                        var tmp_svr_info = _svrmanager.get_svr(ch);
                        _hubproxy.distribute_server_address(tmp_svr_info.Item1, tmp_svr_info.Item2, tmp_svr_info.Item3, tmp_svr_info.Item4);
                    }
                        );
                }
                else
                {
                    _svrmanager.for_each_svr_info(
                        (String _type, String _ip, Int64 _port, String _uuid) =>
                    {
                        _hubproxy.distribute_server_address(_type, _ip, _port, _uuid);
                    }
                        );
                }
            }

            if (type == "dbproxy")
            {
            }

            svrproxy _svrproxy = _svrmanager.reg_svr(juggle.Imodule.current_ch, type, ip, port, uuid);

            _svrproxy.reg_server_sucess();

            var _zone = _clutter.get_zone((int)zone_id);

            _zone.reg_svr(juggle.Imodule.current_ch, type);

            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "{0} server {1} connected", type, uuid);
        }