/// <summary>
 /// Generate a new remote NetworkEntity at this host.
 /// </summary>
 public NetworkEntity(Connection parent)
 {
     nm = LKernel.Get<NetworkManager>();
     local = false;
     owner = parent;
     _GlobalID = nm.AssignGlobalID();
     _Name = String.Format("Ponefag{0}", _GlobalID);
     _Selection = "Twilight Sparkle";
 }
 /// <summary>
 /// Generate a new local NetworkEntity at this host.
 /// </summary>
 public NetworkEntity()
 {
     nm = LKernel.Get<NetworkManager>();
     local = true;
     owner = null;
     _GlobalID = nm.AssignGlobalID();
     _Selection = "Twilight Sparkle";
     _Name = String.Format("Ponefag{0}", _GlobalID);
 }
 /// <summary>
 /// Create a new NetworkEntity that is fully designated by a remote host.
 /// </summary>
 public NetworkEntity(Connection parent, int globalid, string name, string selection, bool islocal)
 {
     nm = LKernel.Get<NetworkManager>();
     if (parent != null) { owner = parent; }
     local = islocal;
     _GlobalID = globalid;
     _Selection = selection;
     _Name = name;
 }
        /// <summary>
        /// Creates a connection, given a destination to send to and a connection ID.
        /// </summary>
        public Connection(UdpClient sender, IPEndPoint destinationep, UInt32 cid)
        {
            var LobbyGUI = LKernel.Get<UIMain>().GetGUI("menu lobby gui");
            LobbyLabel = LobbyGUI.GetControl<Label>("lobby label");

            UDPConnection = new ReliableUDPConnection(sender, destinationep, cid, this);
            UDPConnection.OnPacketRecv += (p) => PacketHandler(p.Contents);
            OutgoingQueue = new Queue<Message>();
            Cid = cid;
            nm = LKernel.GetG<NetworkManager>();
        }
        public MainMenuMultiplayerHandler()
        {
            mmm = LKernel.GetG<MainMenuManager>();
            netMgr = LKernel.GetG<NetworkManager>();

            mmm.OnLevelSelect += new MainMenuLevelSelectEvent(OnLevelSelect);
            mmm.OnCharacterSelect += new MainMenuCharacterSelectEvent(OnCharacterSelect);
            mmm.OnHostInfo_SelectNext += new MainMenuButtonPressEvent(OnHostInfo_SelectNext);
            mmm.OnClientInfo_SelectNext += new MainMenuButtonPressEvent(OnClientInfo_SelectNext);
            mmm.OnLobby_SelectNext += new MainMenuButtonPressEvent(OnLobbyForward);
            mmm.OnLobby_SelectBack += new MainMenuButtonPressEvent(OnLobbyBack);
            mmm.OnLevelSelect_SelectBack += new MainMenuButtonPressEvent(OnLevelSelect_SelectBack);
            var LobbyGUI= LKernel.Get<UIMain>().GetGUI("menu lobby gui");
            LobbyLabel = LobbyGUI.GetControl<Label>("lobby label");
        }