Ejemplo n.º 1
0
        private void OnConnAppEnter(ConnAppProc app_server)
        {
            if (m_srv_servers.ContainsKey(app_server.srv_info.srv_uid))
            {
                Log.Warning("已经存在服务器 sid:" + app_server.srv_info.srv_uid);
                return;
            }
            string ip = m_net_socket.GetConnIP(app_server.conn_idx);

            Log.Info("服务器加入 type:" + app_server.srv_info.srv_type.ToString() + " sid:" + app_server.srv_info.srv_uid + " ip:" + ip);
            m_srv_servers.Add(app_server.srv_info.srv_uid, app_server);

            //写入服务器信息
            RemoteServerInfo server_info = new RemoteServerInfo();

            server_info.srv_uid    = app_server.srv_info.srv_uid;
            server_info.type       = app_server.srv_info.srv_type;
            server_info.ip         = ip;
            server_info.start_time = Time.time;
            ServerInfoManager.Instance.AddRemoteServer(server_info);
        }
Ejemplo n.º 2
0
 public void AddRemoteServer(RemoteServerInfo info)
 {
     this.RemoveRemoteServer(info.srv_uid);
     m_remote_servers.Add(info.srv_uid, info);
 }