コード例 #1
0
ファイル: InGameForm.cs プロジェクト: RikkiRu/ToSpace
        public InGameForm(Player me, ClientConnectionSys connection)
        {
            InitializeComponent();

            this.me = me;

            this.connect = connection;

            this.Show();
        }
コード例 #2
0
ファイル: Renderer.cs プロジェクト: RikkiRu/ToSpace
        public Renderer(GLControl x, Player me, ClientConnectionSys connect)
        {
            this.connect = connect;



            this.me = me;
            display = new mainRenClass(x, 100);
            textureObject.wayToTexturesFolder = Environment.CurrentDirectory + @"/Textures";
        }
コード例 #3
0
        private void button1join_Click(object sender, EventArgs e)
        {
            if (connection != null)
            {
                connection.disconnect();
            }

            me.name             = textBox3name.Text;
            me.online           = true;
            me.civSettings      = new CivSettings();
            me.civSettings.name = "Человеки";


            int port = 0;

            try
            {
                port = Convert.ToInt32(textBox2port.Text);


                Tested     = false;
                connection = new ClientConnectionSys(me, textBox1ip.Text, port, textBox4pass.Text);


                while (!Tested)
                {
                    Thread.Sleep(100);
                }

                if (SuccesConnected)
                {
                    game             = new InGameForm(me, connection);
                    game.FormClosed += game_FormClosed;
                    game.addToChat("Сервер", welcomeStr);
                    this.Hide();
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }