public virtual async Task <HttpResponseMessage> Login(string redirectUrl, string authorizationCode) { var googleToken = await AuthenticationService.GetGoogleToken(redirectUrl, authorizationCode); var userInfo = await AuthenticationService.GetUserInfo(googleToken.TokenType, googleToken.AccessToken); var roleId = DataBridge.GetRoleIdByAccount(userInfo.Email); if (roleId == null) { return(Request.CreateResponse( HttpStatusCode.Unauthorized, $"{userInfo.Email} has not been configured for Sheepshead.\n" + "Please contact Jacob Buysse to create your account.")); } var account = new AccountModel { Account = userInfo.Email, RoleId = roleId.Value }; var loginModel = new LoginModel { Token = AuthenticationService.CreateAuthorizationToken(account), RoleId = roleId.Value }; return(Request.CreateResponse(HttpStatusCode.OK, loginModel)); }
public void InvokeLoginBtn() { if (email_inputfield.text != "" && password_inputfield.text != "") { AuthController authController = new AuthController(); string temp1 = email_inputfield.text; string temp2 = password_inputfield.text; authController.AuthUser(temp1, temp2); _dataBridge = DataBridge.GetInstance(); _dataBridge.ReadPlayer(); if (DataBridge.playerEmail == null || Player.singletonPlayer == null) { EditorUtility.DisplayDialog("Waiting", "Waiting for response from authentication server, please try again.", "Close"); return; } ClearInputfield(); SceneManager.LoadScene(0); Debug.Log(Player.singletonPlayer.company); Debug.Log(Player.singletonPlayer.email); Debug.Log(Player.singletonPlayer.balance); } else { EditorUtility.DisplayDialog("Error", "Fill in all details to login", "Close"); } }
public override IEnumerable <AssociativeNode> BuildOutputAst( List <AssociativeNode> inputAstNodes) { if (IsPartiallyApplied) { return(new[] { AstFactory.BuildAssignment( GetAstIdentifierForOutputIndex(0), AstFactory.BuildFunctionObject( new IdentifierListNode { LeftNode = AstFactory.BuildIdentifier("DataBridge"), RightNode = AstFactory.BuildIdentifier("BridgeData") }, 2, new[] { 0 }, new List <AssociativeNode> { AstFactory.BuildStringNode(GUID.ToString()), AstFactory.BuildNullNode() })) }); } var resultAst = new[] { AstFactory.BuildAssignment( AstFactory.BuildIdentifier(AstIdentifierBase + "_dummy"), DataBridge.GenerateBridgeDataAst(GUID.ToString(), inputAstNodes[0])), AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), inputAstNodes[0]) }; return(resultAst); }
void Start() { Debug.Log("Register button Start() is called"); _dataBridge = DataBridge.GetInstance(); _dataBridge.UpdateGooglePlayService(); // Test.Main(); }
public frmCS(DataBridge bridge) { InitializeComponent(); init(); this.bridge = bridge; }
public override IEnumerable <AssociativeNode> BuildOutputAst(List <AssociativeNode> inputAstNodes) { return(new List <AssociativeNode>() { AstFactory.BuildAssignment( AstFactory.BuildIdentifier(AstIdentifierBase + "_dummy"), DataBridge.GenerateBridgeDataAst(GUID.ToString(), AstFactory.BuildExprList(inputAstNodes ?? new List <AssociativeNode>()))) }); }
public void InvokeRegisterBtn() { if (CheckAllInputfieldsAreFilled() && CheckPasswordIsValid()) { _dataBridge = DataBridge.GetInstance(); _dataBridge.CreatePlayerWithEmailAndPassword(email_inputfield.text, password_inputfield.text); _dataBridge.WritePlayer(email_inputfield.text, company_inputfield.text); ClearInputfield(); } }
internal BinaryExpressionNode CreatePreCompilationAstNode(NodeModel node, List <AssociativeNode> inputAstNodes) { IdentifierNode identifier = AstFactory.BuildIdentifier(node.AstIdentifierBase + beginTag); string id = node.GUID.ToString(); ExprListNode exprListNode = AstFactory.BuildExprList(inputAstNodes); AssociativeNode bridgeData = DataBridge.GenerateBridgeDataAst(id + profilingID, exprListNode); return(AstFactory.BuildAssignment(identifier, bridgeData)); }
public void SetMovement(ActorMovement amovement) { _falling = Vector3.zero; _angular = Vector4.zero; transform.position = DataBridge.cnv(amovement.Location); transform.rotation = DataBridge.cnv(amovement.Rotation); _current_region = Common.ToRegion(transform.position, 0); }
public static Session GetSession() { ICookieCollection cookieCollection = GetCookies(); if (!cookieCollection.ConstainsKey("sid")) { return(null); } return(DataBridge.GetSessionById(cookieCollection["sid"].Value)); }
public override IEnumerable <AssociativeNode> BuildOutputAst(List <AssociativeNode> inputAstNodes) { yield return (AstFactory.BuildAssignment( GetAstIdentifierForOutputIndex(0), AstFactory.BuildFunctionCall(func, inputAstNodes))); yield return (AstFactory.BuildAssignment( AstFactory.BuildIdentifier(AstIdentifierBase + "_dummy"), DataBridge.GenerateBridgeDataAst(GUID.ToString(), GetAstIdentifierForOutputIndex(0)))); }
// movement public void DecodeMovement(ByteString movement) { ActorMovement amovement = ActorMovement.Parser.ParseFrom(movement); transform.localPosition = DataBridge.cnv(amovement.Location); _local_velocity = DataBridge.cnv(amovement.Velocity); transform.localRotation = DataBridge.cnv(amovement.Rotation); _local_angular = DataBridge.cnv(amovement.Angular); ConsoleOutput.Trace("AgentMove " + amovement.Angular.W + " @ " + amovement.Angular.Y); }
internal BinaryExpressionNode CreatePostCompilationAstNode(NodeModel node, List <AssociativeNode> inputAstNodes) { IdentifierNode identifier = AstFactory.BuildIdentifier(node.AstIdentifierBase + endTag); string id = node.GUID.ToString(); List <AssociativeNode> outPortNodeList = Enumerable.Range(0, node.OutPorts.Count).Select( index => (AssociativeNode)node.GetAstIdentifierForOutputIndex(index)).ToList(); ExprListNode exprListNode = AstFactory.BuildExprList(outPortNodeList); AssociativeNode bridgeData = DataBridge.GenerateBridgeDataAst(id + profilingID, exprListNode); return(AstFactory.BuildAssignment(identifier, bridgeData)); }
public virtual HttpResponseMessage UpdateUser([FromBody] UpdateUserModel user) { if (user == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "User was null.")); } if (user.Accounts == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Accounts was null.")); } DataBridge.UpdateUser(user.Name, user.RoleId, user.Accounts); return(Request.CreateResponse(HttpStatusCode.OK)); }
public void TestLocalUpload() { // arrange //SqlConnection clientConnection = new SqlConnection("Server=ASUS-PC/SQLEXPRESS;Initial Catalog=BL;Persist Security Info=True;User ID=sa;Password=syc"); //SqlConnection serverConnection = new SqlConnection("Server=192.168.1.84/S1;Initial Catalog=BL;Persist Security Info=True;User ID=sa;Password=syc"); // act DataBridge b = new DataBridge(); b.SyncData(); // assert }
private static void PrintListOfSuggestedItems() { var suggestions = DataBridge.GetPizzasByOwnerId(Session.UserId); Console.WriteLine("<ul>"); foreach (var suggestion in suggestions) { Console.WriteLine("<form method=\"POST\">"); Console.WriteLine($"<li><a href=\"DetailsPizza.exe?pizzaid={suggestion.Id}\">{suggestion.Title}</a> <input type=\"hidden\" name=\"pizzaId\" value=\"{suggestion.Id}\"/> <input type=\"submit\" class=\"btn btn-sm btn-danger\" value=\"X\"/></li>"); Console.WriteLine("</form>"); } Console.WriteLine("</ul>"); }
public virtual HttpResponseMessage UpdateGame([FromBody] GameModel game) { if (game == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Game was null.")); } if (game.Scores == null) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Scores was null.")); } if (game.Scores.Count() < 5) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Scores must contain at least 5 items.")); } var id = DataBridge.UpdateGame(game); return(Request.CreateResponse(HttpStatusCode.OK, id)); }
public override IEnumerable <AssociativeNode> BuildOutputAst(List <AssociativeNode> inputAsNodes) { var doubleNode = AstFactory.BuildDoubleNode(number); //var funcNode = AstFactory.BuildFunctionCall( // new Func<double, double, double>(NodeModelsEssentialsFunctions.Multiply), // new List<AssociativeNode>() { doubleNode, doubleNode } // ); return(new[] { AstFactory.BuildAssignment( GetAstIdentifierForOutputIndex(0), doubleNode), AstFactory.BuildAssignment( AstFactory.BuildIdentifier(AstIdentifierBase + "_dummy"), DataBridge.GenerateBridgeDataAst(GUID.ToString(), doubleNode)) }); }
public virtual HttpResponseMessage GetGames(int skip, int take) { if (skip < 0) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Skip cannot be negative.")); } if (take < 0) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Take cannot be negative.")); } var games = DataBridge.GetGames(skip, take); var result = new GamesModel { Games = games, MoreGames = games.Count == take }; return(Request.CreateResponse(HttpStatusCode.OK, result)); }
private static void VoteForPizza() { PostParams = WebUtil.RetrievePostParameters(); var pizza = DataBridge.GetPizzaById(int.Parse(PostParams["pizzaid"])); var vote = PostParams["pizzaVote"]; if (vote == "up") { pizza.UpVotes++; } else if (vote == "down") { pizza.DownVotes++; } DataBridge.SaveChanges(); }
static void Main() { if (WebUtil.IsPost()) { RequestParameters = WebUtil.RetrievePostParameters(); string userName = HttpUtility.UrlDecode(RequestParameters["email"]); string password = HttpUtility.UrlDecode(PasswordHeader.Hash(RequestParameters["password"])); if (!String.IsNullOrEmpty(userName) && !String.IsNullOrEmpty(password)) { if (!DataBridge.IsUserExist(userName, password)) { DataBridge.CreateUser(userName, password); } } } ShowPage(); }
public FormConfiguration(DataBridge db) { _db = db; InitializeComponent(); txtWinrarDirectory.Text = _db.WinrarDirectory ?? String.Empty; if (_db.CreateSubdirectory.HasValue) { cbxCreateSubdir.Checked = _db.CreateSubdirectory.Value; } if (_db.DeleteArchiveAfterExtraction.HasValue) { cbxDeleteArchive.Checked = _db.DeleteArchiveAfterExtraction.Value; } if (_db.UsePasswords.HasValue) { cbxUsePassword.Checked = _db.UsePasswords.Value; } _db.Passwords?.ForEach(x => lbPasswords.Items.Add(x)); }
public bool ialUpdate(TryAgent agent, Dictionary <int, AgentUtils <TryAgent> .Property> properties) { AgentUtils <TryAgent> .Property pbasic; if (properties.TryGetValue(( int )PTYPE.Basic, out pbasic)) { if (pbasic.updated) { //Basic abasic = Basic.Parser.ParseFrom( pbasic.data ); // nothing is allowed to be updated ConsoleOutput.Trace("ialUpdate: \"" + agent.id + "\" |Basic " + pbasic.data.Length); pbasic.updated = false; } } AgentUtils <TryAgent> .Property pmovement; if (properties.TryGetValue(( int )PTYPE.Movement, out pmovement)) { if (pmovement.updated) { if (null != agent.amove) { ConsoleOutput.Trace("ialUpdate: \"" + agent.id + "\" |Movement " + pmovement.data.Length); agent.amove.DecodeMovement(pmovement.data); } pmovement.updated = false; } } AgentUtils <TryAgent> .Property pscale; if (properties.TryGetValue(( int )PTYPE.Scale, out pscale)) { if (pscale.updated) { ActorScale ascale = ActorScale.Parser.ParseFrom(pscale.data); agent.gobj.transform.localScale = DataBridge.cnv(ascale.Scale); ConsoleOutput.Trace("ialUpdate: \"" + agent.id + "\" |Scale " + pscale.data.Length); pscale.updated = false; } } return(false); }
private static void LogIn() { RequestParameters = WebUtil.RetrievePostParameters(); string email = RequestParameters["email"]; string password = RequestParameters["password"]; string hashedPassword = PasswordHeader.Hash(RequestParameters["password"]); var user = DataBridge.LogInUser(email, password); if (user != null) { var session = new Session() { Id = new Random().Next().ToString(), User = user }; Header.AddCookie(new Cookie("sid", session.Id)); DataBridge.AddSession(session); DataBridge.SaveChanges(); } }
public override Boolean Initialize() { IsInitialized = false; DataBridge db = new DataBridge { Extensions = new List <String>(Extensions) }; new FormExtensions(db).ShowDialog(); if (db.Status != Status.Saved) { InitError("Configuration process has been canceled"); return(IsInitialized); } Extensions = db.Extensions; return(base.Initialize()); }
/// <summary> /// Startet den Ablauf /// </summary> /// <param name="args">Data passed by the start command.</param> protected override void OnStart(string[] args) { // Debugger.Launch(); //if (string.IsNullOrEmpty(this.ServiceName)) //{ // this.ServiceName = GetServiceName(); //} try { this.dataBridge = new DataBridge(); this.dataBridge.Load(this.dataBridge.GetConfigFileName()); this.dataBridge.Start(); } catch (Exception ex) { EventLogHelper.WriteEntry(Program.EventLogName, "Failed to start: " + ex.Message); throw; } }
static void GenereateAllSuggestions() { var pizzas = DataBridge.GetAllPizzas(); Console.WriteLine("<div class=\"card-deck\">"); foreach (var pizza in pizzas) { Console.WriteLine("<div class=\"card\">"); Console.WriteLine($"<img class=\"card-img-top\" src=\"{pizza.ImageURL}\" width=\"200px\"alt=\"Card image cap\">"); Console.WriteLine("<div class=\"card-block\">"); Console.WriteLine($"<h4 class=\"card-title\">{pizza.Title}</h4>"); Console.WriteLine($"<p class=\"card-text\"><a href=\"DetailsPizza.exe?pizzaid={pizza.Id}\">Recipe</a></p>"); Console.WriteLine("<form method=\"POST\">"); Console.WriteLine($"<div class=\"radio\"><label><input type = \"radio\" name=\"pizzaVote\" value=\"up\">Up</label></div>"); Console.WriteLine($"<div class=\"radio\"><label><input type = \"radio\" name=\"pizzaVote\" value=\"down\">Down</label></div>"); Console.WriteLine($"<input type=\"hidden\" name=\"pizzaid\" value=\"{pizza.Id}\" />"); Console.WriteLine("<input type=\"submit\" class=\"btn btn-primary\" value=\"Vote\" />"); Console.WriteLine("</form>"); Console.WriteLine("</div>"); Console.WriteLine("</div>"); } Console.WriteLine("</div>"); }
public override IEnumerable <AssociativeNode> BuildOutputAst(List <AssociativeNode> inputAsNodes) { //if (!InPorts[0].Connectors.Any()) //{ // return new[] { AstFactory.BuildAssignment(GetAstIdentifierForOutputIndex(0), AstFactory.BuildNullNode()) }; //} var textNode = AstFactory.BuildStringNode(text); //var funcNode = AstFactory.BuildFunctionCall( // new Func<List<object>, int, object>(NodeModelsEssentialsFunctions.SetTextValue), // new List<AssociativeNode>() { inputAsNodes[0], textNode } // ); return(new[] { AstFactory.BuildAssignment( GetAstIdentifierForOutputIndex(0), textNode), AstFactory.BuildAssignment( AstFactory.BuildIdentifier(AstIdentifierBase + "_dummy"), DataBridge.GenerateBridgeDataAst(GUID.ToString(), inputAsNodes[0])) }); }
public FormExtensions(DataBridge db) { InitializeComponent(); _db = db; }
public virtual IEnumerable <AllUserDataModel> GetAllUserData() { return(DataBridge.GetAllUserdata()); }