Example #1
0
        public static void ReadPattern(Client client, PacketReader reader)
        {
            PatternPacket pp = new PatternPacket();
            pp.Read(reader);

            if (!reader.Failed)
            {
                Client.HandlePatternPacket(client, pp);
            }
        }
Example #2
0
        private void SendPattern()
        {
            foreach (Pattern pattern in Server.World.Patterns)
            {
                PatternPacket packet = new PatternPacket
                    {
                        PatternId = pattern.Id,
                        TextureId = pattern.Type.TextureId,
                        X = pattern.X,
                        Y = pattern.Y
                    };

                SendSyncPacket(packet);

            }
        }
Example #3
0
        public static void HandlePatternPacket(Client client, PatternPacket pp)
        {
            Console.WriteLine("Received Pattern Packet: " + client.DebugReceivedPattern++);

            //Retrieve Pattern Texture
            Pattern newPattern = new Pattern(new Vector3(pp.X, 0, pp.Y),
                                             client.GameScene.LoadPatternTexture(pp.TextureId));
            client.GameScene.Pattern.Add(pp.PatternId, newPattern);
        }