Esempio n. 1
0
        private string GetClientIDByToken(string token)
        {
            ServerLogic.ClientData player = this.manager.LoggedPlayers.Find(x => x.Token == token);
            if (player == null)
            {
                return(string.Empty);
            }

            return(player.ID);
        }
        public ActionResult <string> RegisterPlayer([FromBody] PlayerCredentials credentials)
        {
            this.UpdateData();
            ServerLogic.ClientData player = this.service.RegisterPlayer(credentials);
            if (player != null)
            {
                this.rep.RegisterPlayer(player);
                return(player.ID);
            }

            return(string.Empty);
        }