Exemplo n.º 1
0
        public static BMPInitData GetBMP()
        {
            BMPInitData bmp = new BMPInitData();

            bmp.botbmp.AddRange(bot.Cast <int>());
            bmp.frontbmp.AddRange(front.Cast <int>());

            return(bmp);
        }
Exemplo n.º 2
0
        public void SetInitData(BMPInitData bmps)
        {
            botCanvas.GetComponent <CanvasScript>().SetPixels(bmps.botbmp);
            frntCanvas.GetComponent <CanvasScript>().SetPixels(bmps.frontbmp);

            frntCanvas.GetComponent <CanvasScript>().SetAllBlocks();

            BottomButtonDown();
        }
Exemplo n.º 3
0
        static public void ConnectHandler(NetConnection connection, object data)
        {
            PlayerSyncData sync = Players.GeneratePlayer(connection);
            BMPInitData    bmps = World.GetBMP();

            InitData init = new InitData()
            {
                sync = sync, bmps = bmps
            };

            GSrv.Send(MessageType.ConnectSuccess, GSrv.Serialize <InitData>(init), connection, NetDeliveryMethod.ReliableOrdered);
        }
Exemplo n.º 4
0
        InitData GetDummyInitData()
        {
            PlayerSyncData sync = new PlayerSyncData {
                userid = 1, xpos = 10.0f, ypos = 0, zpos = 10.0f, yrot = 0, anime = 0
            };
            BMPInitData bmps = new BMPInitData();

            int[,] bot_blocks = new int[Env.TotalPixels, Env.TotalPixels];
            bmps.botbmp.AddRange(bot_blocks.Cast <int>());
            bmps.frontbmp.AddRange(bot_blocks.Cast <int>());

            return(new InitData {
                sync = sync, bmps = bmps
            });
        }