Beispiel #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}.");
        }
        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);
        }
Beispiel #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;
        }
Beispiel #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);
        }
        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);
        }
Beispiel #7
0
 public Client(int clientId)
 {
     id          = clientId;
     tcpInstance = new TCP(id);
     udpInstance = new UDP(id);
 }
Beispiel #8
0
 public ServerClient(int _clientId)
 {
     id  = _clientId;
     tcp = new TCP(id);
     udp = new UDP(id);
 }
Beispiel #9
0
 public Client(int clientID)
 {
     id  = clientID;
     tcp = new TCP(id);
 }
Beispiel #10
0
 public Client(int iD)
 {
     ID  = iD;
     tCP = new TCP(iD);
     uDP = new UDP(iD);
 }
Beispiel #11
0
 public Client(int clientId)
 {
     id  = clientId;
     tcp = new TCP(id);
     udp = new UDP(id);
 }
Beispiel #12
0
 public Client(int id)
 {
     this.id  = id;
     this.tcp = new TCP(this.id);
     this.udp = new UDP(this.id);
 }
Beispiel #13
0
 public Client(int clientId)
 {
     Id  = clientId;
     Tcp = new TCP(clientId);
 }
 public Client(int _clientid)
 {
     id  = _clientid;
     tcp = new TCP(id);
     udp = new UDP(id);
 }
Beispiel #15
0
 public Client(int _ClientID)
 {
     id  = _ClientID;
     tcp = new TCP(id);
     udp = new UDP(id);
 }
Beispiel #16
0
 public Client(int _clientId)
 {
     id  = _clientId;
     tcp = new TCP(id);
 }
 public Client(int clientId)
 {
     Id  = clientId;
     Tcp = new TCP(Id);
     Udp = new UDP(Id);
 }