public void SetVisibility(hostUser hu) { //[[TODO]] SetMessage("Setting visibility for " + hu.LongName + " Type" + hu.UserType.LongName); LoadEditors(hu.UserType.LongName); this._logon = hu; }
public sysDocuments(hostUser logon, hostChar ch, nwdbRepository repo, nwdbConnection nw) { this.Logon = logon; this.Character = ch; this.Repository = repo; this.Database = nw; initData(); }
public campCampaign(string n, string nl, string email, hostUser gm, DateTime start, DateTime finish, string desc) : this(n, nl) { this.Email = email; this.DateStarted = start; this.DateFinished = finish; this.GM = gm; this.Description = desc; }
private void bs_logons_CurrentChanged(object sender, EventArgs e) { if (bs_logons.Current == null) { bs_nwChar.DataSource = sess.QueryOver <hostChar>().List(); } else { hostUser user = bs_logons.Current as hostUser; bs_nwChar.DataSource = user.Characters; } }
private void bs_hostUser_CurrentChanged(object sender, EventArgs e) { if (bs_hostUser.Current == null) { bs_hostCampaign.DataSource = sess.QueryOver <campCampaign>().List(); } else { hostUser user = bs_hostUser.Current as hostUser; bs_hostCampaign.DataSource = user.GMCampaigns; } }
private void lboxUserType_SelectedIndexChanged(object sender, EventArgs e) { if (bs_hostUser.Current == null || lboxUserType.SelectedItem == null) { return; } hostUser user = bs_hostUser.Current as hostUser; if (user.UserType == null) { return; } string c = lboxUserType.SelectedItem.ToString(); if (user.UserType.LongName != c) { SetMessage("UserType has changed Utype" + user.UserType.LongName + " selvalue:" + c); user.UserType = bs_userType.Current as hostUserType; } }
public virtual void CreateHostUsers(IList <hostUserType> usertypelist) { hostUser steve, matt, lewis; hostUserType players, gms, admins; admins = usertypelist.Where(x => x.LongName == hostConstants.usrSysAdmin).First(); gms = usertypelist.Where(x => x.LongName == hostConstants.usrRulesetAdmin).First(); players = usertypelist.Where(x => x.LongName == hostConstants.usrPlayer).First(); //seed users steve = new hostUser("unclemessy", "unclemessy", "*****@*****.**", "muppet"); steve.fbID = "10152572366130895"; steve.fbAccessToken = "CAANSyHyJq9gBAFYZB2qpnJkZAEsicsnF0kYa7qPIoUZARqGZBhgXpNAZCRN9MplrL6ZCRXRMAUi5AV54NTi8CA9TI6aamXb7HvZAyqMv8Uw4mSNPt6Xtg6TIY3X3YqlvJeYHZC1laqeJUfvSFgZCuuECTmZCv3b2OefSOZBwl1xJC69H5s1Baj9lNMIWwPBbxFt1S2i36jTnUsBQwAm2fM9K0wJ"; steve.fbGender = "male"; steve.fbFirstName = "Steve"; steve.fbSurname = "Dangerfield"; //steve.CreateCampaign("Legends", "Land of Legends", "*****@*****.**", "A Dark and nasty underworld Land plagued by the Mists of Krondell and the spawns of Chortos"); matt = new hostUser("matsly", "matsly", "*****@*****.**", "muppet"); matt.fbID = "10152966328743429"; matt.fbAccessToken = "CAANSyHyJq9gBAL332yEjJrLTZA1GH2rAAn9ZBTy9hXyIvaNkQJdNZBZCOe6y6pZCMeQ0VW0ARq0awxbFsla23lVKdZCpte4CvAR3690Y6X8UDcQJmhF25swYdJmeOUQvfFUEomAVWVcDYXrieywtFzRhrw3MdZAHjQXeKCuZCAH84MGfvU0Qo6pgbylvk09E6W3RnFWdhF45gtc1cFAIMgmI"; matt.fbGender = "male"; matt.fbFirstName = "Matthew"; matt.fbSurname = "Silvester"; //matt.CreateCampaign("traitPBEM", "Traits Play by Email", "*****@*****.**", "This is a PBEM game for the Drowe Underworld"); lewis = new hostUser("lewis", "lewis", "*****@*****.**", "muppet"); //Add to correct host usertypelist after creation steve.UserType = admins; matt.UserType = gms; lewis.UserType = players; this.Save(steve); this.Save(matt); this.Save(lewis); }
private void hostUserBindingSource_CurrentChanged(object sender, EventArgs e) { if (bs_hostUser.Current == null) { return; } hostUser user = bs_hostUser.Current as hostUser; this.bs_chars.DataSource = user.Characters; this.bs_campaigns.DataSource = user.GMCampaigns; if (user.UserType == null) { lboxUserType.SelectedIndex = -1; } else { lboxUserType.SelectedIndex = lboxUserType.Items.IndexOf(user.UserType); } if (user == null) { return; } SetMessage("Set User to" + user.LongName + " Charactercount:" + user.Characters.Count().ToString() + " campaigns" + user.GMCampaigns.Count().ToString()); }
private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) { FacebookOAuthResult authResult; string OWUsername = "******"; bool userUnique; if (fb.TryParseOAuthCallbackUrl(e.Url, out authResult)) { if (authResult.IsSuccess) { //System.Windows.Forms.MessageBox.Show("Logged In"); SetMessage("Access Token" + authResult.AccessToken); //fb.AccessToken = authResult.AccessToken; var accesstoken = authResult.AccessToken; fbuser = new FacebookClient(accesstoken); fb.AccessToken = accesstoken; var results = (IDictionary <string, object>)fb.Get("/me"); fbRecord = sysFacebook.ParseResponse(results, authResult); if (fbRecord == null) { System.Windows.Forms.MessageBox.Show("Failed to Parse Response"); } else { SetMessage("LOGON via FB Sucess"); SetMessage(fbRecord.LongDesc()); } CurrentUser = sysFacebook.UserExists(sess, fbRecord); if (CurrentUser != null) { SetMessage("User Found:" + CurrentUser.LongName); if (CurrentUser.fbAccessToken != fbRecord.AccessToken) { SetMessage("Refreshing token"); CurrentUser.fbAccessToken = fbRecord.AccessToken; CurrentUser.fbTokenExpires = fbRecord.Expires; sess.SaveOrUpdate(CurrentUser); sess.Flush(); } //System.Windows.Forms.MessageBox.Show("Welcome Back : "+CurrentUser.LongName, "User Login"); //Ok to proceed SetOkToProceed(); } else { //Register new if (System.Windows.Forms.MessageBox.Show("User not registered, Register now?", "User Registration", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { //Register userUnique = false; while (userUnique == false) { OWUsername = Microsoft.VisualBasic.Interaction.InputBox("Register Username", "Enter A unique username for OpenWorld to be Associated with this FaceBook Account", "Name", 200, 400); CurrentUser = sysFacebook.FindByUserName(sess, OWUsername); userUnique = (CurrentUser == null); if (!userUnique) { SetMessage("Username " + OWUsername + " is taken, please choose another"); } } //Create new SetMessage("Creating new user:"******"Registered", "User Registered with OpenWorld", "Congratulations, you have sucessfully registered for openworld"); repo.Save(CurrentUser); SetOkToProceed(); } } } else //Auth Failed { SetMessage("FBAuth failed;" + authResult.ErrorDescription); } } }
public virtual bool SeedMockData() { //NEW FEDERATED Initialisations //libMapping Create Base; this.CreateLibMapping(); //libHosting Create Base this.CreateLibHosting(); //libRuleSet Create Base this.CreateLibRuleset(); //libRuleSet Create Base this.CreateLibCampaign(); try { //Seed Characters hostUser steve = this.Find((typeof(hostUser)), "unclemessy") as hostUser; hostUser lewis = this.Find((typeof(hostUser)), "lewis") as hostUser; hostUser matt = this.Find((typeof(hostUser)), "matsly") as hostUser; if (FindIDByLongName(typeof(hostChar), "Messy da Anti Hero") == 0) { hostChar c = new hostChar("Messy", "Messy da Anti Hero", steve); c.RefreshCharacterStats(i); //Chuck in some items nwItem i1 = new nwItem("+1 Dagger", "+1 Dagger"); i1.Owner = c; c.Items.Add(i1); nwItem i2 = new nwItem("+4 LongBow", "+4 LongBow"); i2.Description = "This is a mega bow created by the elven lords"; i2.Owner = c; c.Items.Add(i2); Add(c); //i.SaveOrUpdate(new campCharCampaign(traitPBEM, c, false)); //traitPBEM.Characters.Add(c); //i.SaveOrUpdate(c); } if (FindIDByLongName(typeof(hostChar), "Sabbath") == 0) { hostChar c = new hostChar("Sabbath", "Sabbath", matt); c.RefreshCharacterStats(i); //Chuck in some items nwItem i1 = new nwItem("+5 Vorpal", "+5 Vorpal Sword"); i1.Owner = c; c.Items.Add(i1); Add(c); } if (FindIDByLongName(typeof(hostChar), "Muttley") == 0) { hostChar c = new hostChar("Muttley", "Muttley", lewis); c.RefreshCharacterStats(i); this.Add(c); //i.SaveOrUpdate(new campCharCampaign(traitPBEM, c, false)); //i.SaveOrUpdate(c); } this.Save(steve); this.Save(matt); //this.Save(traitPBEM); return(true); } catch (GenericADOException ex) { var sql = ex.InnerException as SqlException; if (sql != null) { Debug.Print("Caught GenericADO:" + ex.ToString()); Debug.Print("Caught Inner:" + sql.ToString()); Debug.Print("SQL ErrorNumber:" + sql.Number.ToString()); throw; } return(false); } }