public NetObjectManager(SCServer server) { this.server = server; netObjects = new Dictionary <int, NetObject>(); netObjectPool = new Pool <NetObject>(); objectsToBeUpdated = new HashSet <int>(); removedObjects = new HashSet <int>(); }
/********************************************************************************************/ /** Getters and Setters Functions ***********************************************************/ /********************************************************************************************/ public bool hasServer() { if(SCCommunicator.hasServer){ if(localServer == null){ localServer = new SCServer(this, SCCommunicator.numberOfPlayers); } return true; }else{ localServer = null; return false; } }
public SCClient(SCClientCommunicator communicator, bool createServer) { localServer = null; this.communicator = communicator; addCommandBehaviours(); if(createServer){ localServer = new SCServer(this, SCCommunicator.numberOfPlayers); }else{ localServer = null; } mFirstTime = true; }
public ArticleDetails() { try { Globals.SitecoreAddin.Log("Initializing the article details window..."); InitializeComponent(); Opacity = 0; _scTree = new SCTree(); _scServer = new SCServer(); // TEMPORARY code to deal with QA login var credCache = new CredentialCache(); var netCred = new NetworkCredential("velir", "ebi3000"); credCache.Add(new Uri(_scTree.Url), "Basic", netCred); credCache.Add(new Uri(_scServer.Url), "Basic", netCred); _scTree.PreAuthenticate = true; _scTree.Credentials = credCache; _scServer.PreAuthenticate = true; _scServer.Credentials = credCache; // end temporary _user = SitecoreUser.GetUser(); _authors = _scTree.GetAuthors().Select(t => new StaffStruct() { ID = t.ID, Name = t.Name, Publications = t.Publications }).ToArray().ToList(); _editors = _scTree.GetEditors().Select(t => new StaffStruct() { ID = t.ID, Name = t.Name, Publications = t.Publications }).ToArray().ToList(); _sitecoreArticle = new SitecoreArticle(); _wordUtils = new WordUtils(); _wordApp = SitecoreAddin.WordApp; _documentCustomProperties = new DocumentCustomProperties(_wordApp, _wordApp.ActiveDocument); try { InitializeDropdowms(); InitializeControllers(); Opacity = 1; SetCheckedOutStatus(); _connectedAtStart = true; } catch (WebException e) { AlertConnectionFailed(); Globals.SitecoreAddin.LogException("Error getting metadata or checked out status!", e); throw new ApplicationException("Error getting metadata or checked out status!", e); } var deleteIcon = new ImageList(); deleteIcon.Images.Add(Resources.delete_icon); uxSelectedAuthors.SmallImageList = deleteIcon; uxSelectedEditors.SmallImageList = deleteIcon; string articleNumber = GetArticleNumber(); if (!articleNumber.IsNullOrEmpty()) { uxArticleNumber.Text = articleNumber; GetArticeDetailsFromSitecore(); } uxLockStatus.Refresh(); Globals.SitecoreAddin.Log("Article details window initialized."); } catch (Exception ex) { Globals.SitecoreAddin.LogException("Error while loading article details!", ex); } }