Ejemplo n.º 1
0
        public static void Add(int ClientNumber, string MachineName, string fullIP)
        {
            string IP   = fullIP.Split(':')[0];
            string Port = "00000";

            if (fullIP.Split(':').Length >= 2)
            {
                Port = fullIP.Split(':')[1];
            }

            if (HasClient(ClientNumber))
            {
                GetClient(MachineName).fullIP = fullIP;
                GetClient(MachineName).IP     = IP;
                GetClient(MachineName).Port   = Port;
            }
            else
            {
                new ClientViewObject(ClientNumber, MachineName, fullIP, IP, Port);

                reAssignRowAndColumn();

                if (NetworkManager.isServer)
                {
                    NetworkManager.server.TCPBroadcastMessage("addAllClientInfo", ClientViewObject.allClientToXML().ToString());
                }
            }
        }
Ejemplo n.º 2
0
        public static void Delete(string fullIP)
        {
            foreach (ClientViewObject clientViewObject in clientViewObjects)
            {
                if (clientViewObject.fullIP == fullIP)
                {
                    clientViewObjects.Remove(clientViewObject);

                    reAssignRowAndColumn();

                    if (NetworkManager.isServer)
                    {
                        NetworkManager.server.TCPBroadcastMessage("addAllClientInfo", ClientViewObject.allClientToXML().ToString());
                    }

                    return;
                }
            }
            Console.Error.WriteLine("[ClientViewObject] Could not found clientviewobject with IP: {0}", fullIP);
        }