public MultiScreen(Serveur server, Client client) { IsClient = false; this.client = client; this.server = server; Reseau = true; MapData mapData = new MapData(); if (!mapData.FromFile("Content/Maps/map.mrm")) throw new Exception(); MapFirst = new Map(mapData); Camera = new Cam(MainGame.GetInstance().graphics); }
public ServeurClient(Socket socket, Serveur server) { this.socket = socket; this.server = server; stream = new NetworkStream(socket); streamReader = new StreamReader(stream); streamWriter = new StreamWriter(stream); serializer = new Polenter.Serialization.SharpSerializer(false); deserializer = new Polenter.Serialization.SharpSerializer(false); playerMul = new EntityMulti(); t_receive = new Thread(Receive); t_receive.Start(); }
private void OnCreateMouseClick(object sender, MouseClickEventArgs e) { if (box[0].Text().Length > 0 && box[1].Text().Length > 0) { name = box[1].Text(); try { port = Convert.ToInt32(box[0].Text()); StartButton.MouseClick += OnStartMouseClick; createButton.MouseClick -= OnCreateMouseClick; isCreate = true; box[0].IsSelect = false; box[1].IsSelect = false; serveur = new Serveur("test",port,100); serveur.Start(); localClient = new Client(name,true); localClient.Connect("127.0.0.1", port); localClient.SendData(); localClient.StartReadThread(); //localClient.StartWaitStart(); box.Add(new TextBox(new Vector2(Bounds.X + 20, box[0].Bound.Bottom + 10), 20, 10, TexturesManager.Menu, Color.Blue, Color.Red)); } catch (Exception) { box[0].RemoveAll(); } } }