コード例 #1
0
        public static void ReadKeepAlive(Client client, PacketReader reader)
        {
            KeepAlivePacket ap = new KeepAlivePacket();
            ap.Read(reader);

            if (!reader.Failed)
            {
                Client.HandleKeepAlive(client, ap);
            }
        }
コード例 #2
0
        public static void ReadEntitySpawn(Client client, PacketReader reader)
        {
            EntitySpawnPacket esp = new EntitySpawnPacket();
            esp.Read(reader);

            if (!reader.Failed)
            {
                client.HandleEntitySpawn(esp);
            }
        }
コード例 #3
0
        public static void ReadHandshake(Client client, PacketReader reader)
        {
            HandshakePacket hp = new HandshakePacket();
            hp.Read(reader);

            if (!reader.Failed)
            {
                Client.HandleHandshake(client, hp);
            }
        }
コード例 #4
0
ファイル: Client.cs プロジェクト: DynaStudios/Slaysher
        public static void HandleKeepAlive(Client client, KeepAlivePacket ap)
        {
            //Respond KeepAlive Packet to Server
            Console.WriteLine("Received Keep Alive");
            client.SendPacket(new KeepAlivePacket {TimeStamp = ap.TimeStamp});

            lock (client.WaitInitialPositionRequestLook)
            {
                if (client.WaitInitialPositionRequest)
                {
                    client.WaitInitialPositionRequest = false;
                    Monitor.PulseAll(client.WaitInitialPositionRequestLook);
                }
            }
        }
コード例 #5
0
ファイル: GameScene.cs プロジェクト: DynaStudios/Slaysher
        public override void Activate(bool instancePreserved)
        {
            base.Activate(instancePreserved);
            Engine = ScreenManager.Game as Engine;
            _client = new Client(this);

            AsyncLoadScene();
        }
コード例 #6
0
        public static void ReadMovement(Client client, PacketReader reader)
        {
            MovePacket mp = new MovePacket();
            mp.Read(reader);

            if (!reader.Failed)
            {
                Console.WriteLine("Received Move Packet");
                client.Move(
                    mp.EntityId,
                    mp.Position,
                    mp.Direction,
                    mp.Speed);
            }
        }
コード例 #7
0
        public static void ReadPlayerPosition(Client client, PacketReader reader)
        {
            PlayerPositionPacket ppp = new PlayerPositionPacket();
            ppp.Read(reader);

            if (!reader.Failed)
            {
                client.HandlePlayerPosition(ppp);
            }
        }
コード例 #8
0
        public static void ReadPlayerInfo(Client client, PacketReader reader)
        {
            PlayerInfoPacket pip = new PlayerInfoPacket();
            Console.WriteLine("Player Info Packet size is {0}", reader.Size);
            pip.Read(reader);

            if (!reader.Failed)
            {
                client.HandlePlayerInfo(pip);
            }
        }
コード例 #9
0
        public static void ReadPattern(Client client, PacketReader reader)
        {
            PatternPacket pp = new PatternPacket();
            pp.Read(reader);

            if (!reader.Failed)
            {
                Client.HandlePatternPacket(client, pp);
            }
        }
コード例 #10
0
ファイル: ClientPlayer.cs プロジェクト: DynaStudios/Slaysher
 public ClientPlayer(Client client)
 {
     _client = client;
 }
コード例 #11
0
ファイル: Client.cs プロジェクト: DynaStudios/Slaysher
        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);
        }
コード例 #12
0
ファイル: Client.cs プロジェクト: DynaStudios/Slaysher
 public static void HandleHandshake(Client client, HandshakePacket hp)
 {
     //Handle Handshake
     Console.WriteLine("Received Handshake Packet back from Server :))");
 }