Пример #1
0
        public async Task <LoginRes> Process([FromBody] LoginReq request)
        {
            //var tick = DateTime.Now.Ticks.ToString();
            var response = new LoginRes()
            {
                Result          = "0",
                AuthToken       = "fake",
                LobbyServerIP   = APIServer.ServerOpt.LobbyServerIP,
                LobbyServerPort = APIServer.ServerOpt.LobbyServerPort,
            };

            return(response);
        }
Пример #2
0
        public async Task <LoginRes> Process([FromBody] LoginReq request)
        {
            var loginResult = await DBMysql.LoginUser(request.UserID, request.UserPW);

            if (loginResult == false)
            {
                return(new LoginRes()
                {
                    Result = -1
                });
            }

            SetLoginTime(request.UserID);

            var authToken = CreateAuthToken();
            var result    = await DBRedis.SetValue(request.UserID, authToken);

            return(new LoginRes()
            {
                Result = 0, AuthToken = authToken
            });
        }