コード例 #1
0
        public logicproxy reg_logic(juggle.Ichannel ch, String type, String ip, Int64 port, String uuid)
        {
            logicproxy _logicproxy = new logicproxy(ch);

            logicproxys.Add(ch, Tuple.Create(type, ip, port, uuid, _logicproxy));

            return(_logicproxy);
        }
コード例 #2
0
ファイル: svr_msg_handle.cs プロジェクト: hl0071/abelkhan
        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");
        }
コード例 #3
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();

            log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "{0} server {1} connected", type, uuid);
        }
コード例 #4
0
        public void req_get_server_address(String uuid, String callbaclid)
        {
            Tuple <String, String, Int64, String, svrproxy> info = _svrmanager.get_svr_info(uuid);
            logicproxy _logicproxy = _logicmanager.get_logicproxy(juggle.Imodule.current_ch);

            if (_logicproxy != null)
            {
                if (info != null)
                {
                    _logicproxy.ack_get_server_address(true, info.Item1, info.Item2, info.Item3, info.Item4, callbaclid);
                }
                else
                {
                    _logicproxy.ack_get_server_address(false, "", "", 0, "", callbaclid);
                }
            }
            else
            {
                log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "not a logic channel call this function");
            }
        }
コード例 #5
0
        public void req_get_server_address(String uuid, String callbaclid)
        {
            Tuple <String, String, Int64, String, svrproxy> info = _svrmanager.get_svr_info(uuid);
            logicproxy _logicproxy = _logicmanager.get_logicproxy(juggle.Imodule.current_ch);

            if (_logicproxy != null)
            {
                if (info != null)
                {
                    _logicproxy.ack_get_server_address(true, info.Item1, info.Item2, info.Item3, info.Item4, callbaclid);
                }
                else
                {
                    _logicproxy.ack_get_server_address(false, "", "", 0, "", callbaclid);
                }
            }
            else
            {
                System.Console.WriteLine("not a logic channel call this function");
            }
        }