Ejemplo n.º 1
0
        /// <summary>
        /// add a peer by accountid
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="peer"></param>
        /// <returns></returns>
        public bool HandleAccountLogin(long accountId, MarsPeer peer)
        {
            MarsPeer getPeer = null;

            //if ( .TryGetValue(accountId, out getPeer) == false)
            if (Actors.TryGetValue(accountId, out getPeer) == false)
            {
                Actors.Add(peer);//NEW TODO:
                Debug.Log("Start..................................." + Size);
                return(true);
            }
            else
            {
                getPeer.Disconnect();
                getPeer.Dispose();
                getPeer = null;
                return(false);
            }
        }