Пример #1
0
 public Client(int _clientId)
 {
     id = _clientId;
     //accessToken = null;
     tcp = new TCP(id);
     udp = new UDP(id);
 }
        public static void StartServer(int _port)
        {
            port = _port;

            Console.WriteLine("Starting Server...");

            TCP.StartListening(port);
            UDP.StartListening(port);

            Console.WriteLine($"Server Started on {port}.");
        }
Пример #3
0
        public static void Connect(int port, string serverName, int timeOut)
        {
            Port       = port;
            ServerName = serverName;
            TimeOut    = timeOut;

            Console.WriteLine($"\n\t\tMainServerComms trying to connect:{Port}");
            InitIncomingPacketHandler();

            tCP = new TCP();
            tCP.Connect(LocalIP);

            AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnEndingConsoleApplication);
        }
Пример #4
0
        public static void Connect(int port, string serverName, string mainServerIP)
        {
            Port       = port;
            ServerName = serverName;

            Output.WriteLine($"\n\t\tMainServerComms trying to connect:{Port}");
            InitIncomingPacketHandler();

            tCP = new TCP();
            tCP.Connect(mainServerIP);

            Application.quitting += OnApplicationQuiting;

            ServerSendDataTimer.Elapsed += SendServerDataToMainServer;
        }
Пример #5
0
        public Client(int _clientId)
        {
            Id = _clientId;

            Action <Packet> receivePacketAction = (packet) =>
            {
                Server.ReceiveManager.ExecuteOnMainThread(() =>
                {
                    Server.ReceiveManager.ProcessPacket(packet.PacketTypeId, packet);
                });
            };

            tcp = new TCP(this, receivePacketAction);

            if (Constants.AllowUDP)
            {
                udp = new UDPSend(this, receivePacketAction);
            }

            player = new Player(Id, "NewPlayer", new Vector3(0, 0, 0), this);
        }
Пример #6
0
        public Client(TcpClient _tcpSocket)
        {
            bool foundId = false;

            for (byte i = 0; i < maxPlayerCount; i++)
            {
                if (!allClients.ContainsKey(i))
                {
                    foundId = true;
                }
            }
            if (!foundId)
            {
                throw new Exception("Max client count exceeded");
            }

            tcp = new TCP(this);
            udp = new UDP(this);
            playerController = new PlayerController();
            tcp.Connect(_tcpSocket);
            allClients.Add(id, this);
        }
Пример #7
0
 public Client(int clientId)
 {
     id          = clientId;
     tcpInstance = new TCP(id);
     udpInstance = new UDP(id);
 }
Пример #8
0
 public ServerClient(int _clientId)
 {
     id  = _clientId;
     tcp = new TCP(id);
     udp = new UDP(id);
 }
Пример #9
0
 public Client(int clientID)
 {
     id  = clientID;
     tcp = new TCP(id);
 }
Пример #10
0
 public Client(int iD)
 {
     ID  = iD;
     tCP = new TCP(iD);
     uDP = new UDP(iD);
 }
Пример #11
0
 public Client(int clientId)
 {
     id  = clientId;
     tcp = new TCP(id);
     udp = new UDP(id);
 }
Пример #12
0
 public Client(int id)
 {
     this.id  = id;
     this.tcp = new TCP(this.id);
     this.udp = new UDP(this.id);
 }
Пример #13
0
 public Client(int clientId)
 {
     Id  = clientId;
     Tcp = new TCP(clientId);
 }
Пример #14
0
 public Client(int _clientid)
 {
     id  = _clientid;
     tcp = new TCP(id);
     udp = new UDP(id);
 }
Пример #15
0
 public Client(int _ClientID)
 {
     id  = _ClientID;
     tcp = new TCP(id);
     udp = new UDP(id);
 }
Пример #16
0
 public Client(int _clientId)
 {
     id  = _clientId;
     tcp = new TCP(id);
 }
Пример #17
0
 public Client(int clientId)
 {
     Id  = clientId;
     Tcp = new TCP(Id);
     Udp = new UDP(Id);
 }