Exemple #1
0
        public clientproxy reg_client(string uuid, juggle.Ichannel ch, Int64 servertick, Int64 clienttick)
        {
            lock (wait_channel_list)
            {
                wait_channel_list.Remove(ch);
            }

            if (clientproxys_ch.ContainsKey(ch))
            {
                return(clientproxys_ch[ch]);
            }

            clientproxy _clientproxy = new clientproxy(ch);

            lock (clientproxys)
            {
                clientproxys_ch.Add(ch, _clientproxy);

                clientproxys.Add(uuid, _clientproxy);
                clientproxys_uuid.Add(_clientproxy, uuid);

                client_server_time.Add(ch, servertick);
                client_time.Add(ch, clienttick);
            }

            return(_clientproxy);
        }
Exemple #2
0
        public void on_client_disconnect(juggle.Ichannel ch)
        {
            if (clientproxys_ch.ContainsKey(ch))
            {
                clientproxy _proxy = clientproxys_ch[ch];
                clientproxys_ch.Remove(ch);
                client_server_time.Remove(ch);
                client_time.Remove(ch);

                if (clientproxys_uuid.ContainsKey(_proxy))
                {
                    string uuid = clientproxys_uuid[_proxy];
                    clientproxys_uuid.Remove(_proxy);
                    clientproxys.Remove(uuid);

                    if (clientproxy_hubproxy.ContainsKey(_proxy))
                    {
                        var _hubs = clientproxy_hubproxy[_proxy];
                        foreach (var _hub in _hubs)
                        {
                            _hub.client_disconnect(uuid);
                        }
                        clientproxy_hubproxy.Remove(_proxy);
                    }
                }
            }
        }
Exemple #3
0
        public void unreg_client(juggle.Ichannel ch)
        {
            lock (clientproxys)
            {
                if (clientproxys_ch.ContainsKey(ch))
                {
                    clientproxy _proxy = clientproxys_ch[ch];

                    clientproxys_ch.Remove(ch);
                    client_server_time.Remove(ch);
                    client_time.Remove(ch);

                    if (clientproxys_uuid.ContainsKey(_proxy))
                    {
                        string uuid = clientproxys_uuid[_proxy];

                        clientproxys_uuid.Remove(_proxy);
                        clientproxys.Remove(uuid);
                    }

                    if (clientproxy_hubproxy.ContainsKey(_proxy))
                    {
                        clientproxy_hubproxy.Remove(_proxy);
                    }

                    heartbeats_list.Remove(ch);
                }
            }
        }
Exemple #4
0
        public String get_client_uuid(clientproxy _clientproxy)
        {
            if (clientproxys_uuid.ContainsKey(_clientproxy))
            {
                return(clientproxys_uuid[_clientproxy]);
            }

            return(null);
        }
Exemple #5
0
        public void forward_logic_call_client(string uuid, string module, string func, ArrayList argv)
        {
            clientproxy _clientproxy = _clientmanager.get_clientproxy(uuid);

            if (_clientproxy != null)
            {
                _clientproxy.call_client(module, func, argv);
            }
        }
Exemple #6
0
        public clientproxy reg_client(string uuid, juggle.Ichannel ch, Int64 servertick, Int64 clienttick)
        {
            clientproxy _clientproxy = new clientproxy(ch);

            clientproxys.Add(uuid, _clientproxy);
            client_server_time.Add(ch, servertick);
            client_time.Add(ch, clienttick);

            return(_clientproxy);
        }
Exemple #7
0
 public void unreg_client_hub(juggle.Ichannel ch)
 {
     if (clientproxys_ch.ContainsKey(ch))
     {
         clientproxy _proxy = clientproxys_ch[ch];
         if (clientproxy_hubproxy.ContainsKey(_proxy))
         {
             clientproxy_hubproxy.Remove(_proxy);
         }
     }
 }
 public void forward_hub_call_group_client_fast(ArrayList uuids, string module, string func, ArrayList argv)
 {
     foreach (String uuid in uuids)
     {
         clientproxy _clientproxy = _clientmanager.get_clientproxy(uuid);
         if (_clientproxy != null)
         {
             _clientproxy.call_client_fast(module, func, argv);
         }
     }
 }
        public void disconnect_client(string client_uuid)
        {
            clientproxy _clientproxy = _clientmanager.get_clientproxy(client_uuid);

            if (_clientproxy != null)
            {
                _clientmanager.unreg_client(_clientproxy.client_ch);
                _clientmanager.unreg_client_hub(_clientproxy.client_ch);
                _clientproxy.client_ch.disconnect();
            }
        }
Exemple #10
0
        public void connect_sucess(string client_uuid)
        {
            clientproxy _clientproxy = _clientmanager.get_clientproxy(client_uuid);

            if (_clientproxy != null)
            {
                hubproxy _hubproxy = _hubmanager.get_hub(juggle.Imodule.current_ch);
                if (_hubproxy != null)
                {
                }
            }
        }
Exemple #11
0
        public void connect_sucess(string client_uuid)
        {
            clientproxy _clientproxy = _clientmanager.get_clientproxy(client_uuid);

            if (_clientproxy != null)
            {
                logicproxy _logicproxy = _logicmanager.get_logic(juggle.Imodule.current_ch);
                if (_logicproxy != null)
                {
                    _clientproxy.connect_logic_sucess(_logicproxy.uuid);
                }
            }
        }
Exemple #12
0
        public logicproxy get_clientproxy_logicproxy(juggle.Ichannel ch)
        {
            if (clientproxys_ch.ContainsKey(ch))
            {
                clientproxy _clientproxy = clientproxys_ch [ch];

                if (clientproxy_logicproxy.ContainsKey(_clientproxy))
                {
                    return(clientproxy_logicproxy[_clientproxy]);
                }

                return(null);
            }

            return(null);
        }
Exemple #13
0
        public void ack_client_connect_server(string uuid, string result)
        {
            clientproxy _clientproxy = _clientmanager.get_clientproxy(uuid);

            if (_clientproxy != null)
            {
                if (result != "svr_is_busy")
                {
                    _clientmanager.reg_client_logic(uuid, _logicmanager.get_logic(juggle.Imodule.current_ch));
                    _clientproxy.ack_connect_server(result);
                }
                else
                {
                    logicproxy _logicproxy = _logicmanager.get_logic();
                    _logicproxy.client_connect(uuid);
                }
            }
        }
Exemple #14
0
        public void ack_client_get_logic(string client_uuid, string result)
        {
            clientproxy _clientproxy = _clientmanager.get_clientproxy(client_uuid);

            if (_clientproxy != null)
            {
                logicproxy _logicproxy = _logicmanager.get_logic(juggle.Imodule.current_ch);
                if (result == "svr_is_success")
                {
                    _clientproxy.ack_get_logic(_logicproxy.uuid);
                }
                else
                {
                    Console.WriteLine(result + " svr:" + _logicproxy.uuid);

                    _logicproxy = _logicmanager.get_logic();
                    _logicproxy.get_logic(client_uuid);
                }
            }
        }
Exemple #15
0
        public void ack_client_get_logic(string client_uuid, string result)
        {
            clientproxy _clientproxy = _clientmanager.get_clientproxy(client_uuid);

            if (_clientproxy != null)
            {
                logicproxy _logicproxy = _logicmanager.get_logic(juggle.Imodule.current_ch);
                if (String.Equals(result, "svr_is_sucess"))
                {
                    _clientproxy.ack_get_logic(_logicproxy.uuid);
                }
                else
                {
                    log.log.trace(new System.Diagnostics.StackFrame(true), service.timerservice.Tick, "{0} svr:{1}", result, _logicproxy.uuid);

                    _logicproxy = _logicmanager.get_logic();
                    _logicproxy.get_logic(client_uuid);
                }
            }
        }