public static void RecieveChunk(PacketHeader header, Connection connection, byte[] data)
        {
            Chunk obj = Conversion.BytesToObject <Chunk>(data);

            if (obj != null)
            {
                loadedChunks[new Vector2i(obj.posX, obj.posY)] = obj;
                Console.WriteLine("Recieved chunk " + new Vector2i(obj.posX, obj.posY));
                askedChunks.Clear();
            }
        }
Exemple #2
0
        public static void AddTodo(PacketHeader header, Connection connection, byte[] data)
        {
            PlayerTodo todo = Conversion.BytesToObject <PlayerTodo>(data);

            foreach (OtherPlayer p in Program.otherPlayers)
            {
                if (p.id == todo.id)
                {
                    p.MoveTo(Conversion.StringToVectori(todo.moveTo));
                }
            }
        }