Ejemplo n.º 1
0
        public Game1()
            : base()
        {
            fpsMeterStopwatch.Start();

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = 1080;
            graphics.PreferredBackBufferWidth = 1920;
            //graphics.IsFullScreen = true;
            Content.RootDirectory = "Content";

            String ip = "192.168.2.15";

            //WebRequest req = WebRequest.Create("https://dl.dropbox.com/u/1814002/TurtleTurner2000/ip.txt");
            //WebResponse resp = req.GetResponse();
            //using (Stream streampje = resp.GetResponseStream())
            //{
            //    using (TextReader reader = new StreamReader(streampje))
            //    {
            //        ip = reader.ReadLine();
            //    }
            //}

            deveClient = new DeveClient(ip, 1337);
            deveClient.Start();

            DeveOutgoingMessage outje = new DeveOutgoingMessage();
            outje.WriteInt32((int)ServerReceiveMessageType.LoginMessageScreenClient);
            outje.WriteInt32(graphics.PreferredBackBufferWidth);
            outje.WriteInt32(graphics.PreferredBackBufferHeight);
            deveClient.Send(outje);
        }
Ejemplo n.º 2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);

            Content.RootDirectory = "Content";

            String ip = "";
            WebRequest req = WebRequest.Create("https://dl.dropbox.com/u/1814002/TurtleTurner2000/ip.txt");
            WebResponse resp = req.GetResponse();
            using (Stream streampje = resp.GetResponseStream())
            {
                using (TextReader reader = new StreamReader(streampje))
                {
                    ip = reader.ReadLine();
                }
            }

            deveClient = new DeveClient(ip, 1337);
            deveClient.Start();

            DeveOutgoingMessage outje = new DeveOutgoingMessage();
            outje.WriteInt32((int)ServerReceiveMessageType.LoginMessageControlClient); //Join message
            //outje.WriteInt32(1); //Android
            deveClient.Send(outje);

            graphics.IsFullScreen = true;
            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 480;
            graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;

            this.currentTouchCollection = TouchPanel.GetState();
        }
        void kenServer_ReceivedMessage(object sender, ActionEventArgs e)
        {
            form.DebugMSG(e.Id + ": " + e.Action);
            switch (e.Action)
            {
                case "connected":
                    DeveClient deveClient = new DeveClient("localhost", 1337);
                    deveClient.Start();

                    DeveOutgoingMessage outje = new DeveOutgoingMessage();
                    outje.WriteInt32(0); //Join message
                    outje.WriteInt32(1); //Android
                    deveClient.Send(outje);

                    clients.Add(e.Id, deveClient);

                    break;
                case "closed":
                    clients[e.Id].Stop();

                    clients.Remove(e.Id);
                    //deveServer.messages.Enqueue(inc);

                    break;
                default:
                    DeveClient deveClientNow = clients[e.Id];

                    DeveOutgoingMessage outje2 = new DeveOutgoingMessage();
                    outje2.WriteInt32(1); //Identifier for command message
                    outje2.WriteString(e.Action);
                    deveClientNow.Send(outje2);

                    break;
            }
        }
Ejemplo n.º 4
0
        public Game1()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = 1080;
            graphics.PreferredBackBufferWidth = 1920;
            graphics.IsFullScreen = true;
            Content.RootDirectory = "Content";

            String ip = "";
            WebRequest req = WebRequest.Create("https://dl.dropbox.com/u/1814002/TurtleTurner2000/ip.txt");
            WebResponse resp = req.GetResponse();
            using (Stream streampje = resp.GetResponseStream())
            {
                using (TextReader reader = new StreamReader(streampje))
                {
                    ip = reader.ReadLine();
                }
            }
            //deveClient = new DeveClient("localhost", 1337);
            deveClient = new DeveClient(ip, 1337);
            deveClient.Start();

            DeveOutgoingMessage outje = new DeveOutgoingMessage();
            outje.WriteInt32(0);
            outje.WriteInt32(0);
            outje.WriteInt32(graphics.PreferredBackBufferWidth);
            outje.WriteInt32(graphics.PreferredBackBufferHeight);
            deveClient.Send(outje);
        }
Ejemplo n.º 5
0
 public Buttontje(DeveClient deveClient, String stringtosend, Rectangle pos, Color c, Texture2D texture, SpriteFont font)
 {
     this.deveClient = deveClient;
     this.stringtosend = stringtosend;
     this.pos = pos;
     this.c = c;
     this.texture = texture;
     this.font = font;
 }
Ejemplo n.º 6
0
        public ClientForm()
        {
            InitializeComponent();

            int port = 23415;
            //int port = 10239;
            //deveClient = new DeveClient("82.176.123.30", port);

            //deveClient = new DeveClient("devedse.cloudapp.net", port);
            deveClient = new DeveClient("localhost", port);
            deveClient.Start();

            Thread tr = new Thread(new ThreadStart(Runner));
            tr.Start();
        }